sfx2000
Part of the Furniture
Old stuff - but a goodie - wiki markup here...
====== Iperf3 ======
While Ookla (speedtest.net) is a great resource when out on public networks, I'd recommend having something on your LAN for more consistent and thorough results.
Multi-platform support is key for a tool like this.
We've already outlined how to install Speedtest-Mini on the server, but let's dig a bit deeper with iperf3
Here is a brief step-by-step on how to set up the server (ubuntu) and clients (Android,iOS,OSX,Windows,Linux).
**Installing iPerf3**
Ubuntu 16.04LTS
sudo apt install iperf3
on Macs - using Homebrew
brew install iperf3
Windows - download the compiled version for windows at http://iperf.fr
IOS - Included as part of the free he.net app from the iOS app store
Android - Check GooglePlay for apps there
Once installed, verify you've got the correct version with "iperf3 -v". It should output the following, you want to ensure that your client/server are the same version (or close to it):
$ iperf3 -v
iperf 3.0.11
If you're familiar with iperf2, many of the command-line switches are the same. For a list of the different options, just run iperf3 without any switches.
Run IPerf3 in server mode with:
$ iperf3 -s
All CLI clients can be run in "client" or "server" mode. For a quick test from Windows, OSX or Linux CLI run:
iperf3 -c <server_ip>
For example;
<code>
$ iperf3 -c 192.168.1.20
Connecting to host 192.168.1.20, port 5201
[ 4] local 192.168.1.100 port 53868 connected to 192.168.1.20 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 112 MBytes 943 Mbits/sec
[ 4] 1.00-2.00 sec 112 MBytes 940 Mbits/sec
[ 4] 2.00-3.00 sec 112 MBytes 941 Mbits/sec
[ 4] 3.00-4.00 sec 111 MBytes 931 Mbits/sec
[ 4] 4.00-5.00 sec 112 MBytes 941 Mbits/sec
[ 4] 5.00-6.00 sec 112 MBytes 940 Mbits/sec
[ 4] 6.00-7.00 sec 112 MBytes 940 Mbits/sec
[ 4] 7.00-8.00 sec 112 MBytes 940 Mbits/sec
[ 4] 8.00-9.00 sec 112 MBytes 940 Mbits/sec
[ 4] 9.00-10.00 sec 112 MBytes 940 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-10.00 sec 1.09 GBytes 940 Mbits/sec sender
[ 4] 0.00-10.00 sec 1.09 GBytes 939 Mbits/sec receiver
iperf Done.
</code>
You can see the results on stdout (ie on your terminal), at 1 second intervals ("-i" option). Again, to see the different options available just run iperf3 wihtout any switches.
===== Features =====
Some features I like about iperf3:
the server will, by default, only run a test with a single client at a time. If you try to run two tests simultaneously, you'll see a message like the following:
error: The server is busy running a test. try again later.
Another example, using a "reverse" test (from server to client):
iperf3 -c <server_ip> -i1 -R
This can be really useful when testing WiFi and VPN. This was not possible with speedtest-mini. Having asymmetric throughput issues could tell you a lot.
===== Getting more from from iPerf3 =====
Test for 5 seconds and use TCP - TCP is the default for iPerf
iperf3 -c <server_ip> -t 5
Don't include the first 2 seconds in the BW calculator to allow TCP slow start to finish
iperf3 -c <server_ip> -O 2
Label the test - This is useful when testing in several different rooms or to compare a 2.4Ghz connection to a 5Ghz connection
iperf3 -c <server_ip> -T 2.4GHz
Test using more than one stream -- Use 5 parallel streams - I have found this to be a good number to use
iperf3 -c <server_ip> -P 5 -T 2.4GHz
Reverse the test direction - This is useful when you are testing a VPN connection and have an asymmetric connection - 10Mbps download and 2Mbps Upload for example. You can run the test in each direction to verify.
iperf3 -c <server_ip> -P 5 -T VPNtoServer
iperf3 -c <server_ip> -P 5 -R -T VPNfromServer
Test using UDP
iperf3 -c <server_ip> -u
===== Install iperf3 as a service =====
After installing iperf3 from apt
Create a user iperf which will be used to run the iperf3 service.
$ sudo useradd iperf -s /sbin/nologin
Create the following file:
sudo nano /etc/systemd/system/iperf3.service
Put in the following contents and save the file:
<code>
[Unit]
Description=iperf3 Service
After=network.target
[Service]
Type=simple
User=iperf
ExecStart=/usr/bin/iperf3 -s
Restart=on-abort
[Install]
WantedBy=multi-user.target
</code>
Done.
Start the iperf3 service:
$ sudo systemctl start iperf3
Check the status:
$ sudo systemctl status iperf3
Should get something like below;
<code>
iperf3.service - iperf3 Service
Loaded: loaded (/etc/systemd/system/iperf3.service; disabled)
Active: active (running) since Mon 2014-12-08 13:43:49 EST; 18s ago
Main PID: 32657 (iperf3)
CGroup: /system.slice/iperf3.service
└─32657 /usr/bin/iperf3 -s
Dec 08 13:43:49 testbox systemd[1]: Started iperf3 Service.
</code>
Stop the iperf3 service:
$ sudo systemctl stop iperf3
Start the service at boot:
$ sudo systemctl enable iperf3
Disable the service at boot:
$ sudo systemctl disable iperf3
===== More Info =====
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf-and-iperf3/
Public iperf3 servers - https://iperf.fr/iperf-servers.php
====== Iperf3 ======
While Ookla (speedtest.net) is a great resource when out on public networks, I'd recommend having something on your LAN for more consistent and thorough results.
Multi-platform support is key for a tool like this.
We've already outlined how to install Speedtest-Mini on the server, but let's dig a bit deeper with iperf3
Here is a brief step-by-step on how to set up the server (ubuntu) and clients (Android,iOS,OSX,Windows,Linux).
**Installing iPerf3**
Ubuntu 16.04LTS
sudo apt install iperf3
on Macs - using Homebrew
brew install iperf3
Windows - download the compiled version for windows at http://iperf.fr
IOS - Included as part of the free he.net app from the iOS app store
Android - Check GooglePlay for apps there
Once installed, verify you've got the correct version with "iperf3 -v". It should output the following, you want to ensure that your client/server are the same version (or close to it):
$ iperf3 -v
iperf 3.0.11
If you're familiar with iperf2, many of the command-line switches are the same. For a list of the different options, just run iperf3 without any switches.
Run IPerf3 in server mode with:
$ iperf3 -s
All CLI clients can be run in "client" or "server" mode. For a quick test from Windows, OSX or Linux CLI run:
iperf3 -c <server_ip>
For example;
<code>
$ iperf3 -c 192.168.1.20
Connecting to host 192.168.1.20, port 5201
[ 4] local 192.168.1.100 port 53868 connected to 192.168.1.20 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 112 MBytes 943 Mbits/sec
[ 4] 1.00-2.00 sec 112 MBytes 940 Mbits/sec
[ 4] 2.00-3.00 sec 112 MBytes 941 Mbits/sec
[ 4] 3.00-4.00 sec 111 MBytes 931 Mbits/sec
[ 4] 4.00-5.00 sec 112 MBytes 941 Mbits/sec
[ 4] 5.00-6.00 sec 112 MBytes 940 Mbits/sec
[ 4] 6.00-7.00 sec 112 MBytes 940 Mbits/sec
[ 4] 7.00-8.00 sec 112 MBytes 940 Mbits/sec
[ 4] 8.00-9.00 sec 112 MBytes 940 Mbits/sec
[ 4] 9.00-10.00 sec 112 MBytes 940 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-10.00 sec 1.09 GBytes 940 Mbits/sec sender
[ 4] 0.00-10.00 sec 1.09 GBytes 939 Mbits/sec receiver
iperf Done.
</code>
You can see the results on stdout (ie on your terminal), at 1 second intervals ("-i" option). Again, to see the different options available just run iperf3 wihtout any switches.
===== Features =====
Some features I like about iperf3:
the server will, by default, only run a test with a single client at a time. If you try to run two tests simultaneously, you'll see a message like the following:
error: The server is busy running a test. try again later.
Another example, using a "reverse" test (from server to client):
iperf3 -c <server_ip> -i1 -R
This can be really useful when testing WiFi and VPN. This was not possible with speedtest-mini. Having asymmetric throughput issues could tell you a lot.
===== Getting more from from iPerf3 =====
Test for 5 seconds and use TCP - TCP is the default for iPerf
iperf3 -c <server_ip> -t 5
Don't include the first 2 seconds in the BW calculator to allow TCP slow start to finish
iperf3 -c <server_ip> -O 2
Label the test - This is useful when testing in several different rooms or to compare a 2.4Ghz connection to a 5Ghz connection
iperf3 -c <server_ip> -T 2.4GHz
Test using more than one stream -- Use 5 parallel streams - I have found this to be a good number to use
iperf3 -c <server_ip> -P 5 -T 2.4GHz
Reverse the test direction - This is useful when you are testing a VPN connection and have an asymmetric connection - 10Mbps download and 2Mbps Upload for example. You can run the test in each direction to verify.
iperf3 -c <server_ip> -P 5 -T VPNtoServer
iperf3 -c <server_ip> -P 5 -R -T VPNfromServer
Test using UDP
iperf3 -c <server_ip> -u
===== Install iperf3 as a service =====
After installing iperf3 from apt
Create a user iperf which will be used to run the iperf3 service.
$ sudo useradd iperf -s /sbin/nologin
Create the following file:
sudo nano /etc/systemd/system/iperf3.service
Put in the following contents and save the file:
<code>
[Unit]
Description=iperf3 Service
After=network.target
[Service]
Type=simple
User=iperf
ExecStart=/usr/bin/iperf3 -s
Restart=on-abort
[Install]
WantedBy=multi-user.target
</code>
Done.
Start the iperf3 service:
$ sudo systemctl start iperf3
Check the status:
$ sudo systemctl status iperf3
Should get something like below;
<code>
iperf3.service - iperf3 Service
Loaded: loaded (/etc/systemd/system/iperf3.service; disabled)
Active: active (running) since Mon 2014-12-08 13:43:49 EST; 18s ago
Main PID: 32657 (iperf3)
CGroup: /system.slice/iperf3.service
└─32657 /usr/bin/iperf3 -s
Dec 08 13:43:49 testbox systemd[1]: Started iperf3 Service.
</code>
Stop the iperf3 service:
$ sudo systemctl stop iperf3
Start the service at boot:
$ sudo systemctl enable iperf3
Disable the service at boot:
$ sudo systemctl disable iperf3
===== More Info =====
https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf-and-iperf3/
Public iperf3 servers - https://iperf.fr/iperf-servers.php