High latency in game, bufferbloat and port forwarding

Hello everyone,
I own a Fritzbox 7590 AX modem connected lan-wan to a Netgear XR500 (where I installed OpenWRT). The best connection I can get in my house is a FTTC line with around 170 mbs in download and 20 in upload. I play with optimized PC (TCP Optimizer, etc.) and LAN cable; I'm having a lot of issues with my connection when playing online games (call of duty or fortnite in particular). I partially solved my bufferbloat issues by installing OpenWRT with cake qos but my download speed is capped at around 100/120 mbs. I would like to set up the port forward setting inside the router as well. I'm new to this kind of stuff and I don't know what to do. These are my cake qos setttings. If you need any screenshot of my configuration just ask. Appreciated

A few questions...

  1. How are you speed testing? Wi-Fi or direct ethernet cable?
  2. Please post the output of cat /proc/interrupts
  3. Have you tried just placing cake on the wan-upload? (You can Safely enter 20000 as upload speed)

First of all I'd like to thank you for the reply.

  1. I'm speed testing with ethernet cable. This ( https://www.waveform.com/tools/bufferbloat?test-id=8d1b29bb-a801-4021-8389-35607387526d ) is my result with sqm enabled and this
    ( https://www.waveform.com/tools/bufferbloat?test-id=34026d53-896f-42fa-ae22-d1a01f0f3712 ) is what I get when sqm is off

  2. I'm sorry I'm kinda new to this world and I don't understand how exactly I can get this info (cmd?)

  3. No I haven't

No worries! Everyone starts somewhere and is constantly learning.

If you're using Windows, you'll want to use putty.exe and ssh into your router. Then run the commands:
cat /proc/interrupts
cat /etc/config/sqm
(press return or enter)

copy & paste the output to this thread and we'll go from there...

1 Like

What is your network infrastructure:
phone line -> FB 7590 -> XR500?
If so for sqm to be in control of the latency, NO device can directly connect to the FB7590AX, all must connect to the XR500 otherwise sqm/cake does not see the other devices traffic and things go pear-shaped pretty quickly under load.

root@OpenWrt:~# cat /proc/interrupts
           CPU0       CPU1
 24:  256016005   28470855     GIC-0  18 Edge      gp_timer
 26:    8016290          0     GIC-0  51 Edge      qcom_rpm_ack
 27:          0          0     GIC-0  53 Edge      qcom_rpm_err
 28:          0          0     GIC-0  54 Edge      qcom_rpm_wakeup
 34:          0          0     GIC-0 241 Level     ahci[29000000.sata]
 37:   46708679          0     GIC-0 255 Level     eth0
 38:   51482971          0     GIC-0 258 Level     eth1
 39:     507088          0     GIC-0 202 Level     adm_dma
 40:          0          0     GIC-0 130 Level     bam_dma
 41:          0          0     GIC-0 128 Level     bam_dma
 42:          0          0     GIC-0 210 Edge      900000.clock-controller:thermal-sensor@900000
 44:          0          0   PCI-MSI   0 Edge      aerdrv
 46:          0          0   PCI-MSI 134217728 Edge      aerdrv
 47:         11          0     GIC-0 184 Level     msm_serial0
 48:          0          0   msmgpio   6 Edge      keys
 49:          0          0   msmgpio  54 Edge      keys
 50:          0          0   msmgpio  65 Edge      keys
 51:          0          0     GIC-0 237 Level     xhci-hcd:usb1
 52:          0          0     GIC-0 142 Level     xhci-hcd:usb3
 53:         34          0   PCI-MSI 524288 Edge      ath10k_pci
 54:         38          0   PCI-MSI 134742016 Edge      ath10k_pci
IPI0:          0          0  CPU wakeup interrupts
IPI1:          0          0  Timer broadcast interrupts
IPI2:      44238      90511  Rescheduling interrupts
IPI3:     310297    3778953  Function call interrupts
IPI4:          0          0  CPU stop interrupts
IPI5:   77821305   36553032  IRQ work interrupts
IPI6:          0          0  completion interrupts
Err:          0

config queue 'eth1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option interface 'pppoe-wan'
        option overhead '34'
        option download '130000'
        option upload '18000'
        option enabled '1'

Just to make sure every steps I did was correct, these are the screenshot of what I did before entering those commands

Yes, my infrastructure is: phone line -> FB 7590 -> XR500. All my wired devices are connected to the xr500. The only exception is the wireless, which comes from 7590ax (I disabled it in the xr500). Does it have to be off as well?

Pretty much, to be able to limit the amount of queuing sqm needs to see all traffic to/from the relevant interface (in your case WAN). But this is not going to help with your sqm throughput situation...

Your * FRITZ!Box 7590 AX needs to be acting in a modem role only. Search the manual or call your ISP and ask if this device supports Bridged or IP Passthrough Mode. Another suggestion is to ask if they offer/You can purchase a separate DSL Modem only.

At least the German version of FritzOS does not offer that option anymore, the best available id PPPoE passthrough (where you do not configure PPPoE credentials on the fritzbox and enable PPPoE passthrough) the OpenWrt router then needs to terminate the PPPoE link, but that only works if the ISP uses PPPoE in the first place. The other alternative is building one's own version of FritzOS (IIRC that project is called freetz) where one can configure some sort of bridge mode again.

In my country (Italy) PPPoE passthrough is still available in the current FritzOS version and I enabled it in the Fritzbox web interface. Also, with my isp I can use it. As you can see from the speed test, sqm works if enabled.

Here's some commands to help spread the WiFi interrupts and PCI cards to the second processor so that CPU1 isn't doing all the work. Also enabling the software offloading feature. It won't hinder sqm.
SSH into your OpenWRT unit and paste this into the terminal (I've included a reboot command so be cautious of important work/sessions you may have currently going on at the moment):

echo -e '#!/bin/sh\n\necho 2 > /proc/irq/38/smp_affinity\necho 2 > /proc/irq/54/smp_affinity' | tee /etc/hotplug.d/net/30-smp_tune.sh > /dev/null
chmod +x /etc/hotplug.d/net/30-smp_tune.sh
sh -x /etc/hotplug.d/net/30-smp_tune.sh
uci set firewall.@defaults[0].flow_offloading='1'
uci commit

root@OpenWrt:~# echo -e '#!/bin/sh\n\necho 2 > /proc/irq/38/smp_affinity\necho 2
 > /proc/irq/54/smp_affinity' | tee /etc/hotplug.d/net/30-smp_tune.sh > /dev/nul
root@OpenWrt:~# chmod +x /etc/hotplug.d/net/30-smp_tune.sh
root@OpenWrt:~# sh -x /etc/hotplug.d/net/30-smp_tune.sh
+ echo 2
+ echo 2
sh: write error: Invalid argument
root@OpenWrt:~# uci set firewall.@defaults[0].flow_offloading='1'
root@OpenWrt:~# uci commit
root@OpenWrt:~# reboot

Seems like sqm has been disabled for some reason

Unless luci had a hiccup this looks like /etc/config/sqm got corrupted... could you please post the output of:

cat /etc/config/sqm

run from your routers command line via SSH.
Please copy and paste the text from your terminal window, no need for screenshots:

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
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
1111 (note with fixed-width fonts the numbers are right-aligned)

Disregard the "write error: Invalid argument" if you rebooted. The results of cat /proc/interrupts in the terminal should indicate irq's 38 & 54 now moved to cpu2.

config queue 'eth1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option interface 'pppoe-wan'
        option overhead '34'
        option download '130000'
        option upload '18000'
        option enabled '1'

I manually enabled sqm by clicking the previous notification and it should be fine now.
What should I do now?