How to test networks with iperf3Travis N.
Sometimes things seem a bit… slow. Or maybe you really want to see if your ISP is giving you the speeds they say they are. Here’s a dirty little secret about ISPs and speed tests. All the major speed test sites – speedtest.net, DSL Reports, fast.com, etc. – are all well known by ISPs. When they see your traffic going to one of these sites, they let the bits go full throttle. In return, your speed test says you’re getting the full speed of your connection. But are you? iperf3 helps shine some light on that by letting you run a speed test between two clients directly. The traffic to your ISP looks like any standard traffic. Only it’s measuring them.
iperf3 can also do more than tell if your ISP is lying (or if there’s a problem somewhere between you and us) which makes it a very handy tool. It can also easily help you troubleshoot your home or office network. Is that 10 gig fiber link between your MDF and IDF working right? Is your wifi downstairs actually really bad? You can find out with iperf3 and here’s how to use it!
The iperf3 utility
This is a free and open source network testing tool. This utility will show you the rate at which data is being transferred over the network. Basically, it’s a more reliable speed test. You can use it on Windows, macOS, many Linux distros, Android, iPhone/iPad, FreeBSD, or even compile the C++ source code yourself. Download the free tool from the iperf.fr website for your platform(s). If you’re on macOS, you can use Homebrew to install with
brew install iperf3. If you’re on a Linux system, it’s usually shipped in the main repos. For AlmaLinux, it ships in the AppStream repo so all you need to do to install it is run
dnf install iperf3. Pretty easy.
How to use iperf3
Unlike most applications you use, iperf3 is a console application which means there is no GUI. You will have to use your system’s command line to run this utility. Don’t worry though, the commands are actually pretty easy.
iperf3 works in the server-client model which means one device needs to be setup as a server. This can be your actual server or a desktop on your computer. When troubleshooting over the internet, it’s important to note that the client needs to be able to access the port. So if you’re trying to test the speed to your dedicated server, then you should probably host the server on your dedicated server and use your local computer as the client.
The nice thing is that the commands are the same whether you’re using Windows, Linux, or Mac. In this example, I’m going to use my Windows desktop as the server and my Mac as the client. Both devices are on the same VLAN in the office.
On Windows, open up a terminal and go to where you extracted iperf3 and run it with the following command:
iperf3 -s which tells iperf3 to run in server mode. If you’re using a PowerShell terminal, you’ll have to format the command like this:
.\iperf3.exe -s. You may also receive a firewall prompt. You’ll need to allow iperf3 through the firewall.
And now your server is running! Time to connect to it and run a speed test.
From your other device, run the following command:
iperf3 -c <ip of server> -t 30 -V
Let’s break this down so you know what’s happening.
-c tells iperf3 that it’s the client and you pass it the name or IP address of the server you’re connecting to.
-t means we want to run the test for 30 seconds (default is 10, but 30 or longer can help you see fluctuations).
-V means we want verbose output otherwise we won’t see anything until it’s done running.
Here’s what a running test looks like:
When the test is done, you can see a summary:
Pretty easy, right? Now what happens if we want to reverse who is the client and the server? Well, we can throw what I like to call the UNO Reverse Card into our client command and suddenly my local computer becomes the server while my server is the client. All we have to do is add -R to our client command so it looks like this:
iperf3 -c <ip of server> -t 30 -V -R and now you’ll see this:
And now the server is sending data to my local computer instead of the other way. This makes it easy if you can’t open up firewall rules on the other end.
This is just the main use for iperf3, but of course there’s a lot of other functionality such as testing UDP, IPv6, parallel streams, and more. Just check out the docs to see what you can do with this utility.
Feel free to discuss this post over on our new community!