How the Internet works

The Link, chapter 6 of 36

Wi-Fi: Ethernet Without the Wire

At 54 Mbit/s, our 60 bytes of IP need about 9 of the 194.5 microseconds that the SYN's exchange takes in the air.

The laptop's kernel hands the Wi-Fi driver the same 74-byte Ethernet frame that Ethernet: Frames, Switches, and the 1500-Byte Legacy took apart, and that frame never reaches the air. The driver throws away its 14-byte header, wraps the IP packet in 34 bytes of 802.11 and LLC headers, and encrypts it. Then it waits until the channel has been silent for 43 microseconds plus a random number of 9-microsecond slots. The SYN counts as delivered only when the access point answers 16 microseconds after the last bit.

114 bytes
the SYN in the air with CCMP, where the Ethernet frame had 74
9 ms
how long a single attempt can wait at a contention window of 1023 slots
18 percent
the peak channel utilization that Abramson computed for ALOHA in 1970, 1/2e, rounded

Contending for one channel

The laptop shares its 5 GHz channel with two stations that the figure assumes, B and C, whose frames it makes as long as the SYN. Step through the backoff counters, hide station C from the laptop or switch RTS/CTS on, and watch which frames collide and which get their Ack.

What does the SYN look like in the air?

To the IP stack, a Linux Wi-Fi interface looks like Ethernet. mac80211 rewrites the header in ieee80211_build_hdr() [Linux2026]. Where Ethernet puts 14 bytes in front of the IP header, the QoS Data frame puts 34, and its EtherType rides in an LLC and SNAP header, AA AA 03 00 00 00 08 00.

CCMP adds an 8-byte header and an 8-byte integrity code, so the SYN leaves the laptop as 114 bytes. The addresses and the sequence number stay readable for anybody in range [Vanhoef2021].

Why does a wireless frame carry three addresses, and sometimes four?

On Wi-Fi, the laptop talks only to the access point. Two bits in the Frame Control say in which direction a frame crosses the border of the distribution system behind the AP, and they decide what the addresses mean. Our SYN carries the BSSID 00:00:5e:00:53:a1 in Address 1, the laptop in Address 2, and the router's LAN MAC 00:00:5e:00:53:01 in Address 3.

The fourth address is for radios that relay frames on behalf of other stations, as in a mesh. A three-address client cannot bridge a wired LAN onto Wi-Fi.

Why can a radio not detect a collision?

Because what decides a collision is the signal at the receiver, and the sender cannot hear it. Colliding bursts "are not necessarily reflected back to the transmitting stations" (RFC 8325, Section 6.1). 802.11 therefore tries to avoid collisions and learns of failures afterwards from the missing acknowledgment.

A station waits for an idle interframe space, then counts down a random number of 9-microsecond slots, pausing while the medium is busy. The count comes from a contention window that starts at 15 and roughly doubles after every failed attempt, up to 1023 (RFC 8325, Section 6.1.3).

What about the neighbor that the laptop cannot hear?

Carrier sense protects only against transmitters that the laptop can hear. In 1990 Phil Karn proposed MACA, "an acronym, not a Spanish word" [Karn1990]. The receiver repeats in its CTS how much data will follow, and every station that hears the CTS stays silent for that long, even if it cannot hear the sender.

802.11 kept carrier sense and added a virtual one built on the same idea. A station that decodes a frame addressed to somebody else sets its NAV from the Duration field (IEEE 802.11-2024, Clause 10.3.2.4). Our SYN announces 44 microseconds.

Why does Wi-Fi acknowledge every frame?

A missing Ack tells the sender about a loss within microseconds, whereas TCP would need a round trip to notice and would read every radio loss as a sign of congestion. If no Ack arrives, the laptop doubles its contention window, contends again, and resends the frame with the Retry bit set.

Linux initializes the two retry limits to the 802.11 MIB defaults, 7 for short frames and 4 for long ones. The mac80211 documentation remarks that each is called a retry limit "but actually means the number of transmissions not the number of retries" [Linux2026].

What does the 4-way handshake prove, and how did KRACK break it?

Each side proves that it knows the pairwise master key, and both derive the session key, the PTK, from it. The laptop installs the PTK when message 3 arrives. If message 4 is lost, the AP retransmits message 3.

In 2017 Mathy Vanhoef and Frank Piessens showed that clients then reinstalled the same key "and thereby reset the incremental transmit packet number (nonce)" [Vanhoef2017]. CCMP is secure only while no nonce repeats under one key. The paper names our case: decrypted TCP SYN packets let an attacker hijack TCP connections.

Why did WPA3 change the handshake?

In WPA2-Personal, everybody who knows the passphrase can compute everybody's keys, and an attacker who records one handshake can test guesses at leisure. WPA3-Personal replaces the pre-shared key with SAE, the Dragonfly exchange that Dan Harkins designed in 2008. Each run produces a fresh PMK (RFC 7664, Section 3.3), so a recorded run offers no offline test.

RFC 7664 contains an unusual sentence: "Consensus of the CFRG for this document was rough." Dragonblood later found timing and cache side channels in its password encoding [Vanhoef2020].

laptop (supplicant)AP (authenticator) 1: ANonce2: SNonce, MIC3: ANonce, GTK (encrypted), MIC4: MIC
From the book: The 4-way handshake that opens the laptop's data port

The book keeps asking

This chapter has 5,836 words and 16 questions. These 9 are answered only in the book and the audiobook.

  • Where did the idea of sharing a radio channel come from?
  • Which queue does the SYN wait in?
  • How fast is the link, and who picks the rate?
  • Why does Wi-Fi bundle frames?
  • What did OFDMA and MU-MIMO change?
  • Which channels may the laptop use?
  • How does the laptop find and join the network?
  • What happens when the laptop walks to the kitchen?
  • What changes with a username instead of a passphrase?

Open the sources

  • IEEE 802.11-2024 IEEE Standard for Information Technology, Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications (approved 26 September 2024, published 28 April 2025; incorporates 802.11ax-2021) 2024, free via IEEE GET Program after registration
  • IEEE 802.11be-2024 IEEE Standard for Information Technology, Part 11, Amendment 2: Enhancements for Extremely High Throughput (EHT) (approved 26 September 2024, published 22 July 2025) 2024, free via IEEE GET Program after registration
  • RFC 8325 Mapping Diffserv to IEEE 802.11 2018, Proposed Standard
  • RFC 9119 Multicast Considerations over IEEE 802 Wireless Media 2021, Informational
  • RFC 7664 Dragonfly Key Exchange 2015, Informational
  • [Vanhoef2017] Key Reinstallation Attacks: Forcing Nonce Reuse in WPA2. Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security (CCS), pp. 1313-1328 2017, free (authors' copy at papers.mathyvanhoef.com)
  • [Abramson1970] THE ALOHA SYSTEM: Another alternative for computer communications. Proceedings of the AFIPS Fall Joint Computer Conference, pp. 281-285 1970, free copy at people.eecs.berkeley.edu (course mirror, read for this chapter); ACM Digital Library access not checked
  • [Linux2026] Linux kernel source tree, v7.4-rc1 (commit 6628e7d4c6b2, 1 November 2026) 2026, free

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

The Link, chapter 7 of 36

The Last Mile: DSL, Cable, Fiber, and Mobile

The Internet Layer, chapter 8 of 36

IPv4: The Datagram

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.