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
- RFC 2132 DHCP Options and BOOTP Vendor Extensions
- RFC 951 Bootstrap Protocol
- RFC 826 An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet Hardware
- RFC 5227 IPv4 Address Conflict Detection
- RFC 792 Internet Control Message Protocol
- RFC 1122 Requirements for Internet Hosts - Communication Layers
- RFC 1812 Requirements for IP Version 4 Routers
All 46 documents this chapter cites, each with a link to its publisher and a copy kept here.
