How the Internet works

The Internet Layer, chapter 9 of 36

Finding the Neighbor: ARP, ICMP, and DHCP

Every DHCP message keeps 192 octets in which a diskless workstation of 1985 named its boot server and kernel image.

The laptop on the sofa has associated with the home Wi-Fi, some time before the click. It has no IPv4 address of its own and does not know which box on the link is the router. Even with the router's address, it would not know the 48-bit MAC address to put in the frame. Four DHCP messages and two ARP frames fix that, and the first goes from 0.0.0.0, an address that means nobody, to an address that means everybody.

63 82 53 63
the magic cookie, 99.130.83.99, between the BOOTP fields and the DHCP options
4 to 7 s
the cost of an RFC 5227 address probe, off by default in systemd-networkd and BusyBox udhcpc
15 to 45 s
the random time Linux keeps the router's MAC address REACHABLE after a unicast reply

The laptop joins the home LAN

The frames from association to a usable default route, with our laptop's addresses and the ARP bytes. Step through them to see what the laptop knows after each, and switch the client to add the address check.

What can a machine say before it has an address?

It can broadcast. RARP (RFC 903, 1984) asked, in a reused ARP packet, which IP address belongs to a MAC address, but it ran directly on the link layer, so a server needed kernel or driver changes (RFC 951, Section 6). Bill Croft and John Gilmore moved the question into UDP with BOOTP in 1985.

The client sends from 0.0.0.0 to 255.255.255.255, from port 68 to port 67. The client port is fixed because a reply may have to be broadcast, and a fixed port lets every other kernel drop it without waking up a daemon.

What did the router promise?

The address 192.168.1.23/24, the router 192.168.1.1, and the ISP's resolver 198.51.100.53, for 86,400 seconds. Times are relative to the message, because client and server may not have synchronized clocks (RFC 2131, Section 3.3). At T1, after 12 hours, the laptop asks the same server for more time by unicast, and at T2, after 21 hours, any server by broadcast.

In 2024 Leviathan Security Group showed with TunnelVision (CVE-2024-3661) what option 121, classless static routes, does to a VPN [Leviathan2024]. A rogue DHCP server hands out /1 routes, more specific than the VPN's default route, and traffic leaves outside the tunnel.

Is 192.168.1.23 really free?

RFC 2131, Section 4.4.1 sketches the check, an ARP request with sender IP address 0, but not how many probes to send or how long to wait. Stuart Cheshire filled that gap with RFC 5227 in 2008, after eight years of IETF deliberation.

Sender IP zero means that no host caches a mapping that may prove wrong (RFC 5227, Section 2.1.1). Probing costs four to seven seconds. Later, a host may defend its address once, but a second conflict within 10 seconds makes it give the address up.

Who has 192.168.1.1?

Every packet for an address outside 192.168.1.0/24 goes to the router, so the first one after the DHCPACK makes the kernel broadcast a request of 42 bytes before any Ethernet padding. Its hardware type 1 is the 10 Mbit/s Ethernet of 1982, and Linux gives Wi-Fi interfaces the same type [Linux2026].

David Plummer wrote RFC 826 for an Ethernet that carried CHAOS, PUP, DECnet, and Internet traffic. A receiver adds the sender if it is the target, before it looks at the opcode. So the router learns the laptop's mapping from the request and needs no ARP request of its own.

When must ICMP stay silent?

RFC 792 already sent no "ICMP messages about ICMP messages". RFC 1122, Section 3.2.2 adds datagrams sent to a broadcast or multicast address, because one broadcast to a closed port could draw Destination Unreachable from every machine on a large Ethernet that has no client for it.

For echo requests to a broadcast address, a "passionate debate" ended in a neutral rule. The misuse arrived as the Smurf attack, which turns networks that accept directed broadcasts from outside into amplifiers. Since RFC 2644, Section 3 (1999), routers no longer receive or forward directed broadcasts unless configured to.

How do ping and traceroute work?

Mike Muuss wrote ping in December 1983, and FreeBSD's ping.c still says it "has to run SUID to ROOT". Linux 3.0 (2011) added ICMP datagram sockets, in which the kernel assigns the identifier the way UDP assigns a port.

Van Jacobson's traceroute sends UDP probes with TTL 1, 2, 3, and so on, to port 33434 and up. Each router that drops one answers with Time Exceeded (RFC 1812, Section 5.2.7.3), the destination with Port Unreachable. His note in the source, dated 20 December 1988, says the code "sort-of popped out after 48 hours without sleep" [FreeBSD2026].

The book keeps asking

This chapter has 5,846 words and 13 questions. These 7 are answered only in the book and the audiobook.

  • Why does it take four messages?
  • How does a broadcast reach a server behind a router?
  • And if no server answers?
  • How long does the answer stay true?
  • Who else may answer?
  • What is ICMP for?
  • Should the laptop believe a redirect?

Open the sources

  • RFC 2131 Dynamic Host Configuration Protocol 1997, Draft Standard
  • RFC 2132 DHCP Options and BOOTP Vendor Extensions 1997, Draft Standard
  • RFC 951 Bootstrap Protocol 1985, Draft Standard
  • RFC 826 An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet Hardware 1982, Internet Standard, STD 37
  • RFC 5227 IPv4 Address Conflict Detection 2008, Proposed Standard
  • RFC 792 Internet Control Message 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

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

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.