6

Two Tiny Dual-Gigabit Raspberry Pi CM4 Routers

 2 years ago
source link: https://www.jeffgeerling.com/blog/2021/two-tiny-dual-gigabit-raspberry-pi-cm4-routers
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Two Tiny Dual-Gigabit Raspberry Pi CM4 Routers

May 28, 2021

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!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK