Iperf measures the bandwidth and quality of a network link. This tool is delimited by two machines on which Iperf is installed.

Introduction

The quality of a link is determined primarily by the following factors:
– Latency (response time or RTT): can be measured using a ping.
– The variation of latency (jitter): can be measured by an Iperf UDP test.
– Loss of packet: can be measured with an Iperf UDP test.

The bandwidth can be measured by TCP tests between two points of the network, a server on one side and a client on the other side.
The measured bandwidth will correspond to the weakest link.

Download Iperf from officieal website for your OS : https://iperf.fr/fr/iperf-download.php (version 3 is better)

Par défaut, le client Iperf se connecte au serveur Iperf sur le port TCP 5001 (vérifier les ouvertures Firewall) et la bande passante affichée par Iperf est celle du client au serveur (donc upload depuis le client, pour tester le download il faut inverser les rôles des machines).


Bandwith TCP test

On the client side, you need to use this command :

iperf -c 10.1.1.1
------------------------------------------------------------ 
Client connecting to 10.1.1.1, TCP port 5001 
TCP window size: 16384 Byte (default) 
------------------------------------------------------------ 
[ 3] local 10.6.2.5 port 33453 connected with 10.1.1.1 port 5001 
[ 3]   0.0-10.2 sec   1.26 MBytes   1.05 Mbits/sec 

And on server side :

------------------------------------------------------------ 
Server listening on TCP port 5001 
TCP window size: 8.00 KByte (default) 
------------------------------------------------------------ 
[852] local 10.1.1.1 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 

Bandwith UDP test

On the client side, you need to use this command like (iperf -c IP_Address -u -b Bandwith) :

iperf -c 10.1.1.1 -u -b 10M
------------------------------------------------------------ 
Client connecting to 10.1.1.1, UDP port 5001 
Sending 1470 byte datagrams 
UDP buffer size: 108 KByte (default) 
------------------------------------------------------------ 
[ 3] local 10.6.2.5 port 32781 connected with 10.1.1.1 port 5001 
[ 3]   0.0-10.0 sec   11.8 MBytes   9.89 Mbits/sec 
[ 3] Sent 8409 datagrams 
[ 3] Server Report: 
[ 3]   0.0-10.0 sec   11.8 MBytes   9.86 Mbits/sec   2.617 ms   9/ 8409   (0.11%)

And on server side :

iperf -s -u -i 1
------------------------------------------------------------ 
Server listening on UDP port 5001 
Receiving 1470 byte datagrams 
UDP buffer size: 8.00 KByte (default) 
------------------------------------------------------------ 
[904] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 32781 
[ ID]   Interval         Transfer        Bandwidth         Jitter        Lost/Total Datagrams 
[904]   0.0- 1.0 sec   1.17 MBytes   9.84 Mbits/sec   1.830 ms   0/ 837   (0%) 
[904]   1.0- 2.0 sec   1.18 MBytes   9.94 Mbits/sec   1.846 ms   5/ 850   (0.59%) 
[904]   2.0- 3.0 sec   1.19 MBytes   9.98 Mbits/sec   1.802 ms   2/ 851   (0.24%) 
[904]   3.0- 4.0 sec   1.19 MBytes   10.0 Mbits/sec   1.830 ms   0/ 850   (0%) 
[904]   4.0- 5.0 sec   1.19 MBytes   9.98 Mbits/sec   1.846 ms   1/ 850   (0.12%) 
[904]   5.0- 6.0 sec   1.19 MBytes   10.0 Mbits/sec   1.806 ms   0/ 851   (0%) 
[904]   6.0- 7.0 sec   1.06 MBytes   8.87 Mbits/sec   1.803 ms   1/ 755   (0.13%)