The Internet Layer, chapter 8 of 36
IPv4: The Datagram
RFC 791 called the header checksum provisional in 1981, and every router on the path must still verify and recompute it.
The laptop's TCP code hands its IP code 40 bytes and a destination, 192.0.2.80, and IP puts 20 bytes in front of them. Those 20 bytes travel the whole way, and every router between the sofa and the server reads them. Their layout has not changed since Jon Postel edited RFC 791 in September 1981. The meaning of almost every field has, some of them more than once.
- 0x0100
- added to the header checksum by a router that lowers the TTL by one
- 6.4 Mbit/s
- approximate limit per protocol for two hosts in 1500-octet datagrams, with IDs unique for 120 seconds
- 9 dollars
- per IPv4 address, the lowest price in the 40 days before 10 January 2026, paid for a /14
One checksum, eight links
Our SYN's header as ten 16-bit words, summed in one's complement. Step past the seven routers, each after the home router adding 0x0100, or flip bits and see whether the next check passes.
What happened to the Type of Service byte?
The byte stayed in place while its layout changed with almost every revision, from RFC 760 in 1980 to RFC 3168 in 2001. RFC 791 defined eight precedence levels. RFC 2474 (December 1998) replaced all of it with a six-bit codepoint that nodes must match in full (RFC 2474, Section 3).
Only the eight Class Selectors that end in 000 keep a meaning from the old field: 11x000 must be preferred over 000000, so routing traffic marked with precedence 6 or 7 still gets better treatment than the default (RFC 2474, Section 4.2.2.2). In 2001 the last two bits went to Explicit Congestion Notification.
What is the identification field for when nothing is fragmented?
RFC 791 wanted it unique per source, destination, and protocol while any fragment could survive. With a lifetime of 120 seconds, 16 bits limit a pair of hosts to about 6.4 Mbit/s of 1500-octet datagrams per protocol (RFC 6864, Section 3.2). A gigabit flow of such datagrams runs through all 65,536 values in under a second.
RFC 6864 (2013, Joe Touch) took the meaning away from the identification of an atomic datagram, one with DF set, MF clear, and offset zero (RFC 6864, Section 4). Linux counted it per connected socket up to 7.3. The v7.4-rc1 tree sends 0, as FreeBSD 15.1 does by default [Linux2026] [FreeBSD2026].
Why is the TTL counted in seconds that nobody measures?
Because RFC 791 defined it that way, and routers counted hops instead. Every module must decrease the TTL by at least one, even if it processes the datagram in less than a second, so the TTL is only an upper bound on the time a datagram may exist (RFC 791, Section 3.2). The maximum of 255 seconds is 4.25 minutes.
By 1989 gateways "generally treat TTL as a simple hop count" (RFC 1122, Section 3.3.2). RFC 1812, Section 5.3.1 still defines a timer, admits that the TTL serves "somewhat schizophrenically" as both a hop count limit and a time limit, and makes the time limit optional.
How good is a checksum you can compute by hand?
Good enough for 45 years, although RFC 791, Section 3.1 called it provisional. It is the one's complement of the one's complement sum of the header's 16-bit words. The end-around carry makes the sum independent of byte order, so a little-endian machine can add the words as it finds them in memory (RFC 1071, Section 2).
Every router changes the TTL, so every router must verify and recompute the checksum, and may do so incrementally when only the TTL changed (RFC 1812, Section 4.2.2.5). RFC 1141's formula of 1990 could produce FFFF, a value a full computation never takes (RFC 1624, Section 3). RFC 1624 corrected it in 1994.
Why did the options die?
RFC 791, Section 3.1 says options "must be implemented by all IP modules", and RFC 1812, Section 5.3.13.4 forbids enabling, by default, a switch that discards source-routed packets. Yet source routing can bypass controls built on routing tables, and any packet that needs a router's general-purpose CPU is a denial-of-service risk (RFC 7126, Section 3.1).
RFC 7126 (2014) recommends dropping source routes and Record Route by default and timestamps outright. In 2005 about half of the paths tested from PlanetLab dropped packets with options [Fonseca2005]. Linux drops received source-routed datagrams unless two settings are 1 [Linux2026].
What happened when the addresses ran out?
IANA allocated its last five /8 blocks on 3 February 2011, one to each Regional Internet Registry [NRO2011]. The RIPE NCC made its last /22 allocation on 25 November 2019. Since then, members that never received an IPv4 allocation from it can join a waiting list for a single recovered /24 [RIPE2019].
Prices rose to between 45 and 60 US dollars per address at the end of 2021. In the 40 days before 10 January 2026 the mean was 22 dollars, with a low of 9 dollars per address for a /14 [Huston2026a].
The book keeps asking
This chapter has 5,788 words and 12 questions. These 6 are answered only in the book and the audiobook.
- What do the 20 bytes say?
- Why does a header carry its own version and two lengths?
- How does a router cut a datagram into pieces?
- Who decides what protocol 6 means?
- Where did the address classes go?
- Which addresses are special?
Open the sources
- RFC 791 Internet Protocol
- RFC 1122 Requirements for Internet Hosts - Communication Layers
- RFC 1812 Requirements for IP Version 4 Routers
- RFC 2474 Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers
- RFC 6864 Updated Specification of the IPv4 ID Field
- RFC 4632 Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan
- RFC 6890 Special-Purpose IP Address Registries
- [Linux2026] Linux kernel source tree, v7.4-rc1 (commit 6628e7d4c6b2, 1 November 2026)
All 57 documents this chapter cites, each with a link to its publisher and a copy kept here.
