This documentation has been moved
Percentage-Based Policing and Shaping
Downloads: This chapterpdf (PDF - 164.0KB) The complete bookPDF (PDF - 9.54MB) | Feedback

Percentage-Based Policing and Shaping

Table Of Contents

Percentage-Based Policing and Shaping

Feature Overview

Benefits

Restrictions

Related Features and Technologies

Related Documents

Supported Platforms

Supported Standards, MIBs, and RFCs

Prerequisites

Configuration Tasks

Configuring Policing and Shaping Based on Bandwidth Percentage

Attaching the Policy Map to an Interface or a VC

Verifying the Policing and Shaping Bandwidth Percentage Setting

Troubleshooting Tips

Configuration Examples

Example: Specifying Traffic Policing Based on a Bandwidth Percentage

Example: Specifying Traffic Shaping Based on a Bandwidth Percentage

Example: Verifying That CEF Is Enabled

Command Reference


Percentage-Based Policing and Shaping


Feature History

Release
Modification

12.2(13)T

This feature was introduced.

Supported Platforms

For platforms supported in Cisco IOS Release 12.2(13)T, consult Cisco Feature Navigator.


This document describes the Percentage-Based Policing and Shaping feature in Cisco IOS Release 12.2(13)T. It includes the following sections:

Feature Overview

Supported Platforms

Supported Standards, MIBs, and RFCs

Configuration Tasks

Configuration Examples

Command Reference

Feature Overview

Cisco IOS quality of service (QoS) offers two kinds of traffic regulation mechanisms—traffic policing and traffic shaping. A traffic policer typically drops traffic that violates a specific rate. A traffic shaper typically delays excess traffic using a buffer to hold packets and shapes the flow when the data rate to a queue is higher than expected.

Traffic shaping and traffic policing can work in tandem and can be configured in a class map. Class maps organize data packets into specific categories ("classes") that can, in turn, receive a user-defined QoS treatment when used in policy maps (sometimes referred to as "service policies").

Before this feature, traffic policing and traffic shaping were configured on the basis of a user-specified amount of bandwidth available on the interface. Policy maps were then configured on the basis of that specific amount of bandwidth, meaning that separate policy maps were required for each interface.

This feature provides the ability to configure traffic policing and traffic shaping based on a percentage of bandwidth available on the interface. Configuring traffic policing and traffic shaping in this manner enables customers to use the same policy map for multiple interfaces with differing amounts of bandwidth.

This feature also provides the option of specifying burst sizes in milliseconds (ms) when configuring traffic policing and shaping based on a percentage of bandwidth.

Benefits

Increased Flexibility

This feature provides the ability to configure traffic policing and traffic shaping based on a percentage of bandwidth available on an interface. Configuring traffic policing and traffic shaping in this manner enables customers to use the same policy map for multiple interfaces with differing amounts of bandwidth.

Restrictions

The shape (percent) command, when used in "child" (nested) policy maps, is not supported on the Cisco 7500, the Cisco 7200, or lower series routers. Therefore, the shape (percent) command cannot be configured for use in nested policy maps on these routers.

Related Features and Technologies

Modular QoS command-line interface (CLI) (Modular QoS CLI)

Class-based weighted fair queueing (CBWFQ)

Class-based packet marking

Cisco Express Forwarding (CEF) and Distributed CEF (dCEF)

Traffic policing

Two-rate policing

Traffic shaping

Related Documents

"Applying QoS Features Using the MQC" module

"Configuring Weighted Fair Queueing" module

"Marking Network Traffic" module

"Policing and Shaping Overview" module

"Traffic Policing" module

"Two-Rate Policer" module

"Policer EnhancementsMultiple Actions" module

"Cisco Express Forwarding Overview" module

Cisco IOS Quality of Service Solutions Command Reference

Cisco IOS Switching Services Command Reference

RFC 2697, A Single Rate Three Color Marker

RFC 2698, A Two Rate Three Color Marker

Supported Platforms

Determining Platform Support Through Cisco Feature Navigator

Cisco IOS software is packaged in feature sets that are supported on specific platforms. To obtain updated information about platform support for this feature, access Cisco Feature Navigator. Cisco Feature Navigator dynamically updates the list of supported platforms as new platform support is added for the feature.

Cisco Feature Navigator is a web-based tool that enables you to determine which Cisco IOS software images support a specific set of features and which features are supported in a specific Cisco IOS image. You can search by feature or release. In the release section, you can compare releases side by side to display both the features unique to each software release and the features that releases have in common.

