Cisco Catalyst 4500 Series Configuration Manual page 587

Ios software configuration guide isco ios xe 3.9.0e and ios 15.2(5)ex
Hide thumbs Also See for Catalyst 4500 Series:
Table of Contents

Advertisement

Chapter 2
The tokens for both the conform and exceed token buckets are updated based on the token arrival rate,
or committed information rate (CIR).
When a packet of given size (for example, "B" bytes) arrives at specific time (time "T") the following
actions occur:
Examples
Token Bucket Algorithm with One Token Bucket
The following 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 packet
conforms because enough bytes are available in the conform token bucket. The conform action (send) is
taken by the packet and 450 bytes are removed from the conform token bucket (leaving 550 bytes).
If the next packet arrives 0.25 seconds later, 250 bytes are added to the token bucket ((0.25 * 8000)/8),
leaving 800 bytes in the token bucket. If the next packet is 900 bytes, the packet exceeds and the exceed
action (drop) is taken. No bytes are taken from the token bucket.
Tokens are updated in the conform bucket. If the previous arrival of the packet was at T1 and the
current arrival of the packet is at t, the bucket is updated with T -T1 worth of bits based on the token
arrival rate. The refill tokens are placed in the conform bucket. If the tokens overflow the conform
bucket, the overflow tokens are placed in the exceed bucket.
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 is taken on the packet. If the packet conforms, B bytes are removed from the
conform bucket and the conform action is taken. The exceed bucket is unaffected in this scenario.
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 from the exceed token bucket. No bytes 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.
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release XE 3.9.xE and 15.2(5)Ex
police
2-547

Advertisement

Table of Contents
loading

Table of Contents