Preserve byte positions across orders and chunks
04Byte-order independence requires consistency, and an odd chunk boundary needs alignment correction.
Swap the second partial to f0eb→ebf0, then combine and fold to ddf2. Stop the naïve e2ed result; alignment, not chunk size alone, controls the correction.
Source for this drawing: RFC 1071 · Read RFC source: §2(A–B) and §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.
Consistently swapping the bytes of every16-bit word swaps the bytes of the final folded sum. For the published §3 example the swapped-word sum isf2dd, which must be swapped back to ddf2 for this network-order result. Byte-order independence does not mean a raw native integer can always be stored unchanged (§2(B)).
- Consistently swapping the bytes of every16-bit word swaps the bytes of the final folded sum. For the published §3 example the swapped-word sum isf2dd, which must be swapped back to ddf2 for this network-order result. Byte-order independence does not mean a raw native integer can always be stored unchanged (§2(B)).
- Addition is associative and commutative as long as even/odd byte assignment is respected. You may group or reorder whole aligned words, not arbitrarily move individual bytes between high and low positions (§2(A)).
- The published odd-split example separates00 01 f2 from 03 f4 f5 f6 f7. Local padded sums aref201 and f0eb. The second chunk starts at original offset 3, so byte-swap its local sum to ebf0 before adding it to the first (§2(B), §3).
- The corrected combinationf201+ebf0=1ddf1 folds to ddf2. Naively adding local sumsf201+f0eb folds to e2ed and is wrong for this byte stream. The helper tracks total prefix length across chunks, including empty chunks, without appending padding to the original bytes.
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 ↗