Two Tiny Dual-Gigabit Raspberry Pi CM4 Routers

Since I started testing various PCI Express cards on the Raspberry Pi Compute Module 4, I've been excited to see what new kinds of custom networking devices people would come up with.

Well, after months of delays due to part shortages, both DFRobot and Seeed Studios have come out with their 2-port Gigabit router board designs, and I was happy to receive a sample of each for testing:

DFRobot and Seeed Studios Router Boards with Dual Gigabit Ethernet

The boards are tiny, and even with the Compute Module 4 installed, they are incredibly small—take a look at the entire assembled DFRobot unit, complete with a Raspberry Pi attached:

DFRobot CM4 IoT Router Board with Raspberry Pi CM4 and Quarter

These boards are a huge upgrade from any typical Pi 4 model B multi-port router solution, since you not only have half the required device footprint, you also get two ports side-by-side and don't need an extra USB Gigabit network dongle hanging off a USB 3.0 port!

Plus, with the freedom to access the Pi's x1 PCI Express lane directly, DFRobot's board attaches the second Gigabit NIC directly to the bus, instead of through a USB 3.0 controller, like Seeed Studios did. Look at the benchmarks further down this post to see what kind of difference that architecture shift made.

I have an entire video dedicated to reviewing these two tiny router boards on my YouTube channel, but I'll provide a top-level summary and the benchmarks in this post.

Jeff Geerling holding Raspberry Pi Compute Module 4 based DFRobot router board mini
It really is a tiny router! Click the image to see the full video review of these boards.

OpenWRT on the tiny CM4

OpenWRT is about to release a new version compatible with the Pi 4—but that doesn't mean everything will work perfectly on the Compute Module 4 out of the box.

DFRobot offers a customized OpenWRT image download on their Wiki, but Seeed does not. Currently, for the Seeed board, you have to manually compile a version of OpenWRT to work with the LAN7800 USB to Ethernet bridge chip on the board. That is, unless this pull request gets merged in someday.

With Pi OS, both boards will work out of the box with both ports, but then you'd have to set up all the routing functionality by hand.

I was able to get all OpenWRT's functionality working well, though to get WiFi working, I had to employ a few hacky workarounds. WiFi Access Point performance using the built-in 802.11ac chip over SPI is not amazing, though—I could only route around 60 Mbps through the Pi under ideal conditions.

I'm hoping to build a better Pi WiFi 6E router using Intel's AX210 chip, but that's a project for later this year!

Benchmarks

I ran three simple benchmarks to get a feel for the performance of the two boards—and the main thing I wanted to test was whether either would bottleneck a gigabit network connection. The major difference was the architecture of the second Gigabit adapter. The first adapter on each board is supplied by the built-in Broadcom gigabit NIC on the Compute Module itself, but the second one is routed through the Pi's PCI Express bus.

  • For the Seeed board, there is a USB 3.0 chip on the PCI Express bus, and a Microchip LAN7800 USB to Gigabit Ethernet NIC on that bus.
  • For the DFRobot board, there is a Realtek 8111h Gigabit NIC directly attached to the PCIe lane.

How much of a difference does that make? Well, it's pretty noticeable:

Bandwidth and throughput graphs showing DFRobot and Seeed Raspberry Pi Compute Module 4 Router Boards

Testing method and full results in these GitHub issues: DFRobot board, Seeed board.

On the Seeed board, the overhead of the USB 3.0 bus and hardware and driver limitations cause interrupts to stall on one CPU core (as measured by atop), and the router can't put through more than around 700 Mbps.

On the DFRobot board, I didn't see any indication the CPU was getting overloaded even under longer stress tests with a full gigabit of data going through.

And that overhead is most apparent when sending through small packets—using hping, the Seeed board could only handle half the packets per second of the DFRobot board.

Power consumption offers a similar story: the DFRobot board (which, admittedly, has many fewer features and I/O to support!) uses half the power as the Seeed board:

Power consumption of Seeed and DFRobot CM4 router boards

Under 2W at idle is pretty respectable for a full gigabit router!

Conclusion

These little routers aren't for everyone. If you're passionate about networking and are familiar with the basics, they're a fun way to build a reasonably-performant network router without breaking the bank.

You can buy them from their respective stores:

