What is this thread about?
Having read a lot of forum threads, I came to the conclusion that many users (myself included) lack coherent information about how to conduct proper debugging and how to properly measure wifi performance. Furthermore, they lack information about tools available to do such. I invite everybody to point to proper practices, tools and methods in hopes of giving users and committers to OpenWRT alike a starting point to evaluate and debug their wifi issues. Posting measurements for educational purposes would be great. Comparison of methods and tools sounds nice too, but might be a little exhaustive. Screenshots will be nice. I plan to sporadically update and edit this Initial message to account for responses and debate in this thread. Eventually, some info from here could be used for the docs.
What is this thread not about?
- Expecting help, because your measurements point to flaws in OpenWRT code.
- Debugging your very personal setup of OpenWRT
→ If you have issues with your setup or if your measurements point to flaws in the code or hardware, please open a new forum post, instead of raising the issue here.
Best practices:
- test latency (e.g. round trip time) simultaneously with throughput (show graphics side by side) [1]
- run tests long enough [2]
- test same configuration on same hardware with various distances/paths [2]
- test same configuration on same hardware with various hindrances (e.g. walls inbetween)
- test same configuration with multiple devices and different hardware
- Measure latency under load [2]
- Measure latency/throughput with multiple (client) streams [2]
- Do not interpret UDP and TCP results with equal weights [2]
- Do not overvalue throughput rate over range without looking at latency or rate control [2]
- Do not overvalue summary statistics that don’t look at inter-station behaviors [2]
Sources: [1], [2]; OpenWRT Forum; Common Sense
Tools:
- ping
- arping
- Bufferbloat test hosted by waveform
- Crusader (Network bandwidth and latency tester)
- Flent (The flexible network tester)
- irtt (isochronous round trip tester)
-
Iperf2
- The successor to Iperf
-
Iperf3
- iPerf3 and Iperf2 are based on different code. Iperf3 is not the successor to Iperf2.
- Difference between Iperf2 and Iperf3)
- Nuttcp
- sockperf
- tcpdump + tcptrace -G and xplot.org
- OWAMP (One Way Active Measurement Protocol)
- TWAMP (Two-Way Active Measurement Protocol)
-
Wireshark
- how to:
- capture wifi management frames with wireshark: https://wiki.wireshark.org/CaptureSetup/WLAN
- how to:
- Wavemon
- WiFi Analyzer (VREM version)
Simple methods for beginners:
1. Iperf3
-
How to capture throughput:
-
Run following command at the serverside:
ĂŚperf3 -s
-
Run one of the following commands at the client side:
TCP test, which measures the upload from client to server
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -t 60 -i 10
TCP test with 4 Client Streams, which measures the uploads from clients to server
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 4 -t 60 -i 10
TCP test with 8 Client Streams, which measures the uploads from clients to server
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 8 -t 60 -i 10
TCP test; Reverse mode: server sends, client receives
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -t 60 -i 10 -R
TCP test with 4 Client Streams; Reverse mode: server sends, clients receive
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 4 -t 60 -i 10 -R
TCP test with 8 Client Streams; Reverse mode: server sends, clients receive
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 8 -t 60 -i 10 -R
Bidirectional TCP test
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -t 60 -i 10 --bidir
Bidirectional TCP test with 4 Client Streams
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 4 -t 60 -i 10 --bidir
Bidirectional TCP test with 8 Client Streams
iperf3 -c <IP of Iperf Server> -p <Port of Iperf Server> -P 8 -t 60 -i 10 --bidir
-
-
Use Iperf in combination with Wireshark: Capture traffic with wireshark while doing throughput tests with iperf, then look at Wireshark's "Statistics → Stream graphs → Round Trip Time"
-
Tips and things to look out for when using Iperf3
How to debug wifi issues:
- OpenWRT: Wireless FAQ
- OpenWRT: How can I debug my wireless
- https://oldwiki.archive.openwrt.org/doc/devel/debugging#wireless (actually holds more info than the current OpenWRT website!)
Additional info in German language:
- https://bergs.biz/blog/2017/01/05/wlan-probleme-erkennen-und-beseitigen/
- https://bergs.biz/blog/2022/01/15/mein-internet-funktioniert-nicht-was-tun/
Miscellaneous:
Key Vocabulary:
- throughput
- latency
-
round trip time (rtt)
- often measured in milliseconds (ms)
- What is round trip time? - Cloudfare
- Millisecond (ms)
- Bit
- Byte
- Difference between MB/s and Mb/s, or MBps and Mbps: A, B
- 1 Byte = 8 bit
- MB = MegaByte
- Mb = Megabit
- Mbps: Mega bits per second
- Mb/s: Mega bits per second
- MBps: Mega Bytes per second
- MB/s: Mega Bytes per second
- Gigacalculator: Mbps to MB/s Converter
- What is the Difference between TCP and UDP?
Methods that look like, but that actually do NOT measure wifi performance:
Projects that try (or tried) to fix Linux Wifi
History, Videos and Literature about how wifi works, how it used to work in the past and historical attempts to fix it:
- 2022: Linux Plumbers Conference: All types of wireless in Linux are terrible and why
the vendors should feel bad - 2022: Playlist/Tutorial: How TCP works
- 2020: "How internet congestion control actually works in the bufferbloat age" - Dave Taht (LCA 2020)
- 2016: Making Wifi Fast + Slides - BattleMeshV8 - When do you drop packets?
- 2016: Linux Plumbers conference - Fixing wifi latency
- 2016: "Making Wifi fast" - Article about the Linux Plumbers Conference - by Jonathan Corbet
November 8, 2016, LWN.net
Dump of links, which are related to the topic, but that still have to be sifted through and that I am possibly considering to comment upon:
- Is there tools that can measure latency or connection performance?
- Best ways to conduct Speed and Network Performance test from OpenWrt? - #4 by guidosarducci
- Bufferbloat - Continuous measurement script
- Reducing multiplexing latencies still further in wifi - #75 by amteza
- Speedtest: new package to measure network performance - #23 by davidc502
- How do you measure throughput on an OpenWrt device?
- Wifi diagnostics and performance measurement under LEDE
- Ways to measure bufferbloat
- Help me figure out why I have gaming latency - #3 by dlakelan
- Shaping performance
- How to measure (show) cake preformance with luci-app-statistic?
- dtaht: Explaining sch_cake's statistics
- Comparative Throughput Testing Including NAT, SQM, WireGuard, and OpenVPN - #3 by jeff
- Iperf 2.3.8-rc1 and bufferbloat testing - #17 by dtaht
- https://lore.kernel.org/linux-wireless/CAA93jw6F1WLDu=Fq2pDt+gswWkJpygv4CDswD06v=yoCMgHo6A@mail.gmail.com/T/#u (iperf2 now can measure round trip latency (rtt) alongside throughput
- Ethertype Packet counter needed
- Internet protocol suite
- https://github.com/Mellanox/libvma/wiki/Architecture (NVIDIA Messaging Accelerator (vma) userspace application that bypasses the kernel and its TCP/UDP handling network stack to achieve low latency)