Home About

Published

- 3 min read

iperf3

img of iperf3

iperf3

Have you ever wondered how to measure throughput properly? iperf3 got you covered and will be the first of many tools I’d like to introduce on this blog.

Install

Debian based systems:

   sudo apt install iperf3

RedHat based:

   sudo dnf install iperf3

But be aware if you install from vendor repositories, you might end up with different version on clients and servers. Therefore consider compiling the same version on all your systems from source.

Connect to public servers

There is this list with a couple of public servers. But those are pretty unreliable. A couple of weeks ago one of them worked but today none of them. You might be lucky. I didn’t want to keep that from you.

Setup the server

Run the following on a local or remote server:

   iperf3 -s -p 5202 -B 192.168.1.123
  • -s stands for “Server”
  • -p listens on TCP port 5202 (No sudo required)
  • -B defines the binding interface. Only necessary if you have multiple interfaces.

Setup the client

Run the following on your client:

   iperf3 -c 192.168.1.123 -p 5202 -t 30 -b 1G
  • -c HOST defines the server ip or hostname
  • -p 5202 connects to TCP port 5202
  • -t 30 time in seconds until scenario ends
  • -b 1G desired bandwidth. Here Gigabit.

My local setup

I got one client and one server where the server got two 1 gigabit network adapters. Following setup shows how the bandwidth got split up between both streams.

Before the start: iperf3-start

After I started top left about 7 seconds before bottom left. You can see bandwidth drops top right: iperf3-start

You get bit-rate and total transferred bytes when it stops: iperf3-start

Pitfalls

If you do not get full gigabit speed, you might have some of the same problems like me:

  • My Samsung S49A950UIU has a network port with and some kvm capabilities which then gets connected via USB3. I didn’t do the math but gigabit wasn’t possible. Make sure to use a proper network adapter.
  • Second try was a separated USB3 to RJ45 adapter from Delock. I got some sweet gigabit for a while, but oh boy did that one crash often. And it got pretty hot actually.
  • Being mad that my Dell laptop doesn’t have a regular ethernet jack, I attached a Raspberry Pi 3B+ to the network and discovered that it cannot handle that speed level. See Jeff Geerlings post for detailed measurement results.

My Hetzner test

I tested a one to one scenario where I opened a TCP port on my Hetzner VM and was pretty unimpressed. I only got 8.47 Mbits/sec which is not what I expected. Well, good that I checked.

Would be nice to know if that’s always the case or only at crunch times. I’m writing this article at 9pm UTC+1. Internet crunch time: See here. Maybe I’ll setup a regular bandwidth test that’s running in the background. But that might be a story for another time.

Further Reading

I just scratched the surface of what’s possible with iperf3. So after giving it a spin, please go ahead and see what else is possible here. I might come up with a follow up. But this article is almost not short anymore, as promised in the beginning.

Best
Sebastian

Impressum Datenschutz