CS176C — Advanced Topics in Internet Computing
2026-04-16
CSMA/CA, the Distributed Coordination Function (DCF), and the Failure Modes of Local Sensing
Last lecture: the assumption cascade hit a physics wall.
Today’s question: WiFi sits between those extremes. \(\tau \ll T\) on a LAN, so sensing works. But CD doesn’t. How does wireless close the feedback loop without it?
Then: how that loop scales under density — and what finally broke it.
L5 left you here: you can listen before transmitting, but you cannot listen during. So you never directly observe a collision.
30 seconds with your neighbor: what’s the simplest protocol that still closes the loop?
Three steps, nothing more:
That’s it. This is CSMA/CA — Carrier Sense Multiple Access with Collision Avoidance.
The loop closes at the receiver, not the transmitter. The ACK is the only signal available.
You transmit a frame. You listen for an ACK. How long do you wait before giving up?
The wait must cover:
. . .
At 802.11b’s 1 Mbps basic rate, 1500-byte frame:
\[T_{\text{frame}} = \frac{1500 \times 8 \text{ bits}}{10^6 \text{ bits/s}} = 12 \text{ ms}\]
\[T_{\text{ACK}} = \frac{14 \times 8 \text{ bits}}{10^6 \text{ bits/s}} \approx 0.1 \text{ ms}\]
Per-attempt loop: ≈ 12 ms — dominated by frame TX.
Compare to CSMA/CD on Ethernet:
. . .
Ratio: 12 ms / 51 µs ≈ ~250× slower per attempt.
. . .
Why the gap? Not propagation delay (WiFi prop. delay is microseconds at 100 m range). The sender must finish the whole frame before the receiver can even start an ACK — L5’s physics made that unavoidable.
This is the core fragility of CSMA/CA. Ethernet’s tight loop tolerates ~95% load. WiFi’s loose loop can’t — we’ll see the ceiling later in the lecture.
You have CSMA/CA working. Now stress-test it. Turn to your neighbor — 2 minutes: what failure modes can you find?
Listed in the order history recognized them:
1. Hidden terminal (recognized 1975). L5’s environment-vs-measurement gap: station A senses “idle” at A’s antenna, but C (hidden from A) is transmitting to B. Collision at B’s receiver.
2. Backoff collisions repeat (addressed 1994, MACAW — “MACA for Wireless”). Two stations collide. Both retry. If they pick the same random wait, they collide again. How do you prevent cascading retries?
3. ACK is vulnerable to new attempts (addressed 1997, 802.11 DCF — Distributed Coordination Function). After a frame, the receiver sends ACK. But other stations were waiting too — they may try to transmit the moment the medium clears. ACK collides with a new-attempt frame.
4. Density collapse (quantified 2000, Bianchi). As \(n\) stations grow, the probability of two picking the same wait approaches 1. Even perfect random avoidance breaks down at scale.
Next: we’ll take each in turn, starting with the oldest — hidden terminals, 1975.
→ Addressing Challenge 1 (hidden terminal). Chronologically the oldest of the four — recognized in 1975, 15+ years before CSMA/CA as a principle.
The setting: UCLA’s Packet Radio Network (PRNET) experiments — applying Kleinrock’s CSMA to terrestrial radio. Throughput was much worse than the LAN model predicted.
Their diagnosis (“Packet Switching in Radio Channels, Part II”):
Hidden terminal — sensing too optimistic:
A ←──range──► B ←──range──► C
A and C cannot hear each other
Both transmit to B → collide at B
A and C each sense “idle.” Both transmit. Frame destroyed at B. Neither learns why — only an ACK timeout.
Exposed terminal — sensing too conservative:
A ←──range──► B C ←──range──► D
↑ ↑
└────┘ C hears B
C defers to B’s transmission to A. But C → D wouldn’t have hit B → A. Airtime lost.
Tobagi & Kleinrock’s framing: carrier sense at the transmitter is the wrong measurement. The collision is determined at the receiver. Until measurement reaches the receiver, no amount of backoff cleverness will close the gap.
Tobagi & Kleinrock’s proposed solution: Move the measurement to the receiver — literally.
The Busy-Tone Multiple Access (BTMA) idea:
Walk through it: A wants to transmit to B. A senses the data channel (clean — can’t hear C) and the busy-tone channel. B is currently receiving from C → B is emitting the tone. A hears the tone → defers. Hidden terminal solved.
This is an elegant solution. Does it have any problems? — 30 seconds.
What it requires:
Excellent in theory; impractical for 1980s consumer hardware. The idea sat dormant for 15 years — until someone asked: can we get the same effect without the second radio?
→ Still addressing Challenge 1. Same problem Tobagi-Kleinrock identified 15 years earlier — a new implementation strategy.
The setting: Phil Karn, amateur packet radio (KA9Q). Hidden terminals were destroying his throughput. He had read Tobagi & Kleinrock — but commodity transceivers couldn’t do busy tone.
Karn’s question: Can we get the busy-tone effect without a second radio?
The reformulation: MACA — Multiple Access with Collision Avoidance (Karn, 1990). Replace the continuous tone with a brief control-frame exchange on the data channel itself.
The conceptual mapping:
| BTMA (1975) | MACA (1990) |
|---|---|
| Continuous tone | Brief CTS frame |
| Separate channel | Same channel, in-band |
| Receiver always emits during RX | Receiver emits at start of RX |
| Two radios needed | Single radio, control frames |
Same idea, in-band — at the cost of handshake overhead.
Karn’s name was deliberate: the “CA” in MACA originally meant the handshake itself — avoiding collisions by delegating measurement to the receiver, not the random-backoff “avoidance” that 802.11 later folded in.
MACA solves Challenge 1 (hidden terminal) — but what about the others? Turn to your neighbor — 30 seconds:
MACAW (Bharghavan et al., 1994) — “MACA for Wireless”: fixes both.
802.11 DCF (1997) inherits this structure, re-introduces physical carrier sensing by default, and swaps MILD for the simpler Binary Exponential Backoff (BEB) — still a Challenge 2 fix.
→ Completing the Challenge 1 fix. RTS/CTS solves hidden terminal only if overhearing stations know when to defer.
The scenario from slide 10: A and B exchange RTS/CTS. Station C overhears the CTS.
Turn to your neighbor — 30 seconds. C can hear B but is hidden from A (that’s why RTS/CTS was needed). The CTS is ~100 µs, then the medium goes quiet from C’s perspective — A’s DATA frame is inaudible to C.
What stops C from transmitting during A’s DATA?
The answer must be memory, not sensing. C’s carrier sense will report idle right after CTS ends — but the channel is actually busy at B’s receiver for the full data duration.
The fix (built into the CTS):
A: [RTS|D=500µs]──────[DATA]────────
B: [CTS|D=480µs]──────[ACK]
C: ─── hears CTS ──[NAV=480µs: defer]─
D: ─── hears RTS ──[NAV=500µs: defer]─
Two kinds of “channel busy” now coexist:
| Kind | Source | Updated |
|---|---|---|
| Physical CS | Antenna energy | Continuously |
| Virtual CS (NAV) | Overheard Duration field | At handshake |
A station defers if either says busy.
. . .
The conceptual shift: medium-occupancy state is no longer purely measured from physics. It is partly announced via the protocol and remembered locally as a timer.
A new kind of state — forward-looking, trust-based, and local to each station.
Why RTS/CTS is expensive: it’s sent at the PHY’s basic rate (so every legacy client can decode it), not at the high data rate.
For 802.11g: basic rate = 6 Mbps, peak data rate = 54 Mbps. Control frames run 9× slower than the data frame they protect.
Handshake cost added per frame (RTS + SIFS + CTS + SIFS, at 802.11g):
Compare to data airtime at 54 Mbps:
| Frame size | Data airtime | Handshake / data ratio |
|---|---|---|
| 50 B (TCP ACK) | ~27 µs | ~5× data |
| 500 B | ~94 µs | ~1.4× |
| 1500 B | ~242 µs | ~0.5× |
For small frames, the handshake costs several times the payload. For large frames it’s a tax, not a killer.
Benefit: RTS/CTS shifts collisions to short control frames. A 20-byte RTS collision wastes ~52 µs; a 1500-byte data collision wastes ~242 µs + ACK timeout. Probability stays similar; cost-per-collision drops ~5×.
Limit: stations hidden from both TX and RX never hear the handshake. RTS/CTS extends the measurement radius from “what A hears” to “what A or B hears” — still not global.
Why 802.11 makes it optional: the cost-benefit flips with deployment density and frame size. Dense + large frames → enable. Sparse + small frames → disable. The protocol provides the mechanism; the deployer chooses the policy.
→ Addressing Challenges 2 and 3. 802.11 DCF layers three additions on top of CSMA/CA.
The receiver wants to ACK. A new-attempt station also wants to transmit. Both are watching the medium. How do you guarantee the ACK always wins?
Shorter wait = higher priority. Introduce two inter-frame spaces:
→ Challenge 3 fix. The ACK’s shorter wait guarantees it preempts any new attempt.
Two stations collide. Both retry at random. What prevents them from colliding again?
Grow the random range on every collision: Binary Exponential Backoff (BEB).
→ Challenge 2 fix. Same mechanism as Ethernet’s 1976 BEB.
What sets the slot duration that the random backoff decrements in?
Propagation delay + radio turnaround + CCA detect — enough for any station to sense another’s transmission by the next slot boundary.
These are enhancements, not definitions. CSMA/CA worked before them; DCF packaged them together for efficiency.
802.11 DCF: Distributed Coordination Function — state machine (top) and timeline (bottom). Source: CS176C textbook, Figure V01.
What the figure shows:
You’ve just seen the whole protocol. Here’s the intuition to carry with you — DCF in six rules, one sentence each.
30 people in a room, one bartender (the AP), no moderator.
Every piece of this lecture — SIFS, DIFS, BEB, NAV, RTS/CTS, the 12 ms feedback loop, the four challenges — is a zoom-in on one of these six rules.
→ Quantifying Challenge 4 (density collapse). Even with all the DCF enhancements, a fundamental ceiling remains.
Setup: \(n\) stations, all backlogged, all using DCF. Each station transmits in any given slot with probability \(\tau\) (function of \(CW\)).
Collision probability per attempt: \(p = 1 - (1-\tau)^{n-1}\)
Saturated throughput (Bianchi’s analytical model):
\[S = \frac{\text{successful payload time}}{\text{idle slots} + \text{successful TX} + \text{collision TX}}\]
For 802.11b (\(CW_{\min}=31\), slot=20 µs, frame=1500B):
Throughput
▲
│ ● (n=5)
│ ● (n=10)
│ ● (n=15)
│ ● (n=20)
│ ● (n=30)
│ ● (n=50)
│ ● (n=100)
│ ● (n=200)
└───────────────────────► n
~30 stations:
inflection point
Two regimes:
The ~30% ceiling is not a bug — it is the equilibrium of a slow control loop trying to manage many independent contenders with stale feedback.
L5 ended at CSMA/CD. Wireless couldn’t do CD, so the cascade bent:
| Generation | Shared State | Throughput | Loop closes in | Key Failure |
|---|---|---|---|---|
| Pure ALOHA | Nothing | 18.4% | — | Vulnerable window = \(2T\) |
| Slotted ALOHA | Slot timing | 36.8% | — | Bistable instability |
| CSMA | Busy/idle (local) | 80–90% | \(\tau\) (~5 µs) | Hidden terminal |
| CSMA/CD (wired) | Collision signal | ~95% | 51.2 µs | (Wired only) |
| CSMA/CA (principle) | ACK from receiver | N/A | ~12 ms @ 1 Mbps | Backoff, ACK vuln., hidden, density |
| + DCF (1997) | + SIFS/DIFS + BEB + NAV | ~30% at \(n{=}50\) | ~12 ms / attempt | Density (irreducible) |
The trade: wireless got a working protocol, but its feedback loop is frame-time-bounded (~250× slower than Ethernet’s propagation-bounded loop). DCF’s enhancements address 3 of 4 challenges — density is structural.
The question for next lecture: WiFi shipped DCF in 1997 and survived 20 years on it. Why? And what changed?
Which invariant’s answer kept changing across the cascade? Which stayed fixed?
| Protocol | State | Time | Coordination | Interface |
|---|---|---|---|---|
| Pure ALOHA | None | Continuous TX | Distributed | Broadcast |
| Slotted ALOHA | + Slot boundary | Slotted | Distributed | + Slot timing |
| CSMA | + Busy/idle (local) | Slotted | Distributed | + Listen-before-talk |
| CSMA/CD (wired) | + Collision signal | µs detection | Distributed | + Abort + jam |
| CSMA/CA (principle) | + ACK presence | Frame-TX bounded | Distributed | + Link-layer ACK |
| + DCF (1997) | + CW history + NAV | Prescribed µs slots | Distributed | + SIFS/DIFS/RTS/CTS |
The pattern:
The ceiling is a coordination limit, not a state limit. Adding more state has diminishing returns — the next step requires changing who decides.
Scenario: One AP. 40 devices sharing it.
Throughput feels bad to everyone. Why?
Turn to groups of 3 — 5 minutes:
1. Rank the four challenges
Of (a) backoff collisions, (b) ACK vulnerability, (c) hidden terminals, (d) density collapse — which dominate in this setting?
Defend each ranking.
2. Pick one. Design a fix.
What new mechanism would fix your top-ranked challenge? What new state does the mechanism need, and who has that state?
3. Can it be distributed?
Can your fix live within the existing DCF framework (fully distributed)? Or does it require a central authority?
What gives?
The insight most groups will reach: any fix that scales to this density needs someone who sees the aggregate. The only entity with that view is the AP. The protocol evolves toward centralization — which is next lecture’s story.
Beyond CSMA/CA: Why WiFi Had to Change