How the Internet works

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 1981, Internet Standard, STD 5
  • RFC 1122 Requirements for Internet Hosts - Communication Layers 1989, Internet Standard, STD 3
  • RFC 1812 Requirements for IP Version 4 Routers 1995, Proposed Standard
  • RFC 2474 Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers 1998, Proposed Standard
  • RFC 6864 Updated Specification of the IPv4 ID Field 2013, Proposed Standard
  • RFC 4632 Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan 2006, Best Current Practice, BCP 122
  • RFC 6890 Special-Purpose IP Address Registries 2013, Best Current Practice, BCP 153
  • [Linux2026] Linux kernel source tree, v7.4-rc1 (commit 6628e7d4c6b2, 1 November 2026) 2026, free

All 57 documents this chapter cites, each with a link to its publisher and a copy kept here.

The Internet Layer, chapter 9 of 36

Finding the Neighbor: ARP, ICMP, and DHCP

The Internet Layer, chapter 10 of 36

IPv6: The Second Attempt

The Internet Layer, chapter 11 of 36

MTU, Fragmentation, and the Black Hole

The Internet Layer, chapter 12 of 36

NAT, CGNAT, and the Middlebox Internet

The Internet Layer, chapter 13 of 36

Living with Two Protocols

Routing, chapter 14 of 36

Inside One Network: Forwarding, OSPF, and IS-IS

Routing, chapter 15 of 36

BGP: The Protocol That Holds It Together

Routing, chapter 16 of 36

Peering, Transit, and the Money

Routing, chapter 17 of 36

Securing the Routing System

Routing, chapter 18 of 36

MPLS and Segment Routing

Routing, chapter 19 of 36

Anycast and CDNs

Transport, chapter 20 of 36

UDP: Eight Bytes of Header

Transport, chapter 21 of 36

TCP: The Connection

Transport, chapter 22 of 36

Congestion Control: From Collapse to BBR

Transport, chapter 23 of 36

Beyond TCP: SCTP, DCCP, and Multipath

Names and Trust, chapter 24 of 36

DNS: The Namespace and the Wire Format

Names and Trust, chapter 25 of 36

Resolvers, DNSSEC, and Encrypted DNS

Names and Trust, chapter 26 of 36

TLS 1.3: The Handshake

Names and Trust, chapter 27 of 36

Certificates and the Web PKI

Applications, chapter 28 of 36

HTTP: Semantics and HTTP/1.1

Applications, chapter 29 of 36

HTTP/2: Multiplexing over One Connection

Applications, chapter 30 of 36

QUIC: A Transport in Userspace

Applications, chapter 31 of 36

HTTP/3: The Web on QUIC

Applications, chapter 32 of 36

Mail: SMTP and Forty Years of Patches

Applications, chapter 33 of 36

Time, Shells, and Files: NTP, SSH, Telnet, and FTP

The Whole Path, chapter 34 of 36

Measuring and Debugging the Path

The Whole Path, chapter 35 of 36

The Whole Journey, Byte by Byte

The Whole Path, chapter 36 of 36

Ossification and What Comes Next

You have reached the server. The book goes further.

Everything on this site is a short version. Follow the Packet is the long one: 36 chapters and about 280,000 words, with every protocol fact traced to the section of the standard that defines it, every byte dump built by a script you can run, and a directory of more than a thousand cited documents. It comes as a printable book and as an audiobook.

Hear how chapter 1 opens. 70 seconds, narrated by a synthetic voice.

Get the book or the audiobook Read the start of chapter 1 Browse every source

Cover of Follow the Packet: How the Internet Works, Layer by Layer, from ARPANET to QUIC, by Wolfgang Kerschbaumer

The signup uses double opt-in. Every message includes an unsubscribe link.

Published by Sysinit Press. The public addresses, AS numbers and names of the scenario come from ranges reserved for documentation, and the home network uses private addresses, so the site describes no real network. RFC texts are copied unchanged from the RFC Editor.