Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.


Class based policing - Bucket size?

Hi Pros,

I ve been reading CB Shaping and Policing and got confused on the token bucket size in case of CB Policing - Single Rate Two Color.

Single Rate Two Color policers uses Single Token bucket. What is the bucket size in this case. Is the size equals BC? Because by default BC defaults to 1/4th of CIR. If I configure CIR as 96kbps, BC is set to 3000 bytes. Actually it should be set to 12000 bytes.

I am able to get the bucket size in case of Single Rate Three Colour (uses two token buckets) and Two Rate Three Colour (uses two token buckets). In both the cases, the bucket sizes are Bc and Be correspondingly. (only diff is how the buckets are replenished).

Could anyone clarify me on the bucket size in case of Single Rate Two Colour CB Policer?

thanks in advance.


Hall of Fame Super Silver

Re: Class based policing - Bucket size?

Hello Arun,

there is only one bucket in single rate two colors policer and that bucket is expressed in byte with rate expressed in bps

so to accomodate 96 kbps you need 96000/8 = 12000 bytes as you noted if we think of a 1 second time interval, but in policing what counts is the interarrival time between two packets and their respective packet size.

it is not like with shaping where there is a reference time interval that is part of the equation.

if a packet arrives at time t1 with size s1 and it is conforming it will drain s1 tokens.

If a second packet arrives  at time t2 with size2 it is conforming if there are at least s2 tokens in the bucket

So I can police to 96000 bps even with a bucket smaller then 12000 bytes what changes is that initial burst that can be served without dropping is smaller and equivalent to 250 msec of traffic at specified rate.

from 12.4T QoS command reference

Token Bucket Algorithm with One Token Bucket

The one-token bucket algorithm is used when the violate-action option is not specified in the police command CLI.

The conform bucket is initially set to the full size (the full size is  the number of bytes specified as the normal burst size).

When a packet of a given size (for example, "B" bytes) arrives at  specific time (time "T"), the following actions occur:

Tokens are updated in the conform  bucket. If the previous arrival of the packet was at T1 and the current  time is T, the bucket is updated with (T - T1) worth of bits based on  the token arrival rate. The token arrival rate is calculated as follows:

(time between packets (which is equal to T - T1) * policer rate)/8 bytes

If the number of bytes in conform  bucket B is greater than or equal to the packet size, the packet  conforms and the conform action is taken on the packet. If the packet  conforms, B bytes are removed from the conform bucket and the conform  action is completed for the packet.

If the number of bytes in conform  bucket B (minus the packet size to be limited) is fewer than 0, the  exceed action is taken.


Hope to help