The token bucket is an algorithm used in packet switched computer networks and telecommunications networks to check that data transmissions conform to defined limits on bandwidth and burstiness (a measure of the unevenness or variations in the traffic flow).
The token bucket algorithm is based on an analogy of a fixed capacity bucket into which tokens, normally representing a unit of bytes or a single packet of predetermined size, are added at a fixed rate. When a packet is to be checked for conformance to the defined limits, the bucket is inspected to see if it contains sufficient tokens at that time. If so, the appropriate number of tokens, e.g. equivalent to the length of the packet in bytes, are removed ("cashed in"), and the packet is passed, e.g., for transmission. If there are insufficient tokens in the bucket the packet does not conform and the contents of the bucket are not changed. Non-conformant packets can be treated in various ways:
- They may be dropped.
- They may be enqueued for subsequent transmission when sufficient tokens have accumulated in the bucket.
- They may be transmitted, but marked as being non-conformant, possibly to be dropped subsequently if the network is overloaded.
A conforming flow can thus contain traffic with an average rate up to the rate at which tokens are added to the bucket, and have a burstiness determined by the depth of the bucket. This burstiness may be expressed in terms of either a jitter tolerance, i.e. how much sooner a packet might conform (e.g. arrive or be transmitted) than would be expected from the limit on the average rate, or a burst tolerance or maximum burst size, i.e. how much more than the average level of traffic might conform in some finite period.
Read more about Token Bucket: The Token Bucket Algorithm, Comparison To Leaky Bucket, Hierarchical Token Bucket
Famous quotes containing the words token and/or bucket:
“The token woman carries a bouquet of hothouse celery
and a stenographers pad; she will take
the minutes, perk the coffee, smile
like a plastic daisy and put out
the black cat of her sensuous anger
to howl on the fence all night.”
—Marge Piercy (b. 1936)
“Dear fellow-artist, why so free
With every sort of company,
With every Jack and Jill?
Choose your companions from the best;
Who draws a bucket with the rest
Soon topples down the hill.”
—William Butler Yeats (18651939)