About technologies for your digital home

For beginners and tinkerers

LAN speed test

May 14th, 2014

Why would you need LAN speed test?

Usually one of the reasons, why you get interested in LAN speed test, is when something does not work in your LAN.

Just few examples of this:

  • streamed video gets choppy or freezes,
  • it looks like the LAN becomes sluggish for files transfer.

You may want to perform a LAN speed test before and after doing some of your home LAN upgrade. That would show if your investment improved LAN.

Another reason – if you are just curious about your brand new shinny wireless router performance and its match with the vendor’s description 😉

Whatever is the reason for LAN speed test, it is important first to understand how your LAN is built.

Understand all of your LAN components

In simplest case, you would have only one wireless router, which is connected to your Internet service provider (ISP). It sounds quite simple.

However, the situation is not always like this. Here is an example of my current home network:

Home-network

The main components of my home network:

Required tools

The command “iperf” on Linux will be used to perform LAN speed test, however you can download iperf for Windows and MacOS from iperf website.

You would need to install command iperf on two Linux boxes (e.g. Ubuntu server/desktop):

sudo apt-get install iperf

One Linux machine will serve as a iperf server during the LAN speed test, while another as iperf client.

You will have to issue such command on the machine A to setup iperf as a server:

iperf -s

The Linux machine will respond with the following response:

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------

The iperf is waiting on the machine A for the connections on TCP port 5001.

The next step is to setup Ubuntu machine B as a iperf client:

iperf -c 192.168.2.110 -d

Where IP 192.168.2.110 of Linux box which was setup as an iperf server.

After entering this command, I got the response:

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.2.110, TCP port 5001
TCP window size: 21.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.2.140 port 39703 connected with 192.168.2.110 port 5001
[ 5] local 192.168.2.140 port 5001 connected with 192.168.2.110 port 39640
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.4 sec 6.00 MBytes 4.83 Mbits/sec
[ 5] 0.0-10.5 sec 5.88 MBytes 4.71 Mbits/sec

When you finish the test, you can issue Ctrl-C to stop iperf.

LAN speed test results

So as you can see, there was only ~5Mbps speed between two Linux machines (Raspberry Pi and my NAS D-Link DNS-320L on my network. You may wonder why it is so slow.

There is explanation for this. You can see the PowerLine adapters  between both Linux boxes (see the diagram above). Those PowerLine adapters (older generation) are the bottle-neck in my home network. They are marked as 10/100Mbps compatible, however they are only inter-operable for this standard.

Just one last but not least detail. Your measured speed is for “raw” TCP protocol. That means that if you use e.g. Samba (additional packet headers etc.)  to transfer the files, the speed might be slower. Another reason could be because of the slow HDD speed etc.

Hope, this article will help you to perform your LAN  speed test 😉