Watching the 2.4 GHz Band
- Why this matters
- Two instruments, two questions
- Capturing frames
- A workflow that fits together
- Scope and legality
- Key takeaways
- References
Why this matters
2.4 GHz is the most crowded unlicensed band in the world. Wi-Fi, Bluetooth and BLE, Zigbee, Thread, proprietary 802.15.4 variants, wireless keyboards, baby monitors, and microwave ovens all share about 83 MHz of spectrum, and none of them coordinates with the others. When an IoT device “works intermittently”, the cause is as likely to be the neighbour’s channel plan as anything in the firmware.
So before you attack a device, or debug one, you want two things: a picture of what the band is doing, and the frames themselves. Those are two different instruments, and the distinction matters more than beginners expect.
The tools on this page are in wifi24/ —
wifi24_scan.py and
wifi24_capture.py — with an operator manual in
wifi24/README.md.
Two instruments, two questions
A software defined radio like a HackRF tunes anywhere from 1 MHz to 6 GHz and hands you raw samples. It knows nothing about any protocol, which makes it universal and nearly useless at the same time: you see all the energy and none of the meaning.
A Wi-Fi card in monitor mode is the opposite. It demodulates 802.11 and only 802.11, perfectly, in hardware — and is deaf to everything else in the band.
| HackRF | Wi-Fi card in monitor mode | |
|---|---|---|
| sees | all RF energy, 2400–2500 MHz | 802.11 frames only |
| decodes 802.11 | no | yes |
| sees Bluetooth, Zigbee, microwave | as energy | not at all |
| answers | where is the band busy? | what is being said? |
Why a HackRF cannot decode Wi-Fi
This surprises people who paid for a wideband SDR, so it is worth being precise about. An 802.11g/n transmission in this band is a 20 MHz OFDM burst with 52 or 56 active subcarriers. To demodulate it you must capture the entire 20 MHz continuously and coherently, then run an FFT per symbol, track the channel, and decode a convolutional code — all in real time, because the burst lasts microseconds and the ACK is due 10 µs later.
A HackRF can stream 20 Msps, which is marginal for a 20 MHz signal even before
USB jitter, and hackrf_sweep is not streaming one channel at all: it hops
across the band, dwelling in each slice for a fraction of a millisecond. By
construction it sees a different part of the spectrum every few hundred
microseconds. There is no sequence of samples long enough to decode anything.
What it can do is measure power, which is exactly what you want for the first question.
Channels overlap, and the scanner shows it
The 2.4 GHz channel centres are 5 MHz apart:
channel 1 2 3 4 5 6 7 8 9 10 11 12 13 14
MHz 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472 2484
but each channel is about 22 MHz wide. Channel 6 therefore overlaps 2, 3, 4, 5, 7, 8, 9, and 10. Only 1, 6, and 11 are mutually non-overlapping, which is why every deployment guide tells you to use them and only them. Channel 14 exists only in Japan and only for 802.11b.
The consequence for measurement: a strong transmitter on channel 7 raises the reading on channels 5 through 9 as well. That is not an artefact to filter out, it is the interference that actually happens.
Running the scanner
$ cd iotsec/wifi24
$ ./wifi24_scan.py
2.4 GHz channel activity - noise floor -58.4 dBm - busy = mean 6 dB over floor - sweep 6
ch MHz occupancy mean peak recent
1* 2412 ########### -47.6 -42.0 :+::-: <
5 2432 ###### -51.9 -47.4 .:::%. <
6* 2437 ######## -50.1 -43.5 #:::%: <
9 2452 ########################### -30.9 -22.8 #:::%# <
11* 2462 ########################### -31.0 -22.8 =::.*# <
13 2472 ###################### -35.5 -26.0 ::-:++ <
(abridged — the real output lists all fourteen channels)
The mean column is the honest measure of how loaded a channel is; peak is the loudest single bin within 11 MHz, so a high peak with a low mean means short strong bursts. The recent column is one character per sweep, so you can watch traffic arrive and stop. The noise floor is recomputed every sweep as the 10th percentile of all bins, which keeps the display meaningful when you change gain.
That mean is an average of power, not of decibels, and the distinction is worth understanding because getting it wrong is both easy and fatal to the measurement. Wi-Fi is bursty: a channel carrying real traffic is idle most of the time, so most of the samples a sweeping SDR takes in it are just noise. Average the decibel values and the answer sits near the noise floor however loud the bursts were; average the power and the bursts dominate, which is what you want. Concretely, 99 samples at −95 dBm plus one burst at −30 dBm averages to −94.4 dBm in the dB domain and −50.0 dBm in the power domain. Measured across a real band the difference was 1.6 dB of usable spread versus 24 dB.
It measures energy, not access points. Do not expect the display to rank
channels the way an AP census does. On the band above there were 58 BSSes, all
of them on channel 1, 6, or 11, and the energy peak was on none of those: one
associated laptop beside the antenna outweighs thirty-one access points across
a building, because received power falls off with distance and a count does
not. For “how many networks are on channel 6”, use nmcli device wifi list.
For “where is the energy, and will a capture here be productive”, use this.
Things worth looking for that are not Wi-Fi:
- a microwave oven — a very strong, roughly 50%-duty blob near 2450 MHz, switching at the mains frequency. The classic cause of “the Wi-Fi drops when I make lunch”.
- Bluetooth and BLE — frequency hopping across the whole band, so they raise the floor everywhere rather than appearing on one channel.
- Zigbee — narrow 2 MHz channels, often placed in the gaps Wi-Fi leaves.
Each of those is a reason a device might behave badly that no amount of packet capture would reveal, because the packets never arrive to be captured.
Capturing frames
Monitor mode
An ordinary Wi-Fi interface is in managed mode: it associates with one access point and the driver hands up only the frames addressed to you, already stripped of their 802.11 headers and presented as Ethernet. Monitor mode turns that off. The card reports every frame it can demodulate on its current channel — every network, every station, management and control frames included — with the full 802.11 header and a radiotap header carrying signal strength, rate, and channel.
The kernel will not change an interface’s type while it is up, so bring it down
first. Two separate commands are involved, and both matter: set type changes
the mode, set monitor sets the RX filter flags.
$ iw dev # what exists, and in what mode
$ nmcli device set wlan1 managed no # stop NM scanning on it
$ sudo ip link set wlan1 down
$ sudo iw dev wlan1 set type monitor
$ sudo ip link set wlan1 up
$ sudo iw dev wlan1 set monitor otherbss control
$ sudo iw dev wlan1 set channel 6
Three things to internalise:
set type monitoralone is not enough. It puts the card in monitor mode, but the hardware RX filter still discards data frames belonging to BSSes the card is not associated with. You get beacons and probe requests in abundance and almost no data.set monitor otherbsslifts that filter;controladds control frames. Note thatset monitor <flag>only works on an interface that is already of type monitor — run it against a managed interface and it fails withInvalid argument.-
Something else will retune your card. NetworkManager and
wpa_supplicantkeep scanning an interface they still manage, which drags it across the whole band — 2.4 and 5 GHz both — in the middle of your capture. Hand the interface over withnmcli device set wlan1 managed nofirst, andmanaged yeswhen you are finished. - A monitor interface hears one channel at a time. The band has fourteen overlapping channels and your card sits on one of them. This is why you scan first.
- Not every chipset supports it. Monitor mode is a driver feature, and
vendors treat it as optional. Check
iw listfor* monitorunder “Supported interface modes” before buying. Worse,* monitorbeing listed is not sufficient: some adapters advertise and enter monitor mode, hand up perfectly good radiotap headers, and still deliver only broadcast/multicast frames — beacons and probe requests — while silently filtering the unicast data you actually wanted. The MT7921 adapters behave this way; see below.
What encryption does to a capture
Every 802.11 frame’s frame control field carries a Protected Frame bit. Set, it means the payload is encrypted — with WEP, TKIP, CCMP, or GCMP depending on the network’s vintage.
What is never encrypted, on any network:
- beacons, probe requests and responses, authentication and association frames
- all control frames — RTS, CTS, ACK, block ACK
- the MAC addresses of everyone involved, on every single frame
Which means that even on a fully WPA3 network, a passive listener learns the SSID, the BSSID, every client MAC that associates, when each one arrives and leaves, how much traffic each sends, and the signal strength of each. That is a substantial privacy leak with no cryptography involved at all, and it is the reason MAC randomisation exists.
What is encrypted is the data payload. To read it you need:
- the key — the passphrase or the precomputed PSK, and
- the four-way handshake for each station you care about.
The second requirement catches people out. WPA/WPA2 derive a fresh pairwise key per session from the handshake, so knowing the network passphrase is not sufficient — you must have been listening when the client associated, or wait for a rekey. Without the handshake, the frames stay opaque no matter how correct your key is.
Capturing only what you can read
wifi24_capture.py enforces one rule: a frame
reaches the output file only if it is unencrypted, or if your keys decrypted
it. Everything else is dropped before it is ever written.
This is a deliberate choice rather than a limitation. A monitor interface hears all of it, and the ordinary tools write all of it to disk. Retaining ciphertext you cannot read gains you nothing analytically and leaves you holding other people’s traffic.
The mechanism is two complementary display filters:
permit wlan.fc.protected == 0 || (wlan.fc.protected == 1 && llc)
forbid wlan.fc.protected == 1 && !llc
An LLC header is only visible above an encrypted frame when decryption
succeeded, so protected && llc reads as “encrypted, and we read it”.
tshark -Y filters what -w writes, not merely what is displayed, so
rejected frames are never copied into the output. The tool then re-runs the
forbid filter against the finished file; if it matches even one frame the
output is shredded rather than returned. Fail closed. The intermediate raw
capture lives in a 0700 directory and is shredded on exit.
With no keys at all, you get management, control, and open-network traffic:
$ ./wifi24_capture.py -i wlan1 -d 30 -w gated.pcapng
wifi24_capture: no keys given - only unencrypted frames (management, control, open networks) will be kept.
capturing 30s on wlan1...
heard 11058 frames
kept 9769 unencrypted or successfully decrypted -> gated.pcapng
dropped 1289 encrypted and unreadable, discarded
Never take a tool’s word for its own security property. Check it:
$ tshark -r gated.pcapng -Y 'wlan.fc.protected == 1 && !llc' -T fields -e frame.number | wc -l
0
With a passphrase, bound to one SSID so Wireshark does not try it against every network in range:
$ ./wifi24_capture.py -i mon0 -c 1 -d 60 -w lab.pcapng \
--key wpa-pwd:'correct horse battery staple:PSU-IoT'
If that yields fewer decrypted frames than you expect, you almost certainly missed the handshake. Start the capture first, then make the device associate.
When dropped is 0 and it should not be
A dropped 0 line is ambiguous, and the ambiguity bites. It can mean the gate
had nothing to reject — a genuinely quiet or genuinely open channel. On a busy
channel it much more often means your adapter never handed you the encrypted
frames at all. Check which, by counting frame types:
$ tshark -r out.pcapng -T fields -e wlan.fc.type | sort | uniq -c
2882 0
1 2
Type 0 is management, 1 control, 2 data. That result is from a 30-second
capture on a channel carrying an active, associated client: 2882 beacons and
probe requests, one data frame, nothing encrypted. A busy channel that yields
only type-0 frames is an adapter limitation, not a quiet network — the card
supports monitor mode but not promiscuous mode, so broadcast traffic arrives
and unicast does not.
A working adapter on that same channel looks nothing like it:
$ tshark -r out.pcapng -T fields -e wlan.fc.type | sort | uniq -c
4731 0
4928 1
110 2
Management, control, and data all present, and dropped in the thousands
rather than 0. The control-frame count is the tell: a channel busy enough to
carry nearly 5000 ACKs and RTS/CTS exchanges in 30 seconds cannot have
produced zero of them.
Two things make this diagnosis solid rather than a guess. First, confirm the card can hear the AP whose traffic you are missing:
$ tshark -r out.pcapng -T fields -e wlan.bssid | sort | uniq -c | sort -rn | head -3
If the BSSID your client is associated to appears hundreds of times and contributes no data frames, signal and channel are not the problem. Second, rule out power saving, which is the usual suspect on MediaTek parts:
$ sudo cat /sys/kernel/debug/ieee80211/phy11/mt76/runtime_pm_stats
awake time: 1332018
doze time: 0
A doze time of 0 means the radio was awake throughout and missed nothing to
sleep.
The practical rule: verify your adapter can capture data frames before you trust any conclusion drawn from a capture. The MT7921 cannot. Use an RTL8814AU or another adapter known to do promiscuous capture.
Your card must speak the client’s PHY
There is a second, sharper version of the same trap, and on a modern network it is now the more likely one. A capture card can only demodulate the PHY generations it implements. The RTL8814AU and RTL8812AU are 802.11ac: they do HT (Wi-Fi 4) and VHT (Wi-Fi 5), and they are deaf to HE (Wi-Fi 6) and EHT (Wi-Fi 7).
Management and broadcast frames go out at low legacy rates for backward compatibility, so they arrive no matter what and the capture looks healthy. Unicast data goes out at the fastest rate the link negotiated. Check it:
$ iw dev wlan2 link | grep bitrate
tx bitrate: 144.4 MBit/s MCS 15 short GI
MCS is Wi-Fi 4, VHT-MCS Wi-Fi 5, HE-MCS Wi-Fi 6, EHT-MCS Wi-Fi 7. The
difference this makes is total. Same tool, same keys, same network, same
monitor card — only the client’s PHY changed:
| client link | HT frames captured | decrypted payload |
|---|---|---|
EHT-MCS 11 (Wi-Fi 7) |
0 | none: 0 HTTP, 0 TCP |
MCS 15 (Wi-Fi 4) |
563 | 193 TCP, 14 HTTP, 95 DNS |
With a Wi-Fi 7 client, a 45-second capture taken while the client repeatedly loaded a plain-HTTP page contained no HTTP, no TCP, and not one frame involving the client’s own IP address — despite a correctly captured handshake and correct keys. Nothing was broken; the payload simply was not demodulable.
So the handshake and the PHY are independent preconditions. Getting the keys right does not help if your card cannot hear the frames. For lab work, pair a client and a monitor of the same generation, or force the network to 802.11n.
A note on deauthentication
The conventional way to force a handshake is to deauthenticate a client and let it reconnect. Classic WPA2 management frames are unprotected, so a forged deauth works. Note what that is: an active denial of service against a device that may not be yours, and it is the single most common way a student turns a passive exercise into an incident. Do it only on hardware you own or have written permission to disrupt. Protected Management Frames (802.11w), mandatory under WPA3, close this off entirely.
A workflow that fits together
- Sweep first.
wifi24_scan.pyfor a minute. Note which channels carry traffic and whether anything non-Wi-Fi is sitting in the band. - Park the card on the busiest channel of interest, or on 1/6/11 in turn if you are surveying.
- Capture with the gate on. With no keys you still get the entire management plane, which is where most IoT provisioning weakness lives.
- Open the result in Wireshark.
wlan.fc.type_subtype == 0x0008for beacons,eapolfor handshakes,wlan.fc.type_subtype == 0x000cfor deauths. - If you need payloads, supply the key and capture the association.
Scope and legality
Capturing traffic on networks you do not operate, or have not been authorised to test, is unlawful in most jurisdictions regardless of what you can decrypt — in the United States the relevant statute is the Wiretap Act, and “it was broadcast in the clear” has not historically been a successful defence. These tools reduce what you collect; they do not grant you authority to collect it.
Use them on your own networks, on the course lab network, or with written permission. Neither tool transmits.
Key takeaways
- A sweeping SDR and a monitor-mode Wi-Fi card answer different questions. Neither substitutes for the other, and a HackRF genuinely cannot decode 802.11.
- Channels in this band overlap by design; 1, 6, and 11 are the only mutually non-overlapping set, and a loud channel 7 shows up on 5 through 9.
- Interference that is not Wi-Fi is invisible to packet capture and obvious on a sweep.
- Management and control frames are unencrypted on every network, including WPA3. Addresses, timing, and traffic volume leak regardless of the cipher.
- Decrypting WPA/WPA2 needs the four-way handshake as well as the key.
- Collect only what you can read. It is better analysis and a far smaller liability, and the property is cheap to verify.
References
- IEEE 802.11-2020 — the standard itself; frame control and the Protected Frame bit are in clause 9
- Wireshark: How to Decrypt 802.11 — key formats and the handshake requirement
- Wireshark: WLAN capture setup — monitor mode per platform, and what you lose without it
tsharkmanual anddumpcapmanual- Great Scott Gadgets, HackRF documentation
and the
hackrf_sweep(1)man page — the sweep tool and its CSV output - radiotap — the capture-side metadata header
- Linux
iwdocumentation — interface modes and channel control - Aircrack-ng: airodump-ng — the conventional, non-gated way to do the same capture
- Wireshark Q&A: monitor mode without promiscuous mode — why an adapter can be in monitor mode and still yield only broadcast/multicast frames
mt76: mt7921: fix up the monitor mode— the upstream patch that made RTS/CTS and beacon frames reachable on mt7921, and the limits of what the firmware’s sniffer mode covers- morrownr/mt76 issue #18, monitor mode testing — ongoing user reports of mt7921/mt7925 monitor-mode gaps against the in-kernel driver
- Rohde & Schwarz, dB and power ratios — why power must be summed and averaged in the linear domain, not in dB