Limit guest network speeds while having QoS/SQM setup on PC for gaming

Hello!

I have two access points (one for guests, the other for main use) and my PC is connected via LAN cable to the router. I play fps (mainly valorant) a lot so having latency is important. So I want to make my PC the highest priority (lowest latency, above guest/main network) and limit guest network speed so that when people are downloading from guest/main network my gaming won't be affected.

I tried to achieve this by setting up SQM on both my PC and guest network but with lower down/up speeds on the guest network and while it did limit the speed of the guest network, it didn't remove latency from my PC while downloading from guest/main networks as I tested using waveform bufferbloat tester. Is there anything I can to do achieve this?

Thank you for your time.

edit: I use AX23 v1

I guess your increased latency with no SQM comes from line saturation.
Limiting bandwidth with SQM works against that, but it comes with the cost of (much) higher CPU utilization on your router.
So you trade basically line capacity (which is a thing your ISP has a say in) with compute power (which is something your personal router manages).

There's a chance your SQM settings for your guest network max out your routers CPU in a way that now the limiting factor is no longer the line capacity but the CPU of your router. That would be my idea, especially since the MT7621 CPU of your router ins't exactly a powerhouse and using SQM (here I'm not entirely sure) might come at the cost of not using that much hardware offloading and doing stuff in software that would otherwise be done on hardware.

I'd play with SQM settings a bit.

  • Watch CPU utilization on your router via SSH
  • download stuff from your guest network.
  • If the CPU caps at close to 100%, limit the allowed bandwidth in half
  • repeat until your game gets down to an acceptable latency value.
  • Then start playing with different SQM strategies and magic numbers.
  • Once you found SQM settings with minimal CPU utilization, slowly turn up the allowed bandwidth for your guest until you suffer bad latency again.
  • Turn down the allowed bandwidth back a notch to ensure best latency

Can you give us some numbers?

  • What's your connection bandwidth with no SQM?
  • What's your latency with no ongoing download with no SQM?
  • What's the latency peaking up to when downloads are happening with no SQM?
  • To what bandwidth did you limit your guests when enabling SQM?
  • To which numbers do latency beak while downloads are going on with enabled SQM? Are they the same as with no SQM or are they slightly better but not optimal?
1 Like

Hey,
I'm downloading a test file from my guest network with SQM enabled on guest/lan (which my PC is connected to) and here are the results by running "top" command in terminal:

  • My connection bandwidth without SQM and both guest/main networks disabled (only PC is connected) is 81/47mbps.
  • Latency with no ongoing download/SQM while in zoom call here
  • Latency when downloading test file here
  • I set a limit of 30000kbit/s on both egress/ingress on guest network and 70000/40000kbit/s on PC when setting up SQM
  • Here's the result with SQM enabled on both LAN/Guest network while downloading test file from guest network here

Also i wanted ask if having SQM on 2 interfaces (PC and Guest) prioritizes packets on my PC first or are they equal?

Thank you!

Why two separate SQM instances? I think it would be better to just stick with the one on wan. I suppose you could set DSCPs for gaming traffic to video or voice so that other traffic like guest traffic is throttled first.

Does indeed seem bit of a weedy router but maybe sub 100Mbit/s would be OK.

@moeller0 can better advise.

That would be great. Can I do that while limiting guest network?

That would occur given the DSCPs.

https://man7.org/linux/man-pages/man8/tc-cake.8.html

Maybe consider: cake-qos-simple.

How do i set that up? My OS is windows and using luci

Ah. cake-qos-simple may not be the right tool for you.

So having multiple SQM instances is just fine, however the traffic shaper component that actually limits the traffic is quite CPU intensive and not all routers are beefy enough to operate enough sqm instances... You normally already use two instances one for upload and one for download, but you can add others on different interfaces OR you simply run OpenWrt on the Guest AP as well and do the limiting there...

However, game control traffic is generally relative low volume, so maybe try cake's per interal IP fairness mode, which might already solve most of your problem.

No matter how you want to proceed the first step should be making sure your wan sqm instances are operating well. So could you please post the following pieces of information:

  1. cat /etc/config/sqm
  2. /etc/init.d/sqm stop
  3. run a speedtest and post a screenshot:
    https://speed.cloudflare.com
  4. /etc/init.d/sqm start
  5. tc -s qdisc
  6. run a speedtest and post a screenshot:
    https://speed.cloudflare.com
  7. tc -s qdisc

Here are the infos:
1.

root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth1'
        option enabled '1'
        option interface 'lan1'
        option download '70000'
        option upload '40000'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option linklayer 'atm'
        option debug_logging '0'
        option verbosity '5'
        option overhead '44'

config queue
        option enabled '1'
        option interface 'phy0-ap0'
        option download '30000'
        option upload '30000'
        option debug_logging '0'
        option verbosity '5'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option linklayer 'none'

config queue
        option enabled '0'
        option interface 'phy1-ap0'
        option download '70000'
        option upload '40000'
        option debug_logging '0'
        option verbosity '5'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option linklayer 'none'

First config queue's my PC, the second's guest network and the third is main AP but it's disabled

2.

root@OpenWrt:~# /etc/init.d/sqm stop
SQM: Stopping SQM on lan1
SQM: Stopping SQM on phy0-ap0

3.

4.

root@OpenWrt:~# /etc/init.d/sqm start
SQM: Starting SQM script: piece_of_cake.qos on lan1, in: 70000 Kbps, out: 40000 Kbps
SQM: piece_of_cake.qos was started on lan1 successfully
SQM: Starting SQM script: piece_of_cake.qos on phy0-ap0, in: 30000 Kbps, out: 30000 Kbps
SQM: piece_of_cake.qos was started on phy0-ap0 successfully

5. log

6.

7. log

Mmmh that appears to be a dual core MIPS 1004Kc @880 MHz (note 1004Kc supports SMT so this results in 4 CPU cores reported to the OS)... Note MIPS was great in its days, but has not seen any real development/advances in the last decade...
From your top results we see that dring the load test you only have 57% idle left and 30% sirq load... with 4 CPU cores saturating a full core will result in 25% load, so it is well possible that on your 70/40 link your cake instances are already CPU limited with your two SQM instances....

I would guess you need a faster router or reduce your shaper rates.

For the fun of it, try simple.qos/fq_codel and repeat the speedtest under load...
(HTB/fq_codel should keep latency under load lower, but simply reduce the throughput, unlike cake which preserves the requested max shaper rate closer at a cost in latency if the CPU is overloaded; cake does offer a few features that still make it more desirable for a home link though).

Mmmh, for console output it is less work and an friendlier to read result if you do not take a screenshot, but simply copy and paste the text from the terminal window into the forum editor window, Then either

Just make sure you "sandwich" your text between two rows of backtick characters ` (which themselves will be invisible in the preview) looking in something like this in the editor:
```
Your Pasted Text as preformatted text with fixed width font
1
1111 (note with fixed-width fonts the numbers are right-aligned)
```
but looking like this in the rendered forum:

Your Pasted Text as preformatted text with fixed width font
   1
1111 (note with fixed-width fonts the numbers are right-aligned)

or

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

If you want to "hide" config files just use the Hide Details option in the cog drop down list, like this:

Summary

This text will be hidden

Post's edited now. Thanks!

1 Like

Should I set them up on both interfaces?

Which hosts did you run the speedtests from, guest or non-guest, WiFi or wired?

I also note that you used an inward facing port (LAN1) for your supposed "wan" shaper, which is not going to work, as this will not do internet access shaping for all devices connected via WiFi to the router.
You see the result of this also in the speed tests, getting a 45.0 Mbps upload with a 40 Mbps upload shaper should not be possible, but due to SQM residing on inward facing LAN1 the internal directionality and the internet directionality are flipped, and you essentially sahpe internet download to 40Mbps and internet upload to 70 Mbps... (and since 70 Mbps is above your true internet upload speed, this shaper does nothing to keep your upload latency under load increase under control).
So please post the output of:
ifstatus wan | grep device
so we can figure out which interface you should use to control internet bufferbloat. Let's first get this fixed, before we move on, OK?

Also I notice Vodafone Germany as your ISP, I take it you are on a DSL link (judged from the shaper settings and speed test without sqm). If so, wht modem are you using? If it is a Fritzbox, please also post screenshots of all the tabs in the area "Internet -> DSL Informationen" in the GUI...

Let's start easy and get your wan interface SQM instance up and running, and move to the Guest network after that. It might be possible that cake's internet IP fairness mode might already be enough to make you games work well, but that is not the first thing to tackle... Let's start with the wan interface...

We tried to put a howto here:

and in more detail here:

But these might have grown a bit confusing...

Not sure, for the gaming configuration this might exactly be what he ultimately needs (I really really like this approach, and plan to add this to sqm-scripts eventually , but my own primary router is still on iptables so I can neither test nor "dog-food" this right now so have to give it a pass).
However I think we should start simple and increase complexity gradually until performance is sufficient for the OP's needs. He can always go and try to improve things further later, after we got the basic configuration working as intended.

2 Likes

add maybe your own rules like this

nft_rules_vars="# ### START OF CUSTOMISABLE NFT VARS SECTION (DO NOT DELETE THIS LINE) ###

# correspondence between protocol, destination port and DSCPs
# the format is: 
# 'protocol' . 'destination port' . dscp_set_bulk OR dscp_set_besteffort OR dscp_set_video OR dscp_set_voice
define PROTO_DPORT_DSCP_MAP = {
        tcp . 53 : goto dscp_set_voice,  # DNS
        udp . 53 : goto dscp_set_voice,  # DNS
        tcp . 853 : goto dscp_set_voice, # DNS-over-TLS
        udp . 853 : goto dscp_set_voice, # DNS-over-TLS
        udp . 123 : goto dscp_set_voice  # NTP
}

# local MAC addresses to set to bulk (e.g. IoT devices)
# replace MAC address below with comma separated entries
define BULK_MACS = {
        02:00:00:00:00:00
}

# ### END OF CUSTOMISABLE NFT VARS SECTION (DO NOT DELETE THIS LINE) ###" 
EOT

hi so can you delete this and add my own rules example 

nft_rules_vars="# ### START OF CUSTOMISABLE NFT VARS SECTION (DO NOT DELETE THIS LINE) ###

# correspondence between protocol, destination port and DSCPs
# the format is: 
# 'protocol' . 'destination port' . dscp_set_bulk OR dscp_set_besteffort OR dscp_set_video OR dscp_set_voice
define new rules dopam

your rules here

# ### END OF CUSTOMISABLE NFT VARS SECTION (DO NOT DELETE THIS LINE) ###" 
EOT

i'm not sure

I ran the speed test from my PC which is LAN1. Also, I thought I set the inward limit to 70mbps? Did I get it wrong?

option download '70000'
option upload '40000'

Here are the info you requested:

root@OpenWrt:~# ifstatus wan | grep device
        "l3_device": "wan",
        "device": "wan",

Where can I get the DSL information? I looked for it in Luci but couldn't find it. I also set SQM up using the how-to you provided but in guest network and lan1 as you saw. Should I change my lan1 to wan? I thought wan was everything so I only set it up on lan1.

if you are configured in lan 1 download is = to upload i think if you are more instance sqm