Test Network Bandwidth Between Devices with iPerf3
iPerf3 is a command-line tool for measuring network performance between two computers. Running a test can be done by starting the iPerf3 server on one device with iperf3 -s
and then connecting with the client from another device iperf3 -c {server-ip-or-host}
.
# First device - start server
iperf3 -s
# Second device - connect with client
iperf3 -c {server-ip-or-host}
# Client output
Connecting to host 100.119.22.54, port 5201
[ 5] local 100.120.170.40 port 37072 connected to 100.119.22.54 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 1.88 MBytes 15.7 Mbits/sec 0 223 KBytes
[ 5] 1.00-2.00 sec 2.48 MBytes 20.8 Mbits/sec 15 218 KBytes
[ 5] 2.00-3.00 sec 2.17 MBytes 18.2 Mbits/sec 0 255 KBytes
[ 5] 3.00-4.00 sec 2.17 MBytes 18.2 Mbits/sec 0 284 KBytes
[ 5] 4.00-5.00 sec 2.17 MBytes 18.2 Mbits/sec 19 215 KBytes
[ 5] 5.00-6.00 sec 1.74 MBytes 14.6 Mbits/sec 0 235 KBytes
[ 5] 6.00-7.00 sec 2.17 MBytes 18.2 Mbits/sec 0 246 KBytes
[ 5] 7.00-8.00 sec 2.17 MBytes 18.2 Mbits/sec 0 251 KBytes
[ 5] 8.00-9.00 sec 2.17 MBytes 18.2 Mbits/sec 0 251 KBytes
[ 5] 9.00-10.00 sec 1.86 MBytes 15.6 Mbits/sec 15 191 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 21.0 MBytes 17.6 Mbits/sec 49 sender
[ 5] 0.00-10.09 sec 20.5 MBytes 17.0 Mbits/sec receiver
Installing iPerf3
You can install iPerf3 on just about any device. See the home page for instructions for different operating systems or where to download the binary. In a nutshell, you can install iPerf3 with:
# Arch
pacman -S iperf3
# Debian/Ubuntu
sudo apt-get install iperf3
# Fedora
sudo dnf install iperf3
# Chocolatey
choco install iperf3
# Scoop
scoop install iperf3
# Brew
brew install iperf3
You can also clone the GitHub repo and build it directly. Alternative there is also a docker image available to use.
How iPerf3 works
iPerf3 works as a client/server application, so you need to install it on at least two devices.
- One device will act as the server and the other device will act as the client.
- The server will wait for a client to connect to it
- Once the client connects, the client will begin sending data to the server
This means the device that acts as the client using the -c
flag will be the one transmitting data to the server. If you want to reverse the test so the client receives data from the server, you can use the -R
or --reverse
flag
Using iPerf3
Test upload speed to server
# Server
iperf3 -s
# Client
iperf3 -c {server-ip-or-host}
Test download speed from server
Use the -R
or --reverse
flag
# Server
iperf3 -s
# Client
iperf3 -R -c {server-ip-or-host}
Test upload & download simultaneously
Use the --bidir
flag to do a bidirectional test
# Server
iperf3 -s
# Client
iperf3 --bidir -c {server-ip-or-host}
Other useful flags
-p
or--port
- Specify the port to use-i
or--interval
- Specify the interval to report bandwidth usage-f
or--format
- Specify the format to use for reporting bandwidth usage (Kbits, Mbits, Gbits, Tbits)-j
or--json
- Output the results in JSON format-V
or--verbose
- Output more verbose information
Client specific options
-t
or--time
- Specify the time to run the test for
Server specific options
-D
or--daemon
- Run the server as a daemon
References
Comments