wiki:netmon2017iperfw

Version 2 (modified by admin, 6 years ago) ( diff )

--

iperf

Linux systems administrators and network administrators often find diagnosing network speed degradation complicated, as there are very few tools available to diagnose these issues. iperf/iperf3 is a command-line tool used in the diagnostics of network speed issues. iperf/iperf3 measures the maximum network throughput a server can handle. It is particularly useful when experiencing network speed issues, as you can use iperf/iperf3 to determine which server is unable to reach maximum throughput.

Installation

You can use apt-get to install iperf3 on Debian and Ubuntu:

apt-get install iperf3

Note: Installation of perfsonar gives you iperf3 by default. Therefore you do not have to install iperf3.

How to Use iperf

iperf must be installed on both computers between which you are testing the connection. If you are using a Unix or Linux-based operating system on your personal computer, you may be able to install iperf on your local machine. If you are testing the throughput of your Linode, however, it’s better to use another server as the end point, as your local ISP may impose network restrictions that can affect the results of your test.

TCP Clients & Servers

iperf requires two systems because one system must act as a server, while the other acts as a client. The client connects to the server you’re testing the speed of.

  • On the Linode you wish to test, launch iperf3 in server mode:
    iperf -s
    

You should see output similar to:

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

  • On your second Linode, connect to the first. Replace 192.168.1.1 with the first Linode’s IP address.
    iperf -c 192.168.1.1

The output should be similar to:

connecting to host 192.168.1.1, port 5201
[  4] local 192.168.1.2 port 37988 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  47.7 MBytes   400 Mbits/sec    0   1.01 MBytes       
[  4]   1.00-2.00   sec  51.2 MBytes   430 Mbits/sec   22   1.01 MBytes       
[  4]   2.00-3.00   sec  35.0 MBytes   294 Mbits/sec    1   1.41 KBytes       
[  4]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec    0   1.01 MBytes       

You will also see the connection and results on your iPerf server. This will look similar to:

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.1, port 37987
[  5] local 192.168.1.2 port 5201 connected to 192.168.1.1 port 37988
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  43.4 MBytes   364 Mbits/sec                 
[  5]   1.00-2.00   sec  50.4 MBytes   423 Mbits/sec                 
[  5]   2.00-3.00   sec  36.5 MBytes   305 Mbits/sec                 
[  5]   3.00-4.00   sec  67.9 KBytes   556 Kbits/sec     
  • To stop the iPerf server process, press CTRL + c.
Note: See TracWiki for help on using the wiki.