OpenWrt on x86 PC and SQM

Pictured Gigabit Switch: TP-Link 8-Port Gigabit Ethernet Switch. Amazon Referral Link: https://amzn.to/3bgOOvo

Pictured Access Point: Ubiquiti Unifi UAP-AC-LITE. Official Link: https://store.ui.com/collections/wireless/products/unifi-ac-lite

Pictured OpenWrt Device: NanoPi R4. Official Link: https://www.friendlyarm.com/index.php?route=product/product&product_id=284 can also be found on aliexpress.

1.1 Introduction and Why?

The diagram above demonstrates how you would install a more powerful OpenWrt PC or Device as a router into your network. 

The reason why we would want to do this is so we can stop bufferbloat at higher bandwidths with SQM (Smart Queue Management). Currently consumer routers usually can't push past 350 Mbps with luci-app-sqm on because the SQM algorithm cake, uses a lot of CPU processing power. The only way we can get close to 1 Gbits with SQM is by building our own router.

It is also a lot more reliable and better than consumer routers which try to put the modem, routing, and wireless all in one.

What is Bufferbloat and why stop it?

It is lag or ping spikes in video games or zoom calls that is caused when you or someone else uses up all your bandwidth. It could be torrenting, 4k streaming, bulk downloads, or even a speedtest. The SQM algorithm, which can be installed on OpenWrt, can completely mitigate these pings and ensures low latency even under full load. Overall, you do sacrifice a little max speed 5-10% for guaranteed low latencies.

1.2 What Hardware For The OpenWrt Router?

To be honest, I'm not sure what can handle 1000mbps in the real world yet because I don't have a 1000mbps connection. I will try asking Comcast to upgrade my speed temporarily so I can report back.

My current connection is 600Mbps. I use a SEEED ODYSSEY - X86J4105 which has a CPU Mark Score of ~3000 and it handles 600Mbps DL with ease. The htop screenshot below tells me it uses at most 37% of my CPU under full load. In theory, we can guess that a CPU mark of 3000 should be able to work for 1000 Mbps connections, if 600 Mbps only uses 37% CPU at most.

image-1609966808146.png

For now it is safe to assume, any desktop PC with a CPU mark of around 3000 or more on cpubenchmark.net can handle SQM at 1000 Mbps.

1.2.a Seed Odyssey (~$250)

Should you decide to go with the pricey Seed Odyssey they did a write up about running OpenWrt on it thru a USB device: https://wiki.seeedstudio.com/ODYSSEY-X86J4105-Installing-openwrt/

Personally I ran mine on a 16GB M.2 SATA SSD since NVME isn't current supported in the base x86 OpenWrt Image. Instead of flashing a USB drive as instructed by SEEED. I flashed my M.2 SATA drive with balenaEtcher instead.

1.2.b : x86 Desktop

Should you decide to use a PC there are a couple requirements.

1. Make sure it has two Gigabit Ethernet ports. If it has one already, you can add a second one with a Mini PCI-E Gigabit Network Adapter. (Amazon referral link).

2. You also want to make sure it has a CPU Mark of 3000 or more. You can check here: https://www.cpubenchmark.net/cpu_list.php

3. Preferably it would be a low power device around < 25 Watts.

As for installation of software. OpenWrt has their own written guide here: https://openwrt.org/docs/guide-user/installation/openwrt_x86

1.2.c : NanoPi R4S (~$75)

I just bought this for about $75 on aliexpress. I will report back with benchmarks when I receive it in about a month or two from 1/6/2021. If this can handle 1000 Mbps w/ SQM on it would be the cheapest device I know that can. The predecessor, the R2S was known to handle ingress up to 465 Mbps, egress up to 750 Mbps (Source)

How to stop lag with SQM in OpenWrt?

So now you have OpenWrt. Great! The next step is just installing the luci-app-sqm and setting 85-95% of your top speed in the upload and download direction of your WAN port.

I wrote a full tutorial here: https://www.stoplagging.com/openwrt-method-fq_codel-cake/

1.3 What Access Point?

I keep hearing raving reviews about the Ubiquiti APs and use one myself. I have extremely stable WiFi with these and never have to reboot them. Ubiquiti also advertises up to 200 concurrent users as well! If you have a recommendation better than these I'd like to know.

All I actually know is that if you need more coverage you should get more APs not one single AP with a bunch of antennas, because those are marketing gimmicks.

WiFi has limited range due to the physics of their frequency bands.

5Ghz can handle more bandwidth, but will usually be about half the range of 2.4Ghz.

If you're on a budget you can try turning your old router into an access point by putting it into AP mode instead of routing mode. This is important because you should be letting the OpenWrt device do the routing to prevent bufferbloat not your old router.

1.4 Contact

If you need help or consultation please join my rocket.chat server at https://chat.stoplagging.com/invite/zaMu6X you can message me @Starfroz by looking me up under the globe icon after registering and logging in.

image-1609968043493.png