Visual RFC.
ALL RFCs / RFC 1071
Read the RFC ↗
RFC 1071 / INTERNET CHECKSUM

Fold carries in the published worked example

02

The carry from the top of a 16-bit word comes back around to its low end.

RFC 1071 · § 3EXAMPLE
4 / 4
Fold carries in the published worked exampleThe folded sum ddf2 is complemented to stored value220d. Including that aligned checksum word yieldsffff; the drawing distinguishes sum from field.Bring the carry back aroundsum ddf216-bit complementfield 220dInclude field when checkingddf2 + 220d = ffffRFC 1071 · chapter 2 · state 4 · arithmetic example
04
Complement and distinguish the result

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 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

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.
DETAILS

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 ↗

All chapters in RFC 1071

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