Examples: Ingress Policing
The following table provides the traffic policy commands supported at the Ingress:
Table 4 Traffic Policy CommandsCommand |
Description |
police [cir | rate] bps-value [bc | burst] bc [be | peak-burst] be conform-action action exceed-action action violate-action action Example:
Router(config-pmap-c)# police cir 5000000 bc 200000 be 400000 conform-action transmit exceed-action set-dscp-transmit violate-action drop
|
Specifies a maximum bandwidth usage by a traffic class through the use of a token bucket algorithm: - cir—Indicates that the committed information rate (CIR) is used for policing traffic.
- rate—Indicates that the police rate is used for policing traffic.
- bps value—Average rate in bits per second. The valid values range from 8000 to 10000000000.
- bc—Indicates that the committed (conform) burst size is used for policing traffic.
- burst—Indicates that the burst size is used for policing traffic.
- bc—Committed (conform) burst size or burst size in bytes. The valid values range from 1000 to 256000000.
- be—Indicates that the excess burst size is used for policing traffic.
- peak-burst—Indicates that the peak-burst size is used for policing traffic.
- be—Excess burst size or peak-burst size in bytes. The valid values range from 1000 to 256000000.
- action—Action taken on a packet when it conforms, exceeds, or violates the interface bandwidth. The possible actions are shown in Table 1.
|
police [cir | rate] percent % [bc | burst] bc [be | peak-burst] be conform-action action exceed-action action violate-action action Example:
Router(config-pmap-c)# police cir percent 10 bc 200000 be 400000 conform-action transmit exceed-action set-dscp-transmit violate-action drop |
Configures traffic policing on the basis of a percentage of bandwidth available on an interface, where: - cir—Indicates that the committed information rate (CIR) is used for policing traffic.
- rate—Indicates that the police rate is used for policing traffic.
percent—Indicates that a percentage of bandwidth is used for calculating CIR or rate.
%— CIR or rate bandwidth percentage. The valid values range from 1 to 100.
- bc—Indicates that the committed (conform) burst size is used for policing traffic.
- burst—Indicates that the burst size is used for policing traffic.
- bc—Committed (conform) burst size or burst size in mill-seconds or micro-seconds.
- be—Indicates that the excess burst size is used for policing traffic.
- peak-burst—Indicates that the peak-burst size is used for policing traffic.
- be—Excess burst size or peak-burst size in mill-seconds or micro-seconds.
action—Action taken on a packet when it conforms, exceeds, or violates the interface bandwidth. The possible actions are shown in Table 1.
|
police [cir | rate] bps-value [bc | burst] bc [pir | peak-rate] pir [be | peak-burst] be conform-action action exceed-action action violate-action action |
Configures traffic policing using two rates (CIR and PIR) where: - cir—Indicates that the committed information rate (CIR) is used for policing traffic.
- rate—Indicates that the police rate is used for policing traffic.
- bps value—Average rate in bits per second. The valid values range from 8000 to 10000000000
- bc—Indicates that the committed (conform) burst size is used for policing traffic.
- burst—Indicates that the burst size is used for policing traffic.
- bc—Committed (conform) burst size or burst size in bytes. The valid values range from 1000 to 256000000.
pir— Indicates that the peak information rate (PIR) is used for policing traffic.
peak-rate— Indicates that the peak rate is used for policing traffic.
- pir—Peak information rate or peak rate in bits per second. The valid values range from 8000 to 10000000000
- be—Indicates that the excess burst size is used for policing traffic.
- peak-burst—Indicates that the peak-burst size is used for policing traffic.
- be—Excess burst size or peak-burst size in bytes. The valid values range from 1000 to 256000000.
action—Action taken on a packet when it conforms, exceeds, or violates the interface bandwidth. The possible actions are shown in Table 1.
|
The following example shows how to configure policing actions:
Router(config)# policy-map ABC
Router(config-pmap)# class class-default
Router(config-pmap-c)# police 10000000 8000 8000
Router(config-pmap-c-police)# conform-action set-cos-transmit 2
Router(config-pmap-c-police)# exceed-action set-cos-transmit 1
Router(config-pmap-c-police)# end
Router#
The following example shows how to display policy map information:
Router# show policy-map ABC
Policy Map ABC
class class-default
police cir 10000000 bc 8000 be 8000
conform-action set-cos-transmit 2
exceed-action set-cos-transmit 1
Router#
The following example shows how to configure a single rate 2-color policer:
Router(config)# policy-map 1r2c
Router(config-pmap)# class class-default
Router(config-pmap-c)# police 2000000
Router(config-pmap-c-police)# conform-action transmit
Router(config-pmap-c-police)# exceed-action drop
Router(config-pmap-c-police)# end
The following example shows how to configure a single rate, 2-color policer with percent:
Router(config)# policy-map 1r2c_percent
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir percent 20
Router(config-pmap-c-police)# conform-action set-cos-transmit 0
Router(config-pmap-c-police)# exceed-action drop
Router(config-pmap-c-police)# end
Router#
The following example shows how to configure a dual rate, 3-color policer:
Router(config)# policy-map 2r3c
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir 2000000 pir 3000000
Router(config-pmap-c-police)# conform-action set-prec-transmit 3
Router(config-pmap-c-police)# exceed-action set-prec-transmit 2
Router(config-pmap-c-police)# violate-action set-prec-transmit 1
Router(config-pmap-c-police)# end
Router#
The following example shows how to configure a dual rate, 3-color policer with percent:
Router(config)# policy-map 2r3c_percent
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir percent 10 pir percent 20
Router(config-pmap-c-police)# conform-action transmit
Router(config-pmap-c-police)# exceed-action set-cos-transmit 0
Router(config-pmap-c-police)# violate-action drop
Router(config-pmap-c-police)# end
Router#
The following example shows how to configure a single rate, 2-color policer in class-default and a child policy:Router# enable
Router# configure terminal
Router(config)# policy-map police5
Router(config-pmap)# class test18
Router(config-pmap-c)# service policy child-level
Router(config-pmap-c)# police cir 64000 50
The following example shows how to configure a dual rate, 3-color policer configuration in a class and policy-map: Router# enable
Router# configure terminal
Router(config)# policy-map test
Router(config-pmap)# class cos2
Router(config-pmap-c)# police 1000000 pir 2000000 conform-action set-cos-transmit 3 exceed-action set-cos-transmit 1 violate-action drop
The following example shows how to configure a dual rate, 3-color policer in class-default with a CIR of 64 Kbps, and PIR doubled the CIR rate, a conform action of transmit, and an exceed action mark dscp af 11: Router# enable
Router# configure terminal
Router(config)# policy-map qos_test
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir 64000 bc 2000 pir 128000 be 2000 conform-action transmit
exceed-action set-dscp-transmit af11 violate-action set-dscp-transmit cs1
The following example shows how to configure a dual rate, 3-color policer in class-default: Router# enable
Router# configure terminal
Router(config)# policy-map qos_test
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir 64000 bc 2000 pir 128000 be 2000 conform-action transmit
exceed-action set-dscp-transmit af11 violate-action set-dscp-transmit cs1