The idea: listen, wait, count, send, get an ACK

All Wi-Fi devices on a channel share the same air, and only one of them can talk at a time. There is no referee: every station follows the same rule, CSMA/CA (carrier sense multiple access with collision avoidance), called the DCF in the 802.11 standard. A station that has a frame listens first. When the air has been idle for DIFS, it counts down a random backoff, one step per idle 9 µs slot, and sends when the counter reaches 0. The receiver answers every frame with an ACK after a short gap called SIFS. No ACK means something went wrong.

Time line of one exchange: the air is busy, then station A waits DIFS (34 µs), counts its backoff 5, 4, 3, 2, 1, sends DATA, the AP waits SIFS (16 µs) and sends the ACK. Station B, which also has a frame, freezes its backoff while A sends.
One exchange: DIFS, backoff, DATA, SIFS, ACK. Another station's backoff freezes while the air is busy.

The page has one access point (AP) and three stations. Pick who sends, whether a wall hides C from the others and whether RTS/CTS is on. The map shows frames flying; the timeline shows every slot of every node.

Slots, SIFS and DIFS

802.11 measures time in slots. The gaps between frames are fixed, and their order is the whole trick: the reply to a frame waits a shorter gap than anyone who wants to start something new.

Name802.11a/g/n/ac (5 GHz OFDM)On this pageUsed for
slot9 µs1 slotone backoff step
SIFS16 µs2 slotsbefore an ACK, a CTS, or DATA after CTS
DIFS = SIFS + 2 slots34 µs4 slotsbefore a new frame
CWmin / CWmax15 / 1023samerange of the random backoff

Because SIFS < DIFS, the AP always starts its ACK before any waiting station's DIFS can end, so an exchange is never cut in half (Demo 1). The page rounds every time to whole slots and shortens the DATA frame to 12 slots so the timeline fits.

Random backoff, and why it freezes

Each station picks its backoff uniformly from 0 to CW (the contention window, 15 at first). The station with the smallest number goes first. The others hear it start and freeze their counters; after the next DIFS of idle air they continue from where they stopped instead of drawing again (Demo 2: B drew 7, counts to 4, freezes, and later only needs 4 more slots). That makes it fair: a station that already waited long is closer to 0 next time.

Collisions and the contention window

A radio cannot hear others while it transmits, so Wi-Fi cannot do what old Ethernet did (CSMA/CD: detect the collision and stop). If two stations reach 0 in the same slot, both frames are garbled at the AP, nobody gets an ACK, and each sender only learns about it from the silence. It then doubles its window and draws again (Demo 3):

Attempt1234567+
CW (backoff 0..CW)1531631272555111023

A wider window makes a second tie less likely. After a success CW goes back to 15; after the retry limit (7 here) the frame is dropped.

The hidden node problem

Carrier sense only works if stations can hear each other. With the wall on, A and C both reach the AP but not each other. While A sends, C's radio hears silence, so C finishes its DIFS and backoff and transmits right into A's frame. The two overlap at the AP and both are lost (Demo 4). Long DATA frames make this likely: C has many slots in which to start.

Left, without RTS/CTS: A and C are on opposite sides of a wall, both send DATA to the AP and the frames collide at the AP. Right, with RTS/CTS: A sends RTS, the AP answers CTS which reaches both A and C, C sets its NAV and stays quiet while A sends DATA and gets the ACK.
C cannot hear A, but it can hear the AP: the CTS tells C to keep quiet.

RTS/CTS and the NAV

With RTS/CTS on, a station first sends a short RTS (request to send). The AP answers with a CTS (clear to send). Every frame carries a Duration field: how long the rest of the exchange will take. Everyone who decodes the CTS, including hidden C, sets its NAV (network allocation vector) to that time and treats the air as busy until it runs out, even if its radio hears nothing. This is virtual carrier sense (Demo 5, the purple bar in the timeline).

Collisions still happen, but now they hit a 3-slot RTS instead of a 12-slot DATA frame (Demo 6). The price is two extra frames and two SIFS per exchange, so real devices use RTS/CTS only for long frames (an RTS threshold, often off by default) or when they see many losses.

CSMA/CA vs CSMA/CD

Wi-Fi (CSMA/CA)Old shared Ethernet (CSMA/CD)
Before sendingwait DIFS + random backoffwait until the wire is idle
Collision found bymissing ACK, after the whole framehearing it on the wire, at once
After a collisiondouble CW, draw againjam signal, binary exponential backoff
Every frame ACKedyes (layer 2)no
Todayevery Wi-Fi networkgone: full-duplex switched links never collide

See also How Ethernet Switches Forward Frames: an access point bridges these Wi-Fi frames onto a switched Ethernet, where every link is its own collision-free segment, and Hub vs Switch vs Router for CSMA/CD on a hub.

What the page leaves out

  • Real frame lengths and data rates, preambles, EIFS after a garbled frame, and the exact ACK timeout.
  • The rule that a frame arriving at a station whose air was already idle for DIFS may go out at once, and the post-backoff after every transmission.
  • 802.11e/WMM: four access categories (voice, video, best effort, background) with their own AIFS and CW, and TXOP bursts.
  • Aggregation (A-MPDU) with block ACKs, OFDMA and trigger frames in Wi-Fi 6, beacons, power save, association and security (WPA2/WPA3).
  • Exposed nodes, capture effect, rate adaptation, and interference from other networks on the same channel.