Fold carries in the published worked example
02The carry from the top of a 16-bit word comes back around to its low end.
The sum ddf2 produces stored checksum 220d. ddf2+220d=ffff when the checksum is included for checking.
Source for this drawing: RFC 1071 · Read RFC section 3 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
One’s complement addition uses end-around carry. With an ordinary wider accumulator, repeatedly add the high 16bits into the low 16bits until no high bits remain. Discarding overflow, adding modulo65536, or using XOR gives a different operation (§§1–3).
- One’s complement addition uses end-around carry. With an ordinary wider accumulator, repeatedly add the high 16bits into the low 16bits until no high bits remain. Discarding overflow, adding modulo65536, or using XOR gives a different operation (§§1–3).
- The official §3 sequence is00 01 f2 03 f4 f5 f6 f7. Its network-order words 0001,f203,f4f5,f6f7 have a wide sum 2ddf0. Foldddf0+0002 to obtain ddf2; the16-bit complement is220d.
- The running sum and the stored checksum are different values. 0xffff XOR ddf2 yields220d. A receiver includes the checksum field and looks for a folded all-ones sum ffff, rather than complementing twice or expecting the uncomplemented sum to be0000 (§1).
- The picture appends an aligned checksum word only to make this arithmetic example visible. It is not a claim that a real protocol places its checksum after its payload. The guide’s byte helper clears/inserts a caller-selected aligned field.
Educational arithmetic, not a protocol stack or a portable replacement for old assembly/C. Each protocol defines its own covered octets and checksum-field rules.
Read the RFC section ↗