Feedback
|
Table Of Contents
Specifying Average Rate or Peak Rate Traffic Shaping
Configuring CBWFQ Inside Traffic Shaping
Configuring Class-Based Shaping
Configuring CBWFQ Inside Traffic Shaping
Verifying the Configuration of Policy Maps and Their Classes
Class Based Shaping on ATM PVCs Example
CBWFQ in Traffic Shaping Example
CBWFQ Inside Traffic Shaping Examples
Class-Based Shaping
Traffic shaping allows you to control the traffic going out an interface in order to match its transmission to the speed of the remote, target interface and to ensure that the traffic conforms to policies contracted for it.
Feature Specifications for Class-Based Shaping
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
Feature Overview
Traffic shaping allows you to control the traffic going out an interface in order to match its transmission to the speed of the remote, target interface and to ensure that the traffic conforms to policies contracted for it. Traffic adhering to a particular profile can be shaped to meet downstream requirements, thereby eliminating bottlenecks in topologies with data-rate mismatches.
Using the Class-Based Shaping feature, you can do the following specify average rate or peak rate traffic shaping.
Specifying Average Rate or Peak Rate Traffic Shaping
Traffic shaping limits the rate of transmission of data. In addition to using a specifically configured transmission rate, you can use traffic shapingto specify a derived transmission rate based on the level of congestion.
You can specify two types of traffic shaping; average rate shaping and peak rate shaping. Average rate shaping limits the transmission rate to the committed information rate (CIR). Using the CIR ensures that the average amount of traffic being sent conforms to the rate expected by the network.
Peak rate shaping configures the router to send more traffic than the CIR. To determine the peak rate, the router uses the following formula:
peak rate = CIR(1+Be/Bc)
where:
•
Be is the Excess Burst rate.
•
Bc is the Committed Burst rate.
Peak rate shaping allows the router to burst higher than average rate shaping. However, using peak rate shaping, the traffic sent above the CIR (the delta) has the potential of being dropped if the network becomes congested.
If your network has additional bandwidth available (over the provisioned CIR) and the application or class can tolerate occasional packet loss, that extra bandwidth can be exploited through the use of peak rate shaping. However, there may be occasional packet drops when network congestion occurs. If the traffic being sent to the network must strictly conform to the configured network provisioned CIR, then you should use average traffic shaping.
Configuring CBWFQ Inside Traffic Shaping
Using the Class-Based Shaping feature, CBWFQ is supported for the queued packets. You can use CBWQ to configure classes of queued traffic and provide relative or absolute bandwidth guarantees to those classes. Note that the relative or absolute bandwidth guarantees are with regard to the configured CIR.
Benefits
Flexibility of Match Criteria
Applying traffic shaping to classes provides greater flexibility for configuring traffic shaping. Previously, this ability was limited to the use of ACLs.
Better Use of Bandwidth
Specifying peak rate shaping allows you to make better use of available bandwidth by allowing more data than the CIR to be sent if the bandwidth is available.
Bandwidth Allocation
CBWFQ allows you to specify the exact amount of bandwidth to be allocated for a specific class of traffic. Taking into account available bandwidth on the interface, you can configure up to 64 classes and control distribution among them, which is not the case with flow-based WFQ.
Flow-based WFQ applies weights to traffic to classify it into conversations and determine how much bandwidth each conversation is allowed relative to other conversations. These weights, and traffic classification, are dependent on and limited to the seven IP Precedence levels.
Coarser Granularity and Scalability
CBWFQ allows you to define what constitutes a class based on criteria that exceed the confines of flow. CBWFQ allows you to use ACLs and protocols or input interface names to define how traffic will be classified, thereby providing coarser granularity. You need not maintain traffic classification on a flow basis. Moreover, you can configure up to 64 discrete classes in a service policy.
Restrictions
Peak and average traffic shaping is configured on a per-interface or per-class basis, and cannot be used in conjunction with commands used to configure traffic shaping from previous versions of Cisco IOS. These commands include the following:
•
traffic-shape adaptive
•
traffic-shape fecn-adaptive
•
traffic-shape group
•
traffic-shape rate
Adaptive traffic shaping for Frame Relay networks is not supported using the Class-Based Shaping feature. To configure adaptive traffic shaping for Frame Relay networks, you must use the commands from releases prior to Release 12.1(2) of Cisco IOS software.
Configuration Tasks
See the following sections for configuration tasks for the Class-Based Shaping feature. Each task in the list is identified as either optional or required.
•
Configuring Class-Based Shaping (Required)
•
Configuring CBWFQ Inside Traffic Shaping (Optional)
•
Verifying the Configuration of Policy Maps and Their Classes (Optional)
Configuring Class-Based Shaping
To configure Class-Based Shaping, use the first two commands in global configuration mode to specify the name of the policy map and the name of the class map. Use the remaining commands in class-map configuration mode to specify average or peak rate.
Configuring CBWFQ Inside Traffic Shaping
To configure CBWFQ inside Traffic Shaping, use the first two commands in global configuration mode to specify the name of the policy map and the name of the class map. Use the remaining commands in class-map configuration mode to specify average or peak rate and to attach the service policy to the class.
Verifying the Configuration of Policy Maps and Their Classes
To display the contents of a specific policy map, a specific class from a specific policy map, or all policy maps configured on an interface, use one of the following commands in global configuration mode:
Configuration Examples
This section provides the following configuration examples:
•
Class Based Shaping on ATM PVCs Example
•
CBWFQ in Traffic Shaping Example
•
CBWFQ Inside Traffic Shaping Examples
Class-Based Shaping Example
The following example defines one class, c1. Class c1 is configured to shape traffic to 384 kbps, with a normal burst size of 15440 bits.
Router(config)# policy-map shapeRouter(config-pmap)# class-map c1Router(config-pmap-c)# shape average 38400 15440Router(config-pmap-c)# configure terminalRouter(config)# interface Serial 3/3Router(config-if)# service-policy output shapeClass Based Shaping on ATM PVCs Example
Class based shaping is supported on ATM PVCs, as shown in the following example:
Router(config)# class-map c1Router(config-cmap)# match access-group 101Router(config-cmap)# exitRouter(config)# class-map c2Router(config-cmap)# match access-group 102Router(config-cmap)# exitRouter(config)# policy-map atmpvcshapeRouter(config-pmap)# class c1Router(config-pmap-c)# shape average 100Router(config-pmap)# class c2Router(config-pmap-c)# shape average 200Router(config)# interface atm1/0Router(config-if)# pvc 1/200
Router(config-atm-vc)# service-policy output atmpvcshapeCBWFQ in Traffic Shaping Example
The following example uses CBWFQ at the interface and shapes the traffic before it is queued to CBWFQ.
In this example, two classes are defined—cust1 and cust2. The class cust1 is ensured a bandwidth of 256 kbps, and the output is shaped to 384 kbps. The class cust2 is ensured a bandwidth of 384 kbps, but if enough bandwidth is available on the interface, the class can obtain throughput up to a peak of 512 kbps.
Figure 1 illustrates this example.
Figure 1 CBWFQ in Conjunction with Traffic Shaping
The following commands are used to configure this example:
Router(config)# policy-map shape-cbwfqRouter(config-pmap)# class cust1Router(config-pmap-c)# shape average 384000Router(config-pmap-c)# bandwidth 256Router(config-pmap)# class cust2Router(config-pmap-c)# shape peak 512000Router(config-pmap-c)# bandwidth 384Router(config-pmap-c)# configure terminalRouter(config)# interface Serial 3/3Router(config-if)# service-policy output shape-cbwfqCBWFQ Inside Traffic Shaping Examples
This section provides two examples of configuring CBWFQ inside Traffic Shaping.
Example 1
The first example uses hierarchical policy maps and configures CBWFQ inside Traffic Shaping.
In the following example, three policy maps are defined—cust1-classes, cust2-classes, and cust-policy. The policy maps cust1-classes and cust2-classes have three classes defined—gold, silver, and bronze.
For cust1-classes, gold is configured to use 50 percent of the bandwidth. Silver is configured to use 20 percent of the bandwidth, and bronze is configured to use 15 percent of the bandwidth.
For cust2-classes, gold is configured to use 30 percent of the bandwidth. Silver is configured to use 15 percent of the bandwidth, and bronze is configured to use 10 percent of the bandwidth.
The policy map cust-policy specifies average rate shaping of 384 kbps and assigns the service policy cust1-classes to the class cust1. The policy map cust-policy specifies peak rate shaping of 512 kbps and assigns the service policy cust2-classes to the class cust2.
Figure 2 illustrates this example.
Figure 2 Hierarchical Policy Maps Using Class-Based Shaping
Configuration for cust1-classes
Router(config)# policy-map cust1-classesRouter(config-pmap)# class goldRouter(config-pmap-c)# bandwidth percent 50Router(config-pmap)# class silverRouter(config-pmap-c)# bandwidth percent 20Router(config-pmap)# class bronzeRouter(config-pmap-c)# bandwidth percent 15Configuration for cust2-classes
Router(config)# policy-map cust2-classesRouter(config-pmap)# class goldRouter(config-pmap-c)# bandwidth percent 30Router(config-pmap)# class silverRouter(config-pmap-c)# bandwidth percent 15Router(config-pmap)# class bronzeRouter(config-pmap-c)# bandwidth percent 10Configuration for Customer Policy and QoS Features
Router(config)# policy-map cust-policyRouter(config-pmap)# class cust1Router(config-pmap-c)# shape average 38400Router(config-pmap-c)# service-policy cust1-classesRouter(config-pmap)# class cust2Router(config-pmap-c)# shape peak 51200Router(config-pmap-c)# service-policy cust2-classesRouter(config-pmap-c)# interface Serial 3/2Router(config-if)# service-policy output cust-policyExample 2
In this example, the Class-Based Shaping feature is configured for the class named shaped in the policy map named TS_in_ModCLI. The class shaped is shaped to an average rate of 241,000 bits per second (bps). CBWFQ is also enabled on the class, which guarantees a bandwidth of 241 kbps during times of congestion at the interface.
The shaped class is a congestion point for all the subclasses that comprise that class. Therefore, the subclasses can be further differentiated in the shaped class. All these subclasses are part of the policy map, CBWFQ_in_TS, that is attached to the shaped class.
Configuration for Policy Map TS_in_ModCLI
Router(config)# policy-map TS_in_ModCLIRouter(config-pmap)# class shapedRouter(config-pmap-c)# bandwidth 241Router(config-pmap-c)# shape average 241000Router(config-pmap-c)# service-policy CBWFQ_in_TSConfiguration for Policy Map CBWFQ_in_TS
The policy map, CBWFQ_in_TS, has four CBWFQ classes:
Router(config)# policy-map CBWFQ_in_TSRouter(config-pmap)# class cust_ARouter(config-pmap-c)# bandwidth percent 25Router(config-pmap)# class cust_BRouter(config-pmap-c)# bandwidth percent 25Router(config-pmap)# class cust_CRouter(config-pmap-c)# bandwidth percent 25Router(config-pmap)# class class-defaultRouter(config-pmap-c)# fair-queueVerifying the Configurations
The output of the show policy-map command for TS_in_ModCLI displays an expanded configuration, including the subclasses:
Router# show policy-map TS_in_ModCLIPolicy Map TS_in_ModCLIClass shapedWeighted Fair QueueingBandwidth 241 (kbps) Max Threshold 64 (packets)Traffic ShapingAverage Rate Traffic ShapingCIR 241000 (bps) Max. Buffers Limit 1000 (Packets)Policy Map CBWFQ_in_TSClass cust_AWeighted Fair QueueingBandwidth 25 (%) Max Threshold 64 (packets)Class cust_BWeighted Fair QueueingBandwidth 25 (%) Max Threshold 64 (packets)Class cust_CWeighted Fair QueueingBandwidth 25 (%) Max Threshold 64 (packets)Class class-defaultWeighted Fair QueueingFlow based Fair QueueingThe policy map TS_in_ModCLI can be attached to any logical interface that provides a congestion point. Run-time statistics after attaching to interface Serial 3/0 are shown.
Router# show policy interface Serial 3/0Serial3/0output : TS_in_ModCLIClass shapedWeighted Fair QueueingOutput Queue: Conversation 267Bandwidth 241 (kbps) Max Threshold 64 (packets)(pkts matched/bytes matched) 3852/947384(pkts discards/bytes discards/tail drops) 0/0/0Traffic ShapingTarget Byte Sustain Excess Interval Increment AdaptRate Limit bits/int bits/int (ms) (bytes) Active241000 1928 7712 7712 32 964 -Queue Packets Bytes Packets BytesDepth Delayed Delayed Active41 3980 978872 3967 975686 yesClass cust_AWeighted Fair QueueingOutput Queue: Conversation 41Bandwidth 25 (%) Max Threshold 64 (packets)(pkts matched/bytes matched) 0/0(pkts discards/bytes discards/tail drops) 0/0/0Class cust_BWeighted Fair QueueingOutput Queue: Conversation 42Bandwidth 25 (%) Max Threshold 64 (packets)(pkts matched/bytes matched) 0/0(pkts discards/bytes discards/tail drops) 0/0/0Class cust_CWeighted Fair QueueingOutput Queue: Conversation 43Bandwidth 25 (%) Max Threshold 64 (packets)(pkts matched/bytes matched) 0/0(pkts discards/bytes discards/tail drops) 0/0/0Class class-defaultWeighted Fair QueueingFlow Based Fair QueueingMaximum Number of Hashed Queues 32Additional References
The following sections provide references related to Class Based Shaping.
Related Documents
Standards
MIBs
MIBs MIBs LinkNone
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:
RFCs
Technical Assistance
Command Reference
This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 command reference publications.
service-policy (class map)
To attach a policy map to a class, use the service-policy class-map configuration command. To remove a service policy from a class, use the no form of this command.
service-policy policy-map
no service-policy
Syntax Description
Defaults
No service policy is specified.
Command Modes
Class-map configuration within policy map
Command History
Release Modification12.1(2)T
This command was introduced.
12.0(26)S
This command was integrated into Cisco IOS Release 12.0(26)S.
Usage Guidelines
You can attach a single policy map to one or more classes to specify the service policy for those classes. This command is only available for the output interface, which is assumed.
Examples
In the following example, three policy maps are defined—cust1-classes, cust2-classes, and cust-policy. The policy maps cust1-classes and cust2-classes have three classes defined—gold, silver, and bronze.
For cust1-classes, gold is configured to use 50 percent of the bandwidth. Silver is configured to use 20 percent of the bandwidth, and bronze is configured to use 15 percent of the bandwidth.
For cust2-classes, gold is configured to use 30 percent of the bandwidth. Silver is configured to use 15 percent of the bandwidth, and bronze is configured to use 10 percent of the bandwidth.
The policy map cust-policy specifies average rate shaping of 384 kbps and assigns the service policy cust1-classes to the policy map cust1-classes. The policy map cust-policy specifies peak rate shaping of 512 kbps and assigns the service policy cust2-classes to the policy map cust2-classes.
To configure classes for cust1-classes, use the following commands:
Router(config)# policy-map cust1-classesRouter(config-pmap)# class goldRouter(config-pmap-c)# bandwidth percent 50Router(config-pmap)# class silverRouter(config-pmap-c)# bandwidth percent 20Router(config-pmap)# class bronzeRouter(config-pmap-c)# bandwidth percent 15To configure classes for cust2, use the following commands:
Router(config)# policy-map cust2-classesRouter(config-pmap)# class goldRouter(config-pmap-c)# bandwidth percent 30Router(config-pmap)# class silverRouter(config-pmap-c)# bandwidth percent 15Router(config-pmap)# class bronzeRouter(config-pmap-c)# bandwidth percent 10To define the customer policy with cust1-classes and cust2-classes and QoS features, use the following commands:
Router(config)# policy-map cust-policyRouter(config-pmap)# class cust1Router(config-pmap-c)# shape average 38400Router(config-pmap-c)# service-policy cust1-classesRouter(config-pmap)# class cust2Router(config-pmap-c)# shape peak 51200Router(config-pmap-c)# service-policy cust2-classesRouter(config-pmap-c)# interface Serial 3/2Router(config-if)# service out cust-policyRelated Commands
shape
To specify average or peak rate traffic shaping, use the shape class-map configuration command. To remove traffic shaping, use the no form of this command,
shape {average | peak} cir [bc] [be]
no shape {average | peak} cir [bc] [be]
Syntax Description
Defaults
No default behavior or values.
Command Modes
Class-map configuration within policy map
Command History
Release Modification12.1(2)T
This command was introduced.
12.0(26)S
This command was integrated into Cisco IOS Release 12.0(26)S.
Usage Guidelines
Traffic shaping limits the rate of transmission of data. In addition to using a specifically configured transmission rate, you can use traffic shaping to specify a derived transmission rate based on the level of congestion.
You can specify two types of traffic shaping; average rate shaping and peak rate shaping. Average rate shaping limits the transmission rate to the CIR. Using the CIR ensures that the average amount of traffic being sent conforms to the rate expected by the network.
Peak rate shaping configures the router to send more traffic than the CIR. To determine the peak rate, the router uses the following formula:
peak rate = CIR(1+Be/Bc)
where:
•
Be is the Excess Burst rate.
•
Bc is the Committed Burst rate.
Peak rate shaping allows the router to burst higher than average rate shaping. However, using peak rate shaping, the traffic sent above the CIR (the delta) has the potential of being dropped if the network becomes congested.
If your network has additional bandwidth available (over the provisioned CIR) and the application or class can tolerate occasional packet loss, that extra bandwidth can be exploited through the use of peak rate shaping. However, there may be occasional packet drops when network congestion occurs. If the traffic being sent to the network must strictly conform to the configured network provisioned CIR, then you should use average traffic shaping.
Examples
The following example sets the uses average rate shaping to ensure a bandwidth of 256 kbps:
shape average 256000The following example uses peak rate shaping to ensure a bandwidth of 300 kbps, but allow throughput up to 512 kbps if enough bandwidth is available on the interface:
bandwidth 300shape peak 512000Related Commands
CCIP, CCSP, the Cisco Arrow logo, the Cisco Powered Network mark, Cisco Unity, Follow Me Browsing, FormShare, and StackWise are trademarks of Cisco Systems, Inc.; Changing the Way We Work, Live, Play, and Learn, and iQuick Study are service marks of Cisco Systems, Inc.; and Aironet, ASIST, BPX, Catalyst, CCDA, CCDP, CCIE, CCNA, CCNP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, the Cisco IOS logo, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Empowering the Internet Generation, Enterprise/Solver, EtherChannel, EtherSwitch, Fast Step, GigaStack, Internet Quotient, IOS, IP/TV, iQ Expertise, the iQ logo, iQ Net Readiness Scorecard, LightStream, MGX, MICA, the Networkers logo, Networking Academy, Network Registrar, Packet, PIX, Post-Routing, Pre-Routing, RateMUX, Registrar, ScriptShare, SlideCast, SMARTnet, StrataView Plus, Stratm, SwitchProbe, TeleRouter, The Fastest Way to Increase Your Internet Quotient, TransPath, and VCO are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and certain other countries.
All other trademarks mentioned in this document or Web site 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. (0304R)
Feedback
