[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-relays] Understanding bandwidth rate

On Wed, 11 Dec 2013 04:14:41 +0000, BugZ wrote:
> If the amount of data is not measured relative to time, how is it relevant?
> the internal variable is Relay_*Bandwidth*_Burst
> Doesn't "bandwidth" infer rate?

You'd think, but it doesn't here. The algorithm is as follows: There is a
variable that holds the current number of bytes allowed to be transferred.

As long as it is smaller than the next packet to be transferred, the
packet is kept waiting.

The variable is decreased by the size of each packet transferred, and is
increased by BandwidthRate's value every second(*). It is also limited
to BandwidthBurst's value. That means, when BandwidthRate hasn't been
used up recently the node may transfer up to BandwidthBurst bytes as
fast as it can.

But describing BandwidthBurst as bytes per second is pointless because the
burst isn't something that can happen *every* second; the burst just can
(or can't, depending on the hardware and values) happen within a single
second (or a millisecond).

The BandwidthBurst is simply the amount of bytes the node may transmit
at max speed if it hasn't used up the BandwidthRate previously.


(*) Or a tenth of the per-second value every tenth of a second,
    or one every 1/BandwidthRate seconds.

"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
tor-relays mailing list