9. Wi-Fi and other link layers
IP does not care what the link is, but the link's quirks leak upward as latency, loss, and jitter that TCP must cope with.
9.1 Wi-Fi (802.11) vs Ethernet — the differences that matter
| Property | Switched Ethernet | Wi-Fi |
|---|---|---|
| Medium | Dedicated per port | Shared radio, half-duplex |
| Access method | None needed (full duplex) | CSMA/CA — listen, backoff, maybe RTS/CTS |
| Link-layer ACKs | No (FCS drop only) | Yes — every unicast frame is ACKed and retried at L2 |
| Rate | Fixed, negotiated once | Adapts constantly (MCS) with signal quality |
| Loss | ~0 on healthy cable | Bursty; interference, distance, hidden nodes |
| Latency | ~microseconds, stable | 1–50 ms, highly variable (airtime contention) |
| Addressing | 2 MACs per frame | Often 3 or 4 (adds the AP/BSSID) |
Key consequences for TCP:
- Wi-Fi retries hide loss from TCP — good (fewer spurious congestion events) but retries add latency and jitter, which inflates RTT estimates and can cause bufferbloat in the AP's queue (Ch. 44).
- Airtime is the real currency. One slow/distant client transmitting at 6 Mbit/s hogs airtime and starves fast clients ("performance anomaly").
- Half-duplex + contention means measured "100 Mbit/s Wi-Fi" delivers ~50–60 Mbit/s of TCP goodput at best, less with many clients.
- Roaming between APs drops frames briefly; long-lived TCP connections survive because of retransmission, but real-time media hiccups.
9.2 Other link layers you'll meet
- PPP / PPPoE: point-to-point (DSL, some fiber, cellular). MTU 1492 for PPPoE. Carries authentication (PAP/CHAP) and IP assignment.
- DOCSIS (cable): shared upstream, asymmetric, historically bufferbloat-prone until "PIE"/AQM mandates.
- Cellular (LTE/5G): deep per-device buffers, RTT 20–80 ms that spikes on radio state transitions (idle→connected can add 100+ ms), NAT everywhere, frequent IP changes on handover. TCP sees this as latency and occasional connection death.
- MPLS: a "Layer 2.5" label-switching transport carriers use internally; invisible to your IP packets except as one fast hop and possible ICMP oddities.
- Loopback (
lo): MTU 65536, no real link; used for host-local IPC over127.0.0.1/::1.
9.3 War story
A video-call app was blamed for "freezing," but only in one conference room. The
room's AP shared a channel with a 2.4 GHz wireless projector and a microwave
kitchen next door. iw dev wlan0 station dump showed the client rate collapsing
to 1 Mbit/s and 40% frame retries during freezes. Moving the AP to a clean 5 GHz
channel fixed it. Lesson: on Wi-Fi, "the app froze" is often "the RF
environment degraded"; measure PHY rate and retry percentage, not just ping.
Try it yourself
# Linux Wi-Fi diagnostics
iw dev wlan0 link # current BSSID, signal, tx bitrate
iw dev wlan0 station dump # rx/tx bitrate, retries, failed, signal
watch -n1 'iw dev wlan0 link | grep -E "signal|bitrate"'
# macOS
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I