SQM and R7800 router

Weird, i made the changing and lost wifi after reboot.
I removed your code and wifi is back, weird cause with the other script earlier, the wifi was ok

I made a typo - the last line say nssfq_codel - I’ve edited it above.

1 Like

still not easy, maybe worse
:wink:
thanks for your time btw..

Sans titre

Yikes. I’m out of tricks. The tc script is using all the fq_codel defaults - not sure if adjusting the quantum or those subtle tweaks are going to help much.

I’d try the combo of burst and rate that gives you the best results or I’d consider not running SQM. Maybe someone else has some ideas for special combos that work well.

1 Like

Someone in another post said that, maybe it could help my case... I have 10 mbps upload?

if your upstream bandwidth is 10Mbps, cap it with NSS Qdisc as well, or your buffer float will also be affected.

The rate is your cap. I’d experiment with higher and lower rates (even 10mbps).

Make sure when you change settings that you are deleting the settings or restarting your router (you can’t add devices on added devices)


tc qdisc del dev eth0 root

Use this to check your current settings:


tc qdisc show dev eth0

I’d set your burst to 500kbit or 1mbit.

9 was your best, maybe 8.5 with a smaller burst will be a happy spot.


# Shape egress traffic to 8.5 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 8500kbit burst 500kbit
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

How about you size the burst such that it can be cleared in, say 1millisecond (as starting value), so at 10 Mbps, that would be 10Mbps/1000 -> 10 Kbps, or 100Kbps to allow for 10ms?
The point is that after admitting a burst to the device driver, the next packet will have to wait for the full burst to have been transmitted, and if burst is set too high that might already allow for nasty latency spikes....

That makes sense. I agree his burst should be lower. 1mbit had a nasty spike.

so burst at 500kbit, would be better than 1mbit?
I will in few minutes.
btw, with that : tc qdisc del dev eth0 root I thought it would wipe my rc.local script, but it is not. in ssh, yes, but in rc.local the script was still there...

1 Like

It just wipes the current settings. It does not change what is in rc.local (when you wipe the settings - what is in rc.local won’t be loaded until next time you restart).

500kbit means that if you “empty out the bucket” you’ll lose ~50ms (a little more than that) at your speed limit as per @moeller0 calculations above. Hope it gets you good results!

it is not supposed to be in ''mbps'' here: nsstbl rate 8kbit burst 500kbit ??

# Shape egress traffic to 8 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 8kbit burst 500kbit
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

Independent of the unit, 8k is too low :wink:

it is better when I remove the sqm script for upload..

1 Like

hi, can we use the same script for the tp-link C2600?

and the gouvernor script in rc.local?

thanks

1 Like

Yes. Same script as long as you have a NSS build :sunglasses:

1 Like

I hope there is no problem in posting here about my settings or other subjects about SQM and my R7800.
I use Firefox 78.7.0esr (64-bit) as default browser and I use some addons such as adblock plus, noscript, Facebook container, HTTPS everywhere, ublock and DDG Privacy Essentials. These addons might be interfering with the tests. I got many errors on debug console.
Here are 2 screenshots


My setting for SQM are:

config queue 'wan'
        option debug_logging '1'
        option verbosity '5'
        option squash_dscp '1'
        option squash_ingress '1'
        option ingress_ecn 'ECN'
        option egress_ecn 'NOECN'
        option interface 'eth0.12'
        option download '180000'
        option upload '90000'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option qdisc_advanced '1'
        option qdisc_really_really_advanced '0'
        option itarget 'auto'
        option etarget 'auto'
        option enabled '1'
        option linklayer 'ethernet'
        option overhead '44'

But dslreports report tells me some things gonne wrong:

0.00s setting 24 as maximum streams for firefox under linux (sorry)
0.00s Start testing Fiber
00.43s Servers available: 3
00.48s pinging 3 locations
05.49s 104ms Amsterdam, Netherlands, EU
05.49s could not reach Zurich, Switzerland, EU https://t78.dslreports.com
05.49s could not reach Los Angeles 2, CA, USA https://t49.dslreports.com
05.52s cap to 8 stream maximum due to 100ms plus latency
05.52s WARNING could not assemble 8 streams with available or selected servers
05.52s 5 seconds measuring idle buffer bloat
05.65s Internet connection interrupted? - websocket error 
11.31s Trial download normal
11.34s Using GET for upload testing
11.34s preference https set to 1
19.92s  stream0 22.48 megabit Amsterdam, Netherlands, EU
19.92s  stream1 22.75 megabit Amsterdam, Netherlands, EU
19.92s  stream2 21.86 megabit Amsterdam, Netherlands, EU
19.92s  stream3 19.22 megabit Amsterdam, Netherlands, EU
19.92s  stream4 17.35 megabit Amsterdam, Netherlands, EU
19.92s  stream5 16.32 megabit Amsterdam, Netherlands, EU
23.06s End of download testing. Starting upload in 2 seconds
25.06s Web socket to https://t56.dslreports.com are not working reading count =0
25.06s Using POST for upload testing
39.08s Upload report:
39.08s  stream0 13.46 megabit Amsterdam, Netherlands, EU
39.08s  stream1 15.32 megabit Amsterdam, Netherlands, EU
39.08s  stream2 14.39 megabit Amsterdam, Netherlands, EU
39.08s  stream3 15.68 megabit Amsterdam, Netherlands, EU
39.08s  stream4 12.7 megabit Amsterdam, Netherlands, EU
39.08s  stream5 11.1 megabit Amsterdam, Netherlands, EU
45.23s End of upload testing
45.23s Recording upload  83.9
45.23s Timer drops: frames=0 total ms=0 slip=0
45.24s END TEST
47.25s Total megabytes consumed: 355.5 (down:167.4 up:188.1)

