Wednesday, November 25, 2015

Quick and Easy Linux Internal Network Speedtest

I found a quick and easy way to setup a way to test network speed on my internal network using the linux command line tool netcat (or nc), I used this for node to node testing of my wireless network under a variety of conditions. It required no extra tools or software to be installed on my Ubuntu linux machines. It gives me transmit speeds I can understand and easily allows me to size the payload to the type of network I'm testing.

Put the first machine in listening mode (this example machine
nc -lk 2112 >/dev/null

Put the second machine in transmit mode to send packets to first machine
dd if=/dev/zero bs=16000 count=6250 | nc -v 2112

The first part of the command tells the machine to copy 100 MB of data from /dev/zero in 16 KB blocks. The part after the pipe tells it to send that to the first machine ( over port 2112.

The output for this test on the second machine returns:

Connection to 2112 port [tcp/*] succeeded! 
6250+0 records in 
6250+0 records out 
100000000 bytes (100 MB) copied, 8.38876 s, 11.9 MB/s

Essentially we sent 100MB of data from one machine to the other at a speed of 11.9 MB/second.

When done with the tests, end the listening mode on the first machine by pressing CTRL-C.

Hope this helps you out I thought it was really cool and addapted ewhat I found at this link: