SQM with WireGuard

My OpenWRT box is connected to a cellular modem via Ethernet on the WAN port, and the LAN port feeds my APs and wired hosts. All Internet traffic is going through a WireGuard VPN, as described in this guide.

With the VPN enabled, I can get 20-30 Mbps on speedtest.net. However, when one of my devices decides to download software updates or anything of that nature, my other devices struggle to load webpages. This led me to set up SQM as described here. The selected interface is the VPN interface, download speed is set to 12,288 Kbps and upload is 512 Kbps. Link Layer Adaptation is set to Ethernet and I'm not quite sure what the overhead should be. Should it be 44 for Ethernet, 80 for typical WireGuard overhead, or 80+44=124 for both Ethernet and WireGuard? I've been trying out each of these but can't say I've noticed much difference between them.

With SQM enabled, speedtest.net struggles to get more than 7Mbps. It often stays below 6Mbps. This is the case with each of the overhead values I've tried. One trend I have noticed is that the speeds increase near the end of the test. Is this simply the nature of SQM?

Trying not to obsess over getting good speedtest results, but it is frustrating to see it go down so much. Any input would be appreciated. Thanks!

If anyone has some insight about what to use for the overhead value, I’d appreciate it.

This is quite asymmetric, your upload will be (up to) ~50% loaded when you saturate the downlink side from the ACK packets alone. Are speedtests really telling you that your upload is that low?

Well, that really depends on what is transmitted over the trie bottleneck link, so the wireguard overhead should be added, not sure about ethernet (which amounts to either 38 bytes or 42 bytes with a VLAN tag), if in doubt, pick the larger number...

Okay, the question is why, is the router's CPU overloaded? If yes I would expect relative high numbers reported in the av_delay and pk_delay comumns of cake's output from tc -s qdisc.

Not on fixed networks, no, but please post a link to one of your speedtest reports (maybe also try dslreports' speedtest?)

Sorry, interested in that myself.

1 Like

Yes, the upload speeds have never been great. This is on a 4G LTE cellular modem connection and I live far away from the nearest tower. Using MIMO antennas to pull in the signal. The signal readings are decent and as good as I'm able to get them. I've just accepted that uploads will be slow. It hasn't been that much of an issue, fortunately.

It's set to 124 right now. Setting it to 80 didn't seem to make much difference, if any.

During speedtest download: pk_delay: 15.4ms | av_delay: 5.0ms
During speedtest upload: pk_delay: 2.1ms | av_delay: 970us
It's a Zotac CI323 nano with an Intel N3150 which has AES-NI to help with encryption/decryption tasks.

Just took this speedtest with decent results: https://www.speedtest.net/result/10437400401
DSLreports test: http://www.dslreports.com/speedtest/66324321

The speed tests today were surprisingly decent. Although usually it maxes out around 6Mbps and right after I could disable SQM and it would shoot up to 15Mbps or more.

These look innocent or at least not like smoking guns...

And unless you have loads of additional demanding processing on the CPU this should okay for your low link rates.

1 Like

mmmh, I wonder maybe your data link is exceptionally bursty, could you try simple.qos with fq_codel instead? There you could go to /usr/lib/sqm/defaults.sh and change
[ -z "$SHAPER_BURST_DUR_US" ] && SHAPER_BURST_DUR_US=1000
to
[ -z "$SHAPER_BURST_DUR_US" ] && SHAPER_BURST_DUR_US=20000

That will dump 20ms worth of data into the next layer, which might help to get more throughput out of the LTE modem. If that helps, it would be a good idea to play with that number. As that number basically tells how much additional delay under load you will see, so with 20ms latency during downloads will increase by at least that 20ms....

1 Like

I’ll give it a shot this weekend and report back. Thanks.

Can’t tell much difference between this and cake.

Which numbers did you try? And could post links to sah dslreport speedtests?

Well, for now I ended up going with luci-app-ntf-qos. My 4G connection fluctuates so much that SQM just isn't a great solution for me. Setting hard limits on my TV and other bandwidth hogs definitely helps things.

Thanks for your help. I do plan on switching back to SQM once Starlink (hopefully) becomes available.