Back to Topic:

Tags for this page:

Author:

Testing Wifi with netcat

Sat, Mar 4, 2017

I recently picked up a new 802.11ac wireless router because it was on sale. I’ve been on 802.11n for several years and really didn’t have any complaints, but it was a good deal and a chance to restructure my home network a bit.

Here’s a quick and dirty drawing of my network layout before and after done using GNU Dia (first time using this tool, so maybe not a great example):

Nothing special, but in the “after” config you can see that I have both wireless access points available, so I was curious to test throughput differences on AC vs. N. I went looking for a simple way to test throughput on a local network. I found this page that uses netcat and dd to push data across the network with some reporting on throughput.

While testing I tweaked the source of the data a bit and found some interesting results about the speed of 802.11AC vs N as well as AC vs /dev/urandom.

These tests were done by sending data from a linux PC that uses an Intel 7260 PCIe wireless adapter, over the air via the AC access point and subsequently the N router to a PC that’s connected via 1G ethernet to my N-wifi router/gateway.

On the receiving PC, setup netcat to listen on port 2112 (I kept this port from the link where I found this method… I dig Rush and 2112 holds a special place in this nerd’s heart).

$ nc -lk 2112 > /dev/null

OK, that’s it for the receiving end.

Now, like in the tuxtweaks article, on the sending end we’ll use dd to copy the contents of /dev/zero (pro-tip: it’s a bunch of zeros) and pipe it through netcat using the magic of wireless to the PC that’s listening elsewhere on the network:

These results were roughly typical, if a little on the low side… I was consistently seeing AC running ~35 MB/s and 5Ghz N running around ~9 MB/s.

I did start to wonder if there was any effect to throughput from sending only a long stream of zeros, so I decided to use /dev/urandom as the source of my data and that led to something amusing. Piping /dev/urandom over the 5GHz N stayed about 9 MB/s. However, with AC my throughput dropped off to around 19 or 20 MB/s from ~35 MB/s.