Using iPerf Windows Command Line Tool to Measure Bandwidth Between Sites

KB Number:
000001014

Symptoms:
iPerf can be used to measure the available bandwidth between sites. This article covers details on using them to record bandwidth metrics using iPerf on windows machines.

Cause:
N/A

Solution:

For windows, this tool is run through the windows command prompt and can be downloaded here:
http://sourceforge.net/projects/iperf/files/

iPerf runs as a client server app and it must be available at both sites. Note that the server VM must be at one site and the client must be across the link between sites in order to measure bandwidth. Here are a list of example commands with some brief explanations:

Command set 1

VM 1 (Server on IP 10.1.1.10)

iperf -s > .10secserver.txt
This command sets the server and outputs anything received to this server to the current working directory to the "10secserver.txt" file. By default, iPerf runs for 10 seconds.
Example results written to "10secserver.txt"
------------------------------------------------------------ 
Server listening on TCP port 5001 
TCP window size: 8.00 KByte (default) 
------------------------------------------------------------ 
[852] local 10.1.1.10 port 5001 connected with 10.6.2.5 port 33453 
[ ID]   Interval          Transfer       Bandwidth 
[852]   0.0-10.6 sec   1.26 MBytes   1.03 Mbits/sec 

Note how the red highlighted Mbits/sec in the above lines shows the available bandwidth for the test and this is the available bandwidth between these VMs over the connection.
 

VM 2 (client)

iperf -c 10.1.1.10 > .10secclient.txt
This command reaches out to the server (at the specified address) and outputs anything received to the server to the current working directory to the "10secclient.txt" file.
Example results written to "10secclient.txt"
------------------------------------------------------------ 
Client connecting to 10.1.1.10, TCP port 5001 
TCP window size: 16384 Byte (default) 
------------------------------------------------------------ 
[ 3] local 10.6.2.5 port 33453 connected with 10.1.1.10 port 5001 
[ 3]   0.0-10.2 sec   1.26 MBytes   1.05 Mbits/sec 

Note how the red highlighted Mbits/sec in the above lines shows the available bandwidth for the test and this is the available bandwidth between these VMs over the connection.

Command set 2
VM 1 (Server on IP 10.1.1.10)

iperf.exe -s > .10-P2secserver.txt
This command sets the server and outputs anything received to the server to the current working directory to the "10-P10secserver.txt" file. 
 
VM 2 (Client)
iperf.exe -c 10.1.1.10 -P 2 > .10P-10secclient.txt
This command sets the client to reach out to the specified IP address and perform 2 parallel tests (sockets). This is outputted to the current working directory to the "10P-2secserver.txt" file. -P specifies 2 parallel tests (sockets) to be performed.
Example results
------------------------------------------------------------ 
Client connecting to 10.1.1.10, TCP port 5001 
TCP window size: 16.0 KByte (default) 
------------------------------------------------------------ 
[ 3] local 10.6.2.5 port 41534 connected with 10.1.1.10 port 5001 
[ 4] local 10.6.2.5 port 41535 connected with 10.1.1.10 port 5001 
[ 4]     0.0-10.1 sec   1.35 MBytes   1.12 Mbits/sec 
[ 3]     0.0-10.1 sec   1.35 MBytes   1.12 Mbits/sec 
[SUM]  0.0-10.1 sec   2.70 MBytes   2.24 Mbits/sec 

Note that in these results, we can see a line for each parallel test and the sum at the bottom. In this case, the sum is the total bandwidth and each test shows how much it consumed from the total.  

Command set 3
VM 1 (Server on IP 10.1.1.10)

iperf.exe -s > .3minServer.txt
This command starts iPerf as server and outputs anything received to the current working directory to "3minServer.txt" file.
Note that time is not specified.
 

VM 2 (Client)

iperf.exe -c 10.1.1.10 -t 180 > .3minClient.txt
This command sets the client to reach out to the specified IP address for a test of 3 minutes (180 seconds). -t specifies time in seconds for the test. The results are outputted to the current working directory to file "3minClient.txt"
Note: By specifying a longer time interval, you can measure if the total bandwidth available is constant over a longer period of time compared to the default. For example, if a WAN link is burstable, then the results could be skewed over a shorter period of time. 

Command set 4
VM 1 (Server on IP 10.1.1.10)

iperf.exe -s > .3minP10Server.txt
This command starts iPerf as server and outputs anything received to the current working directory to the "3minP10Server.txt" file.
 

VM 2

iperf.exe -c 10.1.1.10 -P 10 -t 180 > .3minP10Client.txt
This command sets the client to reach out to the specified IP address for a test of 3 minutes (180 seconds). -t specifies time in seconds for the test. -P specifies 10 parallel tests (sockets) to be performed.
Note: By specifying a longer time interval, you can measure if the total bandwidth available is constant over a longer period of time compared to the default. For example, if a WAN link is burstable, then the results could be skewed over a shorter period of time. 

Further details on iPerf are available at the following resource:
http://openmaniak.com/iperf.php


Affected Versions:
All

Hypervisor:
VMWare, Hyper-V, AWS

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.60 out of 5)
Loading...