Percentage-Based Policing and Shaping

Last Updated: May 2, 2012

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:

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

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 Enhancements-Multiple 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 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

Configuring Policing and Shaping Based on Bandwidth Percentage

SUMMARY STEPS

1.    Router (config)# policy-mappolicy-name

2.    Router(config-pmap)# class-mapclass-map-name

3.    Router(config-pmap-c)# police cir percent percent[bcconform-burst-in-msec ] [ pir percent percent ] [bepeak-burst-in-msec ]

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

5.    Router (config-pmap-c)# service-policypolicy-map-name

6.    Router(config-pmap-c)# exit


DETAILED STEPS
  Command or Action Purpose
Step 1
Router (config)# policy-mappolicy-name 

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

 
Step 2
Router(config-pmap)# class-mapclass-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[bcconform-burst-in-msec ] [ pir percent percent ] [bepeak-burst-in-msec ] 

Configures traffic policing.

 
Step 4
Router(config-pmap-c)# shape {average | peak} percentpercent [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-policypolicy-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 output
policy-map-name
Router(config-if-atm-vc)#
 
sevice-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

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

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

© 2012 Cisco Systems, Inc. All rights reserved.