Questions about SQM

@richb-hanover yeah that's right.

Never had trouble with the cables but just for completeness:

Ethernet cables used are labeled CAT7 but are most likely just CAT6 with the highest grade of shielding since there's still (shielded) RJ45 plugs on them (and iirc real CAT7 cables don't have RJ45). The COAX cable is also one with a higher grade of shielding.

Topology with cable length:

Wired devices (3m and shorter) -> Switch (3m) -> Router (15m) -> Cisco EPC3212 (50cm) -> Cable stuff (outlet, amp etc) -> ISP

Should 4 bytes be added to every cable connection? I thought it only applied to DSL connections. Is it always 4 bytes or should I run the ATM detector script to find the correct value?

Hi Matt,

well yes and no.The shaper used in DOCSIS systems that limits a users maximal bandwidth does completely ignore DOCSIS overhead and only includes ethernet frames including their frame check sequence (FCS 4 Byte). (The linux kernel accounts for ethernet framing without the FCS).

To cite the relevant section from the Docsis standard (http://www.cablelabs.com/specification/docsis-3-0-mac-and-upper-layer-protocols-interface-specification/):

"C.2.2.7.2 Maximum Sustained Traffic Rate 632 This parameter is the rate parameter R of a token-bucket-based rate limit for packets. R is expressed in bits per second, and MUST take into account all MAC frame data PDU of the Service Flow from the byte following the MAC header HCS to the end of the CRC, including every PDU in the case of a Concatenated MAC Frame. This parameter is applied after Payload Header Suppression; it does not include the bytes suppressed for PHS. The number of bytes forwarded (in bytes) is limited during any time interval T by Max(T), as described in the expression: Max(T) = T * (R / 8) + B, (1) where the parameter B (in bytes) is the Maximum Traffic Burst Configuration Setting (refer to Annex C.2.2.7.3). NOTE: This parameter does not limit the instantaneous rate of the Service Flow. The specific algorithm for enforcing this parameter is not mandated here. Any implementation which satisfies the above equation is conformant. In particular, the granularity of enforcement and the minimum implemented value of this parameter are vendor specific. The CMTS SHOULD support a granularity of at most 100 kbps. The CM SHOULD support a granularity of at most 100 kbps. NOTE: If this parameter is omitted or set to zero, then there is no explicitly-enforced traffic rate maximum. This field specifies only a bound, not a guarantee that this rate is available."

So in essence DOCSIS users need to (only) account for 18 Bytes of ethernet overhead in both ingress and egress directions under non-congested conditions. But since on an ethN interface the linux kernel already accounts for 14 of those for fq_codel+HTB specify the overhead as 4. For recent cake you can and should specify the overhead as 18 as cake can undo the kernels automatic overhead addition.

Best Regards

Found a good slot to do the tests earlier.

Overall results didn't change. Setting "linklayer" did also not make a difference. Still getting best results with ingress set to 0.

Changes for this test run:

  • Switched to "LEDE Reboot SNAPSHOT r2701-c5ca304 / LuCI Master (git-16.363.68908-f12fdba)" with minimal extra packages.
  • Used "fq_codel / simple" for all tests.
  • Values for ingress / egress range from 80% to 95%.
  • Enabled "Hi-Res BufferBloat" on the speed test and set download / upload times to 30 seconds.

Did the tests as per suggestions from @moeller0

Since it's a lot of text, I put the results on pastebin (including the links to the speed test results). They will expire in 2 weeks.

Speed test result with SQM off & cmd line output just after enabling SQM:

Ingress & egress on & link layer ethernet & cmd line output just after running a speed test:

Ingress & egress on & link layer none & cmd line output just after running a speed test:

Egress only & link layer none & cmd line output just after running a speed test:

Egress only & link layer ethernet & cmd line output just after running a speed test:

Also just found these in the kernel log:

I guess they are from SQM_VERBOSITY_MAX=8? Hadn't noticed before tho.

HI hbr,

thanks for the data, I will take a few days before I find time to look over it closely as I did not find any smoking gun on my first reading (and I might not find one on fine reading either). The error messages you got in the log are an already known issue with the hfsc kernel module used by some of the qos scripts (hfsc_lite.qos, hfsc_litest.qos, and nxt_routed_hfsc.qos) if you tried those that might have triggered the message (but we also load the hfsc module during sqm start-up to have it available for the listed hfsc using scripts, auto-loading of modules is not reliable on all "supported" distributions)

Best Regards

Okay, I have looked closer into your files and I am sorry to say, I made you do all these tests for no gain, I have no real idea why you seem to be better of with only upstream shaping. I also am out of realistic ideas what to test next...

Best Regards

No problem, thanks for all the help.

I'll keep testing with newer builds and see how things go. Might even bug my ISP about it (among other things).

And if it doesn't change, I'll just leave it at that since it does improve things over not using SQM at all.

Hi. I have a question about sqm:

When I use SQM, application need realtime data like Skype, Viber, Facebook Video Chat have sound distortion (and video lag). Disable SQM will improve. Can you give me some advise for the config ?

Here is my config:

config queue
	option interface 'eth0.2'
	option qdisc 'fq_codel'
	option qdisc_advanced '0'
	option script 'hfsc_lite.qos'
	option download '18000'
	option upload '18000'
	option linklayer 'ethernet'
	option overhead '8'
	option verbosity '8'
	option debug_logging '0'
	option enabled '1'
  1. You should be sure to read the Howto for SQM at https://wiki.openwrt.org/doc/howto/sqm

  2. If you've followed those instructions and don't see an improvement, please copy/paste the questions from Debugging SQM to Eliminate Bufferbloat into a response, and add your answers.

Hi. Of course i've read all before set up. Here is my test result (SQM turned on):

For the answer:
Model: TP-Link Archer C50
LEDE ver: LEDE Reboot SNAPSHOT r2831-e9f0b75
Connection: Fiber (using PPPoE)
Default Down/Up: 20Mbps/20Mbps
Speeds with SQM turned off

WAN interface: eth0.2
SQM setup:

config queue
	option interface 'eth0.2'
	option qdisc 'fq_codel'
	option qdisc_advanced '0'
	option script 'hfsc_lite.qos'
	option download '18000'
	option upload '18000'
	option linklayer 'ethernet'
	option overhead '8'
	option verbosity '8'
	option debug_logging '0'
	option enabled '1'
1 Like

Your upload speed is not set to ~85% of your provided bandwidth

Speeds with SQM turned off:
    3.12 Mbps Upload

But your settings is 18000

Our country international cable currently having problem so upload speed is not correct, it's the same as download speed.
This is speed test in VN:

@danghuy1994 Both tests with SQM off and on have a "D" grade for connection quality in your dslreports speedtests. According to the FAQ on dslreports, that means you have a packet loss between 5% and 12%. Realtime data such as VOIP and videocalls are extremely sensitive to packet loss and no amount of shaping will fix that problem. As a matter of fact, non-realtime data also suffers from packet loss by decreasing throughput.

There is something very wrong with your setup or ISP that is causing these issues, as that is an extremely high figure for packet loss. I would focus on getting the packet loss under control before looking into any shaping with SQM.

1 Like

@danghuy1994 Out of curiosity, try a dslreport speedtest when connected directly to Cisco EPC3212 via Ethernet cable.

Here you are @komawoyo :

Apparently there is problem in the cable connection. Thanks for your info @Mushoz :smile: May I ask a little further ? Why I still get max download speed on a bad cable ? Thank.

I'm not sure in regards to the cable connection, but now we know what your download/upload is, can you test with the following settings just to see if that makes a difference in regards to bufferbloat (I'm sure the values can be set higher)

	option download '15000'
	option upload '3000'

Direct connection to the Cisco EPC3212 seems to be good, Bufferbloat and Quality ratings are both A+!

1 Like

Hi,
I have a quick question regarding SQM... I currently have a mesh network with 2 AP's and a gateway ( router)... I know SQM will be worth deploying on the Gateway / Router device; but will I gain anything deploying it on each note to regulate the mesh traffic???

Many Thanks

Alex

Hi there,

mmmh, sqm-scripts is not ideal for wifi links, as it really really needs to have fixed bandwidth (or at least slowly changing bandwidth) to function; most WLAN links are just to variable to allow for static shapers like sqm-scripts' to work well. If you have ath9k (or less so ath10K) radios the airtime fairness patches (which I believe to be part of lede) might actually help more. Now if your radio links are super stable you might have luck with sqm-scripts, but even then the half-duplex nature of current generation WLAN will pose a problem...

Best Regards

1 Like

Ah, question answered! Many Thanks for the explanation... I'll leave the repeaters as is! :slight_smile:

Alex