Sub topic 19
Roaming between access points
This chapter assumes you know what an SSID and a BSSID are, how scanning and association work, and the basics of WPA2 and WPA3. It also assumes you can read short Python and shell commands. Roaming builds on all of these.
What roaming is
Roaming is when a client moves its association from one access point (AP) to another without the user having to reconnect. A building with several APs usually gives all of them the same SSID and the same security settings. This is called an extended service set (ESS). Each AP radio still has its own BSSID, so the client sees many BSSIDs under one network name.
The key point is that the client decides when and where to roam. The 802.11 standard has no mechanism that lets an AP push a client to another AP. The infrastructure can only advise, using the amendments described below. Poor roaming is usually a client that stays connected to a distant AP, not a network fault.
The roaming sequence
A roam has four stages:
- The client notices its current link is degrading, usually from falling signal strength (RSSI) or a rising retry rate.
- The client scans for other BSSIDs with the same SSID, either on all channels or on a short list.
- The client picks a candidate and authenticates to it.
- The client sends a reassociation request. This differs from a first association because it names the previous AP, so the network can move the client's state and forward buffered frames.
Why roaming is slow without help
Three costs add up during a roam:
- Scanning. Probing every channel in 2.4, 5 and 6 GHz can take hundreds of milliseconds, and the client cannot send data to the old AP while it is off-channel.
- Authentication. With WPA2-Enterprise or WPA3-Enterprise, a full 802.1X exchange with a RADIUS server can take hundreds of milliseconds to over a second. That is long enough to drop a voice call.
- Client reluctance. Many clients keep their current AP until the signal is very poor. These are called sticky clients. A sticky client can hold a slow, low-MCS link and use a lot of airtime, which slows everyone else on that channel (see the airtime chapter).
The helper amendments: k, v and r
Three amendments reduce these costs. They are often grouped, and they are usually enabled together on the AP.
| Amendment | Name | What it does |
|---|---|---|
| 802.11k | Radio Resource Management | The AP sends the client a neighbor report: a list of nearby BSSIDs and their channels. The client scans only those channels. |
| 802.11v | BSS Transition Management | The AP can send a transition request that suggests a better AP. The client may still ignore it. |
| 802.11r | Fast BSS Transition (FT) | Key material is derived in advance, so the client reauthenticates with the new AP in one short exchange instead of a full handshake. |
802.11r is the one that fixes the authentication cost. Without it, personal (PSK) networks still do a four-way handshake on each roam. Enterprise networks can use PMK caching or opportunistic key caching (OKC) as a partial fix, but those are not universally supported.
Some older devices fail to connect to an SSID that advertises 802.11r. If a few clients cannot join, try disabling 802.11r for that SSID or using FT in "mixed" mode, which allows both FT and non-FT clients.
Seeing roaming candidates from a scan
A scan shows each BSSID with its frequency and signal. The script below groups BSSIDs by SSID and sorts each group by signal, so you can see which APs a client could roam to. It reads iw dev wlan0 scan output from standard input, or uses built-in sample text when run with no pipe.
import re
import sys
from collections import defaultdict
SAMPLE = """BSS aa:bb:cc:00:00:01(on wlan0)
\tfreq: 5180
\tsignal: -52.00 dBm
\tSSID: Office
BSS aa:bb:cc:00:00:02(on wlan0)
\tfreq: 2437
\tsignal: -48.00 dBm
\tSSID: Office
BSS aa:bb:cc:00:01:01(on wlan0)
\tfreq: 5240
\tsignal: -71.00 dBm
\tSSID: Office
BSS dd:ee:ff:00:00:09(on wlan0)
\tfreq: 2412
\tsignal: -80.00 dBm
\tSSID: Neighbor
"""
def parse_scan(text):
entries = []
current = None
for line in text.splitlines():
m = re.match(r"^BSS ([0-9a-fA-F:]{17})", line)
if m:
current = {"bssid": m.group(1).lower(), "freq": None,
"signal": None, "ssid": ""}
entries.append(current)
elif current is not None:
s = line.strip()
if s.startswith("freq:"):
current["freq"] = int(float(s.split()[1]))
elif s.startswith("signal:"):
current["signal"] = float(s.split()[1])
elif s.startswith("SSID:"):
current["ssid"] = s[5:].strip()
return entries
def roam_groups(entries):
groups = defaultdict(list)
for e in entries:
if e["ssid"] and e["signal"] is not None:
groups[e["ssid"]].append(e)
# Keep only SSIDs seen on more than one BSSID: these are roam candidates.
return {s: sorted(v, key=lambda e: e["signal"], reverse=True)
for s, v in groups.items() if len(v) > 1}
text = SAMPLE if sys.stdin.isatty() else sys.stdin.read()
for ssid, aps in roam_groups(parse_scan(text)).items():
print(ssid)
for e in aps:
print(f" {e['bssid']} {e['freq']} MHz {e['signal']:.0f} dBm")With the sample data, Office lists three BSSIDs. Two of them (...:00:01 and ...:00:02) differ only in the last octet, which suggests one AP with a 5 GHz and a 2.4 GHz radio. The third is a different AP. Vendors choose their own BSSID patterns, so this is a hint, not a rule. Neighbor is dropped because only one BSSID is visible.
To collect real input, run sudo iw dev wlan0 scan and pipe it into the script.
Designing the network for roaming
Good roaming depends on AP placement and channel choice as much as on the amendments:
- Overlap cells slightly. A common guideline is 15 to 20 percent overlap, so a client always has a usable next AP. Too much overlap causes co-channel interference. Too little leaves gaps.
- Do not reuse a channel on neighboring APs. Adjacent APs on the same channel share airtime and fight each other. Use 1, 6 and 11 on 2.4 GHz, and a wider set on 5 and 6 GHz.
- Use the same SSID, security mode and passphrase on every AP in the ESS. A mismatch makes the client treat the APs as separate networks.
- Keep the APs on one Layer 2 network or VLAN for the client, or the client's IP address will change on a roam and break TCP sessions. Controller or mesh systems often handle this for you.
- Raise the minimum data rate or the minimum RSSI that an AP accepts. This forces distant clients off sooner, but set it too aggressively and clients at the edge of coverage will be dropped instead of roaming.
- Do not set transmit power to maximum. A loud AP lets distant clients hear it and stay attached, while the AP cannot hear their weaker replies. Matching AP power to typical client power improves roaming decisions.
A rough rule for client thresholds: voice and video devices want to roam around -67 dBm, while general data devices often tolerate -75 dBm. These are guidelines and vary by vendor.
Exercise
A laptop in a hallway stays on an AP at -82 dBm even though another AP with the same SSID is visible at -55 dBm. Name the stage of roaming that failed, and one AP-side setting that could help.
Show answer
The client's decision to leave its current AP failed, because the client chooses when to roam (it is a sticky client). Enabling 802.11v BSS Transition Management lets the AP suggest the better AP. Enabling 802.11k gives the client a neighbor list so scanning is faster. Raising the AP's minimum RSSI so that it disconnects weak clients also forces a roam.