Wi-Fi Basics
Wi-Fi is the family of IEEE 802.11 standards for wireless LANs. To the layers above, a Wi-Fi network looks like Ethernet: frames carry MAC addresses and IP packets. Underneath, radio is a very different medium: shared by everyone in range, noisy, and easy to listen to.
Generations
| Name | Standard | Year | Bands | Max PHY rate (theoretical) |
|---|---|---|---|---|
| Wi-Fi 4 | 802.11n | 2009 | 2.4 / 5 GHz | 600 Mbit/s |
| Wi-Fi 5 | 802.11ac | 2013 | 5 GHz | 6.9 Gbit/s |
| Wi-Fi 6 / 6E | 802.11ax | 2019 / 2020 | 2.4 / 5 / 6 GHz | 9.6 Gbit/s |
| Wi-Fi 7 | 802.11be | 2024 | 2.4 / 5 / 6 GHz | 46 Gbit/s |
Real throughput is typically a third to a half of the PHY rate, shared between everyone on the channel.
Key terms
| Term | Meaning |
|---|---|
| SSID | the network name you pick from the list |
| BSSID | the MAC address of one access point's radio |
| Access point (AP) | bridges wireless clients to the wired LAN |
| Channel | a slice of a frequency band the AP transmits on |
| RSSI | received signal strength, in dBm (−30 excellent, −67 good for video calls, −80 barely usable) |
| Association | the client joining an AP (after authentication) |
| Roaming | moving from one AP to another with the same SSID |
Channels and interference
In the 2.4 GHz band, channels are 5 MHz apart but each transmission is about 20 MHz wide, so neighbouring channels overlap. Only channels 1, 6 and 11 don't overlap each other (in most countries):
def center_mhz(channel):
return 2407 + 5 * channel # 2.4 GHz channels 1-13
def overlap(a, b, width=20):
return abs(center_mhz(a) - center_mhz(b)) < width
channels = [1, 3, 6, 9, 11]
print(" " + "".join(f"{c:>4}" for c in channels))
for a in channels:
row = "".join(f"{'X' if overlap(a, b) else '.':>4}" for b in channels)
print(f"ch{a:<3}{row}")
print("1, 6, 11 overlap-free:", not (overlap(1, 6) or overlap(6, 11) or overlap(1, 11))) 1 3 6 9 11
ch1 X X . . .
ch3 X X X . .
ch6 . X X X .
ch9 . . X X X
ch11 . . . X X
1, 6, 11 overlap-free: True
The 5 GHz and 6 GHz bands have many more non-overlapping channels and less interference, but shorter range because higher frequencies are absorbed more by walls.
Signal strength and distance
Radio power falls off quickly with distance. The free-space path loss formula gives a lower bound (walls make it worse):
import math
def fspl_db(distance_m, freq_mhz):
return 20 * math.log10(distance_m / 1000) + 20 * math.log10(freq_mhz) + 32.44
tx_power_dbm = 20 # a typical AP transmits about 100 mW
for d in [1, 5, 10, 20, 40]:
rssi_24 = tx_power_dbm - fspl_db(d, 2437)
rssi_5 = tx_power_dbm - fspl_db(d, 5500)
print(f"{d:>3} m: 2.4 GHz {rssi_24:6.1f} dBm 5 GHz {rssi_5:6.1f} dBm") 1 m: 2.4 GHz -20.2 dBm 5 GHz -27.2 dBm
5 m: 2.4 GHz -34.2 dBm 5 GHz -41.2 dBm
10 m: 2.4 GHz -40.2 dBm 5 GHz -47.2 dBm
20 m: 2.4 GHz -46.2 dBm 5 GHz -53.3 dBm
40 m: 2.4 GHz -52.2 dBm 5 GHz -59.3 dBm
Every doubling of distance costs about 6 dB, and 5 GHz loses about 7 dB more than 2.4 GHz at the same distance. Add a couple of concrete walls (10–15 dB each) and you see why one AP rarely covers a whole house.
Sharing the air: CSMA/CA
Radios cannot detect a collision while transmitting (their own signal drowns out everything else). So Wi-Fi uses CSMA/CA (Collision Avoidance):
- Listen: if the channel is busy, wait.
- When it becomes free, wait a further back-off of a random number of slots, counting down only while the channel stays idle.
- Transmit; the receiver answers with an ACK. No ACK means the frame is presumed lost and is retried with a longer back-off.
Here is a deterministic illustration of back-off: three stations picked these slot counts, and the lowest one wins the channel.
stations = {"laptop": 5, "phone": 2, "tv": 7} # back-off slots each station picked
slot = 0
remaining = dict(stations)
while remaining:
slot += 1
for name in list(remaining):
remaining[name] -= 1
winners = [n for n, left in remaining.items() if left == 0]
if len(winners) == 1:
winner = winners[0]
print(f"slot {slot}: {winner} transmits; others freeze their counters")
del remaining[winner]
others = ", ".join(f"{n}={left}" for n, left in remaining.items())
print(f" remaining counters: {others or 'none'}")
elif len(winners) > 1:
print(f"slot {slot}: collision between {winners}")
breakslot 2: phone transmits; others freeze their counters
remaining counters: laptop=3, tv=5
slot 5: laptop transmits; others freeze their counters
remaining counters: tv=2
slot 7: tv transmits; others freeze their counters
remaining counters: none
Because every client on a channel takes turns, one slow, far-away device that needs a long time per frame lowers throughput for everyone.
Wi-Fi frames have up to four addresses
A Wi-Fi data frame between a client and an AP carries three or four MAC addresses: the receiver (the AP), the transmitter (the client), and the final destination (for example the router behind the AP). The AP converts it into a normal Ethernet frame for the wired side.
Security
| Mode | Status |
|---|---|
| Open | no encryption: anyone nearby can read the traffic |
| WEP | broken since 2001, crackable in minutes |
| WPA2-Personal (PSK) | AES-CCMP; OK with a long passphrase, but captured handshakes allow offline guessing |
| WPA3-Personal (SAE) | resists offline guessing, forward secrecy: the current recommendation |
| WPA2/WPA3-Enterprise (802.1X) | per-user credentials checked by a RADIUS server: for organisations |
nmcli dev wifi listSample output:
IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
* 70:9C:D1:5E:02:A0 HomeNet Infra 36 540 Mbit/s 78 ▂▄▆_ WPA3
70:9C:D1:5E:02:A1 HomeNet Infra 6 130 Mbit/s 64 ▂▄▆_ WPA2 WPA3
A4:2B:B0:11:22:33 CafeGuest Infra 11 65 Mbit/s 32 ▂▄__ --Tip: On public Wi-Fi assume someone can see your traffic. HTTPS and a VPN protect the contents even when the network itself is open.
Go further: The WPA2 4-Way Handshake and EAPOL-Key Frames shows how the keys are derived and why a capture allows offline passphrase guessing.
Test yourself
Which 2.4 GHz channels don't overlap each other?
- 1, 2, 3
- 1, 6, 11
- 1, 5, 9, 13 everywhere
- All channels are independent
Why does Wi-Fi use collision avoidance (CSMA/CA) instead of collision detection?
- Radios can't detect collisions while transmitting
- Wi-Fi never has collisions
- It is faster than Ethernet
- Collision detection needs fibre
Which Wi-Fi security mode is currently recommended for a home network?
- WEP
- Open
- WPA3-Personal
- WPA (TKIP)