Individual policing configuration and behavior
In policy-map configuration mode, you enter the class command followed by class-map name, and enter policy-map class configuration mode.
Note
There are two limitations to 'set' and 'police' in ingress policies:
-
Set and police are not supported together in a single policy within a single class. However, if these actions are applied on different classes, then that is a supported configuration.
-
The ASIC supports one marking action per policing configuration. On Cisco Catalyst IE3x00 Rugged Series switches, this marking action is available only for yellow packets.
For 1-rate, 2-color policing, you can use the police policy-map class configuration command to define the policer, the committed rate limitations of the traffic, committed burst size limitations of the traffic, and the action to take for a class of traffic that is below the limits (conform-action ) and above the limits (exceed-action ). If you do not specify burst size (bc), the system calculates an appropriate burst size value. The calculated value is appropriate for most applications.
When you configure a 2-rate policer, you must configure the committed information rate (CIR) for updating the first token bucket. You also configure the peak information rate (PIR) for updating the second token bucket. If you do not configure a PIR, the policer is a standard 1-rate, 2-color policer.
For 2-rate, 3-color policing, you can then optionally set actions to perform on packets that conform to the specified CIR and PIR (conform-action), packets that conform to the PIR, but not the CIR (exceed-action), and packets that exceed the PIR value (violate-action).
-
If you set the CIR value equal to the PIR, a traffic rate that is less than or equal to the CIR is in the conform range. Traffic that exceeds the CIR is in the violate range.
-
If you set the PIR greater than the CIR, a traffic rate less than the CIR is in the conform range. A traffic rate that exceeds the CIR but is less than or equal to the PIR is in the exceed range. A traffic rate that exceeds the PIR is in the violate range.
-
If you do not configure a PIR, the policer is configured as a 1-rate, 2-color policer.
If burst sizes are set too low, throughput may be reduced in situations with bursty traffic. If burst sizes are set too high, the traffic rate may exceed acceptable limits.
Note
The switch supports byte counters for byte-level statistics for conform, exceed, and violate classes in the
show policy-map interface privileged EXEC command output.
To make the policy map effective, you attach it to a physical port by using the service-policy input interface configuration command. Policing is done only on received traffic, so you can only attach a policer to an input service policy.
You can use the conform-action and exceed-action policy-map class configuration commands or the conform-action and exceed-action policy-map class police configuration commands to specify the action to take when the packet conforms to or exceeds the specified traffic rate.
Conform actions are to send the packet without modifications, or to drop the packet. Exceed actions are to drop the packet, to send the packet without modification, to set a new CoS, DSCP, or IP DSCP to a value.
You can use the conform-action , exceed-action , and violate-action policy-map class configuration commands or the conform-action , exceed-action , and violate-action policy-map class police configuration commands to specify the action to take when the packet conforms to or exceeds the specified traffic rates.
You can configure multiple conform and exceed actions simultaneously for each service class. You can configure multiple conform, exceed, and violate actions simultaneously for each service class.
To configure multiple actions in a class, enter multiple conform, exceed, or violate action entries in policy-map class police configuration mode.
Switch(config)# policy-map map1
Switch(config-pmap)# class class1
Switch(config-pmap-c)# police 100000 500000
Switch(config-pmap-c-police)# conform-action transmit
Switch(config-pmap-c-police)# exceed-action set-cos-transmit 2
Switch(config-pmap-c-police)# exit
Switch(config-pmap-c)# exit
Switch(config-pmap)# exit