To access Cisco Feature Navigator, you must have an account on Cisco.com. If you have forgotten or lost your account information, send a blank e-mail to cco-locksmith@cisco.com. An automatic check will verify that your e-mail address is registered with Cisco.com. If the check is successful, account details with a new random password will be e-mailed to you. Qualified users can establish an account on Cisco.com by following the directions at http://www.cisco.com/register.

Cisco Feature Navigator is updated regularly when major Cisco IOS software releases and technology releases occur. For the most current information, go to the Cisco Feature Navigator home page at the following URL:

http://www.cisco.com/go/fn

Availability of Cisco IOS Software Images

Platform support for particular Cisco IOS software releases is dependent on the availability of the software images for those platforms. Software images for some platforms may be deferred, delayed, or changed without prior notice. For updated information about platform support and availability of software images for each Cisco IOS software release, refer to the online release notes or, if supported, Cisco Feature Navigator.

Supported Standards, MIBs, and RFCs

Standards

None

MIBs

None

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://tools.cisco.com/ITDIT/MIBS/servlet/index

If Cisco  MIB Locator does not support the MIB information that you need, you can also obtain a list of supported MIBs and download MIBs from the Cisco  MIBs page at the following URL:

http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml

To access Cisco MIB Locator, you must have an account on Cisco.com. If you have forgotten or lost your account information, send a blank e-mail to cco-locksmith@cisco.com. An automatic check will verify that your e-mail address is registered with Cisco.com. If the check is successful, account details with a new random password will be e-mailed to you. Qualified users can establish an account on Cisco.com by following the directions found at this URL:

http://www.cisco.com/register

RFCs

RFC 2697, A Single Rate Three Color Marker

RFC 2698, A Two Rate Three Color Marker

Prerequisites

On a Cisco 7500 series router, Distributed Cisco Express Forwarding (dCEF) must be configured on the interface before you can use the Percentage-Based Policing and Shaping feature.

Configuration Tasks

See the following sections for configuration tasks for the Percentage-Based Policing and Shaping feature.

Configuring Policing and Shaping Based on Bandwidth Percentage (required)

Attaching the Policy Map to an Interface or a VC (required)

Verifying the Policing and Shaping Bandwidth Percentage Setting (optional)

Configuring Policing and Shaping Based on Bandwidth Percentage

 
Command
Purpose

Step 1 

Router (config)# policy-map policy-name

Specifies the name of the policy map to be created. Enters policy-map configuration mode.

Step 2 

Router(config-pmap)# class-map class-map-name

Specifies the name of the class map to be created. Enters policy-map class configuration mode.

Step 3 

Router(config-pmap-c)# police cir percent percent [bc conform-burst-in-msec] pir percent percent] [be peak-burst-in-msec]

Configures traffic policing.

Step 4 

Router(config-pmap-c)# shape {average | peak} percent percent [bc] [be]

Configures traffic shaping using either an average or peak traffic shaping rate based on a percentage of available bandwidth.

Step 5 

Router (config-pmap-c)# service-policy policy-map-name

Specifies the name of a policy map to be used as a child policy map for this class.

Step 6 

Router(config-pmap-c)# exit

Exits policy-map class configuration mode.

Attaching the Policy Map to an Interface or a VC

Command
Purpose

Router(config-if)# service-policy output1 policy-map-name


or


Router(config-if-atm-vc)# service-policy output policy-map-name


Specifies the name of the policy map to be attached to the input direction of an interface or VC.

The policy map evaluates all traffic entering that interface or VC.

Note Traffic shaping is supported on service policies attached to output interfaces or output VCs only.


Verifying the Policing and Shaping Bandwidth Percentage Setting

Command
Purpose

Router# show class-map

Displays all information about a class map, including the match criterion.

Router# show policy-map

Displays all configured policy maps.

Router# show policy-map interface interface-name

Displays the packet statistics of all classes that are configured for all service policies either on the specified interface or subinterface or on a specific permanent virtual circuit (PVC) on the interface.


Troubleshooting Tips

For input traffic policing on a Cisco 7500 series router, verify that dCEF is enabled on the interface on which traffic policing is configured.

For output traffic policing on a Cisco 7500 series router, ensure that the incoming traffic is dCEF-switched. Traffic policing cannot be used on the switching path unless dCEF switching is enabled.

Configuration Examples

