Iperf Guide

Iperf  is a tool to measure network performance. It measures maximum TCP bandwidth and bandwidth performance in UDP test. In this post you will find the main Iperf optins and some exampe. You can perform test between two host (pc or server) one wil be “server” side of the test and the other will be “client” side.

IPERF

Common parameters:

-u
test UDP (optional, if not indicated TCP test will be performed)
-s server side
-c client side, it is followed by server ip address
-b
test bandwidth (only with -u option, for UDP test, defaul is 1Megabit). TCP test will measure maximum TCP bandwidth
-p test port
-t  duration in seconds
-i
time interval between two “live” output during test
-w
tcp windows size, “Sets the socket buffer sizes to the specified value. For TCP, this sets the TCP window size. For UDP it is just the buffer which datagrams are received in, and so limits the largest receivable datagram size.” (from official documentation)
-P number of connection, to be set in server side. After this number of test the connection will be drop (for instance with -P 1 after the first test the connection will be closed)
-B
Bind. On client side it is the ip address of outbound interface, On server side it is the ip address of inbound interface. Useful in case of equipments with multiple interfaces.
-S
for DSCP tag only on client size. Specify the TOS value in hex. (example:  http://www.tucny.com/Home/dscp-tos)

IPERF example

We want to perform a test between MyTerminal and one server called PigServer:

MyTerminal: 10.10.10.10
PigServer: 10.10.10.20
Port: 5501
Duration: 5 minutes (300 sec)
Band: 2M

TCP

In this case we don’t need to specify the bandwidth, it will be calculated by the test.  Tests have to be started always on server side.

DOWNLOAD

MyTerminal: iperf -s -p 5501 -i
PigServer: iperf -c 10.10.10.10 -p 5501 -t 300 -i 30

UPLOAD

PigServer: iperf -s -p 5501
MyTerminal: iperf -c 10.10.10.20 -p 5501 -t 300 -i 30

This is the OUTPUT of the test (measured bandwidth is 2.13 Mbits/sec):

[MyTerminal ]#iperf -s -i 30 5501 -P1
------------------------------------------------------------
Server listening on TCP port 5501
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.10.10.10 port 5501 connected with 10.10.10.20 port 12345
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-30.0 sec  7.58 MBytes  2.12 Mbits/sec
[  4] 30.0-60.0 sec  7.85 MBytes  2.20 Mbits/sec
[  4] 60.0-90.0 sec  8.04 MBytes  2.25 Mbits/sec
[  4] 90.0-120.0 sec  7.97 MBytes  2.23 Mbits/sec
[  4] 120.0-150.0 sec  8.03 MBytes  2.25 Mbits/sec
[  4] 150.0-180.0 sec  8.00 MBytes  2.24 Mbits/sec
[  4] 180.0-210.0 sec  7.99 MBytes  2.24 Mbits/sec
[  4] 210.0-240.0 sec  7.96 MBytes  2.23 Mbits/sec
[  4] 240.0-270.0 sec  7.98 MBytes  2.23 Mbits/sec
[  4] 270.0-300.0 sec  7.95 MBytes  2.22 Mbits/sec
[  4] 300.0-330.0 sec  7.92 MBytes  2.21 Mbits/sec
[  4] 330.0-360.0 sec  8.01 MBytes  2.24 Mbits/sec
[  4] 360.0-390.0 sec  6.10 MBytes  1.70 Mbits/sec
[  4] 390.0-420.0 sec  3.66 MBytes  1.02 Mbits/sec
[  4] 420.0-450.0 sec  7.55 MBytes  2.11 Mbits/sec
[  4] 450.0-480.0 sec  7.87 MBytes  2.20 Mbits/sec
[  4] 480.0-510.0 sec  7.98 MBytes  2.23 Mbits/sec
[  4] 510.0-540.0 sec  8.05 MBytes  2.25 Mbits/sec
[  4] 540.0-570.0 sec  8.05 MBytes  2.25 Mbits/sec
[  4] 570.0-600.0 sec  8.06 MBytes  2.25 Mbits/sec
[  4]  0.0-600.2 sec   153 MBytes  2.13 Mbits/sec
[MyTerminal]#

UDP

There is not connection between client and server during UDP, (so do not surpise if client send flow to server even if server doesn’t receive anything)

DOWNLOAD:

MyTerminal: iperf -s -p 5501 -u
PigServer: iperf -c 10.10.10.10 -p 5501 -t 300 -i 30 -b 2M

UPLOAD

PigServer: iperf -s -p 5501 -u
MyTerminal: iperf -c 10.10.10.20 -p 5501 -t 600 -i 30 -b 2M

Output (you can see bandwidth, jitter and Packet Loss):

[MyTerminal]#iperf -s -u -i 30 -p 5501 -P1
------------------------------------------------------------
Server listening on UDP port 5501 
Receiving 1470 byte datagrams
UDP buffer size:  122 KByte (default)
------------------------------------------------------------
[  3] local 10.10.10.10 port 5501 connected with 10.10.10.20 port 1234
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-30.0 sec  1.94 MBytes   541 Kbits/sec   9.527 ms 9018/10399 (87%)
[  3] 30.0-60.0 sec  1.94 MBytes   542 Kbits/sec  10.235 ms 9026/10408 (87%)
[  3] 60.0-90.0 sec  1.94 MBytes   542 Kbits/sec  11.056 ms 9029/10411 (87%)
[  3] 90.0-120.0 sec  1.94 MBytes   542 Kbits/sec  10.507 ms 9026/10408 (87%)
[  3] 120.0-150.0 sec  1.94 MBytes   542 Kbits/sec  10.644 ms 9030/10412 (87%)
[  3] 150.0-180.0 sec  1.94 MBytes   542 Kbits/sec  12.642 ms 9026/10408 (87%)
[  3] 180.0-210.0 sec  1.94 MBytes   542 Kbits/sec  11.127 ms 9024/10406 (87%)
[  3] 210.0-240.0 sec  1.94 MBytes   542 Kbits/sec  11.599 ms 9026/10409 (87%)
[  3] 240.0-270.0 sec  1.94 MBytes   541 Kbits/sec  11.026 ms 9028/10409 (87%)
[  3] 270.0-300.0 sec  1.94 MBytes   542 Kbits/sec  12.434 ms 9022/10404 (87%)
[  3] 300.0-330.0 sec  1.94 MBytes   542 Kbits/sec  11.881 ms 9028/10410 (87%)
[  3] 330.0-360.0 sec  1.94 MBytes   542 Kbits/sec   9.731 ms 9028/10410 (87%)
[  3] 360.0-390.0 sec  1.94 MBytes   542 Kbits/sec  11.820 ms 9027/10409 (87%)
[  3] 390.0-420.0 sec  1.94 MBytes   542 Kbits/sec  10.770 ms 9022/10404 (87%)
[  3] 420.0-450.0 sec  1.94 MBytes   542 Kbits/sec  11.785 ms 9024/10406 (87%)
[  3] 450.0-480.0 sec  1.94 MBytes   542 Kbits/sec  10.641 ms 9028/10410 (87%)
[  3] 480.0-510.0 sec  1.94 MBytes   542 Kbits/sec  10.987 ms 9028/10410 (87%)
[  3] 510.0-540.0 sec  1.93 MBytes   540 Kbits/sec  10.673 ms 9032/10410 (87%)
[  3] 540.0-570.0 sec  1.93 MBytes   540 Kbits/sec  10.836 ms 9026/10404 (87%)
[  3] 570.0-600.0 sec  1.94 MBytes   542 Kbits/sec   9.461 ms 9026/10409 (87%)
[  3]  0.0-600.2 sec  38.8 MBytes   542 Kbits/sec  13.336 ms 180526/208168 (87%)
[MyTerminal]#
itg and iperf

measure network performance with itg and iperf

It could be intresting: D-ITG and iperf and itg difference

Usefull Links:
http://openmaniak.com/iperf.php
https://iperf.fr/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.