Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
* [Cake] Cake, low speed ADSL & fwmark
@ 2020-07-27 21:41 Jim Geo
  2020-07-27 22:46 ` Jonathan Morton
  2020-07-28 14:52 ` Y
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Geo @ 2020-07-27 21:41 UTC (permalink / raw)
  To: cake

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Hello,

Thank you for all the efforts you have done to make internet usable.

I currently use htb & fq_codel in my low speed ADSL 6Mbps downlink/1 Mbps
uplink. I use fwmark to control both uplink and downlink with good results
in terms of bandwidth allocation. Streaming video is chopping bulk traffic
successfully.

Is setting up cake worth the effort at such low speeds? Would it reduce
latency?

Regarding fwmark can you please elaborate more on the calculations
performed? Man page is not that helpful.

My understanding is this:

I use 1,2,3,4 as marks of traffic.
If I set the mask to 0xffffff[..] the marks will remain unchanged. Then
right shifting will occur for the unset bits, so they will land on tins
1,1,3,1

Can you please correct me? If logical and performed between mask and mark
value?

Thanks,
Jim

[-- Attachment #2: Type: text/html, Size: 1327 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Cake] Cake, low speed ADSL & fwmark
  2020-07-27 21:41 [Cake] Cake, low speed ADSL & fwmark Jim Geo
@ 2020-07-27 22:46 ` Jonathan Morton
  2020-07-28 16:51   ` Jim Geo
  2020-07-28 14:52 ` Y
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Morton @ 2020-07-27 22:46 UTC (permalink / raw)
  To: Jim Geo; +Cc: cake

> On 28 Jul, 2020, at 12:41 am, Jim Geo <dim.geo@gmail.com> wrote:
> 
> Thank you for all the efforts you have done to make internet usable.
> 
> I currently use htb & fq_codel in my low speed ADSL 6Mbps downlink/1 Mbps uplink. I use fwmark to control both uplink and downlink with good results in terms of bandwidth allocation. Streaming video is chopping bulk traffic successfully.
> 
> Is setting up cake worth the effort at such low speeds? Would it reduce latency?

Cake has a better-quality shaper than HTB does, and a more sophisticated flow-isolation scheme than fq_codel does.  These tend to matter more at low speeds, not less.  It's also generally easier to set up than a compound qdisc scheme.

> Regarding fwmark can you please elaborate more on the calculations performed? Man page is not that helpful.
> 
> My understanding is this:
> 
> I use 1,2,3,4 as marks of traffic.
> If I set the mask to 0xffffff[..] the marks will remain unchanged. Then right shifting will occur for the unset bits, so they will land on tins
> 1,1,3,1
> 
> Can you please correct me? If logical and performed between mask and mark value?

Since there's only a few "tins" at a time used in Cake, and the fwmark is a direct mapping into those tins, a narrow mask is probably safer to use than a wide one.  The reason for the mask is so you can encode several values into different parts of the mark value.  The shift is simply to move the field covered by the mask to the low end of the word, so that it is useful to Cake.

For your use case, a mask of 0xF will be completely sufficient.  It would allow you to specify mark values of 1-15, to map directly in the first 15 tins used by Cake, or a mark value of 0 to fall back to Cake's default Diffserv handling.  None of Cake's tin setups use more than 8 tins, and most use fewer.

 - Jonathan Morton


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Cake] Cake, low speed ADSL & fwmark
  2020-07-27 21:41 [Cake] Cake, low speed ADSL & fwmark Jim Geo
  2020-07-27 22:46 ` Jonathan Morton
@ 2020-07-28 14:52 ` Y
  1 sibling, 0 replies; 6+ messages in thread
From: Y @ 2020-07-28 14:52 UTC (permalink / raw)
  To: cake

Hi,all

My situation is/was similer.
I prefer to use cake because it costs lower cpu time than htb + fq_codel.

tc qdisc add root dev eth0 cake bandwidth 810kbit pppoa-vcmux diffserv4 
ack-filter-aggressive dual-srchost

pi@raspberrypi:~ $ tc -s qdisc show dev eth0
qdisc cake 8023: root refcnt 2 bandwidth 810Kbit diffserv4 dual-srchost 
nonat nowash ack-filter-aggressive split-gso rtt 100.0ms atm overhead 10
  Sent 18265833249 bytes 23590044 pkt (dropped 7172987, overlimits 
53950415 requeues 11)
  backlog 1444b 1p requeues 11
  memory used: 130147b of 4Mb
  capacity estimate: 810Kbit
  min/max network layer size:           30 /    1478
  min/max overhead-adjusted size:       53 /    1643
  average network hdr offset:           14

                    Bulk  Best Effort        Video        Voice
   thresh       50624bit      810Kbit      405Kbit    202496bit
   target        356.5ms       22.3ms       44.6ms       89.1ms
   interval      713.0ms      117.3ms      139.6ms      184.1ms
   pk_delay       62.6ms      132.6ms       13.8ms       86.4ms
   av_delay        9.0ms       42.3ms        7.2ms       14.8ms
   sp_delay        1.3ms        5.5ms        981us        3.6ms
   backlog            0b        1444b           0b           0b
   pkts              369     30744151         8116        10396
   bytes           19926  23924477414       438264      5958198
   way_inds            0      6553855            4            1
   way_miss          250      1048934         4749          205
   way_cols            0            0            0            0
   drops               0      4430387            0            0
   marks               0         7611            0            0
   ack_drop            0      2742600            0            0
   sp_flows            1            4            1            1
   bk_flows            0            2            0            0
   un_flows            0            0            0            0
   max_len            54         2984           54          590
   quantum           300          300          300          300



On 28/07/2020 06:41, Jim Geo wrote:
> Hello,
> 
> Thank you for all the efforts you have done to make internet usable.
> 
> I currently use htb & fq_codel in my low speed ADSL 6Mbps downlink/1 
> Mbps uplink. I use fwmark to control both uplink and downlink with good 
> results in terms of bandwidth allocation. Streaming video is chopping 
> bulk traffic successfully.
> 
> Is setting up cake worth the effort at such low speeds? Would it reduce 
> latency?
> 
> Regarding fwmark can you please elaborate more on the calculations 
> performed? Man page is not that helpful.
> 
> My understanding is this:
> 
> I use 1,2,3,4 as marks of traffic.
> If I set the mask to 0xffffff[..] the marks will remain unchanged. Then 
> right shifting will occur for the unset bits, so they will land on tins
> 1,1,3,1
> 
> Can you please correct me? If logical and performed between mask and 
> mark value?
> 
> Thanks,
> Jim
> 
> 
> 
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Cake] Cake, low speed ADSL & fwmark
  2020-07-27 22:46 ` Jonathan Morton
@ 2020-07-28 16:51   ` Jim Geo
  2020-07-28 16:54     ` Jonathan Morton
  2020-07-28 16:56     ` Toke Høiland-Jørgensen
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Geo @ 2020-07-28 16:51 UTC (permalink / raw)
  To: Jonathan Morton; +Cc: cake

>
> > On 28 Jul, 2020, at 12:41 am, Jim Geo <dim.geo@gmail.com> wrote:
> >
> > Thank you for all the efforts you have done to make internet usable.
> >
> > I currently use htb & fq_codel in my low speed ADSL 6Mbps downlink/1 Mbps uplink. I use fwmark to control both uplink and downlink with good results in terms of bandwidth allocation. Streaming video is chopping bulk traffic successfully.
> >
> > Is setting up cake worth the effort at such low speeds? Would it reduce latency?
>
> Cake has a better-quality shaper than HTB does, and a more sophisticated flow-isolation scheme than fq_codel does.  These tend to matter more at low speeds, not less.  It's also generally easier to set up than a compound qdisc scheme.
>
> > Regarding fwmark can you please elaborate more on the calculations performed? Man page is not that helpful.
> >
> > My understanding is this:
> >
> > I use 1,2,3,4 as marks of traffic.
> > If I set the mask to 0xffffff[..] the marks will remain unchanged. Then right shifting will occur for the unset bits, so they will land on tins
> > 1,1,3,1
> >
> > Can you please correct me? If logical and performed between mask and mark value?
>
> Since there's only a few "tins" at a time used in Cake, and the fwmark is a direct mapping into those tins, a narrow mask is probably safer to use than a wide one.  The reason for the mask is so you can encode several values into different parts of the mark value.  The shift is simply to move the field covered by the mask to the low end of the word, so that it is useful to Cake.
>
> For your use case, a mask of 0xF will be completely sufficient.  It would allow you to specify mark values of 1-15, to map directly in the first 15 tins used by Cake, or a mark value of 0 to fall back to Cake's default Diffserv handling.  None of Cake's tin setups use more than 8 tins, and most use fewer.
>
>  - Jonathan Morton
>

Thanks for the info! I've noticed that by using 0xF, marks 1-4 become
tins 0-3. Tin 0 is special? I assumed it's for bulk traffic. I use
diffserv8.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Cake] Cake, low speed ADSL & fwmark
  2020-07-28 16:51   ` Jim Geo
@ 2020-07-28 16:54     ` Jonathan Morton
  2020-07-28 16:56     ` Toke Høiland-Jørgensen
  1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Morton @ 2020-07-28 16:54 UTC (permalink / raw)
  To: Jim Geo; +Cc: cake

> On 28 Jul, 2020, at 7:51 pm, Jim Geo <dim.geo@gmail.com> wrote:
> 
> Thanks for the info! I've noticed that by using 0xF, marks 1-4 become
> tins 0-3. Tin 0 is special? I assumed it's for bulk traffic. I use
> diffserv8.

Mark 0 (not tin 0) is special because it corresponds to "no mark set".  Otherwise, what you see is what you get, and mark N goes into tin N-1.

 - Jonathan Morton

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Cake] Cake, low speed ADSL & fwmark
  2020-07-28 16:51   ` Jim Geo
  2020-07-28 16:54     ` Jonathan Morton
