Shaping Traffic: Cisco 10000 Series Router Quality of Service Configuration Guide OL-7433-09
Shaping Traffic: Cisco 10000 Series Router Quality of Service Configuration Guide OL-7433-09
Shaping Traffic
Managing the flow of data across your network helps to ensure network efficiency by maximizing
bandwidth and avoiding congestion. Manage network traffic using traffic policing and traffic shaping.
Using these tools, you can configure your system to effectively manage issues before an overload on the
network. Traffic policing uses rate-limiting to regulate traffic and traffic shaping regulates traffic by
shaping it to a specified rate. Deploying policing and shaping throughout your network helps to ensure
that a packet, or data source, conforms to the QoS policies contracted for it.
The Cisco 10000 series router supports traffic policing and shaping. This chapter describes traffic
shaping and includes the following topics:
• Traffic Shaping, page 9-2
• Differences Between Traffic Shaping Mechanisms, page 9-10
• Bandwidth and Traffic Shaping, page 9-10
• Differences Between Shaping and Policing, page 9-11
• Advantages and Disadvantages of Shaping and Policing for Bandwidth Limiting, page 9-11
• Modifying the VC Weight and the VP Shaping Parameters, page 9-12
• Example Scenarios of Traffic Shaping Usage, page 9-12
• Interfaces Supporting Traffic Shaping, page 9-13
• Configuring Traffic Shaping, page 9-13
• Verifying Traffic Shaping, page 9-17
• Configuration Examples for Traffic Shaping, page 9-21
• Related Documentation, page 9-22
For information about traffic policing, see Chapter 6, “Policing Traffic.”
For information about per-session traffic shaping and queuing, see Chapter 18, “Regulating and Shaping
Subscriber Traffic.”
Traffic Shaping
Traffic shaping is a tool used to manage network traffic by shaping the traffic to a specified rate. Traffic
shaping enables you to control access to available bandwidth, to ensure that traffic conforms to the
policies established for it, and to regulate the flow of traffic to avoid congestion that can occur when the
transmitted traffic exceeds the access speed of its remote target interface.
Traffic shaping uses a traffic descriptor for a packet—indicated by the classification of the packet—to
ensure that a packet, or data source, adheres to the policies contracted for it and to determine the QoS to
apply to the packet. Traffic shaping enables you to control the traffic leaving an interface, matching its
packet flow to the speed of a particular remote interface. By shaping a class of traffic to conform to
downstream requirements, you can eliminate bottlenecks in topologies with data-rate mismatches.
The Cisco 10000 series router’s traffic shaping algorithm is not based on the token bucket model.
Therefore, the concepts of committed burst (Bc) and excess burst (Be) are not applicable. Because
shaping does not use token buckets, the router cannot gather shaping statistics. As a result, you cannot
display the amount of shaped traffic in relation to the amount of traffic forwarded unshaped.
Unlike traffic policing, shaping does not propagate bursts and is applied to only outbound traffic on an
interface. When congestion occurs, policing drops traffic whereas traffic shaping delays the excess
traffic using a buffer or queuing mechanism and then schedules the excess packets for later transmission
over increments of time. This results in a smooth packet output rate. Shaping requires a queue and
sufficient memory to buffer delayed packets. Since queuing is an outbound function, only packets
leaving an interface can be queued and shaped.
When configuring shaping, you must ensure that the following exists:
• Sufficient memory to buffer delayed packets
• Scheduling function for later transmission of delayed packets
The Cisco 10000 series router supports the following types of traffic shaping:
• Class-Based Shaping—Enables you to shape a class of traffic to control the flow of traffic on an
interface. A service policy that defines shaping for a particular traffic class is attached to an
interface. Shaping is applied on a per-class basis. For more information, see the “Class-Based
Traffic Shaping” section on page 9-3.
• Hierarchical Shaping—Provides two levels of shaping—per-VC ATM-level shaping and per-VC
packet-level shaping—and provides per-VC and per-VP traffic shaping to control or modify the flow
of traffic on an interface. Traffic shaping ensures that traffic from one VC does not adversely impact
another VC and result in loss of data. For more information, see the “Hierarchical Shaping” section
on page 9-4.
• Percentage-Based Shaping—Provides the ability to configure traffic shaping on the basis of a
percentage of bandwidth available on an interface. For more information, see the “Percentage-Based
Traffic Shaping” section on page 9-8.
• Frame Relay Traffic Shaping (FRTS)—Shapes traffic on Frame Relay interfaces. Using FRTS,
service providers can organize traffic into per-data-link connection identifier (DLCI) queues, and
shape each DLCI separately. For more information, see the “Frame Relay Traffic Shaping” section
on page 9-8.
Hierarchical Shaping
Hierarchical shaping provides two levels of shaping—per-VC ATM-level shaping and per-VC
packet-level shaping—and provides per-VC and per-VP traffic shaping to control or modify the flow of
traffic on an interface. Traffic shaping limits throughput by buffering excess traffic instead of dropping
packets. The shaping function also ensures that traffic from one VC does not adversely impact another
VC, resulting in loss of data.
The Cisco 10000 series router supports hierarchical shaping for the following ATM line cards:
• OC-12
• 4-port OC-3
• 8-port E3/DS3
The router supports hierarchical shaping when operating as a Layer 2 Access Concentrator (LAC) and
in the following modes:
• PPP termination and aggregation (PTA)
• Router bridge encapsulation (RBE)
• RFC 1483
Hierarchical shaping does not require that you configure policy maps. You can use hierarchical shaping
with non-queuing related policy maps configured in a virtual template or configured directly on the VC.
Apply queuing-related policy maps directly to the VC.
Hierarchical shaping supports the range pvc command to define shaping for a range of PVCs and the
vc-class atm command to create a VC class with shaping defined for a PVC.
VP-Level Shaping
The segmentation and reassembly (SAR) mechanism of the Cisco 10000 series router handles VP-level
shaping functions, based on the aggregate VP traffic. VP shaping regulates the output rate of the VP
tunnel, rather than the output rate of the individual VCs. The SAR limits the rate of the overall output of
the VP tunnel to the constant bit rate (CBR) with a peak cell rate (PCR) specified for the tunnel that is
compliant with VP-level shaping requirements.
The SAR sends the cells (from the VCs in the VP tunnel) into the tunnel based on a weighted round robin
format. The weight indicates the number of cells a VC can send into the tunnel before the SAR processes
the next VC. The line card software programs a weight that is proportional to the VC’s rate. Only
variable bit rate (VBR) VCs are allowed in the tunnel.
VC-Level Shaping
The parallel express forwarding (PXF) engine of the Cisco 10000 series router handles the VC-level
shaping functions. The PXF shapes the VCs at the packet level, including all ATM overheads based on
the sustained cell rate (SCR). VC-level shaping ensures that the VC traffic stream averages to be no
greater than the SCR, but is not compliant with ATM level instantaneous shaping requirements.
On an ATM OC-12 line card, when you configure UBR PVCs with a shaped value (UBR-PCR) and the
shaped value is greater than one-half of the line rate (for example, 299,520 Kbps), the following
limitations apply:
• The number of VCs the OC-12 line card supports is up to one-half of the VC scaling limit of 16,384
VCs. Cisco IOS software counts each UBR-PVC above 299,520 as two VCs. Therefore, the active
VC count must be maintained at the following:
16,384 > (number of VCs at 299,520 and above * 2) + (number of VCs below 299,520)
At any time, if more VCs are active than the allowed number above, the SAR on the line card leaks
buffers, which results in a reduced buffer pool for active VCs and the SAR might fail if enough
buffers are lost. To recover the lost buffers, reboot the system.
• The router allows you to enter shaping values between 299,520 and 599,040, which the SAR does
not support. The SAR performs shaping in the range of 599,040 and 299,520 to 299,538. If you
configure a shaping value between 299,528 and 399,032, the shape rate the SAR returns is unclear.
• If you initially set a shaping rate of 599,040 and then change to another rate, or you initially
configure a shape rate and change to a rate of 599,040, the router accepts the command and the show
commands display the new rate. However, the SAR does not perform shaping correctly until the next
reload.
If you change the shaping rate from 599,040 to a lower rate, the LP shaper in VTMS allows the
average rate to be met. However, during traffic bursts, ATM-level shaping is not accurate.
The SAR uses weighted round-robin scheduling to schedule the PVP VCs onto the wire. The SAR also
does the following:
• Assigns high rate VCs a high weighting
• Ensures that cells are scheduled in accordance with the configured rate of the PVP
• Offers per-VC buffering to accommodate small bursts at the VC packet level
• Ensures that transmitted cells conform to ATM transmission standards, including cell delay
variation tolerance (CDVT)
The priority of the PVP is the same as the priority of CBR VCs on an interface. If the physical interface
experiences congestion, the PVPs and any CBR VC have priority over VBR-nrt VCs and unspecified bit
rate (UBR) VCs.
Line Card Maximum VCs per Port Maximum VCs per Module VBR, CBR, Shaped UBR VCs
E3/DS3 4,096 32,768 28,672
OC-3 8,192 32,768 28,672
OC-12 16,384 16,384 16,384
Note Frame Relay traffic shaping (FRTS) is available only on the PRE1.
Frame Relay traffic shaping (FRTS) is a shaping mechanism used to eliminate bottlenecks in Frame
Relay networks with high-speed connections at the central site and low-speed connections at the branch
sites. Using FRTS, you can configure rate enforcement to either the committed information rate (CIR)
or some other defined value, such as the excess information rate, on a per-VC basis. The ability to allow
the transmission speed used by the router to be controlled by criteria other than line speed (that is, by
the CIR or the excess information rate) provides the mechanism by which multiple VCs can share media.
By allocating bandwidth to each VC, you create a virtual time-division multiplexing (TDM) network.
Defining a priority queue (PQ) or weighted fair queue (WFQ) at the VC or subinterface level allows for
finer granularity in the prioritization and queuing of traffic. As a result, you have more control over the
traffic flow on an individual VC.
Using information contained in the BECN-tagged packets received from the network, FRTS can
dynamically throttle (decrease) traffic. When an interface configured with FRTS receives a BECN, it
immediately decreases its maximum rate and holds the packets in the buffers of the router to reduce the
data flow from the router into the Frame Relay network. If, after several intervals, the interface has not
received another BECN and traffic is waiting in the queue, the maximum rate increases slightly. FRTS
decreases traffic on a per-VC basis and adjusts the transmission rate based on the number of
BECN-tagged packets received. The dynamically adjusted maximum rate is called the derived rate.
The derived rate is always between the upper bound and the lower bound rate configured on the interface.
For more information, see the “Configuring Frame Relay Traffic Shaping” section on page A-5.
Advantages
• Shaping
– Buffers excess packets, therefore, less likely to drop excess packets.
– Buffers packets up to the length of the queue. Drops may occur if excess traffic is sustained at
a high rate.
– Typically avoids retransmissions due to dropped packets.
• Policing
– Controls the output rate through packet drops.
– Avoids delays resulting from queuing.
Disadvantages
• Shaping
– Can introduce delay resulting from queuing (especially when deep queues are used).
• Policing
– Drops excess packets (when configured), throttles TCP window sizes, and reduces the overall
output rate of affected traffic streams.
– Overly aggressive burst sizes can lead to excess packet drops and throttle the overall output rate
(particularly with TCP-based flows).
that is making the guarantees. Retaining the data in the router allows the router to prioritize traffic
according to the guarantees it is making. (Packet loss can result in detrimental consequences for
real-time and interactive applications.)
Note The router does not support traffic shaping on inbound interfaces.
Note These steps configure class-based traffic shaping, which can be applied to interfaces, subinterfaces, VCs,
and DLCIs.
Command Purpose
Step 1 Router(config)# policy-map policy-map-name Creates or modifies a policy map.
policy-map-name is the name of the child policy map. The
name can be a maximum of 40 alphanumeric characters.
Step 2 Router(config-pmap)# class class-map-name Assigns the traffic class you specify to the policy map. Enters
policy-map class configuration mode.
class-map-name is the name of a previously configured class
map and is the traffic class you want to shape.
Step 3 Router(config-pmap-c)# shape [average] cir Shapes traffic to the rate you specify, or shapes traffic based
on the percentage of available bandwidth you specify.
or
average is the committed burst (Bc) that specifies the
Router(config-pmap-c)# shape [average] maximum number of bits sent out in each interval. This
percent percentage [be excess-burst-in-msec
option is only supported on the PRE3.
ms] [bc committed-burst-in-msec ms]
cir specifies the committed information rate (CIR), in bits per
second (bps).
percent percentage specifies the percentage of available
bandwidth to allocate.
(Optional) be excess-burst-in-msec ms is the excess (peak)
burst (be) size in milliseconds (ms).
(Optional) bc committed-burst-in-msec ms is the committed
(conform) burst (bc) size in milliseconds (ms).
Step 4 Router(config-pmap-c)# shape max-buffers (Optional) Specifies the maximum number of buffers allowed
number-of-buffers on shaping queues.
number-of-buffers specifies the maximum number of buffers.
Valid values are from 1 to 4096.
Step 5 Router(config-pmap-c)# service-policy (Optional) Applies the child policy map you specify to the
policy-map-name traffic class. The router applies the QoS actions specified in
the child policy to the traffic class.
policy-map-name is the name of the child policy.
Note Do not specify the output or input keywords.
Note These steps configure hierarchical shaping. Use these commands to shape an individual VC and then
shape the aggregate VCs into a VP.
Command Purpose
Step 1 Router(config)# interface atm Creates or modifies an ATM interface. Enters interface
slot/module/port configuration mode.
slot/module/port is the interface number.
Step 2 Router(config-if)# atm (Optional) Enables oversubscription on ATM virtual circuits and
over-subscription-factor factor specifies the factor by which the sum of the sustained cell rate
(SCR) values of all VCs in a tunnel can oversubscribe the tunnel’s
peak cell rate (PCR).
factor specifies the amount of oversubscription. Valid values are
from 1 to 500. The default value is 1, which indicates no
oversubscription.
Step 3 Router(config-if)# atm pvp vpi Creates a permanent virtual path (PVP) used to multiplex (or
[peak-rate] [cdvt] bundle) one or more virtual circuits (VCs).
vpi is the ATM network virtual path identifier (VPI) of the VC.
Valid values are 0 to 255. The vpi value is unique only on a single
link, not throughout the ATM network because it has local
significance only.
Note The number specified for the vpi must not already exist. If
the number specified is already being used by an existing
VC, the router rejects this command.
Command Purpose
Step 6 Router(config-if-atm-vc)# vbr-nrt Enables shaping on the ATM PVC and configures variable bit
output-pcr output-scr output-mbs rate-nonreal time (VBR-NRT) quality of service (QoS).
output-pcr is the peak cell rate (PCR) for outbound traffic.
output-scr is the sustained cell rate (SCR) for outbound traffic.
(Optional) output-mbs is the output maximum burst cell size, in
number of cells.
Step 7 Router(config-if-atm-vc)# encapsulation Configures the ATM adaptation layer (AAL) and encapsulation
{aal5mux ppp virtual-template number | type for an ATM virtual circuit (VC).
aal5ciscoppp virtual-template number |
aal5snap} aal5mux ppp specifies the AAL and encapsulation type for
multiplex (MUX)-type VCs. The keyword ppp is Internet
Engineering Task Force (IETF)-compliant PPP over ATM. It
specifies the protocol type being used by the MUX encapsulated
VC.
aal5ciscoppp specifies the AAL and encapsulation type for Cisco
PPP over ATM.
aal5snap specifies the AAL and encapsulation type that supports
Inverse ARP. Logical Link Control/Subnetwork Access Protocol
(LLC/SNAP) precedes the protocol datagram.
virtual-template number is the number used to identify the
virtual template.
Step 8 Router(config-atm-vc)# queue-depth hwm (Optional) Defines the queue-depth size by setting the high and
lwm low watermarks. This ensures the correct shaping of traffic.
hwm is the high watermark. The value you specify is not required
to be higher than 288.
lwm is the low watermark. The value you specify is not required
to be higher than 256.
For information about the default high and low watermark values,
see the “High Watermark and Low Watermark Default Values”
section on page 15-25.
Note The values for high and low watermarks of a VC queue
depend greatly on the queue’s configuration, its purpose,
and usage. We recommend that you configure watermark
values small enough so as to avoid exhausting the line
card buffer. When the queues exhaust the buffer, packets
are randomly dropped, which can cause the loss of critical
system traffic.
Configuration Example for Traffic Shaping at the VC-Level and the VP-Level
Example 9-1 configures hierarchical shaping and shapes traffic at the VC-level and the VP-level. In the
example, shaping is enabled on PVC 1/36 on ATM interface 5/0/0.
Example 9-1 Configuring Traffic Shaping at the VC-Level and the VP-Level
Command Purpose
Router# show atm vp [vpi] Displays the statistics for all virtual paths (VPs) on an interface
or for a specific VP.
(Optional) vpi is the ATM network virtual path identifier (VPI)
for the permanent virtual path (PVP). Valid values are from 0 to
255. The VPI is an 8-bit field in the header of the ATM cell.
Router# show atm vc [vcd] [interface Displays all ATM permanent virtual circuits (PVCs) and traffic
interface-number] information.
(Optional) vcd specifies a virtual circuit. When you specify vcd,
information about only the specified virtual circuit displays.
(Optional) interface interface-number is the interface number or
subinterface number of the PVC. When you specify interface
interface-number, information about all of the PVCs on the
specified interface or subinterface displays.
Router# show controllers atm slot/module/port Displays ATM controller status.
Use this command to ensure that packets are not being discarded
due to internal buffer exhaustion.
slot/module/port is the interface number.
Router# show policy-map Displays the configuration of all policy maps configured on the
router.
Router# show policy-map interface Displays the configuration of all of the classes configured in all
of the policy maps that are attached to all of the router interfaces.
Command Purpose
Router# show policy-map interface interface Displays the configuration of all classes configured for all
[input | output] inbound or outbound policy maps attached to the specified
interface.
interface interface is the type and number of the interface or
subinterface to which the policy configuration you want to
display is attached.
input indicates to display the statistics for the attached inbound
policy.
output indicates to display the statistics for the attached
outbound policy.
Note If you do not specify input or output, the router displays
information about all classes that are configured for all
inbound and outbound policies attached to the interface
you specify.
Router# show policy-map policy-map-name Displays the configuration of all classes contained in the policy
map you specify.
policy-map-name is the name of the policy map for the
configuration information you want to display.
If you do not specify a policy-map-name, the command displays
the configuration of all policy maps configured on the router.
Router# show policy-map policy-map-name class Displays the configuration of the class you specify. The policy
class-name map you specify includes this class.
policy-map-name is the name of the policy map that contains the
class configuration you want to display.
class-name is the name of the class whose configuration you want
to display. If you do not specify class-name, the router displays
class configuration for all classes in the policy map.
Router# show pxf cpu queue atm number Displays the number of dropped and dequeued packets for each
VC on the interface, and for classes associated with sessions that
inherit queues from VCs. Also, monitors the current capacity of
the queue.
number is the number of the interface or subinterface.
Router# show running-config Displays the contents of the currently running configuration file.
Router# show running-config [interface interface] Displays the configuration of the interface you specify that is
currently configured in the running-config file, including any
service policies attached to the interface.
(Optional) interface interface is the type and number of the
interface.
Example 9-2 show atm vp Command Sample Output for a Specific VPI
Example 9-3 shows sample output from the show atm vp command. The output displays the
configuration of the virtual path (VP) with an identifier of 10.
Example 9-4 shows sample output from the show pxf cpu queue atm command. The output indicates
the number of packets dropped and dequeued for VC 1/229 and VC 1/233.
Example 9-5 shows sample output from the show controllers atm command. The output indicates that
no output packets were discarded due to internal buffer exhaustion.
SECTION
LOF =0LOS=0RDOOL=0BIP(B1)=0
LINE
AIS=0RDI=0FEBE=0BIP(B2)=0
PATH
AIS=0RDI=0FEBE=0BIP(B3)=0
LOP=0NEWPTR =0PSE=0NSE=0
LCD=0
Active Defects: None
Active Alarms: None
Alarm reporting enabled for: SF SLOS SLOF B1-TCA LAIS LRDI B2-TCA PAIS PLOP PRDI B3-TCA
RDOOL LCD
PATH TRACE BUFFER: STABLE
Remote hostname:
Remote interface:
Remote IP addr:
Remote Rx(K1/K2): / Tx(K1/K2): /
policy-map shape
class c1
shape average 38400 15440
!
interface serial 3/3/0
service-policy output shape
Note The shape average command is available only on the PRE3. The PRE2 supports the shape cir command.
interface ATM5/0/0
no ip address
no ip mroute-cache
atm over-subscription-factor 50
atm pvp 1 1000 cdvt 600
no atm auto-configuration
no atm ilmi-keepalive
no atm address-registration
no atm ilmi-enable
!
interface ATM5/0/0.1 point-to-point
pvc 1/33
vbr-nrt 1000 256
encapsulation aal5mux ppp Virtual-Template1
queue-depth 288 256
!
!
interface ATM5/0/0.2 point-to-point
pvc 1/34
vbr-nrt 1000 256
encapsulation aal5mux ppp Virtual-Template1
queue-depth 288 256
!
!
interface ATM5/0/0.3 point-to-point
pvc 1/35
vbr-nrt 1000 512
encapsulation aal5mux ppp Virtual-Template1
queue-depth 288 256
!
!
interface ATM5/0/0.4 point-to-point
pvc 1/36
vbr-nrt 1000 512
encapsulation aal5mux ppp Virtual-Template1
queue-depth 288 256
!
Related Documentation
This section provides hyperlinks to additional Cisco documentation for the features discussed in this
chapter. To display the documentation, click the document title or a section of the document highlighted
in blue. When appropriate, paths to applicable sections are listed below the documentation title.