show traffic-shape
Displays traffic shaping configuration and statistics for all interfaces or a specific interface, used to verify shaping parameters and monitor traffic conformance.
Definition: show traffic-shape is a Cisco IOS privileged exec command. Displays traffic shaping configuration and statistics for all interfaces or a specific interface, used to verify shaping parameters and monitor traffic conformance.
Overview
The 'show traffic-shape' command is a vital diagnostic tool in Cisco IOS for verifying and troubleshooting traffic shaping configurations. Traffic shaping is a Quality of Service (QoS) mechanism that regulates the rate of outgoing traffic on an interface to prevent congestion and ensure compliance with service-level agreements (SLAs). Unlike policing, which drops or re-marks excess traffic, shaping buffers packets that exceed the configured rate, smoothing bursts and reducing packet loss.
This command displays the shaping parameters (e.g., committed information rate (CIR), burst size) and real-time statistics (e.g., bytes queued, packets delayed) for all interfaces or a specific interface. Network engineers reach for this command when they need to confirm that shaping policies are applied correctly, monitor traffic conformance, or diagnose performance issues such as excessive delay or packet drops due to shaping. It fits into the broader QoS troubleshooting workflow after configuring shaping with the 'traffic-shape rate' or 'shape average' commands under an interface.
The command is available in privileged EXEC mode (enable) and does not require additional privilege levels. Its output is dynamic and reflects real-time queue states; it does not affect the running configuration. In IOS, shaping can be applied using legacy 'traffic-shape' or Modular QoS CLI (MQC) 'shape' commands; 'show traffic-shape' works with both, but the output varies slightly.
Understanding this command is essential for CCNA and CCNP candidates as it directly relates to QoS topics on the exams and real-world network optimization.
show traffic-shapeWhen to Use This Command
- Verify that traffic shaping is enabled and correctly configured on a WAN interface after deployment.
- Monitor whether traffic is being shaped (delayed) or dropped due to shaping limits during congestion.
- Troubleshoot slow application performance suspected to be caused by excessive traffic shaping.
- Check the number of packets queued or delayed by shaping on a customer-facing interface.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| interface-type interface-number | e.g., GigabitEthernet0/1 | Specifies a particular interface to display traffic shaping information. If omitted, the command shows shaping statistics for all interfaces. Common mistake: using an incorrect interface name or number, which results in no output. |
Command Examples
Basic show traffic-shape output
show traffic-shapeInterface Se0/0/0
Access Target Byte Sustain Excess Interval Increment Adapt
VC List Rate Limit bits/int bits/int (ms) (bytes) Active
- - 256000 16000 16000 16000 125 4000 -
Queueing Stats:
Queue Packets Bytes Packets Bytes Delayed Delayed
Depth Delayed Delayed Dropped Dropped (ms) (ms)
0 0 0 0 0 0 0The output shows shaping parameters for Serial0/0/0: Target Rate is 256000 bps, Byte Limit is 16000 bytes, Sustain and Excess bits are both 16000, Interval is 125 ms, Increment is 4000 bytes. Queueing stats show no packets delayed or dropped, indicating no congestion.
Show traffic-shape with active shaping
show traffic-shape interface serial 0/0/0Interface Se0/0/0
Access Target Byte Sustain Excess Interval Increment Adapt
VC List Rate Limit bits/int bits/int (ms) (bytes) Active
- - 128000 8000 8000 8000 125 2000 -
Queueing Stats:
Queue Packets Bytes Packets Bytes Delayed Delayed
Depth Delayed Delayed Dropped Dropped (ms) (ms)
12 150 24000 5 800 45 120Shaping is active with a target rate of 128 kbps. Queue depth of 12 indicates packets are being queued. 150 packets delayed with average delay 45 ms, and 5 packets dropped due to shaping. This suggests the interface is congested and shaping is throttling traffic.
Understanding the Output
The output is divided into two sections: shaping parameters and queueing statistics. The first section shows per-interface or per-VC shaping configuration: Target Rate (bps), Byte Limit (maximum bytes per interval), Sustain and Excess bits (CIR and Be), Interval (Tc in ms), Increment (bytes sent per interval), and Adapt (whether adaptive shaping is active). The second section shows queueing stats: Queue Depth (current number of packets in the shaping queue), Packets Delayed/Dropped (cumulative counts), Bytes Delayed/Dropped, and Delayed (ms) showing average delay and total delay.
High queue depth or increasing delayed/dropped packets indicates shaping is actively limiting traffic. Zero values mean no shaping activity. Watch for sustained queue depth above 0 or increasing drops, which may indicate the configured rate is too low for the traffic.
Configuration Scenarios
Verify Traffic Shaping on a WAN Interface
A branch router has a 10 Mbps WAN link and traffic shaping is configured to limit outbound traffic to 8 Mbps to avoid congestion. The engineer needs to verify the shaping parameters and monitor traffic conformance.
Topology
R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2
R1 Gi0/0: 10.0.12.1/30
R2 Gi0/0: 10.0.12.2/30Steps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: View shaping configuration on the WAN interface: show traffic-shape interface GigabitEthernet0/0
! Config on R1 interface GigabitEthernet0/0 ip address 10.0.12.1 255.255.255.252 traffic-shape rate 8000000 800000 800000 !
Verify: Command: show traffic-shape interface GigabitEthernet0/0 Expected output includes: Target/Average Byte Sustain Excess Interval Increment Rate Rate (bits/sec) 8000000/8000000 100000 100000 125 10000 Also shows queue depth and packets queued.
Watch out: Ensure the shaping rate is in bits per second; a common mistake is entering the rate in bytes per second, which results in much lower throughput.
Troubleshoot Shaping-Induced Delay on a Serial Link
Users report high latency on a serial link (1.544 Mbps T1) where shaping is configured to 1 Mbps. The engineer suspects excessive buffering due to shaping and uses the command to inspect queue statistics.
Topology
R1(S0/0/0)---1.544 Mbps---(S0/0/0)R2
R1 S0/0/0: 192.168.1.1/30
R2 S0/0/0: 192.168.1.2/30Steps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Check shaping statistics on the serial interface: show traffic-shape interface Serial0/0/0
- 3.Step 3: Look for high 'Packets queued' or 'Bytes queued' values indicating deep buffers.
! Config on R1 interface Serial0/0/0 ip address 192.168.1.1 255.255.255.252 traffic-shape rate 1000000 125000 125000 !
Verify: Command: show traffic-shape interface Serial0/0/0 Look for 'Queue depth' and 'Packets queued'. If these are consistently high, shaping is causing delay. Also check 'Target rate' vs 'Actual rate' to see if shaping is active.
Watch out: On serial interfaces, the default encapsulation (HDLC) may affect shaping behavior; ensure the interface is not using compression that alters bandwidth.
Troubleshooting with This Command
When troubleshooting traffic shaping, the 'show traffic-shape' command provides critical insight into whether shaping is working as intended. A healthy output shows the configured target rate matching the average rate, low queue depth (ideally near zero), and minimal packets queued. Problem indicators include a high queue depth (e.g., hundreds of packets), a large number of packets queued, or a significant difference between the target rate and the actual output rate.
Focus on the 'Queue depth' field: if it is consistently non-zero, the interface is experiencing congestion and shaping is buffering traffic. High queue depth can cause increased latency and jitter, which is detrimental to real-time applications like VoIP. Also examine 'Packets queued' and 'Bytes queued' – if these grow over time, the shaping rate may be too low for the offered traffic.
Another key field is 'Target/Average Rate': if the average rate is significantly lower than the target, the shaper may be limiting traffic too aggressively, or there may be a configuration error. Common symptoms that this command helps diagnose include: intermittent application timeouts (due to shaping delay), low throughput on a link that should support higher rates, and asymmetric traffic patterns where shaping is applied only in one direction. A step-by-step diagnostic flow: 1) Identify the interface with shaping applied. 2) Run 'show traffic-shape interface [interface]' and capture the output. 3) Check the 'Target rate' – does it match the intended CIR? 4) Check 'Queue depth' – if >0, determine if it is transient or persistent. 5) Run the command multiple times to see if queue depth is growing. 6) Correlate with 'show interface' output to see if output drops are occurring (shaping should prevent drops). 7) Use 'show policy-map interface' if MQC shaping is used, as it provides additional per-class statistics. 8) If shaping is causing excessive delay, consider increasing the shaping rate or adjusting burst parameters.
The command can also be used with 'debug traffic-shape' (caution: can be CPU-intensive) to see real-time shaping events. In summary, 'show traffic-shape' is the go-to command for verifying shaping configuration and diagnosing performance issues related to traffic regulation.
CCNA Exam Tips
CCNA exam tip: The 'show traffic-shape' command does not show policing statistics; it is only for shaping. Policing uses 'show policy-map interface'.
CCNA exam tip: Remember that shaping queues packets and delays them, while policing drops or marks packets. This command helps verify queuing behavior.
CCNA exam tip: The 'Byte Limit' is calculated as (Target Rate * Interval) / 8. Exam may ask you to compute this or interpret the values.
CCNA exam tip: If 'Adapt' shows 'Yes', the router is using BECN or FECN to adjust shaping rate on Frame Relay interfaces.
Common Mistakes
Mistake 1: Confusing shaping with policing. Shaping delays packets; policing drops. Use 'show traffic-shape' for shaping, not policing.
Mistake 2: Forgetting to specify the interface when troubleshooting a specific link. Without interface, output shows all interfaces, which may be overwhelming.
Mistake 3: Misinterpreting 'Queue Depth' as the number of packets dropped. Queue depth is the current number of packets waiting; drops are shown separately.
show traffic-shape vs show policy-map interface
Both 'show traffic-shape' and 'show policy-map interface' are used for QoS verification, but they serve different purposes. 'show traffic-shape' focuses specifically on traffic shaping parameters and conformance statistics, while 'show policy-map interface' displays the entire QoS policy (including shaping, policing, marking) applied to an interface with per-class counters. They are commonly confused because shaping can be configured via a policy-map, but the commands provide different levels of detail.
| Aspect | show traffic-shape | show policy-map interface |
|---|---|---|
| Scope | Global or per-interface; no direction qualifier | Per interface with input/output direction |
| Configuration Reference | Shaping parameters (CIR, Bc, Be) and queue limits | Full policy-map including class maps and all actions |
| Output Granularity | Per-interface or per-class if configured under policy-map shape | Per-class statistics from the policy-map applied to the interface |
| Statistics Type | Packets queued, delayed, dropped; conformance and exceed counters | Packets matched, bytes, and action-specific counters (police, shape, set, etc.) |
| Typical Use | Verify shaping rates and monitor traffic conformance | Troubleshoot overall QoS policy and per-class behavior |
Use show traffic-shape when you need to verify traffic shaping parameters and conformance statistics for an interface.
Use show policy-map interface when you need to verify the complete QoS policy applied to an interface and per-class matching/action statistics.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches, ISR 4000 routers), the 'show traffic-shape' command is still available but may show different output formatting, especially when using MQC (policy-map) shaping. The legacy 'traffic-shape rate' command is deprecated in newer IOS-XE versions; instead, use 'shape average' under a policy-map. The equivalent command for MQC shaping is 'show policy-map interface [interface]', which provides per-class shaping statistics.
In NX-OS (e.g., Nexus 9000), the command is not directly available; instead, use 'show policy-map interface [interface]' or 'show queuing interface [interface]' to view shaping parameters. For ASA firewalls, traffic shaping is configured via the 'shape' command in a policy-map, and verification is done with 'show service-policy' or 'show running-config policy-map'. In IOS-XR (e.g., ASR 9000), the command does not exist; use 'show policy-map interface [interface]' or 'show qos interface [interface]' for shaping information.
Between IOS versions, the output format of 'show traffic-shape' has remained largely consistent from 12.x to 15.x, but in 16.x (IOS-XE), the command may show additional fields like 'Queue limit' and 'Packets dropped'. Always check the specific platform documentation, as the command's availability and output can vary significantly.
Related Commands
show interfaces
Displays detailed Layer 1 and Layer 2 statistics for all interfaces or a specific interface: line protocol state, hardware type, MAC address, MTU, bandwidth, duplex, speed, input/output rates, error counters, and queue statistics.
show policy-map interface
Displays the current QoS policy applied to an interface, including per-class statistics such as packets matched, bytes, and actions taken, used to verify and troubleshoot QoS configurations.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions