Cake: diffserv3 seems to up my bandwidth vs using besteffort

On DSLReports I measure 16~16.5mbit/s with cake and 18mbit/s without cake, as expected.
But my real-world download speeds (e.g. from steam or chrome) are at 12mbit/s, which testmy.net seems to agree with (albeit with some big fluctuations/variance).

ISP is Comcast and they advertise 15/2 mbit/s.

These are my configs on an ER-X:
Down: 17200kbit/s, Up: 2200kbit/s
(Ingress) nat wash dual-dsthost ingress mpu 64
(Egress) nat wash dual-srchost mpu 64
and link-layer: Ethernet with overhead 22
Everything else is left on their defaults.

For some reason, setting "Ignore DSCP on ingress" to "Allow" ups my bandwidth back to a steady 16mbit/s on testmy.net and on downloads (and DSLReports remains unaffected). The problem with leaving it on "Allow" is that most traffic is lumped into the 'Bulk' tin and sometimes in 'Best Effort' (because comcast). Some of the traffic in 'Best Effort' is bulk so per-host isolation is sort of circumvented in this way.

Any idea why letting cake do diffserv on ingress seems to up my bandwidth?

also: I noticed during my DSLReports speedtests, most traffic fell under 'Best Effort'

I'd like to see the output from 'tc -s qdisc' please - I have a fundamental distrust of 'sqm-scripts' and setting custom parameters.

I raised my bandwidth config slightly.
Dscp set to "allow"

qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 30718018112 bytes 34584385 pkt (dropped 0, overlimits 0 requeues 209)
 backlog 0b 0p requeues 209
  maxpacket 7570 drop_overlimit 0 new_flow_count 67842 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 813d: dev eth0.2 root refcnt 2 bandwidth 2300Kbit diffserv3 dual-srchost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 841564317 bytes 5818991 pkt (dropped 7107, overlimits 2695533 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 4196000b of 4Mb
 capacity estimate: 2300Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh      143744bit     2300Kbit      575Kbit
  target        126.4ms        7.9ms       31.6ms
  interval      252.8ms      102.9ms      126.6ms
  pk_delay          0us       12.6ms        5.8ms
  av_delay          0us        1.5ms        201us
  sp_delay          0us         24us         17us
  backlog            0b           0b           0b
  pkts                0      5797606        28492
  bytes               0    841799333      3352106
  way_inds            0       460863          211
  way_miss            0       107931         6866
  way_cols            0         2684            0
  drops               0         7107            0
  marks               0            3            0
  ack_drop            0            0            0
  sp_flows            0            2            1
  bk_flows            0            1            0
  un_flows            0            0            0
  max_len             0        12906          590
  quantum           300          300          300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 15710362013 bytes 13439476 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev Wireguard root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 813e: dev ifb4eth0.2 root refcnt 2 bandwidth 17600Kbit diffserv3 dual-dsthost nat wash ingress no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 15936810034 bytes 13418516 pkt (dropped 20960, overlimits 10553928 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 2526288b of 4Mb
 capacity estimate: 17600Kbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh       1100Kbit    17600Kbit     4400Kbit
  target         16.5ms        5.0ms        5.0ms
  interval      111.5ms      100.0ms      100.0ms
  pk_delay       13.3ms        4.7ms        508us
  av_delay        9.3ms        265us         26us
  sp_delay         32us         17us         17us
  backlog            0b           0b           0b
  pkts         12968092       467296         4088
  bytes     15676502224    285314901       649896
  way_inds       169745        25633            0
  way_miss        48465        73201            2
  way_cols            0            0            0
  drops           20691          269            0
  marks               3            2            0
  ack_drop            0            0            0
  sp_flows            1            2            1
  bk_flows            0            0            0
  un_flows            0            0            0
  max_len         16654         7570          244
  quantum           300          537          300

With dscp set to "ignore"

qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 30897506413 bytes 34772917 pkt (dropped 0, overlimits 0 requeues 210)
 backlog 0b 0p requeues 210
  maxpacket 7570 drop_overlimit 0 new_flow_count 68170 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8141: dev eth0.2 root refcnt 2 bandwidth 2300Kbit diffserv3 dual-srchost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 9837697 bytes 36971 pkt (dropped 276, overlimits 24268 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 207784b of 4Mb
 capacity estimate: 2300Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh      143744bit     2300Kbit      575Kbit
  target        126.4ms        7.9ms       31.6ms
  interval      252.8ms      102.9ms      126.6ms
  pk_delay          0us        8.5ms        9.6ms
  av_delay          0us        1.3ms        1.8ms
  sp_delay          0us         12us        220us
  backlog            0b           0b           0b
  pkts                0        37114          133
  bytes               0     10223695        15867
  way_inds            0           53            2
  way_miss            0         1658           13
  way_cols            0            0            0
  drops               0          276            0
  marks               0            0            0
  ack_drop            0            0            0
  sp_flows            0            1            1
  bk_flows            0            1            0
  un_flows            0            0            0
  max_len             0         6056          464
  quantum           300          300          300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 83602980 bytes 68308 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev Wireguard root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8142: dev ifb4eth0.2 root refcnt 2 bandwidth 17600Kbit besteffort dual-dsthost nat wash ingress no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 84987665 bytes 68071 pkt (dropped 237, overlimits 44238 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 129892b of 4Mb
 capacity estimate: 17600Kbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh      17600Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        5.6ms
  av_delay        2.0ms
  sp_delay         13us
  backlog            0b
  pkts            68308
  bytes        85334112
  way_inds           79
  way_miss         1414
  way_cols            0
  drops             237
  marks               0
  ack_drop            0
  sp_flows            3
  bk_flows            1
  un_flows            0
  max_len          9084
  quantum           537

With these settings the maximal measurable goodput should be:

17200 * ((1500-20-20)/(1500+22)) = 16499 Kbps
2200 * ((1500-20-20)/(1500+22)) = 2110 Kbps

From my ISP, I only get 25.2/2.8 with multithreaded and 42/2.7 without multithreaded, while fast.com gives 43/30, so I would not put much stock in testmy.net (as far as speedtests go it beats speedotf.me, which routinely reports impossible numbers...), but that still leaves your observed slowdown for real downloads...

As a test, please try again without the "ingress" option (as that will reduce the measurable thoughput if you have multiple downloads going on simultaneously, which is a good thing if you want to keep latency under load in check, but for testing disabling is a good idea). Also, it would be helpful, if you could post links to your dslreports speedtest results (please see https://forum.openwrt.org/t/sqm-qos-recommended-settings-for-the-dslreports-speedtest-bufferbloat-testing/2803 for recommendations for dslreports).

Yeah, Comcast is still doing this arbitrary re-mapping into CS1? I really need to get @ldir's great copy-egress-dscs-to-ingress-packets-of-the-same-flow mode into sqm-scripts as that should defang Comcast's silliness for good.

Why, the per host isolation should still work...

:wink:

That seems as expected.

as does this. Puzzling.

Please do a test with and without the ingress keyword, if you will. That still does not explain the differences between best-effort and diffserv3, but it might indicate a mechanism.

Okay, I've removed the "ingress" option.

I'll have to update you much later when the network is quiet.

Ah, disregard what i said.

Dscp: "Allow"

qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 34184585076 bytes 39117350 pkt (dropped 0, overlimits 0 requeues 240)
 backlog 0b 0p requeues 240
  maxpacket 7570 drop_overlimit 0 new_flow_count 82561 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8149: dev eth0.2 root refcnt 2 bandwidth 2300Kbit diffserv3 dual-srchost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 13470386 bytes 64860 pkt (dropped 1238, overlimits 33466 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 192352b of 4Mb
 capacity estimate: 2300Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh      143744bit     2300Kbit      575Kbit
  target        126.4ms        7.9ms       31.6ms
  interval      252.8ms      102.9ms      126.6ms
  pk_delay          0us        4.0ms        5.4ms
  av_delay          0us        437us        267us
  sp_delay          0us         34us         17us
  backlog            0b           0b           0b
  pkts                0        65990          108
  bytes               0     15315586        14308
  way_inds            0          823            0
  way_miss            0          560           46
  way_cols            0            0            0
  drops               0         1238            0
  marks               0            0            0
  ack_drop            0            0            0
  sp_flows            0            2            1
  bk_flows            0            1            0
  un_flows            0            0            0
  max_len             0         9084          480
  quantum           300          300          300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 213822194 bytes 158285 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev Wireguard root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 814a: dev ifb4eth0.2 root refcnt 2 bandwidth 17600Kbit diffserv3 dual-dsthost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 214518602 bytes 156450 pkt (dropped 1792, overlimits 129926 requeues 0)
 backlog 63516b 43p requeues 0
 memory used: 211940b of 4Mb
 capacity estimate: 17600Kbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh       1100Kbit    17600Kbit     4400Kbit
  target         16.5ms        5.0ms        5.0ms
  interval      111.5ms      100.0ms      100.0ms
  pk_delay       42.5ms        1.9ms        639us
  av_delay       34.3ms        169us         10us
  sp_delay       14.7ms         21us          9us
  backlog        63516b           0b           0b
  pkts           122388        35886           11
  bytes       166917030     50264750         1764
  way_inds          879           11            0
  way_miss          168          403            2
  way_cols            0            0            0
  drops            1735           57            0
  marks               0            0            0
  ack_drop            0            0            0
  sp_flows            1            2            1
  bk_flows            2            0            0
  un_flows            0            0            0
  max_len          7570         9084          244
  quantum           300          537          300

Dscp: "Ignore"

qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 ta                                                                                                                                                             rget 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 33765069756 bytes 38653319 pkt (dropped 0, overlimits 0 requeues 236)
 backlog 0b 0p requeues 236
  maxpacket 7570 drop_overlimit 0 new_flow_count 81469 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8145: dev eth0.2 root refcnt 2 bandwidth 2300Kbit diffserv3 dual-srch                                                                                                                                                             ost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 19534286 bytes 107351 pkt (dropped 1087, overlimits 72746 requeues 0)
 backlog 6039b 5p requeues 0
 memory used: 135072b of 4Mb
 capacity estimate: 2300Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                   Bulk  Best Effort        Voice
  thresh      143744bit     2300Kbit      575Kbit
  target        126.4ms        7.9ms       31.6ms
  interval      252.8ms      102.9ms      126.6ms
  pk_delay          0us       37.5ms        6.3ms
  av_delay          0us       17.5ms        306us
  sp_delay          0us        1.2ms         60us
  backlog            0b        6039b           0b
  pkts                0       108284          159
  bytes               0     21154221        21179
  way_inds            0          174            0
  way_miss            0         1228           68
  way_cols            0            0            0
  drops               0         1087            0
  marks               0            0            0
  ack_drop            0            0            0
  sp_flows            0            3            1
  bk_flows            0            1            0
  un_flows            0            0            0
  max_len             0        14940          313
  quantum           300          300          300

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
 Sent 167632763 bytes 128319 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev Wireguard root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8146: dev ifb4eth0.2 root refcnt 2 bandwidth 17600Kbit besteffort dua                                                                                                                                                             l-dsthost nat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22 mpu 64
 Sent 167555627 bytes 126260 pkt (dropped 2059, overlimits 94484 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 142048b of 4Mb
 capacity estimate: 17600Kbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh      17600Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        784us
  av_delay         45us
  sp_delay          9us
  backlog            0b
  pkts           128319
  bytes       170667081
  way_inds           17
  way_miss         1201
  way_cols            0
  drops            2059
  marks               1
  ack_drop            0
  sp_flows            3
  bk_flows            1
  un_flows            0
  max_len          9084
  quantum           537

1 Like

image
I did three tests each, and noted the total bandwidth used (Data is in MBytes)

It's just like what you said, so I'll just leave the ingress keyword out.
With no dscp, bufferbloat seems to be similar with and without "ingress", but i'll need to repeat the dslreports test more. Diffserv3 gives me occaisonal spikes in bufferbloat.

Well, Ingress shaping is less precise than egress shaping, at least if one uses a shaper designed for egress. Cake is the only shaper that explicitly allows to shape ingress. But what does that mean? An egress shaper will act such that the data it transmits is <= the configured rate, an ingress shaper such that the rate of incoming traffic will be <= the configured rate. If one wants to avoid backspill ofvexcess traffic into the typically oversized and undermanaged buffers of the upstream network device than ingress shaping is the correct solution... Ingress shaping will behave more aggressive the more flows there are and the less elastic/responsive these flows behave.
As it looks the dslteports test uses a sufficiently low number of responsive enough flows to not cause a large bandwidth sacrifice. While your other traffic seems less ideal, but to see that you will need to run a latency test while saturating your link (that could be as simple as running opkg update ; opkg install mtr ; mtr 8.8.8.8 and look at the RRT of all upstream hops before and during saturating the link).
None of this explains your observed differences in ingress behavior between best effort and diffserv3 though.
And finally, I am a strong believer in "your network, your rules", so if you are happy without the ingress keyword that obviously is fine too, as your networks admin it is your prerogative to set your desired/acceptable trade-off between bandwidth sacrifice and latency under load.

1 Like