Viet Hai wrote:

> I think the definition "bucket" have no mean in bandwidth shaping. In
> those books, it only is a threshold for squid to start it's bandwidth
> shaping.


> Anyone can tell me the way squid technically does bandwidth control?


Clients are only permitted to download as many bytes as are available in the
bucket, and each byte downloaded removes a byte from the bucket.

The rate Squid fills the bucket is set at less than the total bandwith
available. This means the clients can empty the bucket at a faster rate
than Squid fills it.

Eventually the bucket will be empty and the clients will have to wait for
Squid to add bytes to it. While clients wait, they are not permitted to
download anything - this is how their bandwidth becomes limited.

Many traffic shaping tools (such as iproute) work in a similar manner.

Adam