When I want to test the data rates of networks I connect my PC to, I usually use wget to run a large file download from a public server to /dev/null. In the uplink I use an FTP server on the other side to push a file with randomized content. But actually, that is rather crude as there is a convenient tool available: iperf3
Iperf3 does not read and write to files, which is good if one is more interested in raw data rates and less if it is also important to find out if a device would actually be able to read and write data to a storage device at line speed. For this purpose, wget and curl probably do a better job.
There are a number of well connected public iperf3 servers on the net that can be used as source or sink for data streams with iperf3 in client mode on a local device. Running a downlink speed test can be done with the following command:
iperf3 -c ping-ams1.online.net -R -p 5206
This gives one the maximum downlink speed between the server and the location of the device from which the command is run. Vary the port number in case the server returns a message that it is busy.
When leaving out the -R command, the client transmits data to the server in the uplink direction as fast as it can. Perfect to test uplink speeds which are often much slower in DSL, cable and even fiber connections at home. Here’s the command:
iperf3 -c ping-ams1.online.net -p 5206
This made me think a little bit about how fast the server I run this blog on at a data center in Germany is connected and can be reached. In theory the virtual machine is connected with a 1 Gbit/s link. But how much of that is actually usable and is there another bottleneck in the data center? So since my virtual server subscription includes 10 TB of data traffic per month, of which I only use a few gigabytesfor this blog, there is ample capacity for some super high speed iperf3 tests.
And here are the results which I think are rather impressive:
DOWNLINK ========= # iperf3 -c bouygues.iperf.fr -R -p 5203 Connecting to host bouygues.iperf.fr, port 5203 Reverse mode, remote host bouygues.iperf.fr is sending [ 4] local 126.96.36.199 port 58990 connected to 188.8.131.52 port 5203 [ ID] Interval Transfer Bandwidth [ 4] 0.00-1.00 sec 44.2 MBytes 371 Mbits/sec [ 4] 1.00-2.00 sec 58.3 MBytes 489 Mbits/sec [ 4] 2.00-3.00 sec 63.1 MBytes 530 Mbits/sec [...] [ 4] 8.00-9.00 sec 66.7 MBytes 559 Mbits/sec [ 4] 9.00-10.00 sec 71.4 MBytes 599 Mbits/sec [ 4] 10.00-11.00 sec 76.2 MBytes 639 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth [ 4] 0.00-11.17 sec 0.00 Bytes 0.00 bits/sec sender [ 4] 0.00-11.17 sec 721 MBytes 541 Mbits/sec receiver UPLINK ====== # iperf3 -c bouygues.iperf.fr -p 5203 Connecting to host bouygues.iperf.fr, port 5203 [ 4] local 184.108.40.206 port 58994 connected to 220.127.116.11 port 5203 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 92.0 MBytes 771 Mbits/sec 6 7.70 MBytes [ 4] 1.00-2.00 sec 114 MBytes 956 Mbits/sec 0 7.88 MBytes [...] [ 4] 5.00-6.00 sec 115 MBytes 966 Mbits/sec 0 7.88 MBytes [ 4] 6.00-7.00 sec 115 MBytes 966 Mbits/sec 0 7.88 MBytes [ 4] 7.00-7.52 sec 59.8 MBytes 971 Mbits/sec 0 7.88 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ 4] 0.00-7.52 sec 840 MBytes 938 Mbits/sec 6 sender
That makes the 285 Mbit/s downlink and 42 Mbit/s uplink of my fiber link at home in Paris look rather slow. But o.k., my home is not a data center, despite what some people might say.