From: Jeff Weeks <jweeks@sandvine.com>
To: Jonathan Morton <chromatix99@gmail.com>,
"Luis E. Garcia" <luis@bitamins.net>
Cc: "cake@lists.bufferbloat.net" <cake@lists.bufferbloat.net>,
"codel@lists.bufferbloat.net" <codel@lists.bufferbloat.net>
Subject: Re: [Codel] [Cake] Proposing COBALT
Date: Tue, 24 May 2016 13:47:45 +0000 [thread overview]
Message-ID: <274D3A0FA900FD47AA6B56991AAA32FDC5529FC8@wtl-exchp-1.sandvine.com> (raw)
In-Reply-To: <323AFC22-A092-4F59-8197-AF21EF73FD58@gmail.com>
> In COBALT, I keep the drop-scheduler running in this phase, but without actually dropping packets, and *decrementing* count instead of incrementing it; the backoff phase then
> naturally ends when count returns to zero, instead of after an arbitrary hard timeout. The loop simply ensures that count will reduce by the correct amount, even if traffic
> temporarily ceases on the queue. Ideally, this should cause Codel’s count value to stabilise where 50% of the time is spent above target sojourn time, and 50% below. (Actual
> behaviour won’t quite be ideal, but it should be closer than before.)
I tried this as well, at one point, but can't remember, off-hand, why I didn't stick with it; will have to see if I can find mention of it in my notes.
What trigger are you using to decrement count? I initially did a crude decrement of count every interval, but then you end up with a ramp-down time which is considerably slower then the ramp-up (and the ramp up is slow to begin with).
I assume you're actually re-calculating the next drop, using the 1/sqrt(count) but instead of dropping and increasing count, you're simply decreasing count, so the time to get from 1->N is the same as the time to get to N->1?
> As another simplification, I eliminated the “primed” state (waiting for interval to expire) as an explicit entity, by simply scheduling the first drop event to be at now+interval when
> entering the dropping state. This also eliminates the first_above_time variable. Any packets with sojourn times below target will bump Codel out of the dropping state anyway.
How do you handle the case where you're scheduled a drop event 100ms in the future, and we immediately see low latency; is the event descheduled?
If not, what if we then see high latency again; can the still-scheduled-event cause us to start dropping packets earlier than 100ms?
--Jeff
________________________________________
From: Codel [codel-bounces@lists.bufferbloat.net] on behalf of Jonathan Morton [chromatix99@gmail.com]
Sent: Monday, May 23, 2016 2:30 PM
To: Luis E. Garcia
Cc: cake@lists.bufferbloat.net; codel@lists.bufferbloat.net
Subject: Re: [Codel] [Cake] Proposing COBALT
> On 20 May, 2016, at 19:43, Jonathan Morton <chromatix99@gmail.com> wrote:
>
>> On 20 May, 2016, at 19:37, Luis E. Garcia <luis@bitamins.net> wrote:
>>
>> I think this would be a great idea to implement and test.
>> Can COBALT's behavior be easily implemented to test it using the OpenWRT or LEVE ?
>
> I assume you mean LEDE.
>
> Yes, the BLUE algorithm is very simple (and is already in Linux, if you want to see how it behaves independently). It’s merely a case of modifying a fork of sch_codel and/or sch_fq_codel and/or sch_cake to run it in parallel with the Codel algorithm.
>
> I’ll probably get around to it once I’ve got some current Cake changes out of the way.
While I don’t have COBALT working in an actual qdisc yet, I’ve coded the core algorithm - including a major refactoring of Codel. This core code, containing *both* Codel and BLUE, is 90 lines *shorter* than codel5.h alone. Quite a surprising amount of simplification.
There’s even a possibility that it’ll be faster, especially on embedded CPUs, simply because it’s smaller.
The simplification partly results from a change in API structure. Rather than calling back into the qdisc to retrieve however many packets it wants, COBALT is handed one packet and a timestamp, and returns a flag indicating whether that packet should be dropped or delivered. It becomes the qdisc’s responsibility to dequeue candidate packets and perform the actual dropping. So there is no longer a gnarly branched loop in the middle of the AQM algorithm.
There were objections to Codel’s “callback” structure for other reasons, too. The refactoring obviates them all.
The one remaining loop in the fast path is a new backoff strategy for the Codel phase where it’s just come out of the dropping state. Originally Codel reduced count by 1 or 2 immediately, and reset count to zero after an arbitrary number of intervals had passed without the target delay being exceeded. My previous modification changed the immediate reduction to a halving, in an attempt to avoid unbounded growth of the count value.
In COBALT, I keep the drop-scheduler running in this phase, but without actually dropping packets, and *decrementing* count instead of incrementing it; the backoff phase then naturally ends when count returns to zero, instead of after an arbitrary hard timeout. The loop simply ensures that count will reduce by the correct amount, even if traffic temporarily ceases on the queue. Ideally, this should cause Codel’s count value to stabilise where 50% of the time is spent above target sojourn time, and 50% below. (Actual behaviour won’t quite be ideal, but it should be closer than before.)
As another simplification, I eliminated the “primed” state (waiting for interval to expire) as an explicit entity, by simply scheduling the first drop event to be at now+interval when entering the dropping state. This also eliminates the first_above_time variable. Any packets with sojourn times below target will bump Codel out of the dropping state anyway.
Yet another simplification is enabled by COBALT’s hybrid structure and the tacit assumption that it will be used with flow isolation. Because BLUE is present to handle overloads, much logic to handle overloads and “extra” signalling in Codel is not replicated in the refactored version. For example, there is no “drop then mark” logic any more; in all probability the traffic in one flow is either all ECN capable or all not so.
BLUE doesn’t add much code; only two lines in the fast path, and a couple of extra entry points for the qdisc to signal queue-full and queue-empty.
While going over codel5.h, I noticed that the invsqrt cache stored as u16 while calculations were being done in u32. This probably caused some major weirdness with Codel’s behaviour in Cake, so I fixed it in the original.
Next step: get an actual qdisc working using this.
- Jonathan Morton
_______________________________________________
Codel mailing list
Codel@lists.bufferbloat.net
https://lists.bufferbloat.net/listinfo/codel
next prev parent reply other threads:[~2016-05-24 13:47 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 10:04 [Codel] " Jonathan Morton
2016-05-20 11:37 ` [Codel] [Cake] " moeller0
2016-05-20 12:18 ` Jonathan Morton
2016-05-20 13:22 ` moeller0
2016-05-20 14:36 ` Jonathan Morton
2016-05-20 16:03 ` David Lang
2016-05-20 17:31 ` Jonathan Morton
[not found] ` <CALnBQ5mNgHgFoTcvLxppv2P9XODc4D-4NObKyqbZJ0PccVkwiA@mail.gmail.com>
2016-05-20 16:43 ` Jonathan Morton
2016-05-23 18:30 ` Jonathan Morton
2016-05-24 13:47 ` Jeff Weeks [this message]
2016-05-24 14:07 ` Jonathan Morton
2016-05-24 15:52 ` Dave Täht
2016-05-24 15:56 ` Jonathan Morton
2016-05-24 16:02 ` Dave Taht
2016-05-26 12:33 ` Jonathan Morton
2016-06-03 19:09 ` Noah Causin
2016-06-03 19:34 ` Jonathan Morton
2016-06-04 1:01 ` Andrew McGregor
2016-06-04 6:23 ` Jonathan Morton
2016-06-04 13:55 ` Jonathan Morton
2016-06-04 14:01 ` moeller0
2016-06-04 14:16 ` Jonathan Morton
2016-06-04 15:03 ` moeller0
2016-06-04 17:10 ` Noah Causin
2016-06-04 17:49 ` Eric Dumazet
2016-06-04 19:55 ` Jonathan Morton
2016-06-04 20:56 ` Eric Dumazet
2016-06-27 3:56 ` Jonathan Morton
2016-06-27 7:59 ` moeller0
2016-05-20 13:41 ` David Lang
2016-05-20 13:46 ` moeller0
2016-05-20 14:04 ` David Lang
2016-05-20 14:42 ` Kathleen Nichols
2016-05-20 15:11 ` Jonathan Morton
2016-05-20 15:12 ` Jonathan Morton
2016-05-20 16:05 ` David Lang
2016-05-20 17:06 ` Jonathan Morton
2016-05-20 16:20 ` Rick Jones
2016-05-20 16:35 ` Jonathan Morton
2016-05-20 17:01 ` Rick Jones
2016-05-20 17:07 ` Jonathan Morton
2016-05-20 17:21 ` Rick Jones
2016-05-20 17:26 ` David Lang
2016-05-20 17:33 ` Jonathan Morton
2016-05-20 14:09 ` Jonathan Morton
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/codel.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=274D3A0FA900FD47AA6B56991AAA32FDC5529FC8@wtl-exchp-1.sandvine.com \
--to=jweeks@sandvine.com \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.com \
--cc=codel@lists.bufferbloat.net \
--cc=luis@bitamins.net \
/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