Raspberry pi 4 as broadband router

Posted on Fri 21 February 2020 in linux

A few years ago, I already considered using a Raspberry Pi as a broadband router. Back then, its first generation wasn't fast enough. This changed with the 4th generation of the Raspberry pi.

The test setup was similar to the setup I use previously:

  • Two beefy laptops on the ends
  • A VLAN-capable switch to connect everything
  • The Raspberry pi "on a stick" to route traffic from one VLAN to the other

I was happy with the results. Ping latency was 0.834 ±0.075 ms.

$ iperf -c 192.168.23.231 -p 5001 -t 60 -i 5
------------------------------------------------------------
Client connecting to 192.168.23.231, TCP port 5001
TCP window size:  289 KByte (default)
------------------------------------------------------------
[  4] local 192.168.10.20 port 60887 connected with 192.168.23.231 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 5.0 sec   510 MBytes   855 Mbits/sec
[  4]  5.0-10.0 sec   514 MBytes   862 Mbits/sec
[  4] 10.0-15.0 sec   513 MBytes   860 Mbits/sec
[  4] 15.0-20.0 sec   512 MBytes   860 Mbits/sec
[  4] 20.0-25.0 sec   513 MBytes   860 Mbits/sec
[  4] 25.0-30.0 sec   514 MBytes   862 Mbits/sec
[  4] 30.0-35.0 sec   516 MBytes   866 Mbits/sec
[  4] 35.0-40.0 sec   515 MBytes   864 Mbits/sec
[  4] 40.0-45.0 sec   514 MBytes   863 Mbits/sec
[  4] 45.0-50.0 sec   506 MBytes   849 Mbits/sec
[  4] 50.0-55.0 sec   498 MBytes   835 Mbits/sec
[  4] 55.0-60.0 sec   506 MBytes   849 Mbits/sec
[  4]  0.0-60.0 sec  5.99 GBytes   857 Mbits/sec

The bidirectional flows performed worse, as expected. But I had expected a bit better results:

$ iperf -c 192.168.23.231 -d -p 5001 -t 60 -i 5
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: -1.00 Byte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 192.168.23.231, TCP port 5001
TCP window size:  273 KByte (default)
------------------------------------------------------------
[  5] local 192.168.10.20 port 60891 connected with 192.168.23.231 port 5001
[  6] local 192.168.10.20 port 5001 connected with 192.168.23.231 port 36352
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0- 5.0 sec  82.2 MBytes   138 Mbits/sec
[  6]  0.0- 5.0 sec   187 MBytes   313 Mbits/sec
[  5]  5.0-10.0 sec  71.4 MBytes   120 Mbits/sec
[  6]  5.0-10.0 sec   163 MBytes   273 Mbits/sec
[  5] 10.0-15.0 sec  75.8 MBytes   127 Mbits/sec
[  6] 10.0-15.0 sec   177 MBytes   296 Mbits/sec
[  6] 15.0-20.0 sec   177 MBytes   297 Mbits/sec
[  5] 15.0-20.0 sec  79.6 MBytes   134 Mbits/sec
[  5] 20.0-25.0 sec  66.0 MBytes   111 Mbits/sec
[  6] 20.0-25.0 sec   187 MBytes   313 Mbits/sec
[  5] 25.0-30.0 sec  70.6 MBytes   118 Mbits/sec
[  6] 25.0-30.0 sec   200 MBytes   335 Mbits/sec
[  6] 30.0-35.0 sec   174 MBytes   291 Mbits/sec
[  5] 30.0-35.0 sec  75.2 MBytes   126 Mbits/sec
[  5] 35.0-40.0 sec  74.0 MBytes   124 Mbits/sec
[  6] 35.0-40.0 sec   185 MBytes   310 Mbits/sec
[  5] 40.0-45.0 sec  65.2 MBytes   109 Mbits/sec
[  6] 40.0-45.0 sec   171 MBytes   287 Mbits/sec
[  5] 45.0-50.0 sec  67.0 MBytes   112 Mbits/sec
[  6] 45.0-50.0 sec   173 MBytes   291 Mbits/sec
[  5] 50.0-55.0 sec  65.0 MBytes   109 Mbits/sec
[  6] 50.0-55.0 sec   163 MBytes   273 Mbits/sec
[  5] 55.0-60.0 sec  69.2 MBytes   116 Mbits/sec
[  5]  0.0-60.0 sec   861 MBytes   120 Mbits/sec
[  6] 55.0-60.0 sec   166 MBytes   279 Mbits/sec
[  6]  0.0-60.0 sec  2.07 GBytes   297 Mbits/sec
[SUM]  0.0-60.0 sec  2.25 GBytes   323 Mbits/sec