@ 2020-07-28 16:56     ` Toke Høiland-Jørgensen
  1 sibling, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-07-28 16:56 UTC (permalink / raw)
  To: Jim Geo, Jonathan Morton; +Cc: cake

Jim Geo <dim.geo@gmail.com> writes:

>>
>> > On 28 Jul, 2020, at 12:41 am, Jim Geo <dim.geo@gmail.com> wrote:
>> >
>> > Thank you for all the efforts you have done to make internet usable.
>> >
>> > I currently use htb & fq_codel in my low speed ADSL 6Mbps downlink/1 Mbps uplink. I use fwmark to control both uplink and downlink with good results in terms of bandwidth allocation. Streaming video is chopping bulk traffic successfully.
>> >
>> > Is setting up cake worth the effort at such low speeds? Would it reduce latency?
>>
>> Cake has a better-quality shaper than HTB does, and a more sophisticated flow-isolation scheme than fq_codel does.  These tend to matter more at low speeds, not less.  It's also generally easier to set up than a compound qdisc scheme.
>>
>> > Regarding fwmark can you please elaborate more on the calculations performed? Man page is not that helpful.
>> >
>> > My understanding is this:
>> >
>> > I use 1,2,3,4 as marks of traffic.
>> > If I set the mask to 0xffffff[..] the marks will remain unchanged. Then right shifting will occur for the unset bits, so they will land on tins
>> > 1,1,3,1
>> >
>> > Can you please correct me? If logical and performed between mask and mark value?
>>
>> Since there's only a few "tins" at a time used in Cake, and the fwmark is a direct mapping into those tins, a narrow mask is probably safer to use than a wide one.  The reason for the mask is so you can encode several values into different parts of the mark value.  The shift is simply to move the field covered by the mask to the low end of the word, so that it is useful to Cake.
>>
>> For your use case, a mask of 0xF will be completely sufficient.  It would allow you to specify mark values of 1-15, to map directly in the first 15 tins used by Cake, or a mark value of 0 to fall back to Cake's default Diffserv handling.  None of Cake's tin setups use more than 8 tins, and most use fewer.
>>
>>  - Jonathan Morton
>>
>
> Thanks for the info! I've noticed that by using 0xF, marks 1-4 become
> tins 0-3. Tin 0 is special? I assumed it's for bulk traffic. I use
> diffserv8.

Nah, it's just that the fwmark uses 1-indexed tin numbers (because a
mark of 0 is the same as 'unset').

The code in cake_select_tin() that handles the mark is literally just this:

	else if (mark && mark <= q->tin_cnt)
		tin = q->tin_order[mark - 1];

-Toke

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-28 16:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 21:41 [Cake] Cake, low speed ADSL & fwmark Jim Geo
2020-07-27 22:46 ` Jonathan Morton
2020-07-28 16:51   ` Jim Geo
2020-07-28 16:54     ` Jonathan Morton
2020-07-28 16:56     ` Toke Høiland-Jørgensen
2020-07-28 14:52 ` Y

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox