4.3.6 · D2Computer Networks

Visual walkthrough — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

2,220 words10 min readBack to topic

Before we start, one word we will use everywhere:

We also need a unit of time.

Why a shared beat and not free-flowing seconds? Because if everyone counts in the same discrete beats, two stations can compare "who reached zero first" cleanly — there is no blurry in-between. Discreteness is what makes the countdown fair.


Step 1 — Listen before you speak (Carrier Sense)

WHAT. A station that has a frame ready does not transmit immediately. It first measures the energy on the channel. If the energy is above a threshold, the channel is busy and the station waits.

WHY. The air is one shared line. If X transmits while Y is already transmitting, the two radio waves add up at the receiver and neither frame can be decoded — a collision. Listening first is the cheapest way to not walk into an obvious ongoing conversation.

PICTURE. In the figure, the mint band is "busy" energy on the timeline. Station X wants to send (coral arrow) but sees busy, so it holds. Only when the mint band ends — the channel falls idle — does X even consider speaking.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

Read the as the word "and": both conditions must hold. The (Network Allocation Vector) is a countdown timer a station sets when it hears another frame announce how long it will last — we meet it fully in the hidden-terminal step. For now: means "nobody has reserved future time."


Step 2 — Wait a fixed pause (Interframe Space)

WHAT. The instant the channel goes idle, a station does not jump in. It waits a fixed gap called an Interframe Space (IFS). Data waits a long gap called DIFS; urgent replies (like an ACK) wait a short gap called SIFS.

WHY. The length of the pause is a priority knob. A shorter wait always wins the channel, because that station starts acting while the longer-waiters are still frozen. By giving replies (SIFS) a shorter pause than new data (DIFS), the reply is guaranteed to go first.

PICTURE. The timeline shows the idle moment (dashed line). The lavender bar is the short SIFS; the longer butter bar is DIFS. Notice DIFS finishes strictly later — new data can never sneak ahead of a reply.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

That single inequality is the whole priority system: whoever is allowed to wait the smaller amount owns the channel. Same idea as acknowledgement timing — the ACK must never lose its slot.


Step 3 — Count down a random number (Backoff)

WHAT. After DIFS, a data station picks a random whole number between and (the contention window) and treats it as a countdown. Each idle slot, it subtracts . When it reaches , it transmits.

  • = a fair dice roll giving any integer from up to and including .
  • = the contention window, the size of the dice. Bigger = bigger dice = more possible answers.
  • Multiplying by turns "number of beats" into actual waiting time.

WHY random? Two stations that were both blocked will both finish DIFS at the same instant. If they used the same fixed count they'd collide again forever. A random roll means they almost surely pick different numbers — one hits first and speaks alone.

PICTURE. X rolled , Y rolled . Both tick down together on each idle slot (green ticks). At the 4th slot X reaches and transmits (coral). Y, still at , sees the channel go busy.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

This is the direct descendant of slotted ALOHA, but smarter: instead of just retrying in a random future slot, we count down beat by beat so the earliest roller always wins cleanly.


Step 4 — Freeze, don't reset (fairness)

WHAT. When the channel goes busy mid-countdown, the losing station freezes its counter at its current value. It does not roll a new number. When the channel is idle again (after the winner finishes and everyone re-waits DIFS), it resumes counting from where it froze.

WHY. Freezing preserves your "place in line." Y already waited down to ; if it reset, it might roll a big number and be overtaken by newcomers forever — starvation. Freezing guarantees Y's lead shrinks toward and it wins soon.

PICTURE. Y's counter is drawn as a shrinking bar. It runs , then holds flat (frozen) during X's transmission, then continues in the next idle window. The flat "hold" region is highlighted.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

Step 5 — The only proof of arrival (ACK)

WHAT. After X's frame ends, X and the receiver wait exactly SIFS, then the receiver sends a tiny ACK ("acknowledgement — got it"). If X does not hear an ACK within that window, X assumes the frame was lost or collided.

WHY. Recall the parent's core fact: a radio cannot hear a collision while transmitting — its own signal deafens it. So X can never directly know its frame arrived. The only evidence is a separate reply coming back. The ACK is that evidence.

