How WiFi Works — OFDM, Subcarriers and Wireless Physics
When a laptop streams 4K video over WiFi at 1 Gbps, hundreds of millions of radio waves per second are being choreographed with mathematical precision. Behind the seamless experience lies OFDM — Orthogonal Frequency-Division Multiplexing — a technique that uses the Fourier transform to simultaneously transmit data on dozens of subcarriers, each modulated independently, achieving near-Shannon-limit efficiency.
1. Radio Waves and the ISM Bands
WiFi transmits data as electromagnetic waves at radio frequencies. The speed of the waves is c = 3×10⁸ m/s; their wavelength and frequency are related by λ = c/f.
These frequencies are in the ISM (Industrial, Scientific, Medical) bands — unlicensed spectrum available without a radio operator license. The tradeoff:
- 2.4 GHz: longer wavelength penetrates walls better (~35 m indoors); more congested (Bluetooth, microwaves); only 3 non-overlapping channels in 20 MHz mode.
- 5 GHz: shorter range (~15 m indoors) but 25 non-overlapping channels and less interference; higher maximum bandwidth.
- 6 GHz (WiFi 6E): 1 200 MHz of fresh spectrum; up to 59 non-overlapping 20 MHz channels; mainly short-range high-throughput uses.
The free-space path loss (how much signal weakens with distance) follows the Friis equation:
2. Modulation — Encoding Bits on Waves
Digital data (bits) must be encoded onto the carrier wave by varying one of its properties over time:
- BPSK (Binary Phase-Shift Keying): 0° = bit 1, 180° = bit 0. Robust; 1 bit per symbol. Used for control frames and at long range.
- QPSK: 4 phases (0°, 90°, 180°, 270°) → 2 bits per symbol. Better efficiency, still fairly noise-resistant.
- 16-QAM: 16 points in the 4×4 amplitude-phase constellation → 4 bits per symbol. Requires higher SNR.
- 64-QAM: 6 bits/symbol. WiFi 4/5 maximum.
- 256-QAM: 8 bits/symbol. WiFi 5 (802.11ac).
- 1024-QAM: 10 bits/symbol. WiFi 6 (802.11ax).
- 4096-QAM: 12 bits/symbol. WiFi 7 (802.11be).
Higher-order QAM achieves more bits per symbol but requires better signal-to-noise ratio (SNR). The Shannon-Hartley theorem sets the absolute limit:
3. OFDM — Orthogonal Subcarriers
A single wideband carrier is vulnerable to multipath fading — reflected signals arriving with different delays destructively interfere at some frequencies. OFDM divides the total bandwidth into many narrow subcarriers, each narrow enough that fading is flat across its width.
The key innovation: the subcarrier frequencies are spaced exactly 1/T_symbol apart, making them mathematically orthogonal. The sum of two orthogonal sinusoids over a symbol period is zero — they don't interfere with each other.
A cyclic prefix (CP) — a copy of the tail of each OFDM symbol prepended to its start — absorbs the delay spread from multipath, preventing inter-symbol interference as long as the multipath delay is shorter than the CP duration (~0.8 μs for 802.11a).
4. 802.11 Frame Structure
A WiFi frame carries data in a structured format:
- PLCP Preamble: known training symbols used by the receiver to synchronize timing, estimate carrier frequency offset, and estimate the channel response on each subcarrier.
- PLCP Header: encodes frame rate (MCS index), length, and coding scheme.
- MAC Header: destination MAC address, source MAC address, BSSID, sequence numbers, QoS information.
- Payload (MSDU): encrypted data using WPA2 (AES-CCMP) or WPA3 (AES-GCMP-256).
- FCS (Frame Check Sequence): 32-bit CRC for error detection.
Data is additionally protected with channel coding: convolution coding (802.11a/g), LDPC (802.11n+), or Turbo codes. For 802.11ax (WiFi 6), LDPC up to rate 5/6 is standard, approaching the Shannon limit closely.
5. MIMO and Spatial Multiplexing
MIMO (Multiple-Input Multiple-Output) uses multiple transmit and receive antennas to send independent data streams simultaneously on the same frequency — multiplying throughput by the number of streams.
Beamforming focuses transmit energy toward the receiver by weighting each antenna's phase. The access point communicates sounding frames to estimate the channel; the receiver feeds back the optimal precoding matrix. This improves range and reduces interference to neighboring devices.
MU-MIMO (Multi-User MIMO) allows a WiFi 5/6 access point to simultaneously transmit to multiple clients using different spatial beams on the same time-frequency resources — increasing overall network capacity in dense environments.
6. Channel Interference and CSMA/CA
WiFi is a shared medium — all devices in range hear each other's transmissions. Unlike wired Ethernet (CSMA/CD), WiFi cannot simultaneously transmit and listen for collisions, so it uses CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance):
- Before transmitting, a device senses whether the channel is idle.
- If idle for a DIFS period (34 μs for 802.11g), it starts a random backoff counter.
- The backoff counter decrements only when the channel is idle; the device transmits when it reaches zero.
- If two devices finish backoff simultaneously and collide, both detect the failure (no ACK received) and restart with a doubled contention window (binary exponential backoff).
7. WiFi Evolution — From 802.11b to WiFi 7
- 802.11b (1999): 2.4 GHz, DSSS, 11 Mbps max. Wide range, but slow by today's standards.
- 802.11a/g (2003): First OFDM; 5 GHz (a) and 2.4 GHz (g); 54 Mbps max.
- 802.11n / WiFi 4 (2009): Introduced MIMO (up to 4×4); 600 Mbps; 2.4 and 5 GHz.
- 802.11ac / WiFi 5 (2013): 5 GHz only; 256-QAM; 8 spatial streams; up to 3.5 Gbps (theoretical).
- 802.11ax / WiFi 6/6E (2019/2021): 1024-QAM; OFDMA (multiple users per OFDM symbol); BSS Coloring to reduce interference; 6 GHz in WiFi 6E; up to 9.6 Gbps.
- 802.11be / WiFi 7 (2024): 4096-QAM; 320 MHz channel width; Multi-Link Operation (simultaneous use of multiple bands); up to 46 Gbps theoretical.