This guide explains how you can determine the effective data-transfer rates between two devices on the same network. This can be useful when testing your home network for the first time, when troubleshooting specific bandwidth problems, or when trying to ascertain whether a given device (say, a NAS) is fast enough to do what you need it to do.
iperf is a free tool that measures how fast data is being transferred between two devices on the same network. iperf works seamlessly across different operating systems, so if you want, for example, to test how fast a Linux server transfers data to a Mac, you can do so with no problem — providing, that is, that you are using the same version of iperf on both machines.
For the purposes of this guide, we will use the latest version of iperf, which is iperf3.
To install iperf3 on Linux or Raspberry Pi, run:
sudo apt-get install iperf3
To install iperf3 on macOS, use Homebrew.
WAIT If you are using a Mac and have not yet installed Homebrew, please follow this guide and do so now before continuing.
To install iperf3 via Homebrew, run:
brew install iperf3
Decide which will be the server and which will be the client
iperf3 requires that one machine act as the “server” and the other act as the “client.” Simply put, the “server” will the be machine on which the sample files are hosted, and the “client” will be the machine that pulls those files across the network.
Bear in mind that, when you run the test, you will not solely be testing the speed of the network. The maximum speed of your network is, naturally, also the maximum speed you will see in the test results. But there are a host of other variables to consider, among them:
- How fast the network card in each machine is;
- How fast the processor and hard disk in each machine is;
- Whether one or both is connected to Wi-Fi, and, if so, how reliable that connection is
If you are trying to find out how fast your network connection is between two points, make sure to use two high-powered machines (say, two servers or MacBook Pros) whose maximum transfer speeds exceeds your network’s. If you are trying to find out how fast two specific devices can talk to each other on your network, make sure to run the test both ways (i.e. run the test twice, with each machine alternating between playing the server and the client). It is important to do this because some devices may be better at “pulling” data than “pushing” it, and vice-versa.
Set up one machine as the server
You should set up the “server” machine first. This is done exactly the same way on macOS, Linux, and Raspberry Pi. To set up a machine as an iperf3 server, simply run:
When you press
Enter, you should see the following output:
Server listening on 5201
NOTE If, for whatever reason, you need to change the port on which your server listens for iperf3 traffic, you can do so by adding a -p flag, followed by the port number. If, for example, you want the server to listen on port 49185, you’d run:
iperf3 -s -p 49185
Set up the other machine as the client
Next, you need to set up the “client” machine. This is done exactly the same way on macOS, Linux, and Raspberry Pi.
To do this, you will need to know the IP address of the machine you set up as the server. For the sake of this guide, let’s assume that the IP address of the machine you set up as the server is
To set up a machine as an iperf3 client, you run:
iperf3 -c followed by the IP address of the server.
Assuming that the IP address of the machine you set up as the server is
10.0.1.50, you’d run:
iperf3 -c 10.0.1.50
Read the results
When you press
Enter on the client machine, the test will start. By default, iperf3 will run ten consecutive one-second-long tests. When the tests are finished, you should see an output that looks like this (in this example, the client machine has the IP address
Connecting to host 10.0.1.50, port 5201
[ 5] local 10.0.1.60 port 60950 connected to 10.0.1.50 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 54.7 MBytes 458 Mbits/sec
[ 5] 1.00-2.00 sec 57.2 MBytes 480 Mbits/sec
[ 5] 2.00-3.00 sec 56.0 MBytes 469 Mbits/sec
[ 5] 3.00-4.00 sec 56.1 MBytes 471 Mbits/sec
[ 5] 4.00-5.00 sec 62.7 MBytes 527 Mbits/sec
[ 5] 5.00-6.00 sec 56.2 MBytes 471 Mbits/sec
[ 5] 6.00-7.00 sec 61.1 MBytes 512 Mbits/sec
[ 5] 7.00-8.00 sec 68.6 MBytes 577 Mbits/sec
[ 5] 8.00-9.00 sec 67.6 MBytes 566 Mbits/sec
[ 5] 9.00-10.00 sec 58.1 MBytes 487 Mbits/sec
– – – – – – – – – – – – – – – – – – – – – – – – –
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 598 MBytes 502 Mbits/sec sender
[ 5] 0.00-10.01 sec 598 MBytes 501 Mbits/sec receiver
The output above shows for how long each of the ten tests ran; how much data was transferred; and at what speed. The final line shows the total amount of data transferred, followed by the average speed over the ten seconds of tests.
Those who need more information than is given in this readout can find a full list of additional variables here.