iperf

Messing around with iPerf in a 1000BASE-T Ethernet LAN



Set an iPerf TCP server
beryllium:~# iperf -s -B 172.31.1.2
------------------------------------------------------------
Server listening on TCP port 5001
Binding to local address 172.31.1.2
TCP window size: 85.3 KByte (default)
------------------------------------------------------------




Measure achievable TCP bandwidth with iPerf from another host
lithium:~# iperf -c 172.31.1.2
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 44159 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   982 MBytes   823 Mbits/sec



Seen on server
beryllium:~# iperf -s -B 172.31.1.2
------------------------------------------------------------
Server listening on TCP port 5001
Binding to local address 172.31.1.2
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 172.31.1.2 port 5001 connected with 172.31.1.1 port 44159
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   982 MBytes   823 Mbits/sec



Set an iPerf UDP server
beryllium:~# iperf -s -u -B 172.31.1.2
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 172.31.1.2
Receiving 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------



Measure achievable UDP bandwidth with iPerf from another host
lithium:~# iperf -u -c 172.31.1.2
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 60431 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] Sent 893 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec   0.055 ms    0/  893 (0%)

Which appears to be a NOT Good way to do UDP bandwidth measurements, because iperf tries only the default or the set rate and UDP has no way of determining the pipe capacity or congestion.

