Linux for Network Engineers: How to Use iPerf

By July 24, 2019Linux

iPerf is an open source, free, network performance measurement tool. It works by simply sending traffic from one host to another and measuring the bandwidth that can be achieved. In addition to the throughput measurement it can give metrics such as packet loss, jitter, and traffic distribution. iPerf works for both TCP and UDP traffic with certain nuances that pertain to the specifics of each protocol.

Versions

There are two versions of iPerf which are being developed in parallel: version 2 and version 3. They are incompatible to each other, and maintained by different teams. However, both have the same set of functionalities, more or less.

iPerf version 2 was released in 2003 and it’s currently in version 2.0.13. iPerf version 3 was released in 2014 and it’s current version is 3.7. iPerf3 is a rewrite of the tool in order to produce a simpler and smaller code base.

The team that has taken the lead in iPerf2 development is mainly focused on WiFi testing, while iPerf3 is focused on research networks. However, most of their functionality overlaps, and they can be both used for general network performance and testing.

Both versions support a wide variety of platforms, including Linux, Windows, and MAC OS. And there is also a GUI version of iPerf2 based in Java, called JPerf.

Usage

In iPerf “lingo”, the host that sends the traffic is called client and the receiver is called server. Here is how the command line output looks for the two versions and for UDP and TCP tests, at their basic forms without any advanced options.

TCP

iPerf2 server

iPerf2 client

iPerf3 server

iPerf3 client

 UDP

iPerf2 server

iPerf2 client

iPerf3 server

iPerf3 client

As you can see, the output format is very similar and both versions gave the same measurements in this example. More specifically, in TCP mode iPerf tries to achieve the maximum possible bandwidth. In the previous example, it almost saturated the gigabit link that connects the two hosts. In UDP mode, you can specify the target throughput, and if you don’t give any bandwidth input value iPerf targets 1Mbps.

This is just an introduction on the basics of iPerf. If you have questions don’t hesitate to ask them in the comments. To explore further by yourself, here is a list of resources that you may find useful:

iPerf2 home page

iPerf3 home page

iPerf2 vs iPerf3

iPerf Performance Testing on Single Board Computers

Speedtest Comparison: Ookla, NDT, NetFlix, HTML, iPerf

Iperf WiFi: Raspberry Pi 3, ASUS, Hawking, LinkSys & TP-LINK

iPerf Series of Videos