This section provides the following configuration examples:

Example: Specifying Traffic Policing Based on a Bandwidth Percentage

Example: Specifying Traffic Shaping Based on a Bandwidth Percentage

Example: Verifying That CEF Is Enabled

Example: Specifying Traffic Policing Based on a Bandwidth Percentage

The following example configures traffic policing using a committed information rate (CIR) and a peak information rate (PIR) based on a percentage of bandwidth. In this example, a CIR of 20 percent and a PIR of 40 percent have been specified. Additionally, an optional bc value and be value (300 ms and 400 ms, respectively) have been specified.

Router (config)# policy-map policy1

Router(config-pmap)# class-map class1

Router(config-pmap-c)# police cir percent 20 bc 300 ms pir percent 40 be 400 ms

Router (config-pmap-c)# service-policy child-policy1

Router(config-pmap-c)# exit

Router(config-pmap-c)# interface serial 3/1

Router(config-if)# service-policy output policy1


The purpose of the burst parameters (bc and be values) is to drop packets gradually, as is done with Weighted Random Early Detection (WRED), and to avoid tail drop. Setting sufficiently high burst values helps to ensure good throughput.

Example: Specifying Traffic Shaping Based on a Bandwidth Percentage

The following example configures traffic shaping using an average shaping rate based on a percentage of bandwidth. In this example, 25 percent of the bandwidth has been specified. Additionally, an optional bc value and be value (300 ms and 400 ms, respectively) have been specified.

Router (config)# policy-map policy1

Router(config-pmap)# class-map class1

Router(config-pmap-c)# shape average percent 25 300 ms 400 ms

Router (config-pmap-c)# service-policy child-policy1

Router(config-pmap-c)# exit

Router(config-pmap-c)# interface serial 3/1

Router(config-if)# service-policy output policy1


The purpose of the bc and be values is to drop packets gradually, as is done with WRED, and to avoid tail drop. Setting sufficiently high burst values helps to ensure good throughput.

Example: Verifying That CEF Is Enabled

On a Cisco 7500 series router, dCEF must be configured on the interface before you can use the Percentage-Based Policing and Shaping feature. The show ip cef summary command can be used to confirm that dCEF is enabled and is being used for IP switching. In rare instances, this command displays "IP Distributed CEF without switching" in the command output. This indicates that dCEF is disabled. The following sample output of the show ip cef summary command indicates that dCEF is disabled:

Router# show ip cef summary 

    IP Distributed CEF with switching (Table Version 36), flags=0x0
      18 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 3
      18 leaves, 19 nodes, 22136 bytes, 45 inserts, 27 invalidations
      0 load sharing elements, 0 bytes, 0 references
      universal per-destination load sharing algorithm, id 680E93E2
      3(0) CEF resets, 1 revisions of existing leaves
      Resolution Timer:Exponential (currently 1s, peak 1s)
      0 in-place/0 aborted modifications
      refcounts: 5136 leaf, 5120 node

When you configure a feature that requires special handling or is not yet supported in the dCEF switching paths, packets are forwarded to the next switching layer for handling. In this instance, the output of the show cef interface command displays "Packets switched to this interface on line card are dropped to next slow path" as shown in the following sample output.

Router# show cef interface Serial 10/0/0:28 

    Serial10/0/0:28 is up (if_number 38) 
      Internet address is 90.0.0.1/8 
      ICMP redirects are never sent 
      Per packet loadbalancing is disabled 
      Inbound  access list is not set 
      Interface is marked as point to point interface 
      Packets switched to this interface on linecard are dropped to next slow path 
      Hardware idb is Serial10/0/0:28 
      Fast switching type 4, interface type 20 
      IP Distributed CEF switching enabled
      Fast flags 0x0. ifindex 37(37) 
      Slot 10 Slot unit 0 VC 28 
      Hardware transmit queue ptr 0x48001AE0 (0x48001AE0) 
      Transmit limit accumulator 0x48000102 (0x48000102) 
      IP MTU 1500

Command Reference

The following commands are introduced or modified in the feature or features documented in this module. For information about these commands, see the Cisco IOS Quality of Service Solutions Command Reference at http://www.cisco.com/en/US/docs/ios/qos/command/reference/qos_book.html. For information about all Cisco IOS commands, use the Command Lookup Tool at http://tools.cisco.com/Support/CLILookup or a Cisco IOS master commands list.

police (percent)

shape (percent)

show policy-map

show policy-map interface