The Raspberry Pi 4 model B was the first model to include both a dedicated Gigabit Ethernet
port and two USB 3 ports. Older Raspberry Pis had pretty lackluster networking performance,
and if you wanted to use multiple network interfaces, you'd be limited to around 300
Megabits of network throughput.
But the Pi 4 made it possible to add on additional gigabit interfaces, and people started using
the Raspberry Pi as a router, the device that controls access between a Wide Area Network
(like the Internet) and a Local Area Network (like your home network).
A popular way of doing this is with OpenWRT, a lightweight operating system designed for
wired and wireless routers. I also learned the VyOS community is working on ARM support,
and I'll be testing that out soon, too!
The Pi 4 model B is certainly capable if you need less than a gigabit of bandwidth. But
let's be honest, the entire footprint of a basic 2-port Pi 4-based router gets
pretty ugly, fast.
And that's where these guys come in. This is the DFRobot Routerboard, which is literally
the tiniest gigabit router I've ever held. It's a case study in minimalism. And only
a tiny bit larger is Seeed Studio's Dual Gigabit Carrier board.
Both of these little guys are much more compact than the Pi 4-based router, and they use the
Compute Module 4, which is basically a Pi 4 but with all the IO chopped off.
But while these boards look similar on the outside, in this video I'm going to test whether
one small architecture difference has an impact on real-world router performance. The DFRobot
board uses a Gigabit PCI Express interface, while the Seeed board uses a Gigabit to USB
3.0 bridge through the PCI Express interface.
In the Seeed board's case, a network packet travels through this Network jack to the Gigabit
NIC through the USB 3.0 bus, which connects to the CM4 PCI Express bus, then back out
to the CM4's built-in NIC, and finally out the other Network jack.
For the DFRobot board, the USB 3.0 bus is eliminated. Will that make it faster? Well,
watch the rest of this video and find out! We're also gonna
explore how these boards perform in general,
how much power they consume, and whether one of these could replace an off-the-shelf router.
Looking at the Seeed board up close, there's a lot of IO that's not present on DFRobot's
board.
This little VLI chip is the heart of the operation—it's
a USB 3.0 controller, and it's wired to both
this little USB network chip, and two external and two expansion USB 3.0 ports.
Over on the side of the Seeed board, it has a CSI and DSI plug for a Pi display and camera,
a 4-pin fan header with PWM control, a USB port header for internal USB 3.0 ports, a
micro HDMI port for display, and a USB-C port for power only.
This board crams a lot of functionality into a really tight space!
One thing that annoyed me, though, is the orientation of the microSD card slot on the
bottom. The contact pins are actually pushed into open space when you insert a card...
so if you don't have a good enclosure to cover that area (and prevent shorts between the
pins), you could end up corrupting the filesystem just because of the physical layout of the
board!
Not only that, if you have an HDMI cable plugged in—which you might not if you're using it
only as a router—then the card is upside-down and it's really hard to pull out the card!
One other design quirk is this vertical USB Type C power plug. I can imagine this thing
pulling off the board due to the torque involved in the connection. I'd be gentle with the
power plug on this board if you want it to last for a long time.
Now, moving over to DFRobot's Routerboard... wow, this thing is tiny!
And it might be small, but one critical architecture
change might make it mighty. The Gigabit Ethernet
chip is wired directly into the Pi's PCI Express bus, with no USB controller in the way.
Other than that, this board covers the basics, like power via USB-C, a single USB Type C
port with USB 2.0 speeds, a reset button, a microSD card slot, and even 26 GPIO pins!
But that's it. There's no frills here—not even an HDMI port for a display.
This thing was made for one thing: being the tiniest little Pi router in existence.
I also noticed that DFRobot has a downloadable 3D model with a snap-together enclosure design,
so I printed it on my 3D Printer. It printed fine, but I ended up having to sand down the
corners on every tab, since the design has basically 0.0mm tolerances! Once I did that,
it fit together just barely, and it held the board in okay, but I'd rather have a smaller
metal enclosure.
So, how does it work as a network router, though?
Both boards are perfect for OpenWRT, so my next step was installing it. I'll start with
DFRobot's board.
Right now, OpenWRT doesn't have a full version that works out of the box with the Compute
Module 4, so until that happens, DFRobot offers a custom image based on the latest development
snapshot, and there's a link to it on the Routerboard Wiki.
I downloaded that image to my Mac and decompressed the image file. Then I inserted the microSD
card I was going to boot the Pi from, and wrote the image using dd with the command
you see on the screen.
I popped the microSD card into the Routerboard and plugged in the Pi to boot it and... well
this is a little weird if you're used to using a monitor with your Pi. This board doesn't
have a display output, so there are only two ways you can get OpenWRT set up: first, you
could use a serial console through USB on another computer, or second, you could plug
the ETH1 port directly into a computer and access the OpenWRT web interface at 192.168.1.1.
I wanted to access the web interface, but which port is ETH1? It's not labeled on the
board itself, but at least it's in the documentation.
I wish the ports were labeled on the board
though, it would save me having to look it up whenever I plug in the board.
Anyway, I plugged the Routerboard straight into my Mac using a separate network dongle,
and went to the router's address in Safari.
The default login is root with no password, and I was in! The first thing you should do
is set a root password. Once that's done, you can also log into the router via SSH in
a Terminal or using Putty if you're on Windows. The login is root@192.168.1.1.
The USB 2.0 Type C port on the side is actually disabled by default, but that's not the fault
of the Routerboard, that's a limitation of the Pi; you have to manually go in and add
this configuration line in the /boot/config.txt file and reboot if you want to use USB.
OpenWRT also doesn't expand your boot volume to use all the available space on the Pi's
storage, so if you want to have all the room available, you have to Adjust the OpenWRT
root partition manually.
With all that setup work done, it was time to start digging into the system. First, I
plugged in my Internet connection—in my case for this test, my home LAN—into the ETH0
port on the right. And I installed pciutils so I could check out the Ethernet chip with
lspci. And there it is, with the r8169 driver
loaded for the Realtek Gigabit Ethernet controller.
Now let's do some tests to see how well it runs. First, the most basic test. I unplugged
my 10 Gigabit wired connection from my Mac, and turned off WiFi, so all my network and
Internet connections would go through the Router board.
I ran a few Speedtests on Speedtest.net, and my cable 'gigapower' connection actually lived
up to its name, giving me around 930 Megabits of bandwidth. That's the same result I get
over my normal home gigabit network, so there's no bottleneck there!
So this board seems to be doing great in terms
of a Gigabit Internet connection (at least, ONE way). I wanted
to make sure the router could also perform when connecting through it to other devices
on my home network, so I ran an iperf3 test between my Mac and my main home network router.
943 Megabits per second is right at the limit of the normal line speed I get, so yay, no
bottleneck there either!
It doesn't seem like the board or the Pi are throttling anything at all. For my last test,
I wanted to get a rough idea of how many packets per second the Pi could put through in its
default configuration, and I used this command with hping to basically flood a connection
through the router, from my Mac on one side to a Pi running on the other side. And with
64-byte packets, I was able to pump through around 77 thousand packets per second.
I've been documenting all my testing in this GitHub issue, and it's linked in the description.
If there are any major flaws in my tests or you have ideas for better ones, please let
me know in the comments. These are pretty basic networking tests, and you can go a lot
deeper, testing things like quality of service and benchmarking
things like VPN performance. I even tried
getting Flent to do some benchmarks between my Mac and another server on the other end
of the router, but I was having some trouble with netperf so I'm gonna have to put that
testing on hold for now.
Before I wrap up the testing on the DFRobot, I wanted to check thermals and energy consumption.
At idle, the board uses 1.79 Watts as measured by my Satechi USB-C power meter, and at maximum
throughput, running iperf3 and speedtest simultaneously,
it uses 2.95 Watts.
That's pretty good for a device you'll be running 24x7!
The board never got hot enough to even warrant a fan, though the network chip did warm up
a little to 35 degrees Celsius.
Now, moving on to the Seeed board. It uses a Microchip LAN7800 USB gigabit ethernet bridge,
which is supported in the Linux kernel. It's actually the same chip used on the Raspberry
Pi 3 B+, so hopefully it's supported out of the box.
I tried swapping the microSD card and Compute Module from the DFRobot board to the Seeed
board, but that didn't work; it only identified one network interface, because the current
OpenWRT builds don't include the LAN7800 driver for the Pi 4.
Since OpenWRT is open source, I opened a [pull
request](https://github.com/openwrt/openwrt/pull/4191)
to see if OpenWRT might add support so the Seeed board could work out of the box, but
I was also able to get the board fully working with Raspberry Pi OS.
I even ran all my benchmarks using a custom lightweight router configuration, which I
blogged about on my website, and I documented that experience on GitHub too.
While I was doing that benchmarking, GitHub user bobafetthotmail built a version of OpenWRT
with the right driver, and I got it working on the Seeed board. I had to do a tiny bit
of manual work to get the LAN and WAN configuration
working, but I got the Seeed board working
exactly the same as the DFRobot board.
One interesting thing I noticed when I was first booting it was that the lights on the
ETH1 port, which is the one that goes through USB, never came on.
I should note that the board I have is actually a prototype, and you can even see a little jumper
here that's common on prototypes I get. It's common for small issues like this to appear,
and I think they sorted out the issue with the activity lights on the final production
version.
But back to testing: My first benchmark, running a Speedtest through the Pi, wasn't amazing;
I got just under 700 megabits down, about 25% worse than the DFRobot result.
So I tried iperf3, and found the throughput was similar between two devices in my house:
around 700 Megabits.
And to round it out, using hping, I measured just over 36,000 packets per second of throughput,
meaning for small packets, this board has half the capacity of DFRobot's.
I could see that the bottleneck was IRQ interrupts,
which I measured with atop. Interestingly,
I didn't see the same thing on the DFRobot board, so I'm guessing the driver for its
PCI Express Realtek chip, or maybe even the Realtek chip itself, does some offloading
that saves the Pi's CPU from being crushed by all the network packets.
This is behavior I've seen on some other network cards on the Pi too, so it's not too surprising.
And before you comment on how I need to use irqbalance—I know you're out there, with
your finger on the comment button right now—I tried that too and it seems like on the Pi,
each network interface is pinned to one CPU core.
And just to be thorough, I flashed Pi OS to the microSD card, booted the Seeed board with
that, and ran an iperf test directly through the LAN1 port, and it was still giving me
less consistent numbers, maxing out around 700 Mbps.
The built-in network interface, using the same cable, plugged into the same port on
my switch, tested with the same devices, was getting 930 megabits, so there's definitely
some overhead using the USB-to-Gigabit architecture
like the Seeed board does. But is that a show-stopper?
Well, if you have a slower Internet connection, and want to be able to plug in an SSD and
use the router as a little NAS, too, that might be a compelling reason to buy the Seeed
board instead of the DFRobot board.
There are plenty of other nice features I covered earlier, too, plus I like the fact
that all the ports are on one side, making it simpler to mount it somewhere without a
spaghetti mess of cables.
Before I wrap up, here are the benchmarks for energy consumption:
It uses about 4 Watts at idle, and 5 Watts fully saturated. And that's a big difference
from the DFRobot board, which uses about half the energy.
With that increased wattage comes a little extra heat, too. This board runs pretty hot,
and I'd worry a little about the network and USB chips which are sandwiched under the CM4
board with no airflow to them. You definitely need a fan with Seeed's board, but you could
probably get away with just a heat sink on the Pi on the DFRobot board.
But what about wireless?
Can these devices also act as wireless routers or WAPs? Well, technically they can. And you
could use the Pi's built-in 802.11ac WiFi, but I should warn you that the built-in WiFi
chip is not great for sharing with multiple wireless devices, and in my testing I wasn't
able to get more than 60 Megabits of WiFi data in the best case.
Plus, OpenWRT doesn't support the Compute Module 4's WiFi out of the box right now,
so I had to do a couple hacky workarounds to get it working.
If you wanna build the best Raspberry Pi Wireless Access Point... well, let's just say I'm also
working on that, maybe using this WiFi 6E Intel chip, for over a gigabit of WiFi!
Unfortunately
this chip won't work on either of these router boards due to their hardware design.
So while these boards look similar on the outside, their internal architecture makes
a big difference if you want to use them as routers. Different use cases will dictate
which one you might choose if you do like building your own router with a Pi. And price
may also impact your decision!
The DFRobot CM4 IoT Router Board is $30, and the Seeed Studio Board is $45. It's not a
huge difference, but pair that with a Compute Module 4 and you're looking at spending at
least $60 to get one of these tiny Gigabit routers. You can get a decent budget router
for around the same price, but the Pi is more upgradeable and often much more customizable.
But going the opposite direction, I'm also testing a custom dual 2.5 Gigabit Pi Router
build, which might blow both of these tiny boards out of the water both in price and
performance, so subscribe so you don't miss it!
Until next time, I'm Jeff Geerling.