From: Dave Taht <dave.taht@gmail.com>
To: Jonathan Morton <chromatix99@gmail.com>,
Greg White <g.white@cablelabs.com>
Cc: cake@lists.bufferbloat.net
Subject: Re: [Cake] cake shaper vs leaky bucket algorithm
Date: Wed, 18 Nov 2015 11:58:34 +0100 [thread overview]
Message-ID: <CAA93jw6P3YjWn_HswhBxHakEjNXScP5UOEXU2OVCbN_i3AaaMw@mail.gmail.com> (raw)
In-Reply-To: <37A0F159-70F5-4FCF-B6FA-FE1D5DB9E6C4@gmail.com>
thx.
greg, your answer below.
Dave Täht
Let's go make home routers and wifi faster! With better software!
https://www.gofundme.com/savewifi
On Wed, Nov 18, 2015 at 11:49 AM, Jonathan Morton <chromatix99@gmail.com> wrote:
>
>> On 18 Nov, 2015, at 09:46, Dave Taht <dave.taht@gmail.com> wrote:
>>
>> Greg white (of cablelabs) asked that how cake's shaper works, be
>> compared to a classic leaky bucket algorithm...
>
> I’m pretty sure I’ve already done this a couple of times. If “leaky bucket” can be said to operate in “credit mode”, Cake’s shaper operates in “deficit mode”.
>
> Leaky-bucket establishes a pool of tokens, replenished at a steady rate, that can be used at any time to transmit data. If a burst of packets arrives at such a queue when it is fully charged, that burst may be transmitted all at once; to minimise burstiness, the size of the pool must be minimised. But if timer resolution is poor (the basic PC-AT timer operates at 1kHz under Linux, though modern PCs have a much better one), or there is a significant scheduling delay, an insufficient pool leads to underperformance in throughput. These artefacts must therefore be estimated in advance, and the pool size chosen to trade off between throughput and maximum burst size.
>
> Burst outputs are problematic in Cake’s primary use case, because there is typically a dumb network device’s queue immediately downstream of Cake, in which bursts of packets inevitably induce latency.
>
> In fact, where the shaper rate is precisely equal to the downstream link rate, leaky-bucket effectively induces persistent latency equal to its pool size when saturated. At a system level, burstiness must therefore be minimised, but it is desirable to do so without limiting throughput more than necessary. This is typically achieved in leaky-bucket by choosing an adequately large pool size (to absorb timing artefacts) and then slightly reducing the shaping rate (so that the latency induced is not persistent).
>
> By contrast, Cake’s shaper establishes time intervals in which packet transmission is *prohibited*, equal to the time required to transmit the previous packet. As long as the shaper is saturated, this is achieved by advancing a schedule pointer (using an integer multiply-accumulate operation, which is straightforward in both hardware and software) by the time-length of the packet just transmitted; the next packet may be transmitted when the actual time reaches that pointer. The shaper is unsaturated iff the schedule time is reached when there is no data ready to send, and in this case the schedule is reset to begin with the next available packet.
>
> This does allow bursts, but only after a timing artefact actually occurs, and precisely to the extent required to recover the average throughput. The initial burst that leaky-bucket allows when first becoming saturated is eliminated completely. I believe this behaviour is optimal.
>
> As a detail, Cake’s shaper also includes facilities for correction of on-wire packet size, which is particularly important when the downstream link is ATM based. Queue accounting is based on the in-memory packet size, while timing calculations are based on the corrected size. This further reduces the likelihood of the downstream hardware queue becoming saturated.
>
> - Jonathan Morton
>
next prev parent reply other threads:[~2015-11-18 10:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 7:46 Dave Taht
2015-11-18 10:49 ` Jonathan Morton
2015-11-18 10:58 ` Dave Taht [this message]
2015-11-18 17:12 ` Greg White
2015-11-18 17:30 ` Jonathan Morton
2015-11-18 17:40 ` Dave Taht
2015-11-18 18:16 ` Greg White
2015-11-18 17:41 ` Greg White
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=CAA93jw6P3YjWn_HswhBxHakEjNXScP5UOEXU2OVCbN_i3AaaMw@mail.gmail.com \
--to=dave.taht@gmail.com \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.com \
--cc=g.white@cablelabs.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