iperf is a command line tool for performing real-time network throughput measurements. It is a powerful tool for testing the maximum achievable bandwidth in an IP network.
-s run in server mode
-p port to listen n (default 5001)
-f traffic format to report
K KBytes M Mbytes G Gbytes
iperf -s -p 5111 -f K
------------------------------------------------------------
Server listening on TCP port 5111 TCP window size: 85.3 KByte (default)
------------------------------------------------------------
Next, connect to the device which you will use as the client and issue the iperf command with the following parameters.
-c connect to the specified server
-p port to connect to n (default 5001)
-f traffic format to report
K KBytes M Mbytes G Gbytes
iperf -c 172.30.6.110 -p 5111 -f K
------------------------------------------------------------
Client connecting to 172.30.6.110, TCP port 5111 TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.199.138 port 51840 connected with 172.30.6.110 port 5111
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.1 sec 5248 KBytes 519 KBytes/sec
iperf -c 172.30.6.110 -p 5111 -f K -R
iperf UDP mode allows you to test the maximum possible throughput of your connection. This can be useful when troubleshooting networking issues or when you are trying to optimize your network’s performance.
iperf -s -p 5111 -f K -u
------------------------------------------------------------
Server listening on UDP port 5111
Receiving 1470 byte datagrams
UDP buffer size: 41.1 KByte (default)
------------------------------------------------------------
[ 3] local 172.30.6.1 port 5111 connected with 172.30.6.101 port 36141
------------------------------------------------------------
iperf -c 172.30.6.1 -p 5111 -f K -f -u
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] local 172.30.6.1 port 5111 connected with 172.30.6.101 port 34011
[ 3] 0.0- 9.9 sec 1282 KBytes 130 KBytes/sec 8.960 ms