police
Use this command to configure policing of the data rates for a particular class of traffic.
Use the no command to remove a policing configuration.
Note: Committed Information Rate (CIR) and Peak Information Rate (PIR) can only be whole numbers.
Command Syntax
police (colour-blind | colour-aware |) (cir) (<1-2000000000> (kbps|mbps|gbps) | percent <1-100>) ((pir (<1-2000000000> (kbps|mbps|gbps) | percent <1-100>)|)(bc) <1-256000> (kbytes|mbytes|ms|us)|)((be)<1-256000> (kbytes|mbytes|ms|us)|)((conform (transmit | set-prec-transmit <0-7> | set-dscp-transmit <0-63> | set-cos-transmit <0-7> | set-mpls-class <0-7> )) |)((exceed (drop | set-dscp-transmit <0-63> | set-cos-transmit <0-7> | transmit | set-mpls-class <0-7> ))|) ((violate (drop | set-dscp-transmit <0-63> | set-cos-transmit <0-7> | transmit | set-mpls-class <0-7> ))|))
no police
Parameters
colour-blind
Do not police on color.
colour-aware
Do police on color.
cir <1-2000000000>
Specify Committed information rate.
pir <1-2000000000>
Peak information rate.
kbps
Specify the units of kbps per second.
mbps
Specify the units of mbps per second.
gbps
Specify the units of gbps per second.
Percent
Specify the rate in percent.
bc <1-256000>
Burst rate committed.
be <1-256000>
Burst rate extended.
transmit
Specify the action of transmitting packets.
set-prec-transmit
Sets the IP precedence field to the specified value and transmits the packet.
set-dscp-transmit
Sets the Differentiated Service Code Point (DSCP) field to the specified value and transmits the packet.
set-cos-transmit
Sets the class of service (CoS) field to the specified value and transmits the packet.
set-mpls-class
Set the mpls class filed to the give value and tx the packet
drop
Specify the action of dropping packets.
conform
Sets the action to take when the data rate is within bounds
exceed
Sets the action to take when the data rate is exceeded. Default is drop.
violate
Sets the action to take when the data rate violates the configured rate values. The default is drop.
Default
Table 1-2: Default values
Parameter | Default |
---|
policer-type | Color-Blind |
cir | N/A |
pir | 0 |
bc | 0 |
be | 0 |
conform | Transmit |
exceed | Drop |
violate | Drop |
Command Mode
Policy-map mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
(config)# policy-map type qos 2345
(config-pmap-qos)#class type qos 2345
(config-pmap-c-qos)# police cir 2 mbps pir 4 mbps bc 2 mbytes be 4 mbytes conform transmit exceed set-cos-transmit 1 violate drop
Usage
Traffic policing is based on the concept of marking IP packets, and then metering the packets in relation to how they are marked. This is called the “Two Rate Three Color Marker (trTCM)” process.
The Two Rate Three Color Marker (trTCM) meters an IP packet stream, and marks its packets as either green, yellow, or red. A packet is marked RED if it exceeds the Peak Information Rate (PIR). Otherwise it is marked either YELLOW or GREEN depending on whether it exceeds or does not exceed the Committed Information Rate (CIR). The trTCM is useful, for example, for ingress policing of a service, where a peak rate needs to be enforced separately from a committed rate.
The Meter meters each packet and passes the packet and the metering result to the Marker. The Meter operates in one of two modes – Color-Blind or Color-Aware. In the Color-Blind mode, the Meter assumes that the packet stream is uncolored.In the Color-Aware mode, the Meter assumes that some preceding entity has pre-colored the incoming packet stream so that each packet is either GREEN, YELLOW, or RED.
The following describes the equations used to determine the BC an BE values:
Note: CIR, PIR, BC, and BE values are all in kbits/sec.
=================
BC = CIR * 5 / 1000;
Range check [64kbytes-256mbytes]
if (BC / 8) < 64)
then BC = 64 * 8;
else if (BC / 8) > 256000)
then BC = 256000 * 8;
=================
Same calculation for BE, as well.
Note: If the PIR value is not mentioned in the configuration, then the CIR value itself is considered for BE calculation.
=================
BE = PIR * 5 / 1000;
Range check [64kbytes-256mbytes]
if (BE / 8) < 64)
then BE = 64 * 8;
else if (BE / 8) > 256000)
then BE = 256000 * 8;
==================
For example:
Configure: police CIR 1 mbps
Hardware: CIR = 1000kbits/sec , BC = 512kbits, BE = 512kbits
Configure: police CIR 1 mbps PIR 200 mbps
Hardware: CIR = 1000kbits/sec, BC = 512kbits, PIR = 200000kbits/sec, BE = 1000kbits
For additional information regarding policing, see RFC 2697 and RFC 2698.
Last modified date: 07-14-2023