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:
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.
![](https://www.cisco.com/content/dam/en/us/td/i/templates/note.gif) 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:
enable
configure terminal
policy-map policy_parent ! This is the primary-level policy map.
class class-default
shape 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:
enable
configure terminal
policy-map policy_child ! This is the secondary-level policy map.
class class-default
bandwidth percent 50 ! This enables CBWFQ.
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.