Since, I know that that both hosts have gigabit ethernet interfaces and they are in the same gigabit LAN, I should try to set the bandwidth to something closer to 1000Mb/s
lithium:~# iperf -u -c 172.31.1.2 -b 1000M
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 49712 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   909 MBytes   763 Mbits/sec
[  3] Sent 648395 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec   908 MBytes   762 Mbits/sec   0.012 ms  549/648394 (0.085%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order


hmm, what if
# iperf -u -c 172.31.1.2 -b 800M
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 46421 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   919 MBytes   771 Mbits/sec
[  3] Sent 655661 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec   919 MBytes   771 Mbits/sec   0.012 ms    1/655660 (0.00015%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order


greater rate or just better timing ...
less stuff going on in the LAN,
we need a few more tests ...
lithium:~# iperf -u -c 172.31.1.2 -b 1000M
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 56018 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   942 MBytes   790 Mbits/sec
[  3] Sent 671758 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec   940 MBytes   789 Mbits/sec   0.008 ms  941/671757 (0.14%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order
lithium:~# iperf -u -c 172.31.1.2 -b 1100M
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 48590 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   941 MBytes   789 Mbits/sec
[  3] Sent 671138 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec   937 MBytes   786 Mbits/sec   0.016 ms 2547/671137 (0.38%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order


but still less bandwidth than in the TCP tests, I want to make it say more in UDP , what if I try 2 or 3 client threads?
lithium:~# iperf -u -c 172.31.1.2 -b 1000M -P 2
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  4] local 172.31.1.1 port 44169 connected with 172.31.1.2 port 5001
[  3] local 172.31.1.1 port 46647 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   570 MBytes   478 Mbits/sec
[  4] Sent 406535 datagrams
[  3]  0.0-10.0 sec   570 MBytes   478 Mbits/sec
[  3] Sent 406862 datagrams
[SUM]  0.0-10.0 sec  1.11 GBytes   957 Mbits/sec
[  4] Server Report:
[  4]  0.0-10.0 sec   570 MBytes   478 Mbits/sec   0.023 ms  268/406534 (0.066%)
[  4]  0.0-10.0 sec  1 datagrams received out-of-order
[  3] Server Report:
[  3]  0.0-10.0 sec   570 MBytes   478 Mbits/sec   0.112 ms  169/406861 (0.042%)
[  3]  0.0-10.0 sec  25 datagrams received out-of-order
lithium:~# iperf -u -c 172.31.1.2 -b 1000M -P 3
------------------------------------------------------------
Client connecting to 172.31.1.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  5] local 172.31.1.1 port 42214 connected with 172.31.1.2 port 5001
[  4] local 172.31.1.1 port 43282 connected with 172.31.1.2 port 5001
[  3] local 172.31.1.1 port 45155 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec   380 MBytes   319 Mbits/sec
[  5] Sent 271093 datagrams
[  3]  0.0-10.0 sec   380 MBytes   319 Mbits/sec
[  3] Sent 271140 datagrams
[  4]  0.0-10.0 sec   380 MBytes   319 Mbits/sec
[  4] Sent 271280 datagrams
[SUM]  0.0-10.0 sec  1.11 GBytes   957 Mbits/sec
[  5] Server Report:
[  5]  0.0-10.0 sec   380 MBytes   319 Mbits/sec   0.162 ms   46/271092 (0.017%)
[  5]  0.0-10.0 sec  69 datagrams received out-of-order
[  3] Server Report:
[  3]  0.0-10.0 sec   380 MBytes   318 Mbits/sec   0.021 ms  284/271139 (0.1%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order
[  4] Server Report:
[  4]  0.0-10.0 sec   380 MBytes   319 Mbits/sec   0.282 ms  242/271279 (0.089%)
[  4]  0.0-10.0 sec  10 datagrams received out-of-order


What if I try TCP bandwidth tests with 2 and 3 client threads ?
lithium:~# iperf -c 172.31.1.2
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 44165 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   977 MBytes   819 Mbits/sec
lithium:~# iperf -c 172.31.1.2 -P 2
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  4] local 172.31.1.1 port 44167 connected with 172.31.1.2 port 5001
[  3] local 172.31.1.1 port 44166 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   564 MBytes   473 Mbits/sec
[  3]  0.0-10.0 sec   553 MBytes   464 Mbits/sec
[SUM]  0.0-10.0 sec  1.09 GBytes   937 Mbits/sec
lithium:~# iperf -c 172.31.1.2 -P 3
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  5] local 172.31.1.1 port 44170 connected with 172.31.1.2 port 5001
[  4] local 172.31.1.1 port 44169 connected with 172.31.1.2 port 5001
[  3] local 172.31.1.1 port 44168 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   373 MBytes   313 Mbits/sec
[  3]  0.0-10.0 sec   374 MBytes   313 Mbits/sec
[  5]  0.0-10.0 sec   375 MBytes   314 Mbits/sec
[SUM]  0.0-10.0 sec  1.10 GBytes   940 Mbits/sec
lithium:~# iperf -c 172.31.1.2 -P 4
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  5] local 172.31.1.1 port 44173 connected with 172.31.1.2 port 5001
[  6] local 172.31.1.1 port 44174 connected with 172.31.1.2 port 5001
[  3] local 172.31.1.1 port 44171 connected with 172.31.1.2 port 5001
[  4] local 172.31.1.1 port 44172 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   281 MBytes   236 Mbits/sec
[  4]  0.0-10.0 sec   280 MBytes   235 Mbits/sec
[  5]  0.0-10.0 sec   280 MBytes   235 Mbits/sec
[  6]  0.0-10.0 sec   281 MBytes   236 Mbits/sec
[SUM]  0.0-10.0 sec  1.10 GBytes   941 Mbits/sec
lithium:~# iperf -c 172.31.1.2 -P 5
------------------------------------------------------------
Client connecting to 172.31.1.2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 172.31.1.1 port 44176 connected with 172.31.1.2 port 5001
[  5] local 172.31.1.1 port 44178 connected with 172.31.1.2 port 5001
[  4] local 172.31.1.1 port 44175 connected with 172.31.1.2 port 5001
[  6] local 172.31.1.1 port 44179 connected with 172.31.1.2 port 5001
[  7] local 172.31.1.1 port 44180 connected with 172.31.1.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   223 MBytes   187 Mbits/sec
[  4]  0.0-10.0 sec   225 MBytes   189 Mbits/sec
[  6]  0.0-10.0 sec   225 MBytes   188 Mbits/sec
[  7]  0.0-10.0 sec   224 MBytes   188 Mbits/sec
[  5]  0.0-10.0 sec   226 MBytes   189 Mbits/sec
[SUM]  0.0-10.0 sec  1.10 GBytes   941 Mbits/sec





next, meausure in the same setup with iperf3



Options Used


-B, --bind 
    bind to , an interface or multicast address

-s, --server
    run in server mode

-D, --daemon
    run the server as a daemon

-b, --bandwidth n[KM]
    set target bandwidth to n bits/sec (default 1 Mbit/sec).  This setting requires UDP (-u).

-u, --udp
    use UDP rather than TCP

-P, --parallel n
    number of parallel client threads to run







iperf