How to measure Wi-Fi® throughput

Back to main page

1. Overview

iPerf is a widely used network testing tool that can create TCP and UDP data streams and measure the throughput of a network carrying them. It is particularly useful for diagnosing network issues and testing the performance (throughput) of a network.

2. iPerf installation

2.1. Linux

On Linux, iPerf should be available in the native package management system.

2.1.1. Debian

apt install iperf

2.1.2. Redhat

yum install iperf

2.2. Windows

To obtain binaries of iPerf for Windows, we recommend visiting one of the following websites. No installation is needed, once downloaded and unzipped, the user just has to navigate to the extracted folder, open a command prompt and launch iPerf commands.

https://files.budman.pw/

https://github.com/ar51an/iperf3-win-builds

2.3. OpenWrt

On OpenWrt access points you may install iPerf either by opkg package manager:

opkg update
opkg install iperf

or by using their web user interface LuCI by navigating to System > Software and searching "iPerf" in "Available" software:

3. iPerf usage

3.1. Features selection

  • TCP and UDP Testing: iPerf can test both TCP and UDP protocols (and SCTP since iPerf 3.1)
  • Server (RX) and Client (TX) Mode: iPerf operates in a client-server mode, where one device acts as the server and the other acts as the client
  • Multiple Connections: Supports multiple simultaneous connections to test the network under load
  • Bandwidth Measurement
  • Bidirectional testing
  • IPv4 & IPv6 support

For detailed documentation, please visit the iPerf 2.0, iPerf 3.0 and iPerf 3.1 documentation.

Warning
Please note the X-CUBE-ST67W61 supports only iPerf 2.0 and 2.1!

3.2. Test examples

For test scenarios in the table below, an AP with Linux based OS (OpenWrt), or any Windows/Linux machine with iPerf installed might be used.

To see the details and limitations of our implementation of iPerf, you may use iperf -h.

Test ST67W6X CLI command AP command
UDP Tx/Client iperf -c <AP_IP> -u -b 50M -t 10 iperf -s -u -t 10 -i 1 -f m
UDP Rx/Server iperf -s -u -t 10 iperf -c <DUT_IP> -u -b 50M -t 10 -i 1 -f m
TCP Tx/Client iperf -c <AP_IP> -t 10 iperf -s -t 10 -i 1 -f m
TCP Rx/Server iperf -s -t 10 iperf -c <DUT_IP> -t 10 -i 1 -f m

Legend:

Argument Description
-s Run in server mode
-c <server IP address> Run in client mode
-u UDP mode (default TCP)
-l <length> Set read/write buffer size
-i <interval> Reporting intervals in seconds
-t <duration> Time of the test in seconds
-b <bandwidth> Bandwidth (desired client bandwidth - UDP only! TCP manages this automatically)

3.3. iPerf on Android smartphone

Testing performance of our devices against smartphones is another possibility. We recommend using iPerf2 for Android application, not available on the Play Store anymore but unofficial version can be found at this link. Otherwise another application, you can find here, propose the same functionalities, under iPerf2 panel, which allows you to use iPerf with all its parameters.

All you have to do is connect the two devices - either set up Wi-Fi hotspot on your smartphone, or setup soft-Access Point (soft-AP) on our device and connect the two. Then you may use iPerf on both of the devices as described in the section 3:

4. IPv4 Throughput

Present values of throughput with LWIP on host are given below:

Throughput in Mbps Tx Rx
UDP 27.2 27.7
TCP 23.6 24.5

4.1. Throughput tuning

There are some LWIP parameters which can be optimized (provided in lwipopts.h, at Projects/NUCLEO-U575ZI-Q/Applications/ST67W6X/ST67W6X_CLI_LWIP/LWIP/Target) in order to obtain better throughput, an example is shown below:

4.1.1. TCP_SND_BUF

Existing value of TCP_SND_BUF is 16*TCP_MSS. This flag manages the buffer allocated for TCP Tx in LWIP. If this value is changed without changing anything else in the lwipopts.h, throughput is

TCP_SND_BUF TCP Tx (in Mbps)
8 18.8
12 22.2
16 24.5