I need someone to show me how this checksum is calculated.
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I need someone to take me step by step through how to calculate this checksum. I have tried a dozen ways and I keep getting numbers that are wildly incorrect. I am posting an example with the correct checksum (04b5) from wireshark, along with the hex. I am happy to tip if somone wants to put some swift code together to calculate it.

Internet Protocol Version 4, Src:, Dst:
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 332
Identification: 0x9ba4 (39844)
Flags: 0x00
Fragment Offset: 0
Time to Live: 64
Protocol: UDP (17)
Header Checksum: 0xc748 [validation disabled]
[Header checksum status: Unverified]
Source Address:
Destination Address:
User Datagram Protocol, Src Port: 6454, Dst Port: 6454
Source Port: 6454
Destination Port: 6454
Length: 312
Checksum: 0x8dca [unverified]
[Checksum Status: Unverified]
[Stream index: 88]
UDP payload (304 bytes)
Art-Net, Opcode: ArtRdm (0x8300)
Descriptor Header
ID: Art-Net
OpCode: ArtRdm (0x8300)
ProtVer: 14
ArtRdm packet
RDM Version: 0x01
filler: 00
spare: 00000000000000
Address High: 0x00
Command: ArProcess (0x00)
Address: 0x00
[Universe: 0]
Remote Device Management, Dst UID: 6205:6c4ee4bc, Src UID: 414c:00000000
Sub-start code: 0x01
Message length: 24
Destination UID: 62056c4ee4bc
Source UID: 414c00000000
Transaction number: 2
Port ID: 0
Message count: 0
Sub-device: 0
Message Data Block
Command class: Get Command (0x20)
Parameter ID: Device Info (0x0060)
Parameter data length: 0
Checksum: 0x04b5 [correct]
[Checksum Status: Good]
Trailer: 030000000000000000000000000000000000000000000000000000000000000000000000…

Hex dump

The Hex got cut off 4500014c9ba400004011c7480a0001520a0001631936193601388dca4172742d4e6574000083000e010000000000000000000000011862056c4ee4bc414c0000000002000000002000600004b5030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Effilctar 5 months ago
awarded to ButterTruck

Crowdsource coding tasks.

1 Solution

Winning solution

Here are the steps to calculate a checksum
- Add all bytes of the packet, except the start delimiter 0x7E and the length (the second and third bytes).
- Keep only the lowest 8 bits from the result.
- Subtract this quantity from 0xFF.