Testing internal network speed with iperf3
I’ve been playing with different Ethernet network adapters to see if I can maximise the throughput to my Mac as my ethernet didn’t seem particularly faster than WiFi.
To test the speed, I want to use my internal network only as going onto the Internet will create too many variables. iperf3 is the solution for this.
Running the test
To run a speed test with iperf3, you need two computers: one to act as the server and one as the client.
Server
On my internal Linux server, that’s wired into my switch, I run:
iperf3 -s
The -s option puts iperf3 into server mode.
Client
On my Mac, I run:
iperf3 -c holland1 -f M
The parameters are:
- -c holland1: client mode, commenting to holland1 which is the name of the Linux server (it’s really quiet!)
- -f M: Format to print bandwidth numbers where M is MBytes/s
You could also add -R for reverse mode (server sends) to measure the download speed/bandwidth.
The output is:
$ iperf3 -c holland1 -f M Connecting to host holland1, port 5201 [ 7] local 192.168.220.206 port 60000 connected to 192.168.220.211 port 5201 [ ID] Interval Transfer Bitrate [ 7] 0.00-1.01 sec 107 MBytes 106 MBytes/sec [ 7] 1.01-2.00 sec 106 MBytes 106 MBytes/sec [ 7] 2.00-3.01 sec 107 MBytes 107 MBytes/sec [ 7] 3.01-4.00 sec 107 MBytes 107 MBytes/sec [ 7] 4.00-5.00 sec 106 MBytes 106 MBytes/sec [ 7] 5.00-6.00 sec 107 MBytes 107 MBytes/sec [ 7] 6.00-7.00 sec 107 MBytes 107 MBytes/sec [ 7] 7.00-8.01 sec 106 MBytes 106 MBytes/sec [ 7] 8.01-9.01 sec 108 MBytes 108 MBytes/sec [ 7] 9.01-10.00 sec 108 MBytes 108 MBytes/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 7] 0.00-10.00 sec 1.04 GBytes 107 MBytes/sec sender [ 7] 0.00-10.00 sec 1.04 GBytes 107 MBytes/sec receiver iperf Done.
This shows that I’m getting Gigabit Ethernet speeds as I hoped. Running in reverse mode showed essentially the same numbers.
For comparison, this is what I get with WiFi:
$ iperf3 -c holland1 -f M Connecting to host holland1, port 5201 [ 7] local 192.168.220.83 port 60308 connected to 192.168.220.211 port 5201 [ ID] Interval Transfer Bitrate [ 7] 0.00-1.00 sec 37.5 MBytes 37.5 MBytes/sec [ 7] 1.00-2.01 sec 32.6 MBytes 32.5 MBytes/sec [ 7] 2.01-3.01 sec 37.6 MBytes 37.6 MBytes/sec [ 7] 3.01-4.00 sec 36.1 MBytes 36.1 MBytes/sec [ 7] 4.00-5.01 sec 36.9 MBytes 36.9 MBytes/sec [ 7] 5.01-6.00 sec 32.9 MBytes 32.9 MBytes/sec [ 7] 6.00-7.01 sec 34.9 MBytes 34.7 MBytes/sec [ 7] 7.01-8.00 sec 32.0 MBytes 32.1 MBytes/sec [ 7] 8.00-9.00 sec 33.6 MBytes 33.8 MBytes/sec [ 7] 9.00-10.01 sec 33.1 MBytes 33.0 MBytes/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 7] 0.00-10.01 sec 347 MBytes 34.7 MBytes/sec sender [ 7] 0.00-10.03 sec 345 MBytes 34.4 MBytes/sec receiver iperf Done.
Decidedly slower!
Not all Ethernet adapters are equal on macOS
I started this testing because I was using a UNI USB-C hub with 1Gbps Ethernet that seemed a little slow.
Testing it I got:
[ ID] Interval Transfer Bitrate [ 7] 0.00-10.01 sec 490 MBytes 49.0 MBytes/sec sender [ 7] 0.00-10.01 sec 489 MBytes 48.8 MBytes/sec receiver
Better than the WiFi, but not 1Gbps.
I have now changed to a D-Link DUB-E250 USB-C to 2.5G Ethernet Adapter, which is giving the full 1Gbps as seen above.
Reading around the Internet, the UNI adapter is slow because it uses a Realtek RTL8153 chipset which doesn’t seem to be fully supported for 1 GbE by macOS in some way. The D-Link however uses the RTL8156 chipset, which is 2.5 GbE capable and fully supported by macOS.