Home Network: Measuring Connection Speed

It can be tedious to find out at which point in your network infrastructure there are bandwidth bottlenecks. Even if you have Gigabit ethernet connections everywhere, sometimes the devices just do not connect with the right settings. This is getting even more complicated whenever you bridge to wireless connections.

Ethernet Network (cable connections)

Turris Omnia Tests

Let’s start with the central system in the environment: the router.

The router will have at least two interfaces

  • one interface (depending on the internet provider this can be a ethernet port / DSL modem / Cable Port ) which connects to the infrastructure of your internet provider
  • one or more ethernet ports which connect to your local network
  • WLAN (2.4 and/or 5 GHz)

I use the Turris Omnia router for the discussion.

  • Internet Access is provided by connecting eth1 to an ethernet port of a cable modem
  • The home network is connected using Gigabit Switch to eth0

First we check the connection speed of the individual ports:

root@turris:~# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]

Supported link modes:   10baseT/Half   10baseT/Full 
                        100baseT/Half  100baseT/Full 
                        1000baseT/Half 1000baseT/Full 

Supported pause frame use: No
Supports auto-negotiation: Yes

Advertised link modes:  10baseT/Half   10baseT/Full 
                        100baseT/Half  100baseT/Full 
                        1000baseT/Half 1000baseT/Full 

Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes:  10baseT/Half  10baseT/Full 
                                     100baseT/Half 100baseT/Full 
                                     1000baseT/Full 

Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes

Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Link detected: yes

So this looks as expected – 1000Mb/s Full Duplex.

root@turris:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes:   1000baseT/Half 1000baseT/Full 
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes:  1000baseT/Half 1000baseT/Full 
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes:  1000baseT/Full 
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: No

Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: external
Auto-negotiation: on
Link detected: yes

This looks also as expected – 1000Mb/s Full Duplex.

Now let’s check if we see the expected connection speed to devices in the home network.

iperf3

I measure the throughput using the tool iperf3. You can install iperf3 directly from the repositories of Turris Omnia. GNU/Linux distributions normally contain a iperf3 package. Else you can have look at the iperf3 homepage  to download precompiled executables for your operating system.

On Mac OS Devices I used the installation via  Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install iperf3

Let’s test the internet connection speed using a public iperf3 server. I have a cable modem from Vodafone providing 200MBit/s download and 12MBit/s upload speed.

Internet download speed test:

root@turris:~# iperf3 -c iperf.volia.net -R -P 10
Connecting to host iperf.volia.net, port 5201
Reverse mode, remote host iperf.volia.net is sending
...
[SUM]   0.00-10.00  sec   234 MBytes   196 Mbits/sec  296             sender
[SUM]   0.00-10.00  sec   216 MBytes   181 Mbits/sec                  receiver

The download speed is in line with the expectation.

Internet upload speed test:

root@turris:~# iperf3 -c iperf.volia.net  -P 10 
Connecting to host iperf.volia.net, port 5201
...
[SUM]   0.00-10.00  sec  14.1 MBytes  11.9 Mbits/sec  446             sender
[SUM]   0.00-10.00  sec  13.5 MBytes  11.3 Mbits/sec                  receiver

The upload speed is in line with the expectation.

Home network test:

The next test is in between two devices connected to the Gigabit Ethernet switch. I have installed iperf3 on a new QNAP TS451A NAS and will run the test on the Turris Omnia.

root@turris:~# iperf3 -c ts451a -P 10
Connecting to host ts451a, port 5201
...
[SUM]   0.00-10.01  sec  1.10 GBytes   946 Mbits/sec  775             sender
[SUM]   0.00-10.01  sec  1.10 GBytes   946 Mbits/sec                  receiver

root@turris:~# iperf3 -c ts451a -P 10 -R
Connecting to host ts451a, port 5201
Reverse mode, remote host ts451a is sending
...
[SUM]   0.00-10.00  sec  1.10 GBytes   946 Mbits/sec   51             sender
[SUM]   0.00-10.00  sec  1.07 GBytes   922 Mbits/sec                  receiver

The bandwidth between the devices connected to the Gigabit Switch is symmetrical and as expected.

Turris Omnia routing test:

The last test is now at which speed the Turris Omnia can route internet traffic via NAT to the internet.

root@TS451A # ./iperf3 -c iperf.volia.net  -P 10 
Connecting to host iperf.volia.net, port 5201
...
[SUM]   0.00-10.00  sec  15.7 MBytes  13.2 Mbits/sec  694             sender
[SUM]   0.00-10.00  sec  13.7 MBytes  11.5 Mbits/sec                  receiver
root@TS451A # ./iperf3 -c iperf.volia.net -P 10 -R  
Connecting to host iperf.volia.net, port 5201 
Reverse mode, remote host iperf.volia.net is sending 
... 
[SUM]   0.00-10.00  sec   235 MBytes   197 Mbits/sec  171             sender 
[SUM]   0.00-10.00  sec   220 MBytes   184 Mbits/sec                  receiver

Perfect – no difference between the iperf3 test started on the Turris Omnia itself an the test started on the TS451A with Turris Omnia doing all the NAT!

Now we check the Turris Omnia CPU utilisation during the test:

Mem: 1561444K used, 509436K free, 61820K shrd, 28K buff, 1060880K cached
CPU:   6% usr   3% sys   0% nic  64% idle   0% io   0% irq  25% sirq

The time spent handling interrupts ’sirq’ shows that the router should be able to route up to 4 times more data at the same time.

WLAN connections

With iperf3 running in server mode on the TS451A the WLAN speed can be tested in the Home Network reliably. Adding a test to a public iperf server like perf.volia.net is very good for testing the end-to-end internet connection speed.

For the tests I use iperf3 on a MacBook Pro. Two meters away from a FritzBox (which is connected via Gigabit to the Turris Omnia) I get following results connecting to the 5GHz Band:

This is what the access point tells me about my WLAN connection

WLAN-Network    (5 GHz)
Signal Strength -54 dBm
300 / 300 Mbit/s
actual Speed    300 / 117 Mbit/s
WLAN-n+a
5 GHz
Channel         3
40 MHz
Security       WPA2
2 x 2

Starting iperf3 from MacBook Pro:

perf.voila.net: 143 Mbits/sec download,  12 MBit/s upload
TS451A:         180 Mbits/sec download, 140 MBit/s upload

Starting iperf3 from Turris Omnia to set the baseline:

perf.voila.net: 193 Mbits/sec download,  12 MBit/s upload
TS451A:         916 Mbits/sec download, 930 MBit/s upload

So even with a 5 GHz WLAN 802.11n connection I am not able to benefit from the full download bandwidth of my internet connection – but probably I will never notice 🙂

With this test methodology different access points can be tested using different WLAN bands from different places in the home. To optimise the coverage and the speed the position of the Access Point, the directions of the antennas and the WLAN channels can be varied. This is going way beyond this blog.

My experience is that WLAN connection in cities are always a tricky thing. sometimes you get a very good connection to your access point and then a router of a neighbour changes it’s WLAN channels and your connection get bad. So you have to adjust again your setup.

Therefore my advice is to connect as many devices as possible using cables instead of relying on WLAN connections if you are in an agile environment where many WLAN access points fight for the few channels available.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.