They each have their own limitations, and I'm also looking forward to testing out a more full-featured (and full-priced!) Compute Module 4-based router I'm building with Dual-2.5 Gbps router with WiFi 6E as I mentioned earlier. Stay tuned and subscribe to my YouTube channel or this blog's RSS feed if you don't want to miss it!

Comments

Intel wifi chips do not support 5Ghz AP mode. FYI.

According to Intel's support doc, this is true, and I confirmed it on the AX200... but I was hopeful the AX210 might support it. Something like the PN02.7 could work, but those cost a lot and don't seem like they have any kind of open source drivers yet :(

Very much looking forward to replacing my current PI3B+ Router on a stick setup with the DFRobot + CM4. Glad I pick the right one with both nics on the PICE bus.

Hi, I've bought for my pleasure a DFRobot CM4 carrier and I have a small issue with it. After flashing the "official" dfrobot openwrt image router won't boot (probably). LEDs PWR and ACT lights are constantly on (they don't blink); furthermore, if I plug ethernet cable into ETH0 (WAN) port - lights go up BUT if the cable is in ETH1 (LAN) they don't. I have tried different sd cards (I guess that this is not the cause of the problem). Unfortunately I have only one CM4 board :/
Do I understand correctly that serial tty comes up when opewrt successfuly boots up ?

Okay it seems that I have to buy a motherboard as well. Totally missed that piece of information.
No possible way of switching priority between SDCard and eMMC I guess ?!

I think that might be done by guide from this wiki page https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR… :

eMMC Installation
Suitable for Compute Module 4 with eMMC version.
1 Requirements
USB-C data cable
rufus Mirroring tool
7-Zip Compressed File Manager
rpiboot eMMC tool
System Mirror

2 Enter Boot Mode
i Toggle RPiBOOT on the CM4 router to side 1, and disable eMMC startup
ii Use the USB-C data cable to connect the computer and the USB data port of the CM4 router, and then connect the CM4 router to the power supply
iii Install and run the rpiboot tool on the computer, you can see that eMMC has been displayed as a disk

3 Use 7-Zip to decompress the system mirror compression package, get the img image file

4 Use rufus to open the decompressed img file, and select the corresponding drive letter of the card reader to write.

hello jeff

would the dfrobot board+ CM4 perform well as part of a pi-hole solution?

have you tried running the dfrobot board with openwrt 21.02-rc3? I have flashed it when I use this image only one of the NIC's appear.

Same for me. Seems one has to manually load/install the driver for the Realtek NIC. I’m trying to find the correct driver now but it is not obvious which one it is.

What I did was plug the NIC that works into my switch, then from the OpenWRT GUI on the one NIC, assign your default gateway to the correct one you currently have, then set your DNS too so the OpenWRT pi router can have internet access.

After that, I was able to update the opkg from within the interface and download the kmod-r8169 package. Then you will see your other interface and you can then assign that to your WAN and setup both how you please.

You might have an IP address conflict if your current router is 192.168.1.1 too. In that case just unplug your current one temporarily and then change the OpenWRT interface to something different. Then you can plug it all back in and access both routers.

The easiest way to do this is to either:
1. Download the driver for your flavour and version of OpenWrt (e.g. for 21.02.0-rc3 use this link - https://downloads.openwrt.org/releases/21.02.0-rc3/targets/bcm27xx/bcm2…), copy it to your OpenWrt instance via SCP and install using "opkg install kmod-r8169_5.4.124-1_aarch64_cortex-a72.ipk"
2. Change you OpenWrt instance temporary to be a Wifi / Ethernet client to your existing network by editing your network configuration in "/etc/config/network", setting a static ip address and DNS to your existing router for the "lan" interface and then running "opkg install kmod-r8169"|

hello jeff

i finally have the CM4 2G lite and the DFrobot board.

I wonder if it might be easier to install and use Pi Os (Buster) instead of WRT?
I am more familiar with setting up the pi with Raspian/Pi Os

i have formatted the sd card and installed Raspian-Buster.

Would i now need to edit the config file to enable usb or should that work OOB?
presumably i can ssh into the board through usb or ethernet?

If anyone has done this and can give some tips or a walk through that info would be gratefully received.

Yes i am new to this so yes the above are newbie questions.

Thank you.