Wi-Fi operation
Connecting to the internet lists the Wi-Fi generations, bands, and security protocols. This page covers what happens on the air between a client and an access point, and why that makes Wi-Fi behave differently from Ethernet. Wireless fundamentals covers the radio background. Security protocols are in Wireless security.
Building blocks
Section titled “Building blocks”A basic service set (BSS) is one access point and the stations associated with it. An extended service set (ESS) is several BSSs joined by a wired network under one network name (SSID). When all the APs in an ESS share a layer 2 network and a single IP subnet, a client can move between them and keep its IP address. That is the foundation for roaming.
The AP acts as a layer 2 bridge between the 802.11 radio link and the wired 802.3 Ethernet network. Two stations in the same BSS never talk directly. Their frames go up to the AP and back down.
Channels
Section titled “Channels”In the 2.4 GHz band, channels are 20 MHz wide but spaced 5 MHz apart, so most overlap. Only channels 1, 6, and 11 (in the United States and many other regions) are fully separate. Neighboring APs must use these three or interfere with each other. The 5 GHz and 6 GHz bands have many more non-overlapping channels, and they can be bonded into 40, 80, 160, and 320 MHz wide channels. Wider channels give higher rates and fewer channels to share, and they pick up more noise.
# Channels in use around you, and how crowded each issudo iw dev wlan0 scan | grep -E 'SSID|freq|signal'
# Your own channel, width, and BSSIDiw dev wlan0 infoiw dev wlan0 linkJoining a network
Section titled “Joining a network”- Discovery. APs send beacon frames about ten times a second carrying the SSID, supported rates, and channel details. A client scans passively by listening on each channel, or actively by broadcasting a probe request and waiting for replies. The standard leaves the choice of network to the client: the last network used, a priority list, or the strongest signal.
- Association. The client sends an association request and the AP replies with a response. Authentication and key setup follow (WPA2 or WPA3, with a pre-shared key or 802.1X).
- IP configuration. With the link up, the client broadcasts DHCP through the AP and gets an address in the local subnet. From here the sequence is the one in A web request, end to end.
# Watch the association and key exchangesudo iw event -t# wlan0 (phy #0): auth ... assoc ... connected to aa:bb:cc:dd:ee:01
# Or from NetworkManagernmcli -f IN-USE,SSID,BSSID,CHAN,RATE,SIGNAL,SECURITY device wifi listWhen a client has an association but no connectivity, work down the list: authentication (wrong passphrase gives a handshake failure in the logs), DHCP (a 169.254.x.x address), then the rest.
Sharing the channel: CSMA/CA
Section titled “Sharing the channel: CSMA/CA”Ethernet detects a collision while sending and aborts. A radio cannot do that: its own transmission is far stronger than anything it hears, so it cannot listen at the same time. Wi-Fi uses collision avoidance instead, and it acknowledges every unicast frame, because a missing ACK is the only sign of a collision.
The sender follows these rules:
- Sense the channel. If it has been idle for a DIFS interval, transmit.
- If the channel is busy, choose a random backoff count from a window, and count it down only while the channel is idle. Freeze the count when another station transmits.
- At zero, transmit the whole frame.
- The receiver checks the CRC, waits a short SIFS interval (shorter than DIFS, so the ACK always wins the channel), and sends an ACK.
- No ACK means a collision or noise. Double the backoff window and retry.
Sender : | DIFS | backoff | DATA frame ............ | | nextReceiver : | SIFS | ACK |Even with an idle channel the sender backs off after a busy period, because several stations may have been waiting. If they all started at once when the channel freed, they would collide, and a collided Wi-Fi frame runs to completion rather than being aborted.
RTS/CTS
Section titled “RTS/CTS”For the hidden terminal problem, a station can first send a short request to send naming how long it needs. The AP answers with a clear to send, which every station in range of the AP hears, and they defer for that time. A collision between two short control frames wastes little airtime, while a collision between long data frames wastes a lot. The exchange costs time itself, so it is applied only to frames above a size threshold. Every frame also carries a duration field, and stations keep a network allocation vector (NAV), a timer that tells them the channel is reserved.
# Linux: RTS threshold (off by default on many drivers)iwconfig wlan0 | grep -i rtssudo iw phy phy0 set rts 500Enable RTS/CTS only after measuring retries in a place with known hidden stations, such as a large warehouse. In an ordinary home or office it only adds overhead.
Efficiency and airtime
Section titled “Efficiency and airtime”Everything that stays on the air consumes shared time. Three consequences:
- Airtime is the real resource. A client far from the AP sends at a low rate, and its frames occupy the channel many times longer than a nearby client’s. One slow client drags down all the others on that AP, even though each has its own “equal” share of the transmit opportunities. This is the performance anomaly. Remedies are lower transmit power on APs and an AP placement that avoids weak links, plus disabling the lowest legacy rates so slow clients roam away.
- Retries show interference. A high retry rate means frames are being lost and resent. The link adapts by dropping to a lower rate, which uses more airtime.
- Management traffic counts. Beacons are sent at the lowest basic rate. Many SSIDs on one AP multiplies the beacons and uses airtime even when idle.
# On a Linux AP or client: per-station retries and failuresiw dev wlan0 station dump | grep -E 'Station|signal|tx retries|tx failed|tx bitrate'The 802.11 frame header
Section titled “The 802.11 frame header”An 802.11 frame has up to four address fields, because the AP sits between the wireless and wired sides. In infrastructure mode, three are used, and their meaning depends on the direction.
| Direction | Address 1 (receiver) | Address 2 (transmitter) | Address 3 |
|---|---|---|---|
| Station to AP | The AP | The station | Final destination (for example the gateway’s MAC) |
| AP to station | The station | The AP | Original sender (for example the gateway’s MAC) |
Address 3 is what lets the AP build the Ethernet frame for the wired side with the right addresses. The fourth address field appears only when a frame is relayed from one AP to another over the air, as in wireless distribution and mesh links.
Other fields carry the frame type (data, ACK, RTS, CTS, beacon), flags (to-AP, from-AP, retry, power management), a duration for the NAV, and a sequence number so duplicate retransmissions are discarded. The payload is followed by a 32-bit CRC.
In a packet capture, tcpdump on a monitor-mode interface shows these frames. A normal interface shows only the Ethernet-translated version.
# Capture raw 802.11 (needs monitor mode)sudo ip link set wlan0 downsudo iw dev wlan0 set type monitorsudo ip link set wlan0 upsudo tcpdump -i wlan0 -e -nn 'wlan type mgt subtype beacon'Wi-Fi 6 and OFDMA
Section titled “Wi-Fi 6 and OFDMA”Earlier Wi-Fi gave the whole channel to one station at a time. OFDM splits a channel into many narrow subcarriers that are transmitted together. OFDMA, introduced in Wi-Fi 6, then assigns groups of subcarriers (resource units) to different stations in the same transmission. Small frames to many devices share one transmission opportunity instead of each paying the per-frame overhead.
This coexists with CSMA/CA. The AP wins the channel through normal contention and sends a multi-user RTS to all clients over the full channel width. OFDMA-capable clients answer with a CTS on their own subchannels, and the AP then schedules parallel uploads and downloads. OFDMA mainly helps dense networks with many small flows, such as offices, stadiums, and IoT, more than it raises one client’s peak speed.
Saving power
Section titled “Saving power”A radio listening for traffic drains a battery, so clients sleep.
- The client sets the power management bit in a frame to tell the AP it is going to sleep.
- The AP buffers frames for it.
- The AP lists sleeping clients with waiting data in the traffic indication map inside each beacon.
- The client wakes for the beacon, and if it is listed, sends a PS-Poll to fetch the frames.
Wi-Fi 6 adds target wake time, where a client and the AP agree on exact wake times so the client can sleep for long periods. It suits IoT devices that report rarely. The 802.11ah variant for sub-1 GHz IoT uses it with shorter headers.
Power saving shows up as latency. An idle phone may answer a ping after tens or hundreds of milliseconds because it only checks for data at beacon intervals. First pings are slow and later ones fast: that is power save, not a network fault.