Specifications
White Paper
© 2009 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 50 of 89
on the number of bits in the packet (i.e. 512 bytes x 8 bits = 4096). If only 4095 tokens are in the bucket then the
packet cannot be sent (it is dropped) and the tokens remain in the bucket. When a packet is sent, the tokens are
removed from the bucket.
The depth of the bucket is another important factor to consider. The Burst should be set so that it can hold the
largest sized packet in the data flow being policed. In IOS, the minimum defined burst size is 1000. The number
1000 equates to a burst size of 1 kilobyte or the buckets ability to hold 8000 tokens (i.e. 1 kilobyte = 8000 bits). If this
value were used, and the data flow consisted of maximum size Ethernet packets (1518 byte), then no packet could
ever be sent as there would never be enough tokens in the bucket to forward a packet in each interval. The Burst
should be set to a value that ensures the switch can at least sustain the configured Rate. If a burst value is defined
in the policer, the minimum set will be equal to the rate in a 4-millisecond interval. For example, if a 10Mbps rate
were specified, then the minimum burst would be 5000 which is calculated as follows:
10,000,000 bits x 0.004 seconds / 8 bits = 5000
This is confirmed showing the following CLI where a lower burst of 4000 is configured:
c6500(config-pmap-c)# police 10000000 4000 conform transmit exceed drop
Info: Illegal normal burst size, increased to 5000
If no burst is specified, then the default burst will be calculated at 250ms. In the
above example, this would set the burst to 312500 which is calculated as follows:
10,000,000 x 0.25 seconds / 8 bits = 312500
This can be confirmed as shown by the following CLI
c6500(config-pmap-c)# police 10000000 conform transmit exceed drop
c6500(config-pmap-c)#^Z
c6500# show policy
Policy Map limit_to_10Mb
Class marketing
police 10000000 312500 312500 conform-action transmit exceed-action drop
Note the resulting burst value in the show output. As a fallback, always remember that the CLI will reset your
configured Burst size if it is too small for the configured Rate.
8.8 A Walk through how the Token Bucket is used
To better explain how the token bucket works, a simple example will be explored below.
Step 1: At the beginning of the time interval (call it T0), the token bucket is primed with a full complement of tokens.
This is always the case whenever a policer is activated.
Step 2: Data will start to arrive at the switch. The policer will only process data that fits within the classification
criteria and arrives in the given 0.25ms interval. Any data that has not fully clocked in within that interval will be
processed in the next interval.