I can't get a bufferbloat score. Not sure if this is due to addons but I have already tried to deactivate them all and results are the same. I also tried in a private window which I haven't any addon installed.

Hi Team,

How do you calculate burst ?

Im using gigabit gpon line and not sure that the burst of 1mb is the correct value.

Thanks.

Here is what sqm-scripts uses to calculate the burst size, the idea is by default to allow a bust size worth 1ms of transmission time. Note cake will automatically use its own internal values, here this is only used when either TBF or HTB are used as traffic shapers.

# try to define the burst parameter in the duration required to transmit a burst
# at the configured bandwidth conceptuallly the matching quantum for this burst
# should be BURST/number_of_tiers to give each htb tier a chance to dequeue into
# each burst, but that most likely will end up with a somewhat too small quantum
# note: to get htb to report the configured burst/cburt one needs to issue the
# following command (for ifbpppoe-wan):
#	tc -d class show dev ifb4pppoe-wan
get_burst() {
    local MTU
    local BANDWIDTH
    local SHAPER_BURST_US
    local MIN_BURST
    local BURST
    MTU=$1
    BANDWIDTH=$2 # note bandwidth is always given in kbps
    SHAPER_BURST_US=$3

    sqm_debug "get_burst: 1: ${1}, 2: ${2}, 3: ${3}"

    if [ -z "${SHAPER_BURST_US}" ] ; then
	SHAPER_BURST_US=1000	# the duration of the burst in microseconds
	sqm_warn "get_burst (by duration): Defaulting to ${SHAPER_BURST_US} microseconds bursts."
    fi

    # let's assume ATM/AAL5 to be the worst case encapsulation
    #	and 48 Bytes a reasonable worst case per packet overhead
    MIN_BURST=$(( ${MTU} + 48 ))	# add 48 bytes to MTU for the  ovehead
    MIN_BURST=$(( ${MIN_BURST} + 47 ))	# now do ceil(Min_BURST / 48) * 53 in shell integer arithmic
    MIN_BURST=$(( ${MIN_BURST} / 48 ))
    MIN_BURST=$(( ${MIN_BURST} * 53 ))	# for MTU 1489 to 1536 this will result in MIN_BURST = 1749 Bytes

    # htb/tbf expect burst to be specified in bytes, while bandwidth is in kbps
    BURST=$(( ((${SHAPER_BURST_US} * ${BANDWIDTH}) / 8000) ))

    if [ ${BURST} -lt ${MIN_BURST} ] ; then
	sqm_log "get_burst (by duration): the calculated burst/quantum size of ${BURST} bytes was below the minimum of ${MIN_BURST} bytes."
	BURST=${MIN_BURST}
    fi

    sqm_debug "get_burst (by duration): BURST [Byte]: ${BURST}, BANDWIDTH [Kbps]: ${BANDWIDTH}, DURATION [us]: ${SHAPER_BURST_US}"

    echo ${BURST}
}
1 Like

Thanks @moeller0 in my case in understand this not applicable as im using the nss_fqcodel with nsstbl.

Anyway, thanks for sharing.

This my current configuration with nss supported builds

# ingress traffic
tc qdisc add dev nssifb root handle 1: nsstbl rate 1024Mbit burst 1Mb
tc qdisc add dev nssifb parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

# egress traffic
tc qdisc add dev wan root handle 1: nsstbl rate 1024Mbit burst 1Mb
tc qdisc add dev wan parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default

Nah, the main point is, to size the burst buffer you need to understand that you will always get up to a full burst buffer added to your latency and jitter, the larger burst the more noticeable this gets. So convert the buffer size to the time required to transmit as many packets/bytes, that way you immediatly should be aware of the trad-off you are accepting. If 1ms is too low (because you might be CPU starved) increase that value gently and iteratively (or do a binary search)...

I note that for variable rate links this is not going to work all that well...

1 Like