Skip to content

About Iperf3

iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6).

For each test it reports the bandwidth, loss, and other parameters. This is a new implementation that shares no code with the original iPerf and also is not backwards compatible.

Iperf3 is a rewrite of Iperf so KEEP IN MIND All iperf3 options work for iperf but the opposite isn't true.

Launch the server

To work with iperf3 you must to have two PC minimum, one server and one client to do the test.

So go to launch the server with the following command line iperf3 -s and he should show if he start fine.

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

Warning

Your firewall is already set up ?

So edit your settings to add a new rules who accept the incoming connections on socket 5201 in TCP & UDP.

If you want to measure the jitte and somes other things you need to have access in UDP protocol.

It is possible to use an other socket as "5201" by using argument "-p" for server and client.

How to do a bandwith test

Launch a basic test from client :

# We launch the test from client to server at 192.168.2.8 (Wifi Laptop)
iperf3 -c 192.168.2.8

# This should show a similar output below
Connecting to host 192.168.2.8, port 5201
[  4] local 192.168.2.9 port 42114 connected to 192.168.2.8 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  13.6 MBytes   114 Mbits/sec    0    643 KBytes
[  4]   1.00-2.00   sec  14.9 MBytes   125 Mbits/sec    0   1.37 MBytes
[  4]   2.00-3.00   sec  23.5 MBytes   197 Mbits/sec    0   1.37 MBytes
[  4]   3.00-4.00   sec  21.4 MBytes   179 Mbits/sec    0   1.37 MBytes
[  4]   4.00-5.00   sec  20.6 MBytes   173 Mbits/sec    0   1.37 MBytes
[  4]   5.00-6.00   sec  22.4 MBytes   188 Mbits/sec    0   1.37 MBytes
[  4]   6.00-7.00   sec  18.5 MBytes   155 Mbits/sec    0   1.37 MBytes
[  4]   7.00-8.00   sec  28.5 MBytes   239 Mbits/sec    0   1.37 MBytes
[  4]   8.00-9.00   sec  24.3 MBytes   204 Mbits/sec    0   1.37 MBytes
[  4]   9.00-10.00  sec  22.5 MBytes   189 Mbits/sec    0   1.37 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   210 MBytes   176 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   210 MBytes   176 Mbits/sec                  receiver

iperf Done.

Generate a network flow with UDP protocol

Basic all the tests that are launched are in TCP protocol, we can use more options like beneath to launch an UDP test.

  • -u : Set on UDP protocol.
  • -b : Defines the bandwith size.
  • -P : Defines the flow number.
  • -t : Defines the duration of the test.
# UDP test with 10Mega at each request during 60 seconds
iperf3 -c 192.168.2.8 -u -b 10m -P 5 -t 60

# This should show a similar output below
Connecting to host 192.168.2.8, port 5201
[  4] local 192.168.2.9 port 45981 connected to 192.168.2.8 port 5201
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-60.00  sec  71.4 MBytes  9.99 Mbits/sec  1.437 ms  0/6547 (0%)  
[  4] Sent 6547 datagrams
[  6]   0.00-60.00  sec  71.4 MBytes  9.99 Mbits/sec  1.440 ms  0/6547 (0%)  
[  6] Sent 6547 datagrams
[  8]   0.00-60.00  sec  71.4 MBytes  9.99 Mbits/sec  1.387 ms  0/6547 (0%)  
[  8] Sent 6547 datagrams
[ 10]   0.00-60.00  sec  71.4 MBytes  9.99 Mbits/sec  1.348 ms  0/6547 (0%)  
[ 10] Sent 6547 datagrams
[ 12]   0.00-60.00  sec  71.4 MBytes  9.99 Mbits/sec  1.325 ms  0/6547 (0%)  
[ 12] Sent 6547 datagrams
[SUM]   0.00-60.00  sec   357 MBytes  49.9 Mbits/sec  1.387 ms  0/32735 (0%)  

iperf Done.

VoIP flow testing

In VoIP packets use the UDP protocol and have a size well below the MTU.

The ideal way to simulate / test a VoIP stream is to use the -l options to play on the size of the datagrame and -w which is the maximum size of the buffer that receives the datagras.

The datagram size MUST be smaller than the buffer size.

# We launch the test
iperf3 -s -l 32 -w 128k -c 192.168.2.8 -b 1m

# This should show a similar output belo
Connecting to host 192.168.2.8, port 5201
[  4] local 192.168.2.9 port 58650 connected to 192.168.2.8 port 5201
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[  4]   0.00-1.00   sec   110 KBytes   903 Kbits/sec  3526  
[  4]   1.00-2.00   sec   122 KBytes  1000 Kbits/sec  3906  
[  4]   2.00-3.00   sec   122 KBytes  1.00 Mbits/sec  3907  
[  4]   3.00-4.00   sec   122 KBytes  1000 Kbits/sec  3906  
[  4]   4.00-5.00   sec   122 KBytes  1000 Kbits/sec  3906  
[  4]   5.00-6.00   sec   122 KBytes  1000 Kbits/sec  3906  
[  4]   6.00-7.00   sec   122 KBytes  1.00 Mbits/sec  3906  
[  4]   7.00-8.00   sec   122 KBytes  1.00 Mbits/sec  3907  
[  4]   8.00-9.00   sec   122 KBytes  1000 Kbits/sec  3905  
[  4]   9.00-10.00  sec   122 KBytes  1.00 Mbits/sec  3907  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-10.00  sec  1.18 MBytes   990 Kbits/sec  0.002 ms  0/38681 (0%)  
[  4] Sent 38681 datagrams

iperf Done.

Of course I only presented a few options and use cases of Iperf3.

Iperf3 is a little less complete than iperf but evolves to go further so you can: vary the values for the bandwidth, the protocol, the number of flows.

You can also combine iperf with other tools like traceroute or mtr to further refine your network test and of course look to use iperf if iperf3 does not seem complete enough.