Throughput testing with iperf

Iperf is a nice utility to test links between switches, remote sites–anything that you have control of. It’s a Unix based utility that can be installed directly on a *nix OS or on Windows using Cygwin. It can give you an idea of the general speed, latency of the link or how many threads can be run at a time before the link gets over utilized.

I’ll cover how to install it using Cygwin since that’s how I use it most often. (Most *nix folks can easily install iperf with apt or yum).

1. Download and begin the installer for Cygwin. 

NOTE: You need two instances of iperf to do the test. Set up a host on one end of the link you want to test, and one on the other.

2. Once the installer starts there is an easy way to install iperf.

  • Click Next on the main screen
  • Click Install from Internet
  • Enter the root directory you’d like to use and user options.
  • Click Next
  • Enter your proxy settings
  • On the packages page type iperf in the search box and click the Skip button to install it
  • Cygwin will install with the core platform with iperf installed.

3. Once it’s installed open Cygwin on both ends.

4. On the receiving end (the end of the link you will most likely download from) enter the following.

$ iperf -s
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)

You will see that the server listens on TCP port 5001 by default. If you have firewalls in between sites you can change this (check with iperf –help)

5. On the client end run your test. In my example I am testing to the endpoint for 30 seconds using 5 threads. It can be tweaked as needed (iperf –help)

$ iperf -c -t 30 -P 5
Client connecting to, TCP port 5001
TCP window size: 64.0 KByte (default)
[ 7] local port 35488 connected with port 5001
[ 6] local port 35487 connected with port 5001
[ 5] local port 35486 connected with port 5001
[ 4] local port 35485 connected with port 5001
[ 3] local port 35484 connected with port 5001
[ ID] Interval Transfer Bandwidth
[ 6] 0.0-30.1 sec 29.8 MBytes 8.30 Mbits/sec
[ 3] 0.0-30.1 sec 28.2 MBytes 7.88 Mbits/sec
[ 5] 0.0-30.1 sec 23.6 MBytes 6.58 Mbits/sec
[ 4] 0.0-30.2 sec 26.6 MBytes 7.39 Mbits/sec
[ 7] 0.0-30.5 sec 26.8 MBytes 7.35 Mbits/sec
[SUM] 0.0-30.5 sec 135 MBytes 37.1 Mbits/sec

You will see you get the speed per thread and the summarized speed. Use this as a generalization, not a definitive test of your link. It is a good way to test how much traffic you can pump through your links or to see if an ISP is giving you what you pay for…

Throughput testing with iperf

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s