WHY SIFS specifically? Because SIFS is the shortest pause (Step 2), the ACK jumps in before any new data station (which must wait the longer DIFS) can grab the channel. The handshake finishes uninterrupted.

PICTURE. X's frame, then a short lavender SIFS gap, then the receiver's mint ACK. A second station Z, waiting DIFS (longer, butter), is still frozen when the ACK lands — it never gets a chance to smash it.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands


Step 6 — Degenerate case: no ACK ⇒ double the window

WHAT. If the ACK never comes, X retransmits — but first it doubles the contention window before rolling a new backoff:

  • : contention windows are always "all-ones" numbers like (in binary ). This formula turns one all-ones number into the next bigger one — it doubles the number of possible slots.
  • : an upper limit (often ). The makes sure stops growing there.

WHY double? A lost ACK usually means a collision — several stations rolled the same small number. Doubling the window doubles the number of slots to hide in, roughly halving the chance of colliding again. Repeated collisions ⇒ repeated doubling ⇒ retries spread far apart. This is binary exponential backoff, the same trick used in Ethernet's collision recovery.

WHY a ceiling? Without , a badly congested network could double the window forever, giving effectively infinite delay. The cap trades a little collision risk for a bounded wait.

PICTURE. A staircase: , then flat. Each step is drawn twice as wide as the last to show the doubling, and the flat top is the cap.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

Step 7 — Edge case: the hidden terminal (RTS/CTS)

WHAT. Sometimes carrier sense lies. Stations A and C can both reach access point B, but A and C are too far apart to hear each other. Both sense "idle" (truthfully — neither hears the other) and both transmit → collision at B. The fix: before a big frame, A sends a tiny RTS ("Request To Send"); B replies with CTS ("Clear To Send"). Everyone who hears either RTS or CTS sets their NAV timer and stays silent.

WHY it works. Even though C can't hear A's RTS, C can hear B's CTS (C is in range of B). That CTS carries a duration, so C sets and defers — the virtual sense from Step 1 finally earns its keep. This is the full treatment in Hidden and Exposed Terminal Problems.

PICTURE. A layout view: A—B—C in a line with overlapping range circles. A's RTS reaches B only. B's CTS (butter burst) reaches both A and C. C's NAV bar lights up "quiet." No collision at B.

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

The one-picture summary

Everything above, on a single timeline for one successful turn:

Figure — Wi-Fi (IEEE 802.11) — CSMA - CA, bands

Read it left to right: busy (mint) → channel goes idle (dashed) → DIFS wait (butter) → backoff countdown ticking on idle slots (coral steps) → frame transmitted → SIFS (lavender) → ACK (mint) → delivery confirmed. A loser station's frozen counter sits underneath, resuming next round.

Recall Feynman retelling — say it in plain words

Imagine a dark room full of polite people who can't see each other.

  1. Shush and listen. Don't talk while someone else is (carrier sense).
  2. Wait a beat after silence. Replies wait a tiny beat (SIFS) so they always win; new speakers wait a long beat (DIFS).
  3. Roll dice, count down. Everyone waiting picks a random number and counts down on the shared metronome. Lowest roll speaks first — no clash.
  4. If someone else starts, freeze your count. Keep your place in line so you win soon (fairness).
  5. Wait for "got it." Since you're deaf while talking, the only proof you were heard is the listener saying "got it" after the tiny beat (ACK).
  6. No "got it"? Assume a clash. Double your dice before trying again, so retries scatter — but stop doubling at a ceiling.
  7. Can't hear a rival across the room? Shout a quick "I'm about to talk" (RTS); the moderator echoes "go ahead" (CTS) so even people who can't hear you can hear the moderator and stay quiet. That whole dance is CSMA/CA.
Recall One-line self-tests

What replaces "detect a collision" in Wi-Fi? ::: Waiting for an ACK — no ACK means assume collision. Why measure waiting in slot times, not seconds? ::: Discrete shared beats let stations compare "who reached zero first" cleanly. Why does the loser freeze instead of re-rolling? ::: To keep its place in line and avoid starvation (fairness). After a lost ACK, what happens to ? ::: It doubles () up to , spreading retries apart. Which station hears the CTS that A can't reach? ::: The hidden station C, which is in range of the access point B.