Wireless LANs: Wi-Fi, CSMA/CA, and Hidden Terminals
Characteristics of Wireless Links
The most important difference between wireless and wired links is the channel itself:
- Decreasing signal strength: radio waves weaken as they pass through objects such as walls, and even in free space the signal strength falls rapidly with distance (path loss).
- Interference: other senders in the same frequency band (such as other Wi-Fi networks, cordless phones, and microwave ovens) interfere with each other.
- Multipath propagation: radio waves reflect off the ground and objects and reach the receiver along paths of different lengths, blurring the received signal.
As a result, wireless links have far more bit errors than wired links. The higher the signal-to-noise ratio (SNR), the lower the bit error rate (BER); a sender can adapt its modulation to the channel, using a fast modulation when the channel is good and falling back to a more robust, slower one when it is poor. Precisely because errors are frequent, 802.11 uses acknowledgments and retransmissions at the link layer to fix corrupted frames locally.
802.11 Architecture
The basic building block of an IEEE 802.11 wireless LAN (Wi-Fi) is the basic service set (BSS). In infrastructure mode, a BSS contains one access point (AP) and several wireless stations, and the AP connects to a switch or router over wired Ethernet. In ad hoc mode, stations talk to each other directly without an AP.
The administrator gives each AP a service set identifier (SSID), the "Wi-Fi name" we see on our devices, and chooses a channel. To join the network, a station must first associate with an AP. It can scan passively, listening for the beacon frames that APs send periodically, or scan actively, broadcasting a probe request frame and waiting for probe responses from APs. After associating, a station usually authenticates and then obtains an IP address with DHCP.
| Standard | Band | Maximum rate |
|---|---|---|
| 802.11b | 2.4 GHz | 11 Mbps |
| 802.11g | 2.4 GHz | 54 Mbps |
| 802.11n (Wi-Fi 4) | 2.4 / 5 GHz | 600 Mbps |
| 802.11ac (Wi-Fi 5) | 5 GHz | about 3.5 Gbps |
| 802.11ax (Wi-Fi 6) | 2.4 / 5 / 6 GHz | about 9.6 Gbps |
All of these standards use the same medium access protocol, CSMA/CA, and the same link-layer frame structure, so they interoperate.
Why Not Collision Detection?
Ethernet's CSMA/CD requires an adapter to detect collisions while it is sending. That is hard on a wireless channel: an adapter's own signal is far stronger than signals from distant stations, so it can hardly hear anything else while transmitting. More importantly, because of hidden terminals and fading, many collisions cannot be detected at the sender even if it could listen while sending. So 802.11 does not detect collisions; it tries to avoid them (CA, collision avoidance), and once it starts sending a frame, it sends the whole frame.
KNOWLEDGE QUIZ
CSMA/CA
802.11 defines two time intervals: the short inter-frame space (SIFS) and the distributed inter-frame space (DIFS), with . A station sends a frame as follows:
- If the station senses that the channel is idle, it waits for DIFS and then transmits the whole frame.
- Otherwise, it picks a random backoff value and decrements the counter one slot at a time while the channel is idle. When the channel becomes busy, the counter freezes, and the countdown resumes after the channel has been idle for DIFS again.
- When the counter reaches 0 (the channel is necessarily idle then), the station transmits the whole frame and waits for an acknowledgment.
- A receiver that gets the frame correctly waits for SIFS and then returns an ACK. If the sender receives no ACK, it assumes the frame was lost, enlarges the range of backoff values, and goes back to step 2.
Why freeze the counter instead of sending as soon as the channel becomes idle, as Ethernet does? Ethernet detects collisions quickly and aborts, so a collision costs little; in 802.11 a collision wastes an entire frame time. If two stations are both waiting for the same transmission to end, sending immediately guarantees a collision. Their backoff values, however, are probably different: the station whose counter reaches 0 first sends, and the other hears it, freezes its counter, and resumes from there in the next round.
Count down, freeze, and resume: CSMA/CA in slow motion
Unlock the complete interactive lab, deeper explanations, and curated reference answers.
Hidden Terminals and RTS/CTS
Suppose stations A and C are both within range of the access point but, because they are too far apart or blocked by an obstacle, cannot hear each other. While A is sending to the AP, C senses an idle channel and starts sending too. The two frames collide at the AP, yet neither A nor C can tell. This is the hidden terminal problem.
802.11 offers an optional reservation scheme:
- The sender first sends a short Request to Send (RTS) frame stating the total time needed for the data frame and the ACK.
- When the AP receives the RTS, it broadcasts a Clear to Send (CTS) frame. The CTS gives the sender permission to send and tells every station that hears it not to transmit during that time; those stations set their network allocation vector (NAV) accordingly.
- The sender sends the data frame, and the AP replies with an ACK.
A hidden terminal cannot hear the sender's RTS but is sure to hear the AP's CTS, so RTS/CTS solves the hidden terminal problem. Even if RTS frames collide, only the time of a short RTS is wasted. RTS/CTS does add delay and overhead, however, so it is normally used only for long frames above an RTS threshold.
Hide a terminal, then rescue it with RTS/CTS
Unlock the complete interactive lab, deeper explanations, and curated reference answers.
KNOWLEDGE QUIZ
The 802.11 Frame and Its Addresses
The most unusual feature of the 802.11 frame is its four address fields. Infrastructure mode commonly uses the first three:
| Field | Meaning |
|---|---|
| Address 1 | MAC address of the wireless station or AP that is to receive the frame over the air |
| Address 2 | MAC address of the station or AP that transmits the frame over the air |
| Address 3 | MAC address of the router interface the AP is connected to (the frame's original source or final destination) |
| Address 4 | Used only when APs form a wireless distribution system |
For example, when router R1 sends a datagram to wireless host H1, R1's Ethernet frame has H1's MAC address as its destination and R1's as its source; R1 does not know there is an AP in between. The AP converts it into an 802.11 frame with address 1 = H1, address 2 = AP, and address 3 = R1. When H1 replies, it is the reverse: address 1 = AP, address 2 = H1, address 3 = R1, and the AP converts it into an Ethernet frame with destination R1 and source H1.
An 802.11 frame also has a duration field (used to set the NAV) and a sequence number field. Because the ACK itself can be lost, a sender may retransmit a frame the receiver already has; the receiver uses the sequence number to tell new frames from duplicates.
Mobility within a Subnet
If several APs are connected to the same switch and belong to the same IP subnet, a host moving between them can keep its IP address, and its ongoing TCP connections are not interrupted. After the host associates with the new AP, the new AP sends an Ethernet broadcast frame with the host's MAC address as the source on the host's behalf. The switch updates its table, and from then on frames for the host are forwarded out of the interface leading to the new AP.
How much of 54 Mbps does CSMA/CA deliver?
An 802.11 station sends one data frame at 54 Mbps and receives a 14-byte ACK at 24 Mbps. Use DIFS = 34 µs, SIFS = 16 µs, slot = 9 µs, a backoff of K = 4 slots, and ignore physical-layer preambles.
- For a 1500-byte frame, how long does one complete exchange take, and what throughput does the station achieve?
- Repeat with RTS (20 bytes) and CTS (14 bytes), both at 24 Mbps, each followed by SIFS.
- Repeat both cases for a 100-byte frame. When is RTS/CTS worth using?
Fill in the 802.11 address fields
Host H1 is associated with access point AP, which is connected through an Ethernet switch to router R1, H1's default gateway.
- R1 sends an IP datagram to H1. Give the source and destination MAC addresses of the Ethernet frame, and addresses 1, 2 and 3 of the 802.11 frame the AP sends.
- H1 replies to R1. Give the three addresses of H1's 802.11 frame and the two MAC addresses of the Ethernet frame the AP sends.
- Why does an 802.11 frame carry a sequence number, even though the link layer is not a transport protocol?