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

Re: Proper settings for 'Bandwidth' parameters

On Sat, Jan 01, 2005 at 10:19:10PM -0800, admin wrote:
> How should one "tune" a tor node using the Bandwidth settings?
> What do BandwidthRate and BandwidthBurst stand for? (Exactly)

Tor uses a token bucket scheme to do rate limiting:

  Each connection has a token bucket with a specified capacity
  BandwidthBurst. BandwidthRate tokens are added to the bucket each
  second (when the bucket is full, new tokens are discarded.) Each
  token represents permission to receive one byte from the network
  --- to receive a byte, the connection must remove a token from the
  bucket. Thus if the bucket is empty, that connection must wait until
  more tokens arrive. The number of tokens we add enforces a longterm
  average rate of incoming bytes, yet we still permit short-term bursts
  above the allowed bandwidth.

We currently don't rate-limit bytes going *onto* the network, on
the theory that each byte out roughly corresponds to a byte in. This
assumption no longer holds for nodes that open their DirPort though --
this is a known bug, and we hope to get around to fixing it soon by
adding rate-limiting for writes as well. For now, the workaround if you
need one is to leave your DirPort closed.

> As an example: A cable connection has a 256 Kbps up-rate and a
> 3 Mbps down-rate. This obviously limits the in/out-rate of an
> or tunnel to 256 bps. In order not to saturate the up rate of
> the local users how should the parameters be set? (note the
> dif between the b(its)ps rates and the B(ytes)ps rates used in
> tor).

I've just added this answer to the FAQ as:


In the case of a cable-modem, you typically have much more than 256
kpbs up-rate sometimes, and much less other times, so alas it's not
so clear-cut as we'd like it to be. Let me know if you still have
more questions.