SQM info/clarifications

i have a vdsl2 link ptm connection with vlan, no pppoe, from wiki i should use ethernet with overhead of 26. was wondering if there is any difference for sqm between using link layer adaptation tab in luci or using manual parameters in ingress/egress.

with link layer adaptation:

config queue 'eth0'
        ...
        ...
        option linklayer 'ethernet'
        option overhead '26'
        option eqdisc_opts 'ack-filter'
        ...
        ...

root@router:~# tc -d qdisc show dev ifb4eth0.2 && tc -d qdisc show dev eth0.2
...
qdisc cake 800a: root refcnt 2 bandwidth 85500Kbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms **noatm overhead 26** 
...
qdisc cake 8009: root refcnt 2 bandwidth 18500Kbit besteffort triple-isolate nonat nowash ack-filter split-gso rtt 100.0ms **noatm overhead 26** 
...

with manual parameters in ingress/egtress:

config queue 'eth0'
        ...
        ...
        option linklayer 'none'
        option iqdisc_opts 'bridged-ptm ether-vlan ingress'
        option eqdisc_opts 'bridged-ptm ether-vlan ack-filter'
        ...
        ...
        
        
root@router:~# tc -d qdisc show dev ifb4eth0.2 && tc -d qdisc show dev eth0.2
...
qdisc cake 800e: root refcnt 2 bandwidth 85500Kbit besteffort triple-isolate nonat wash ingress no-ack-filter split-gso rtt 100.0ms **ptm overhead 26** 
...
qdisc cake 800d: root refcnt 2 bandwidth 18500Kbit besteffort triple-isolate nonat nowash ack-filter split-gso rtt 100.0ms **ptm overhead 26**
...

the result is overhead of 26 in both case, and no-atm vs ptm in details from tc -d comand.. is this basically the same from sqm prospective? or?

many thanks

No, in the latter version you still have the ptm keyword that is not in the former, and both are missing a mpu 68 stanza. The ptm keyword aims at taking care of PTM's 64/65 encoding, but it does so on a packet by packet fashion that requires to do individual calculations per packet. Instead I would propose to simply set the shaper 100-100*64/65 = 1.6 percentage points lower than otherwise intended and thereby statically solving the PTM encoding issue (unlike ATM 48/53 encapsulation, which is per packet and introduces packet size dependent padding, ptm encapsulation is not on a per packet basis and can be addresses by statically reducing the shaper bandwidth).

so use 26 overhead link layer ethernet in config (or from luci) and just play around with bandwidth until i get good result from dslreports or flent, no need to use ptm keyword, i'm getting this right (sorry bit of a noob here)?

thanks

Yes, pretty much, here are my recommended settings for a config file, but please adjust the bandwidth parameters and check the rest for sanity:

    option verbosity '5'
    option qdisc_advanced '1'
    option squash_dscp '0'
    option squash_ingress '0'
    option ingress_ecn 'ECN'
    option egress_ecn 'ECN'
    option qdisc_really_really_advanced '1'
    option linklayer 'ethernet'
    option overhead '26'
    option linklayer_advanced '1'
    option tcMTU '2047'
    option tcTSIZE '128'
    option linklayer_adaptation_mechanism 'default'
    option iqdisc_opts 'nat dual-dsthost ingress'
    option eqdisc_opts 'nat dual-srchost ack-filter'
    option interface 'eth0.2'
    option script 'piece_of_cake.qos'
    option tcMPU '68'
    option download '85500'
    option qdisc 'cake'
    option debug_logging '1'
    option enabled '1'
    option upload '18500'

Also note that this enables ECN for ingress and egress and configures for by-internal-IP-fairness, if you do not want that remove the dual-srchost and dual-dsthost keywords. Also this uses the nat keyword as that is required by the dual-xxhost isolation modes.

1 Like

i'll play around with this but those number are doing the magic for now

have both to 1 becouse i don't really trust what my provider is doing with marking, or should i?

was totally unaware of this options, will test and get documented (the mpu should refer to your hint about ptm in previous post)

i'm aware how ip fairness works, i will test your suggestion for ecn (i had it on just for ingress btw), will also do some reading on this. apart from this few points i almost got my config right, cannot thank you enough for such a detailed explenation and for tacking time to write a full config. i will mark this as solved since the original question was clearly answered. if you have any other suggestion i will gladly read it :slight_smile:

No, that is a policy decision you need to take, squashing is the safer option, good catch.

Yes, and cake will happily ignore tcMTU and tcTSIZE, just as it should, as these are specific to tc-stab, and cake has its own, arguably better way to deal with per packet overhead.

Yes, this is the default in sqm, but with your upload you might as well enable it, the idea behind the default is that in a slow link, not sending a packet allows us to send more important packets earlier.

took me ages to get a decent connection and the all is ruined by a crappy provider modem! anyways just for reference this is my config with your suggestions (testing with no nat at the moment):

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

config queue 'eth0'
        option interface 'eth0.2'
        option verbosity '5'
        option enabled '1'
        option qdisc_advanced '1'
        option squash_ingress '1'
        option ingress_ecn 'ECN'
        option qdisc_really_really_advanced '1'
        option linklayer 'ethernet'
        option overhead '26'
        option download '85500'
        option upload '18500'
        option squash_dscp '1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option eqdisc_opts 'ack-filter'
        option egress_ecn 'ECN'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '68'
        option linklayer_adaptation_mechanism 'default'
        option debug_logging '1'

and some results:

root@router:~# tc -s qdisc show dev ifb4eth0.2 && tc -s qdisc show dev eth0.2
qdisc cake 8042: root refcnt 2 bandwidth 85500Kbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 26 mpu 68 
 Sent 813021793 bytes 657616 pkt (dropped 6794, overlimits 452624 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 815976b of 4275000b
 capacity estimate: 85500Kbit
 min/max network layer size:           42 /    1500
 min/max overhead-adjusted size:       68 /    1526
 average network hdr offset:           14

                  Tin 0
  thresh      85500Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        925us
  av_delay        136us
  sp_delay         19us
  backlog            0b
  pkts           664410
  bytes       823305349
  way_inds         2026
  way_miss         1086
  way_cols            0
  drops            6794
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         10598
  quantum          1514

qdisc cake 8041: root refcnt 2 bandwidth 18500Kbit besteffort triple-isolate nonat nowash ack-filter split-gso rtt 100.0ms noatm overhead 26 mpu 68 
 Sent 274998453 bytes 499954 pkt (dropped 4288, overlimits 493459 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 299392b of 4Mb
 capacity estimate: 18500Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       68 /    1526
 average network hdr offset:           14

                  Tin 0
  thresh      18500Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        371us
  av_delay         79us
  sp_delay         13us
  backlog            0b
  pkts           504242
  bytes       280562429
  way_inds           94
  way_miss         1172
  way_cols            0
  drops            3643
  marks               0
  ack_drop          645
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          9084
  quantum           564

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 806144713 bytes 664410 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0


A+ http://www.dslreports.com/speedtest/64766997 http://www.dslreports.com/speedtest/64766993
A http://www.dslreports.com/speedtest/64766985 http://www.dslreports.com/speedtest/64767026

apart from some random spikes (will investigate) sqm wins again!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.