CUC (6) CUCM (26) Jabber (6) Python (2) Routing (3) Solarwinds Orion NPM (4) switching (1) Video (6) voice (2)

Tuesday, 30 May 2017

Test your links using iperf3

Recently I was looking for some tooling that could test QoS policy maps. So what I wanted to do is max out a link that has QoS applied towards a WAN provider. 

Iperf is essentially a tool that operates in a client/server fashion. So, if you want to  test a certain link in terms of performance, you would need to have iperf running on a machine on either side of the link; one as server, one as client.

By default it generates traffic, initiated on the client to the server, by default on destination port 5201 (UDP or TCP), so if you have a firewall in the path, make sure you open it for the default 5201 towards the iperf server.

Let us look at the full syntax and options first and then discuss a few examples and applications.

Simply run iperf3.exe <enter> from the DOS prompt, this will give you the out put below:

 Server or Client:
  -p, --port      #                       port to listen on/connect to
  -f, --format    [kmgKMG]        format to report: Kbits, Mbits, KBytes, MBytes
  -i, --interval  #                      seconds between periodic bandwidth reports
  -F, --file name                      xmit/recv the specified file
  -B, --bind      <host>            bind to a specific interface
  -V, --verbose                         more detailed output
  -J, --json                               output in JSON format
  --logfile f                              send output to a log file
  -d, --debug                            emit debugging output
  -v, --version                          show version information and quit
  -h, --help                               show this message and quit
Server specific:
  -s, --server                             run in server mode
  -D, --daemon                         run the server as a daemon
  -I, --pidfile file                      write PID file
  -1, --one-off                           handle one client connection then exit
Client specific:
  -c, --client    <host>              run in client mode, connecting to <host>
  -u, --udp                                use UDP rather than TCP
  -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)
                                                (default 1 Mbit/sec for UDP, unlimited for TCP)
                                                (optional slash and packet count for burst mode)
  -t, --time      #                         time in seconds to transmit for (default 10 secs)
  -n, --bytes     #[KMG]           number of bytes to transmit (instead of -t)
  -k, --blockcount #[KMG]      number of blocks (packets) to transmit (instead of -t or -n)
  -l, --len       #[KMG]              length of buffer to read or write
                                                (default 128 KB for TCP, 8 KB for UDP)
  --cport         <port>               bind to a specific client port (TCP and UDP, default: ephemeral port)
  -P, --parallel  #                      number of parallel client streams to run
  -R, --reverse                          run in reverse mode (server sends, client receives)
  -w, --window    #[KMG]      set window size / socket buffer size
  -M, --set-mss   #                   set TCP/SCTP maximum segment size (MTU - 40 bytes)
  -N, --no-delay                      set TCP/SCTP no delay, disabling Nagle's Algorithm
  -4, --version4                       only use IPv4
  -6, --version6                       only use IPv6
  -S, --tos N                            set the IP 'type of service'
  -Z, --zerocopy                       use a 'zero copy' method of sending data
  -O, --omit N                          omit the first n seconds
  -T, --title str                           prefix every output line with this string
  --get-server-output               get results from server
  --udp-counters-64bit             use 64-bit counters in UDP test packets

[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-

iperf3 homepage at:
Report bugs to:

So, because iperf uses a client/server relationship, you will need to copy the iperf3.exe file, to the destination machine (most likely on the far end of the link you are testing), and start it up as the iperf server:

iperf3.exe -s
Server listening on 5201

This now means you can start generating traffic to the IP address to the iperf server. By default this traffic will be generated, using TCP port 5201.

Now that you have the iperf server running, generate some traffic towards it:

iperf3.exe -c -t 60

This will generate TCP traffic for 60 seconds to on port 5201, where is the IP address of the iperf server.

So how could can you apply all this?

If you wanted to swap a link for instance to see what its maximum sustainable bandwidth is, or just to see if your provider is delivery what is set out to. Or if you want to swamp your link and push additional high priority traffic across (such as video and voice) to see if your real time media remain of good quality/are protected by QoS policies; run iperf with multiple parallel stream for, say 300 seconds, or at least a sufficient time frame to test and check.


iperf3.exe -c -P4 - t 300

This will run 4 unlimited bandwidth streams  (P 4) for a period of 300 seconds to the iperf3 server at


With iperf3 it should be possible to generate traffic with a certain ToS (DSCP) value, this is done by useing the -S parameters so for instance:

iperf3.exe -c -P4 - t 300 -S 184   (where 184 is DSCP/PHB ef)

Having said that, I have not been able to get this to work on win10 machine, so anyone who has' drop me a line. 

What you could do to test QoS is to swamp your link and run a video and or audio call across the same link at the same time, meanwhile checking jitter and media quality.

Oh and you might want to use wireshark as an additional tool so you can verify iperf's working. Try the following link to make DSCP settings more visible in wireshark:

All in all I think Iperf is quite a useful tool, and it comes for free, so why not use it.

No comments:

Post a Comment