Sub topic 8
Access points, SSIDs and BSSIDs
This chapter assumes you know what an IP address is, how a router, a switch and an access point differ, and how to read short Python and shell snippets. It also assumes you know what a channel is from the earlier chapters. Here the focus moves from the radio to the names and structures that sit on top of it.
What an access point does
An access point (AP) is a device that bridges wireless clients to a wired network. A client is any device with a Wi-Fi radio, such as a laptop or phone. The AP receives 802.11 frames from clients and forwards them to the wired side, usually Ethernet. It does the reverse for traffic going to clients.
An AP works at layer 2. It does not route and it does not hand out IP addresses by itself. Many home devices called "Wi-Fi routers" combine three roles in one box: a router, a small switch and an AP. In larger networks these are separate devices, and the AP only handles the radio and the bridging.
An AP transmits on one channel per radio. A dual-band or tri-band AP has several radios, and each radio runs its own network on its own band and channel.
The BSS: one AP and its clients
The basic building block of Wi-Fi is the Basic Service Set (BSS). A BSS is one AP together with the clients currently associated with it. All members of a BSS share one channel and take turns using it, which the chapter on CSMA/CA covers.
Two names identify a BSS, and they do different jobs.
- The SSID (Service Set Identifier) is the human-readable network name, up to 32 bytes. You pick it in the AP settings, and it is what you see in your phone's network list.
- The BSSID (Basic Service Set Identifier) is the 48-bit hardware address that identifies one specific BSS. On almost all APs it is the MAC address of that AP's radio interface.
The SSID is a label that many APs can share. The BSSID is unique to one radio, so it tells you exactly which AP you are talking to.
One SSID, many BSSIDs
A single physical AP can offer several networks at once, for example "HomeNet" and "HomeNet-Guest". Each SSID on a radio gets its own BSSID, typically made by changing a few bits of the radio's base MAC address. Each of these virtual networks is often called a VAP (virtual AP).
A dual-band AP broadcasting "HomeNet" on both 2.4 GHz and 5 GHz has one BSSID per radio, even though both use the same SSID. Your device sees two entries with the same name and different BSSIDs.
The following table shows a typical scan result from one dual-band AP with a guest network enabled.
| SSID | BSSID | Band | Channel |
|---|---|---|---|
| HomeNet | aa:bb:cc:00:00:01 | 2.4 GHz | 6 |
| HomeNet-Guest | aa:bb:cc:00:00:02 | 2.4 GHz | 6 |
| HomeNet | aa:bb:cc:00:00:11 | 5 GHz | 36 |
| HomeNet-Guest | aa:bb:cc:00:00:12 | 5 GHz | 36 |
Both 2.4 GHz entries share a channel because they come from one radio. The guest network does not add a second channel. It adds a second set of beacons on the same one.
The ESS: many APs, one network
Larger sites need more than one AP to cover the space. If you configure several APs with the same SSID and the same security settings, and connect them to the same wired network, they form an Extended Service Set (ESS). To a user it looks like one network. The SSID is shared, and each AP keeps its own BSSID.
Neighboring APs in an ESS normally use different channels, such as 1 and 11 on 2.4 GHz. This lowers co-channel interference, which later chapters cover. A client that moves through the building changes from one BSS to another. That process is roaming, and a later chapter describes it.
A standalone network with no AP, where devices talk directly, is called an IBSS or ad hoc network. It is uncommon today, and this chapter only covers infrastructure networks, which use an AP.
How a client tells BSSs apart
When a client sees two beacons that carry the same SSID, it cannot tell from the name which AP is which. It looks at the BSSID in each frame. Every 802.11 frame from an AP carries the BSSID in its header, so the client can match frames to the right BSS.
The client usually picks which BSS to join using signal strength and the capabilities the AP advertises. You normally do not choose the BSSID yourself. Some operating systems let you pin a connection to one BSSID, which is useful when you diagnose a problem with a single AP.
Hidden SSIDs
An AP can be set to "hide" its SSID. In this case the beacon still exists, but the SSID field is empty or filled with zero bytes. Clients that already know the network send a probe request with the name, and the AP answers.
Hiding does not add security. The SSID is sent in clear text in probe requests, association requests and probe responses, so anyone with a capture tool sees it as soon as one legitimate client connects. Hidden networks can also make clients probe more often, which reveals the name from the client side and can drain battery. Use real encryption, covered in the security chapter, and leave the SSID visible unless you have a specific reason.
Common errors and gotchas
- Treating the SSID as unique. Many networks use "linksys", "NETGEAR" or "xfinitywifi", so two unrelated networks can share a name. Only the BSSID identifies a single radio.
- Expecting a changed SSID to change the BSSID. Renaming a network leaves the radio's MAC address as it was.
- Mixing security settings inside an ESS. If APs share an SSID but use different passphrases or security modes, clients fail to roam or connect to some of them unpredictably.
- Assuming a guest network is a separate radio. It shares the radio, the channel and the airtime with the main network, so heavy guest use slows everyone.
- Randomized MAC addresses on clients. Phones often use a different MAC per network. This applies to the client address, not the BSSID.
Reading SSIDs and BSSIDs from the command line
On Linux, iw shows the BSSID your client is joined to and lists nearby BSSs. The sample below, which you can run in a Python script, groups scan lines by SSID so you can see how many BSSIDs share one name.
# Show the BSSID and SSID of your current connection
iw dev wlan0 link
# List nearby BSSs: each block starts with "BSS <bssid>"
sudo iw dev wlan0 scan | grep -E '^BSS|freq:|signal:|SSID:'The same scan output can be parsed in Python. This program reads a saved scan and counts the BSSIDs per SSID.
import re
from collections import defaultdict
scan_text = """BSS aa:bb:cc:00:00:01(on wlan0)
\tfreq: 2437
\tsignal: -48.00 dBm
\tSSID: HomeNet
BSS aa:bb:cc:00:00:11(on wlan0)
\tfreq: 5180
\tsignal: -55.00 dBm
\tSSID: HomeNet
BSS 11:22:33:44:55:66(on wlan0)
\tfreq: 2412
\tsignal: -80.00 dBm
\tSSID: Neighbor
"""
groups = defaultdict(list)
current = {}
for line in scan_text.splitlines():
line = line.strip()
m = re.match(r"BSS ([0-9a-f:]{17})", line)
if m:
current = {"bssid": m.group(1)}
elif line.startswith("freq:"):
current["freq"] = int(line.split()[1])
elif line.startswith("SSID:"):
groups[line[5:].strip()].append(current)
for ssid, bss_list in groups.items():
freqs = sorted(b["freq"] for b in bss_list)
print(f"{ssid}: {len(bss_list)} BSSID(s) on {freqs} MHz")Running it prints:
HomeNet: 2 BSSID(s) on [2437, 5180] MHz
Neighbor: 1 BSSID(s) on [2412]The scan lists one entry per BSS. "HomeNet" appears twice because the AP has two radios, which matches the table earlier in this chapter.
Summary of terms
| Term | Meaning | Unique per radio? |
|---|---|---|
| AP | Device that bridges Wi-Fi clients to a wired network | Yes |
| BSS | One AP radio and its associated clients | Yes |
| SSID | Text name of a network, up to 32 bytes | No |
| BSSID | 48-bit address that identifies one BSS | Yes |
| ESS | Several BSSs sharing an SSID and one wired network | No |
Exercise
A scan shows four entries named "CafeWiFi" with four different BSSIDs on channels 1, 6, 11 and 36. How many access points are there at minimum, and what must be true for a customer to roam between them without re-entering a password?
Show answer
At minimum there are two dual-band APs, because one AP with a 2.4 GHz and a 5 GHz radio can account for two BSSIDs, and channels 1, 6 and 11 are three separate 2.4 GHz channels. A single radio uses one channel, so three different 2.4 GHz channels need at least three 2.4 GHz radios, so the minimum is three APs, with one of them also having a 5 GHz radio on channel 36. For roaming, all of them must use the same SSID and the same security settings and passphrase, and be on the same wired network, so they form one ESS.
Exercise
You rename your network from "HomeNet" to "HomeNet-5". Does the BSSID change? Why does a client that saved the old network now fail to connect?
Show answer
The BSSID does not change, because it comes from the radio's MAC address and not from the name. The client fails because it saved the old SSID and its credentials, and the beacons now announce a different SSID, so the client no longer sees a network it recognizes.