|
|
This feature module describes the Traffic Policing feature. It includes information on the benefits of the feature, supported platforms, related documents, and so forth.
This document includes the following sections:
The Traffic Policing feature performs the following functions:
Traffic policing is used to control the rate of traffic flowing across an interface. These matching criteria are defined in a traffic class (which is configured with the class-map command). The Traffic Policing feature is applied when you configure a service policy in the Modular Quality of Service Command-Line Interface (Modular QoS CLI). For information on configuring the Modular QoS CLI, see the Modular Quality of Service Command-Line Interface Overview on CCO and the Documentation CD-ROM.
Bandwidth Management Through Rate Limiting
Traffic policing allows you to control the maximum rate of traffic transmitted or received on an interface. Traffic policing is often configured on interfaces at the edge of a network to limit traffic into or out of the network. Traffic that falls within the rate parameters is transmitted, whereas traffic that exceeds the parameters is dropped or transmitted with a different priority.
Packet Marking Through IP Precedence, QoS Group, and DSCP Value Setting
Packet marking allows you to partition your network into multiple priority levels or classes of service (CoS).
Standards
No new or modified standards are supported by this feature.
MIBs
No new or modified MIB's are supported by this feature.
For descriptions of supported MIBs and how to use MIBs, see the Cisco MIB web site on CCO at http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml.
RFC's
No new or modified RFCs are supported by this feature.
Cisco Express Forwarding (CEF) must be configured on the interface before traffic policing can be used.
For additional information on Cisco Express Forwarding, see the Cisco Express Forwarding and Distributed Cisco Express Forwarding feature modules.
See the following sections for configuration tasks for the Traffic Policing feature. Each task in the list indicates if the task is optional or required.
To successfully configure the Traffic Policing feature, a traffic class and a service policy have to be created, and the service policy must be attached to a specified interface. These tasks are performed using the Modular QoS CLI. For information on the Modular QoS CLI, see the Modular Quality of Service Command-Line Interface document on CCO or the Documentation CD-ROM.
The Traffic Policing feature is configured in the service policy. To configure the Traffic Policing feature, use the following command in policy map configuration mode:
| Command | Purpose |
|---|---|
| Specifies a maximum bandwidth usage by a traffic class. |
The Traffic Policing feature works with a token bucket. For a description of a token bucket and an explanation of how it works, see the "What is a Token Bucket?" section of the Policing and Shaping Overview document. An example of how the token bucket algorithm works is also given in the Command Reference section of this document.
Use the show policy-map interface EXEC command to verify that the Traffic Policing feature is configured on your router. If the feature is configured on your interface, the show policy-map interface command output displays policing statistics:
Router# show policy-map interface
Ethernet1/7
service-policy output: x
class-map: a (match-all)
0 packets, 0 bytes
5 minute rate 0 bps
match: ip precedence 0
police:
1000000 bps, 10000 limit, 10000 extended limit
conformed 0 packets, 0 bytes; action: transmit
exceeded 0 packets, 0 bytes; action: drop
last packet: 1096090208ms ago, current burst: 0 bytes
conformed 0 bps, exceed 0 bps
| Command | Purpose |
|---|---|
Displays all configured policy maps. | |
| Displays the user-specified policy map. |
Displays statistics and configurations of all input and output policies, which are attached to an interface. |
This section provides the following configuration example:
The following configuration shows how to define a traffic class (with the class-map command) and associate that traffic class with a service policy (with the policy-map command). Traffic policing is applied in the service policy. The service-policy command is then used to attach the service policy to the interface.
For additional information on configuring traffic classes and service policies, see the Modular Quality of Service Command-Line Interface document on CCO and the Documentation CD-ROM.
In this particular example, traffic policing is configured with the average rate at 8000 bits per second, the normal burst size at 2000 bytes, and the excess burst size at 4000 bytes. Packets coming into Fast Ethernet interface 0/0 are evaluated by the token bucket algorithm to analyze whether packets conform or exceed. Packets that conform are transmitted, whereas packets that exceed are assigned a QoS transmit value of 4.
For a description of a token bucket and an explanation of how a token bucket works, see the "What is a Token Bucket?" section of the Policing and Shaping Overview document. An example of how the token bucket works is also given in the "Command Reference" section of this document.
7200-uut(config)# class-map larry 7200-uut(config-cmap)# match access-group 2 7200-uut(config-cmap)# exit 7200-uut(config)# policy-map bird 7200-uut(config-pmap)# class larry 7200-uut(config-pmap-c)# police 8000 2000 4000 conform-action transmit exceed-action set-qos-transmit 4 7200-uut(config-pmap-c)# exit 7200-uut(config-pmap)# exit 7200-uut(config)# interface fastethernet 0/0 7200-uut(config-if)# service-policy input bird
To configure the Traffic Policing feature, use the police policy map configuration command. The no form of this command removes the Traffic Policing feature from the configuration.
police bps burst-normal burst-max conform-action action exceed-action action
Syntax Description Description
bps Average rate in bits per second. burst-normal Normal burst size in bytes. burst-max Excess burst size in bytes. conform-action Action to take on packets that conform to the rate limit. exceed-action Action to take on packets that exceed the rate limit. action Action to take on packets. Specify one of the following keywords:
Usage
Defaults
Disabled
Command Modes
Policy-map configuration mode
Command History
| Release | Modification |
|---|---|
11.1 CC | This command was introduced as the rate-limit command. |
12.0(5)XE | This command was renamed police for policy map configuration mode. |
Usage Guidelines
The Traffic Policing feature operates with a token bucket. For a description of a token bucket and an explanation of how a token bucket works, see the "What is a Token Bucket?" section of the Policing and Shaping Overview document.
The following configuration shows users 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 1 bit per second, the normal burst size at 2 bytes per second, and the excess burst size at 4 bytes per second for all packets leaving Fast Ethernet interface 0/0.
7200-uut(config)# class-map larry 7200-uut(config-cmap)# match access-group 2 7200-uut(config-cmap)# exit 7200-uut(config)# policy-map bird 7200-uut(config-pmap)# class larry 7200-uut(config-pmap-c)# police 1 2 4 conform-action transmit exceed-action set-qos-transmit 4 7200-uut(config-pmap-c)# exit 7200-uut(config-pmap)# exit 7200-uut(config)# interface fastethernet 0/0 7200-uut(config-if)# service-policy input bird
Below is a step-by-step summation of how a series of packets entering Fast Ethernet interface 0/0 are treated. This example assumes that all entering packets conform to the specified matching criteria and that 1 data unit enters the token bucket for each time unit.
The following table summarizes the example:
| Packet Number | Tokens Taken by Arriving Packet | Tokens Remaining | Actual Debt | Compound Debt | Action to Take on Packet and Why |
|---|---|---|---|---|---|
Before Packet 1 | X | 2 | 0 | 0 |
|
Packet 1 | 1 | 1 | 0 | 0 | Transmit. No actual or compound debt. |
Packet 2 | 1 | 0 | 0 | 0 | Transmit. No actual or compound debt. |
Packet 3 | 1 | 0 | 1 | 1 | Transmit. Tokens are borrowed and counted against actual and compound debt, but the compound debt is still less than the excess burst size. |
Packet 4 | 1 | 0 | 2 | 3 | Transmit. Tokens are borrowed and counted against actual and compound debt, but the compound debt is still less than the excess burst size. |
Packet 5 | 1 | 0 | 3 | 6 | Assign a QoS transmit value of 4. Because the compound debt exceeds the excess burst size, the exceed action is taken. |
Packet 6 | 1 | 0 | 3 | 3 | Transmit. After packet 5 is dropped, the compound debt resets to 0. However, the actual debt of 2 remains. Therefore, the new compound debt of 3 is lower than the excess burst size, so the packet conforms. |
Packet 7 | 1 | 0 | 4 | 7 | Assign a QoS transmit value of 4. Because the compound debt exceeds the excess burst size, the exceed action is taken. |
Related Commands
| Command | Description |
|---|---|
policy-map | Specifies the name of the service policy to configure. |
service-policy | Specifies the name of the service policy to be attached to the interface. |
show policy-map | Displays all configured service policies. |
show policy-map policy-map-name | Displays the user-specified service policy. |
show policy-map interface | Displays statistics and configurations of all input and output service policies, which are attached to an interface. |
average rate---Maximum long-term average rate of conforming traffic.
conform action---Action to take on packets with a burst size below the rate allowed by the rate limit.
DSCP---differentiated services code point
exceed action---Action to take on packets that exceed the rate limit.
excess burst size---Bytes allowed in a burst before all packets will exceed the rate limit.
normal burst size---Bytes allowed in a burst before some packets will exceed the rate limit. Larger bursts are more likely to exceed the rate limit.
QoS group---Internal QoS group ID for a packet used to determine weighted fair queuing characteristics for that packet.
policing policy---Rate limit, conform actions, and exceed actions that apply to traffic matching a certain criteria.
Versatile Interface Processor (VIP)---Interface card used by Cisco 7500 series and Cisco 7000 series with RSP7000 routers.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Wed May 17 16:36:39 PDT 2000
Copyright 1989 - 2000©Cisco Systems Inc.