KB0014

Using iperf3 to Troubleshoot Network Speed Issues

By Stephen Schwetz

iPerf3 is a tool for actively measuring the maximum achievable bandwidth on IP networks. It supports tuning various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). It reports the bandwidth, loss, and other parameters for each test.

Note: This new implementation shares no code with the original iPerf and is not backward compatible. iPerf was initially developed by NLANR/DAST. iPerf3 is principally developed by ESnet / Lawrence Berkeley National Laboratory.

To run iperf3, you need two computers on which you can run the software. As the software utilises an ephemeral port it can be run without root access, though it may require root access to install depending on your operating system

Starting the Server

The first step is to start iperf3 on the computer that is your server, after ensuring that no firewall is active enter the command below.

class="highlight">
1
2
3
4
5
iperf3 -s

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 Server listening on 5201
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

By default iperf will listen on port 5201, but you can change this by using the -p option followed by the port

class="highlight">
1
2
3
4
5
iperf3 -s -p 12345

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 Server listening on 12345
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

Starting the Client

Standard Mode

With iperf3 in its standard mode of operation, the client sends data towards the server. If you are using TCP it is recommended to use more than one thread, otherwise a single thread my not max out your network.

class="highlight">
1
iperf3 -с 172.28.22.101 -p 5201 -f m -z -b 1000M -P 10

This command will do the following

  • run as a client -c;
  • connect to the host 172.28.22.101;
  • connect on port 52011 -p;
  • give the speed readings in megabits -f m;
  • use β€œzero copy” to lower CPU usage -Z ;
  • each connection will send 1000Megabits/sec -b 1000M; and
  • it will use 10 processes (thus send 10GB/s) -P 10; and

Reverse Mode

  • if you want to have the server send traffic to the client the CLI option -R will β€œReverse the traffic flow”.

Related Posts

Share: Facebook LinkedIn