Measure real network speed (between two machines)

Sometimes you want to measure the real network speed between two machines without the interference of possibly slow storage device reading speeds. The following two tools will help you with that.

1. Using preinstalled `netcat`
2. Using installable `iperf`

Using preinstalled netcat

On Linux/Ubuntu you can use netcat for that:

  1. On one machine open a data sink:
    nc -v -l PORT > /dev/null
  2. On the other machine send some data:
    dd if=/dev/zero bs=1M count=10 | nc -v HOST PORT
  3. Results will be displayed on the senders side.

Example results:

[18:11] pguth@pc ~ $ dd if=/dev/zero bs=1M count=10 | nc -v proxy 1234
Ncat: Version 6.47 ( )  
Ncat: Connected to  
10+0 records in  
10+0 records out  
10485760 bytes (10 MB) copied, 5.12357 s, 2.0 MB/s  
Ncat: 10485760 bytes sent, 0 bytes received in 5.19 seconds.  

Using installable iperf

On Linux/Ubuntu you can get iperf from the default repositories:

  1. On both machines install iperf:
    sudo apt-get install iperf
  2. Make one machine play server:
    iperf -s
  3. On the other machine start the measurement:
    iperf -c HOST
  4. Results will be presented on both sides.

Example results:

[18:21] pguth@pc ~ $ iperf -c proxy
Client connecting to proxy, TCP port 5001  
TCP window size: 85.0 KByte (default)  
[  3] local port 57176 connected with port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.1 sec  21.1 MBytes  17.6 Mbits/sec

- Measuring Network Speeds with Netcat and Dd
- Getting Gigabit Networking on a Raspberry Pi 2 and B+