Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Jim Geo <dim.geo@gmail.com>, Jonathan Morton <chromatix99@gmail.com>
Cc: cake@lists.bufferbloat.net
Subject: Re: [Cake] Cake, low speed ADSL & fwmark
Date: Tue, 28 Jul 2020 18:56:13 +0200	[thread overview]
Message-ID: <87pn8f4lzm.fsf@toke.dk> (raw)
In-Reply-To: <CAD9MmSeeEYgcaQ6K1Y=mNrJ2yGDCNiL=X-Z21ZOg5SJLgSiwvQ@mail.gmail.com>

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

  parent reply	other threads:[~2020-07-28 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 21:41 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 [this message]
2020-07-28 14:52 ` Y

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn8f4lzm.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=cake@lists.bufferbloat.net \
    --cc=chromatix99@gmail.com \
    --cc=dim.geo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox