Specifications

2-411
Catalyst 4500 Se ries S wit ch C is co IO S C om mand R efer ence —Re lease I OS XE 3 .3.0 XO(1 5.1 (1)XO)
OL_28738 -01
Chapter 2 Cisco IOS Commands for the Catalyst 4500 Series Switches
police
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 the conform bucket - B is greater than or equal to 0, the packet conforms
and the conform action i s taken on the pac ket. If the packet c onforms, B bytes are removed f rom the
conform bucket and the conform actio n is taken. The exceed bucket is una ffected in this scenari o.
If the number of bytes in the conform bucket B is less than 0, the excess token bucket is checked for
bytes by the packet. If the number of bytes in the exceed bucket B is greater than or equal to 0, the
exceed action is taken and B bytes are removed fr om the excee d token bu cket. No byt es are removed
from the conform bucket.
If the number bytes in the exceed bucket B is fewer than 0, the packet violates the rate and the violate
action is taken. The action is complete for the packet.
Examples Token Bucket Algorithm with One Token Bucket
This example shows how to define a traffic class (using the class-map command) and associate the
match criteria from the traffic class with the Traffic Policing configuration, which is configured in the
service policy (using the policy-map command). The service-policy command is then used to attach this
service policy to the interface.
In this particular example, Traffic Policing is configured with the average rate at 8000 bits per second
and the normal burst size at 1000 bytes for all packets leaving Gigabit Ethernet interface 6/1:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# class-map access-match
Switch(config-cmap)# match access-group 1
Switch(config-cmap)# exit
Switch(config)# policy-map police-setting
Switch(config-pmap)# class access-match
Switch(config-pmap-c)# police 8000 1000 conform-action transmit exceed-action drop
Switch(config-pmap-c)# exit
Switch(config-pmap)# exit
Switch(config)# interface gigabitethernet 6/1
Switch(config-if)# service-policy output police-setting
Switch(config-if)# end
In this example, the initial token buckets starts full at 1000 bytes. If a 450-byte packet arrives , the packe t
conforms because enough bytes a re available in the c onform toke n bucket. The confor m action (send) is
taken by the packet and 450 bytes are removed from the conform token bucket (le aving 550 bytes).
If the next packet arrives 0.25 seconds later, 250 byt es are added to the token bucket (( 0.25 * 8000)/8),
leaving 800 bytes in the toke n bucket. If the next packet is 900 bytes, the packet exceeds a nd the exce ed
action (drop) is taken. No bytes are taken from the token bucket.
Token Bucket Algorithm with Two Token Buckets Example (Refer to RFC 2697)
In this particular example, Traffic Policing is configured with the average rate at 8000 bits per second,
the normal burst size at 100 0 bytes, and the exces s burst size a t 1000 bytes for all packe ts leaving Gi gabit
Ethernet interface 6/1.
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# class-map access-match
Switch(config-cmap)# match access-group 1
Switch(config-cmap)# exit
Switch(config)# policy-map police-setting
Switch(config-pmap)# class access-match