.The Dual Token Bucket

The Dual Token Bucket consists of two cascaded token buckets. The conformance condition requires both buckets to have sufficient tokens to match the size of a newly arriving packet. If at least one of the buckets have insufficient tokens then the packet is non-conforming and tokens are removed from neither buckets.

The token bucket has four parameters:

  • token accumulation rate at CIR (Committed Information Rate) 
  • burst tolerance for CIR (Committed Burst Size)
  • token accumulation rate at PIR (Peak Information Rate)
  • burst tolerance for PIR (Peak Burst Size)
The Dual Token Bucket

The Purpose of the Dual Token Bucket Policer

The Dual Token Bucket Policer is useful when the deviation permitted from the long term average information rate (CIR) is rather large, yet it is undesirable that such deviations occur at line rate or at much larger rate than the CIR.

Therefore a second token bucket watches over the peak rate of the source.

The PIR-PBS token bucket defines a traffic envelope that crosses the CIR-CBS bucket’s envelope. It enforces a smaller burst at line rate but allows a higher information rate than CIR. If traffic continuously bursts at PIR, then eventually the CBS bucket becomes empty, and from that moment on traffic can only pass at CIR bits/sec.

 

The Traffic Envelope of a Dual Token Bucket

The traffic envelope enforced by a dual token bucket policer is indicated with the red curve.

At time zero both buckets start full. Tokens accumulate in bucket one at CIR bits/s which is lower than in bucket two (PIR bits/sec). PBS is smaller than CBS.

 

Traffic can burst at infinite speed up to PBS bytes. Then traffic can pass at most at PIR bits/sec, until CBS is depleted. From that moment on traffic can only pass at CIR bits/sec.

PBS can be as low as one MTU-sized frame. In that case PIR is really the peak information rate. If PBS is larger than one frame then the absolute peak information rate is the line rate of incoming packet (or infinity if multiple interfaces contribute to the flow that is being policed).

The dual token bucket has its analogous brother in the ATM domain dual leaky bucket. The two models are equivalent, except that in the leaky bucket case arriving cells/frames pour fluid in the bucket from where it is leaked at a constant pace, while in the token bucket case tokens arrive at constant pace and are removed when traffic arrives.

The dual leaky bucket had practical purpose in the nascent ATM world, characterized by intermediate switches that had very small cell buffers. It was important that traffic sources do not burst at very high speeds, as this could cause depletion of cell buffers in intermediate nodes. If a ˜burst allowance” was sought above the long term average bit rate, then that should happen at one or two times faster than the average bit rate but not at line rate.

The dual token bucket is seldom used in today’s packet networks. Instead other combinations of two token buckets are used (see srTCM, trTCM, MEF policer) that exploit the fact that two buckets have more than two valid state combinations, and use that for conveying various colors on top of discarding packets.

The dual token bucket can emulate a single token bucket by setting the envelopes of the two meter non-crossing. If PIR > CIR and PBS>CBS then the token bucket defined by PIR,PBS will never act as the other one would become empty always sooner.

[QoS Guide] [Policing] [Token Bucket Policer] [Leaky Bucket] [Dual Token Bucket] [Single Rate Three Color Marker] [Two Rate Three Color Marker] [MEF Policer] [ATM  GCRA and F-GCRA] [A TCP-friendly policer] [Shaping] [Scheduling] [BAC] [Nomenclature] [About] [Sitemap]