Table Of Contents
Regulating Packet Flow on a Per-Class Basis—Using Class-Based Traffic Shaping
Prerequisites for Configuring Class-Based Traffic Shaping
Restrictions for Configuring Class-Based Traffic Shaping
Information About Class-Based Traffic Shaping
Class-Based Traffic Shaping Functionality
Benefits of Class-Based Traffic Shaping
Hierarchical Policy Map Structure of Class-Based Traffic Shaping
How to Configure Class-Based Traffic Shaping
Configuring Class-Based Traffic Shaping in a Primary-Level (Parent) Policy Map
Configuring the Secondary-Level (Child) Policy Map
Configuration Examples for Class-Based Traffic Shaping
Class-Based Traffic Shaping Configuration: Example
Feature Information for Class-Based Traffic Shaping
Regulating Packet Flow on a Per-Class Basis—Using Class-Based Traffic Shaping
First Published: February 25, 2002Last Updated: June 30, 2008Packet flow on a network can be regulated using a traffic shaping mechanism. One such traffic shaping mechanism is a Cisco feature called Class-Based Traffic Shaping. Class-Based Traffic Shaping allows you to regulate the flow of packets (on a per-traffic-class basis) going out an interface, matching the packet flow to the speed of the interface. This module describes the concepts and tasks related to configuring Class-Based Traffic Shaping.
Finding Feature Information in This Module
Your Cisco IOS software release may not support all of the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To reach links to specific feature documentation in this module and to see a list of the releases in which each feature is supported use the "Feature Information for Class-Based Traffic Shaping" section.
Finding Support Information for Platforms and Cisco IOS and Catalyst OS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS and Catalyst OS software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Contents
•
Prerequisites for Configuring Class-Based Traffic Shaping
•
Restrictions for Configuring Class-Based Traffic Shaping
•
Information About Class-Based Traffic Shaping
•
How to Configure Class-Based Traffic Shaping
•
Configuration Examples for Class-Based Traffic Shaping
•
Feature Information for Class-Based Traffic Shaping
Prerequisites for Configuring Class-Based Traffic Shaping
Knowledge
Be familiar with the concepts in the "Regulating Packet Flow Using Traffic Shaping" module.
Platform Support
Use Feature Navigator to determine if the platform in use supports Class-Based Traffic Shaping. Access Cisco Feature Navigator at http://www.cisco.com/go/fn.
Enable dCEF
Distributed Cisco Express Forwarding (dCEF) must be enabled if the customer is using a Versatile Interface Processor (VIP) on the router.
Create Policy Map and Class
A policy map and a class map must be created first using the Modular Quality of Service (QoS) Command-Line Interface (MQC). For information about using the MQC, see the "Applying QoS Features Using the MQC" module.
Restrictions for Configuring Class-Based Traffic Shaping
Adaptive Traffic Shaping
Adaptive traffic shaping for Frame Relay networks is supported for Frame Relay networks only.
Outbound Traffic Only
Class-Based Traffic Shaping applies to outbound traffic only.
Unsupported Commands
Class-Based Traffic Shaping does not support the following commands:
•
traffic-shape adaptive
•
traffic shape fecn-adaptive
•
traffic-shape group
•
traffic-shape rate
Information About Class-Based Traffic Shaping
To configure Class-Based Traffic Shaping, you should understand the following concepts:
•
Class-Based Traffic Shaping Functionality
•
Benefits of Class-Based Traffic Shaping
•
Hierarchical Policy Map Structure of Class-Based Traffic Shaping
Class-Based Traffic Shaping Functionality
Class-Based Traffic Shaping is a traffic shaping mechanism (also known as a "traffic shaper"). A traffic shaper typically delays excess traffic using a buffer, or queueing mechanism, to hold packets and shape the flow when the data rate of the source is higher than expected. It holds and shapes traffic to a particular bit rate by using the token bucket mechanism. For more information about token buckets and traffic shaping, see the "Regulating Packet Flow Using Traffic Shaping" module.
Class-Based Traffic Shaping is the Cisco-recommended traffic shaping mechanism.
Note
Class-Based Traffic Shaping should be used instead of what was previously referred to as Distributed Traffic Shaping (DTS). Class-Based Traffic Shaping can and should be used on the Cisco 7500 series router with a VIP2-40, VIP2-50, or greater processor.
Using the Class-Based Traffic Shaping, you can perform the following tasks:
•
Configure traffic shaping on a per-traffic-class basis. It allows you to fine-tune traffic shaping for one or more classes and it allows you to configure traffic shaping on a more granular level.
•
Specify average rate or peak rate traffic shaping. Specifying peak rate shaping allows you to make better use of available bandwidth by allowing more data than the configured traffic shaping rate to be sent if the bandwidth is available.
•
Configure traffic shaping in a hierarchical policy map structure. That is, traffic shaping is configured in a primary-level (parent) policy map and other QoS features (for instance, CBWFQ and traffic policing) can be configured in the secondary-level (child) policy maps. For more information, see the "Hierarchical Policy Map Structure of Class-Based Traffic Shaping" section.
Benefits of Class-Based Traffic Shaping
All of the benefits associated with traffic shaping also apply to Class-Based Traffic Shaping, but on a more granular level. For information about the benefits of traffic shaping, see the "Regulating Packet Flow Using Traffic Shaping" module.
Hierarchical Policy Map Structure of Class-Based Traffic Shaping
With the Class-Based Traffic Shaping mechanism, traffic shaping can be configured in a hierarchical policy map structure; that is, traffic shaping is enabled in a primary-level (parent) policy map and other QoS features used with traffic shaping, such as CBWFQ and traffic policing, can be enabled in a secondary-level (child) policy map.
Traffic shaping is enabled by using the shape command (and specifying a rate) in a policy map. When traffic shaping is enabled, one the following actions occur:
•
Packets exceeding the specified rate are placed in a queue using an appropriate queueing mechanism.
•
Packets conforming to the specified rate are transmitted.
When packets are placed in a queue, the default queueing mechanism used is weighted fair queueing (WFQ). However, with Class-Based Traffic Shaping, class-based WFQ (CBWFQ) can be configured as an alternative queueing mechanism.
CBWFQ allows you to fine-tune the way traffic is placed in a queue. For instance, you can specify that all voice traffic be placed in a high-priority queue and all traffic from a specific class be placed in a lower-priority queue.
If you want to use CBWFQ with the Class-Based Traffic Shaping mechanism, the following conditions must be met:
•
A secondary-level (child) policy map must be created. This secondary-level (child) policy map is then used to configure CBWFQ by enabling the bandwidth command.
•
Traffic shaping must be configured in the primary-level (parent) policy map.
Note
CBWFQ is supported in both the primary-level (parent) policy map and the secondary-level (child) policy map. However, to use CBWFQ at the secondary-level (child) policy map, traffic shaping must be configured in the primary-level (parent) policy map.
The following sample configuration illustrates how the Class-Based Traffic Shaping mechanism is configured in a hierarchical policy map structure:
enableconfigure terminalpolicy-map policy_parent ! This is the primary-level policy map.class class-defaultshape average 1000000 ! This enables traffic shaping.service-policy policy_child ! This associates the policy maps.Traffic shaping must be configured in the primary-level (parent) policy map. With this configuration, WFQ is used as the default queueing mechanism for placing all the traffic in a queue.
In the following secondary-level (child) policy map, the alternative queueing mechanism CBWFQ is configured:
enableconfigure terminalpolicy-map policy_child ! This is the secondary-level policy map.class class-defaultbandwidth percent 50 ! This enables CBWFQ.How to Configure Class-Based Traffic Shaping
This section contains the following procedures:
•
Configuring Class-Based Traffic Shaping in a Primary-Level (Parent) Policy Map (required)
•
Configuring the Secondary-Level (Child) Policy Map (optional)
Configuring Class-Based Traffic Shaping in a Primary-Level (Parent) Policy Map
Traffic shaping is configured in a policy map. Policy maps determine the specific quality of service (QoS) feature that will be applied to traffic on a network. In this module, the QoS feature being applied is traffic shaping.
Traffic shaping is configured in the primary-level (parent) policy map in the hierarchy.
Note
Traffic shaping is supported in the primary-level (parent) policy map only.
Prerequisites
Before configuring traffic shaping, you must use the MQC to create a policy map and a class map. For information about using the MQC to create a policy map and a class map, see the "Applying QoS Features Using the MQC" module.
To configure Class-Based Traffic Shaping (after first creating a policy map and class map), complete the following steps.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
policy-map policy-map-name
4.
class {class-name | class-default}
5.
shape [average | peak] mean-rate [[burst-size] [excess-burst-size]]
6.
service-policy policy-map-name
7.
end
8.
show policy-map
9.
show policy-map interface type number
10.
exit
DETAILED STEPS
Command or Action PurposeStep 1
enable
Example:Router> enable
Enables privileged EXEC mode.
•
Enter your password if prompted.
Step 2
configure terminal
Example:Router# configure terminal
Enters global configuration mode.
Step 3
policy-map policy-map-name
Example:Router(config)# policy-map policy_parent
Specifies the name of the policy map created earlier and enters policy-map configuration mode. See the "Prerequisites" section for more information.
•
Enter the policy map name.
Step 4
class {class-name | class-default}
Example:Router(config-pmap)# class class-default
Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode.
•
Enter the name of the class or enter the class-default keyword.
Step 5
shape [average | peak] mean-rate [burst-size] [excess-burst-size]
Example:Router(config-pmap-c)# shape average 1000000
Shapes traffic according to the keyword and rate specified.
•
Enter the keyword and rate.
Step 6
service-policy policy-map-name
Example:Router(config-pmap-c)# service-policy policy_child
Uses a service policy as a QoS policy within a policy map (called a hierarchical service policy).
•
Enter the policy map name.
Step 7
end
Example:Router(config-pmap-c)# end
Returns to privileged EXEC mode.
Step 8
show policy-map
Example:Router# show policy-map
(Optional) Displays all configured policy maps.
Step 9
show policy-map interface type number
Example:Router# show policy-map interface serial4/0
(Optional) 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 PVC on the interface.
•
Enter the interface type and number.
Step 10
exit
Example:Router# exit
(Optional) Exits privileged EXEC mode.
What to Do Next
So far, you have configured Class-Based Traffic Shaping in a primary-level (parent) policy map. To configure a secondary-level (child) policy map in the hierarchical policy map structure (an optional task), proceed with the instructions in "Configuring the Secondary-Level (Child) Policy Map" section.
Configuring the Secondary-Level (Child) Policy Map
In the secondary-level (child) policy map, additional QoS features used with traffic shaping (for example, CBWFQ and traffic policing) are typically configured. For Class-Based Traffic Shaping, the only two QoS features supported at the secondary-level (child) policy map are CBWFQ and traffic policing.
Note
CBWFQ is supported in both the primary-level (parent) policy map and the secondary-level (child) policy map. However, to use CBWFQ in the secondary-level (child) policy map, traffic shaping must be configured in the primary-level (parent) policy map. For more information about CBWFQ in a secondary-level (child) policy map, see the "Hierarchical Policy Map Structure of Class-Based Traffic Shaping" section.
To configure a QoS feature (such as CBWFQ and traffic policing) in a secondary-level (child) policy map, complete the following steps.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
policy-map policy-map-name
4.
class {class-name | class-default}
5.
bandwidth {bandwidth-kbps | remaining percent percentage | percent percentage}
6.
end
7.
show policy-map
8.
show policy-map interface type number
9.
exit
DETAILED STEPS
Command or Action PurposeStep 1
enable
Example:Router> enable
Enables privileged EXEC mode.
•
Enter your password if prompted.
Step 2
configure terminal
Example:Router# configure terminal
Enters global configuration mode.
Step 3
policy-map policy-map-name
Example:Router(config)# policy-map policy1
Specifies the name of the policy map created earlier and enters policy-map configuration mode. See the "Prerequisites" section for more information.
•
Enter the policy map name.
Step 4
class {class-name | class-default}
Example:Router(config-pmap)# class class-default
Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode.
•
Enter the name of the class or enter the class-default keyword.
Step 5
bandwidth {bandwidth-kbps | remaining percent percentage | percent percentage}
Example:Router(config-pmap-c)# bandwidth percent 50
Specifies or modifies the bandwidth allocated for a class belonging to a policy map.
•
Enter the amount of bandwidth as a number of kbps, a relative percentage of bandwidth, or an absolute amount of bandwidth.
Note
The bandwidth command used here is only an example of a QoS feature than can be configured. The bandwidth command configures CBWFQ. You could also use the police command to configure traffic policing.
Step 6
end
Example:Router(config-pmap-c)# end
Returns to privileged EXEC mode.
Step 7
show policy-map
Example:Router# show policy-map
(Optional) Displays all configured policy maps.
Step 8
show policy-map interface type number
Example:Router# show policy-map interface serial4/0
(Optional) 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 PVC on the interface.
•
Enter the interface type and number.
Step 9
exit
Example:Router# exit
(Optional) Exits privileged EXEC mode.
Configuration Examples for Class-Based Traffic Shaping
This section contains the following examples:
•
Class-Based Traffic Shaping Configuration: Example
Class-Based Traffic Shaping Configuration: Example
The following is an example of Class-Based Traffic Shaping configured in a hierarchical policy map structure. In this example, two policy maps have been created; the primary-level (parent) policy map called "policy_parent," and a secondary-level (child) policy map called "policy_child." Traffic shaping is configured in the policy_parent policy map, and CBWFQ has been configured in the policy_child policy map.
The service-policy command associates the two policy maps in the hierarchical policy map structure.
enableconfigure terminalpolicy-map policy_parentclass class-defaultshape average 1000000 ! This enables traffic shaping.service-policy policy_child ! This associates the policy maps.exitexitpolicy-map policy_childclass class-defaultbandwidth percent 50 ! This enables CBWFQ.endWhere to Go Next
To configure Generic Traffic Shaping (GTS), see the "Regulating Packet Flow on a Per-Interface Basis—Using Generic Traffic Shaping" module.
To configure Frame Relay Traffic Shaping (FRTS), see the "MQC-Based Frame Relay Traffic Shaping" module.
Additional References
The following sections provide references related to configuring Class-Based Traffic Shaping.
Related Documents
Related Topic Document TitleQoS commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples
Packet classification
MQC, policy maps, class maps, and hierarchical policy maps
CBWFQ and other queueing mechanisms
dCEF
"Cisco Express Forwarding Features Roadmap" module
Overview information about using traffic shaping to regulate packet flow on a network
GTS
"Regulating Packet Flow on a Per-Interface Basis—Using Generic Traffic Shaping" module
FRTS
Information on a feature in this technology that is not documented here
"Regulating Packet Flow Roadmap" module
Standards
Standard TitleNo new or modified standards are supported, and support for existing standards has not been modified.
—
MIBs
RFCs
RFC TitleNo new or modified RFCs are supported, and support for existing RFCs has not been modified.
—
Technical Assistance
Feature Information for Class-Based Traffic Shaping
Table 1 lists the features in this module and provides links to specific configuration information. Only features that were introduced or modified in Cisco IOS Release 12.2(1) or a later release appear in the table.
For information on a feature in this technology that is not documented here, see the "Regulating Packet Flow Roadmap" module.
Not all commands may be available in your Cisco IOS software release. For release information about a specific command, see the command reference documentation.
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS and Catalyst OS software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Note
Table 1 lists only the Cisco IOS software release that introduced support for a given feature in a given Cisco IOS software release train. Unless noted otherwise, subsequent releases of that Cisco IOS software release train also support that feature.
.
Table 1 Feature Information for Class-Based Traffic Shaping
Feature Name Software Releases Feature Configuration InformationDistributed Traffic Shaping
12.2(8)T
Distributed Traffic Shaping (DTS) is a legacy method for regulating the flow of packets going out an interface. Class-Based Traffic Shaping should be used instead of (DTS).
The following sections provide information about Class-Based Traffic Shaping:
•
Information About Class-Based Traffic Shaping
CCDE, CCENT, Cisco Eos, Cisco Lumin, Cisco Nexus, Cisco StadiumVision, Cisco TelePresence, Cisco WebEx, the Cisco logo, DCE, and Welcome to the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn and Cisco Store are service marks; and Access Registrar, Aironet, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, EtherFast, EtherSwitch, Event Center, Fast Step, Follow Me Browsing, FormShare, GigaDrive, HomeLink, Internet Quotient, IOS, iPhone, iQuick Study, IronPort, the IronPort logo, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking Academy, Network Registrar, PCNow, PIX, PowerPanels, ProConnect, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx, and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0809R)
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
© 2007 Cisco Systems, Inc. All rights reserved.

