Measuring Wi-Fi properly with iperf3
After moving the access point to the hallway ceiling, the bedroom "felt faster". Feelings are not numbers, and online speed tests were useless: they topped out at my internet plan and said nothing about the radio. So I measured inside the network.
Setup
One wired machine runs the server. The laptop on Wi-Fi is the client. Both need iperf3:
# on the wired machine
sudo apt install iperf3
iperf3 -s
# on the laptop
iperf3 -c 192.168.1.10 -t 20
The server must be wired. If both ends are on Wi-Fi, you are measuring two radio links at once and the result is meaningless.
Measure both directions
By default the client uploads. Add -R to reverse it, which is usually what you care about (downloads to the laptop):
iperf3 -c 192.168.1.10 -t 20 -R
Wi-Fi is often asymmetric: the access point has better antennas than a laptop, so downloads tend to be faster.
Use several streams
A single TCP stream can be limited by latency rather than by the link. Four parallel streams give a more honest ceiling:
iperf3 -c 192.168.1.10 -t 20 -R -P 4
My numbers
| Room | Old position | Ceiling mount |
|---|---|---|
| Living room | 610 Mbit/s | 640 Mbit/s |
| Bedroom | 140 Mbit/s | 390 Mbit/s |
| Balcony | 35 Mbit/s | 160 Mbit/s |
The feeling was right, for once. The living room barely changed, but the far rooms more than doubled: fewer walls between the antenna and the client matter more than anything in the settings menu.
Things that skewed early results
- The laptop on battery saver throttled the Wi-Fi card. Plug it in.
- A phone streaming video on the same channel. Test when the network is quiet, or at least note it.
- 20-second runs varied by 10–15%. I ran each test three times and took the median.