Wi-Fi (IEEE 802.11) — CSMA - CA, bands
WHY does Wi-Fi need a special MAC protocol?
WHY can't Wi-Fi just use Ethernet's CSMA/CD?
- CSMA/CD = "listen while you talk; if you hear a collision, stop." This needs the sender to simultaneously transmit and receive.
- A Wi-Fi radio transmitting at, say, full power cannot simultaneously sense a faint colliding signal from a distant station — its own transmitter saturates its receiver. So collision detection is impossible in the air.
- Worse, there's the hidden terminal problem (below): two stations may collide at the receiver while being unable to hear each other at all.
So Wi-Fi's answer: avoid collisions by waiting, sensing, and using random backoff + (optional) handshakes.
HOW CSMA/CA works — derived step by step
Step 1 — Carrier Sense (two kinds)
- Physical CS: measure energy on the channel. Busy → defer.
- Virtual CS: every frame header announces a Duration field. Others set a timer called the NAV (Network Allocation Vector) = "channel busy until time T, don't even bother sensing." Saves power and handles hidden terminals.
Step 2 — Interframe Spaces (IFS): priority by waiting time
After the channel goes idle, you must wait a gap before doing anything. Shorter wait = higher priority.
| IFS | Length | Used for |
|---|---|---|
| SIFS | shortest | ACKs, CTS — replies that must win |
| DIFS | longest (data) | normal data before backoff |
Step 3 — Random Backoff (the collision avoider)
After waiting DIFS, the station picks a random backoff counter: where is the contention window. The counter decrements only while the channel is idle, and freezes when the channel goes busy. When it hits 0 → transmit.
Step 4 — ACK & Exponential Backoff
- Sender transmits, then waits SIFS; receiver sends an ACK.
- No ACK ⇒ assume collision/loss. Retransmit, but first double the contention window (binary exponential backoff): Doubling spreads out retries when the network is congested.
Step 5 (optional) — RTS/CTS handshake (solves hidden terminal)
Fix: before a big frame, sender sends a tiny RTS (Request To Send); AP replies with CTS (Clear To Send). Everyone who hears either RTS or CTS sets their NAV and stays quiet. Now even hidden C hears the CTS and backs off.

The Bands — WHERE Wi-Fi lives
| Band | Range (approx) | Wi-Fi gens | Trade-off |
|---|---|---|---|
| 2.4 GHz | 2.400–2.4835 GHz | b/g/n, ax | Long range, better wall penetration, but crowded & slow |
| 5 GHz | ~5.15–5.85 GHz | a/n/ac/ax | More channels, faster, shorter range |
| 6 GHz | ~5.925–7.125 GHz | Wi-Fi 6E / 7 | Huge clean spectrum, least range |
Worked Examples
Common Mistakes (Steel-manned)
Active Recall
Recall Quick self-test (cover the answers!)
- Why CA not CD in Wi-Fi? → can't detect collisions while transmitting (half-duplex radio).
- What proves a frame arrived? → the ACK after SIFS.
- Why freeze the backoff counter instead of resetting? → fairness / keep your place in line.
- What solves the hidden terminal problem? → RTS/CTS + NAV.
- Why does 2.4 GHz reach farther than 5 GHz? → longer wavelength penetrates/diffracts better.
Recall Feynman: explain to a 12-year-old
Imagine a group of kids in a totally dark room who all want to talk, but no one can hear themselves while shouting. So they make rules: listen first; if it's quiet, count silently to a random number; whoever finishes counting first talks. If someone else starts talking, you pause your counting and continue later (so you don't lose your turn). After you speak, the listener must say "got it!" — that's the only way you know your words weren't garbled by someone else talking at the same moment. Some kids are too far to hear each other but stand near the same teacher, so before talking they shout "may I?" and the teacher shouts "yes, everyone else be quiet!" — that's RTS/CTS. Low-pitched voices (2.4 GHz) carry through walls; high-pitched voices (5 GHz) are clearer but get muffled.
Flashcards
Why does Wi-Fi use CSMA/CA instead of CSMA/CD?
What is the NAV in 802.11?
What is the role of SIFS vs DIFS?
How does a station pick its backoff?
What happens to CW after a collision (no ACK)?
Why freeze the backoff counter instead of resetting it?
What proves a unicast frame was received in Wi-Fi?
What is the hidden terminal problem?
How does RTS/CTS solve hidden terminals?
Why does 2.4 GHz reach farther than 5 GHz?
How many non-overlapping 20 MHz channels does 2.4 GHz typically have?
Which band do Wi-Fi 6E/7 add and why?
Connections
- CSMA-CD and Ethernet — wired cousin that detects collisions
- ALOHA and Slotted ALOHA — ancestors of random-access MAC
- Hidden and Exposed Terminal Problems
- Frequency, Wavelength and Attenuation — physics behind band trade-offs
- MAC Layer and ARQ / ACK — acknowledgements & retransmission
- Bandwidth vs Throughput
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, Wi-Fi ka asli problem yeh hai ki sab devices ek hi "hawa" (radio channel) share karte hain, aur ek radio jab khud transmit karta hai to wo apni hi awaaz mein dab jaata hai — yaani transmit karte waqt collision detect nahi kar sakta. Isliye wired Ethernet wala CSMA/CD (collision detect) yahan kaam nahi karta. Wi-Fi ka jugaad hai CSMA/CA — collision ko avoid karo, detect mat karo. Pehle channel sun lo (carrier sense), thoda fixed time ruko (DIFS), phir ek random number count karo (backoff), aur jab 0 pe pahuncho tab bhejo. Random isliye taaki do log ek saath na bol padein, aur agar koi beech mein bolne lage to apna counter freeze kar lo (reset nahi) — taaki fairness bani rahe, tumhari baari na chhine.
Kyunki collision sunai nahi deta, to proof chahiye ki frame pahuncha — isliye receiver ek ACK bhejta hai, wo bhi sabse chhote gap SIFS ke baad, taaki koi naya sender beech mein ghus na sake. Agar ACK nahi aaya, maan lo collision hua: dobara bhejo lekin contention window double karke (exponential backoff), taaki retry log aapas mein phir na takraayein. Ek aur dikkat hai hidden terminal: do device AP ko to sun lete hain par ek dusre ko nahi, isliye dono "khaali hai" samajh ke ek saath bhej dete hain. Iska solution hai RTS/CTS — pehle chhota "may I?" bhejo, AP "haan, baaki sab chup" (CTS) bolta hai jise hidden device bhi sun leta hai aur NAV set karke ruk jaata hai.
Bands ka funda simple hai: 2.4 GHz ki wavelength lambi hoti hai, isliye deewaron ke paar door tak jaati hai — par crowded hai (sirf 3 non-overlapping channels: 1,6,11) aur slow. 5 GHz fast hai, zyada channels, par deewar ke paar weak. 6 GHz (Wi-Fi 6E/7) ekdum khaali aur fast, par range sabse kam. Yaad rakho: "2 walls, 5 speed, 6 spacious." Exam aur real life dono mein yeh range-vs-speed trade-off hi pura khel hai.