One's-complement sum of 0x1234 and 0xABCD — parity and checksum
coreend-around carry
Answer
BE01
Why this example is worth doing
The one's-complement sum adds the carry out back into the low bit — the end-around carry — rather than discarding it. The page explains why that matters: the result becomes independent of the byte order in which the words were added, which is what lets the Internet checksum be computed incrementally and on either endianness. It is a small detail with a large consequence.
Try your own input in the Parity & checksum. Even and odd parity, one’s-complement sums and the Internet checksum, step by step.
How the answer is reached
16-bit one's-complement sum over 4 bytes
Adjacent octets are paired into big-endian 16-bit integers and added with end-around carry.
| Word | Running sum | + word | End-around carry | New running sum |
|---|---|---|---|---|
| 0x1234 | 0x0000 | 0x1234 | no | 0x1234 |
| 0xABCD | 0x1234 | 0xBE01 | no | 0xBE01 |
One's-complement sum0xBE01— RFC 1071 prints this value in its example
Checksum0x41FE— the complement of the sum — this is what goes in the packet
Verification0xBE01 — not 0xFFFF— summing the octets *including* the checksum field must give 0xFFFF
This is the sum, not the checksum. Complement it to get the value a sender transmits.
Source: RFC 1071, "Computing the Internet Checksum"