Traffic Shaping vs Policing
When traffic exceeds a contracted WAN rate, something must give. Policing enforces the rate at the enforcement point — packets beyond the limit are dropped immediately or re-marked to a lower DSCP value. The sender never slows down; it simply loses packets and TCP retransmits. Shaping takes a gentler approach — excess packets are held in a buffer and released at the contracted rate when tokens become available. Traffic is smoothed rather than clipped. The trade-off is delay: buffered packets wait, increasing latency and jitter for everything in the shaping queue. Understanding when to use each — and when to combine them — is one of the most practical WAN QoS skills in enterprise networking.
Both mechanisms rely on the token bucket model to measure conformance against a committed rate. Policing uses a dual token bucket (CIR + PIR) to classify traffic into three outcomes: conform, exceed, and violate. Shaping uses a single bucket and defers non-conforming packets to a built-in shaping queue. Both are configured using Cisco's MQC (Modular QoS CLI) framework. For the DSCP marking that typically precedes policing and shaping decisions see DSCP Marking & Classification. For queuing policies that work alongside shaping see CBWFQ and LLQ Configuration and MQC QoS Basics. For the broader QoS model see QoS Overview, QoS Marking, QoS Queuing, and QoS Policing & Shaping. For WAN tunnel interfaces where these policies are commonly applied see GRE Tunnel Configuration.
1. Token Bucket — Core Mechanics
How the Token Bucket Works
Token Bucket Model:
─────────────────────────────────────────────────────────────────
Tokens fill at the CIR rate (e.g. 1 Mbps = 125,000 bytes/sec)
Each arriving packet consumes tokens equal to its byte size
If enough tokens exist → packet CONFORMS → transmit/forward
If tokens are depleted → packet EXCEEDS → drop / remark / buffer
Tc (timing interval)
◄──────────────────►
Tokens added per Tc: Bc = CIR × Tc
CIR = 1,000,000 bps (1 Mbps committed rate)
Bc = 8,000 bytes (committed burst — tokens added each Tc)
Be = 16,000 bytes (excess burst — extra tokens for policing)
Tc = 8 ms (token interval: Bc / CIR × 8 = 8ms)
Bucket capacity:
Policing: CIR bucket holds up to Bc; PIR bucket holds up to Be
Shaping: bucket holds up to Bc + Be (allows controlled burst)
Key Rate Parameters
| Parameter | Full Name | Definition | IOS Keyword |
|---|---|---|---|
| CIR | Committed Information Rate | The contracted sustained rate — average traffic must stay at or below this | police rate [bps] or shape average [bps] |
| PIR | Peak Information Rate | Maximum rate allowed in policing — traffic between CIR and PIR is "exceeded" but not violated | police rate [CIR] peak-rate [PIR] |
| Bc | Committed Burst Size | Maximum bytes that can be sent at line rate in one Tc interval while conforming. Default = CIR/8 (1 second worth of tokens) | police rate [bps] bc [bytes] or shape average [bps] [Bc] |
| Be | Excess Burst Size | Additional bytes beyond Bc — in policing defines the "exceed" window; in shaping allows short bursts above CIR when tokens have accumulated during idle periods | police rate [bps] bc [Bc] be [Be] or shape average [bps] [Bc] [Be] |
| Tc | Token Refresh Interval | How often tokens are added to the bucket — calculated as Bc ÷ CIR × 8000 (in ms). Shorter Tc = smoother shaping; longer Tc = burstier | Derived automatically; tunable via Bc in shaping |
Shaping vs Policing — Side-by-Side Comparison
| Characteristic | Policing | Shaping |
|---|---|---|
| Action on excess traffic | Drop or re-mark immediately — packet is discarded or DSCP is lowered | Buffer (defer) — packet waits in shaping queue, sent when tokens available |
| Effect on latency | No added latency — packets are forwarded or dropped instantly | Adds latency and jitter — buffered packets wait in the shaping queue |
| Effect on TCP | TCP detects drops and reduces its window (congestion avoidance) — throughput drops but may recover | TCP does not see drops; it sees delay instead — throughput is smooth but latency increases |
| Typical deployment | Inbound on the ISP/provider edge (rate enforcement); inbound on enterprise WAN ingress; protecting EF class from exceeding priority queue allocation | Outbound on enterprise WAN egress — shaping output to match ISP contracted rate, preventing upstream provider from dropping bursts |
| Built-in queue | No — drops excess immediately (unless remarked for downstream handling) | Yes — each shape class has its own FIFO or hierarchical child queue |
| Direction | Typically input (ingress policing); output also valid for egress rate enforcement | Output only — shaping buffers traffic before sending; cannot buffer incoming traffic |
| Dual token bucket | Yes — CIR bucket (conform) + PIR bucket (exceed); three outcomes: conform, exceed, violate | No — single token bucket; two outcomes: conform (send) or exceed (buffer) |
| IOS command | police rate [bps] inside a policy-map class |
shape average [bps] inside a policy-map class |
2. Lab Topology & Scenario
[LAN hosts — 192.168.10.0/24]
│
Gi0/1 (LAN)
192.168.10.1/24
NetsTuts-R1
Gi0/0 (WAN) ──────────────► ISP / MPLS Core
10.0.0.1/30 10.0.0.2/30
ISP contracted WAN rate: 2 Mbps CIR
Physical interface speed: 100 Mbps (FastEthernet)
Burst above CIR: ISP allows up to 4 Mbps for 250 ms
QoS objectives on Gi0/0 outbound:
VoIP RTP (DSCP EF) → Police to 256 kbps — protect priority queue
Video (DSCP AF41) → Shape to 512 kbps — smooth delivery to ISP
Bulk data (DSCP AF11) → Police to 512 kbps, remark exceed to CS1
All other → Shape aggregate to 2 Mbps CIR with 4 Mbps burst
3. Step 1 — Configure Traffic Policing
Policing uses the police action inside a policy-map
class. The minimum configuration specifies a rate and a
conform/exceed action. The full form adds a peak rate for
three-outcome (conform/exceed/violate) policing using the
dual token bucket model:
Simple Two-Rate Policing — Conform / Exceed
NetsTuts-R1>en NetsTuts-R1#conf t ! ── Class-maps referencing DSCP markings ───────────────── class-map match-any CM-VOIP match dscp ef ! class-map match-any CM-VIDEO match dscp af41 ! class-map match-any CM-BULK match dscp af11 ! ! ════════════════════════════════════════════════════════ ! Policy-map: policing only (simple two-action form) ! ════════════════════════════════════════════════════════ policy-map PM-POLICE-SIMPLE ! ! ── VoIP: police to 256 kbps ───────────────────────── class CM-VOIP police rate 256000 bps conform-action transmit exceed-action drop ! ! ── Bulk: police to 512 kbps, remark exceed to CS1 ─── class CM-BULK police rate 512000 bps conform-action transmit exceed-action set-dscp-transmit cs1 ! class class-default ! !
police rate command accepts bps (bits per second)
values. 256000 bps is 256 kbps. Alternative units:
256 kbps, 256000 (unitless defaults to bps),
or percent of interface bandwidth with police rate percent 10.
The conform-action transmit forwards the packet unchanged.
The exceed-action set-dscp-transmit cs1 lowers the
DSCP to CS1 (scavenger) and forwards — the packet is not dropped
but is marked as low priority, allowing downstream queuing policies
to deprioritise or drop it under congestion. This re-marking approach
(also called "markdown") is often preferred over hard dropping because
it gives congested downstream links a chance to discard the packet
rather than forcing the drop at the policing point.
Three-Rate Policing — Conform / Exceed / Violate
! ════════════════════════════════════════════════════════ ! Policy-map: three-rate policing with explicit Bc and Be ! CIR = 512 kbps, PIR = 1 Mbps ! Bc = 64000 bytes (~1 sec of CIR tokens) ! Be = 128000 bytes (~1 sec of PIR tokens) ! ════════════════════════════════════════════════════════ policy-map PM-POLICE-3RATE class CM-BULK police rate 512000 bps bc 64000 byte be 128000 byte conform-action transmit exceed-action set-dscp-transmit af13 violate-action drop ! class class-default police rate 1000000 bps conform-action transmit exceed-action drop ! !
bc 64000) fills at 512 kbps and holds
up to 64,000 bytes — traffic drawing from this bucket conforms.
The Be bucket (be 128000) provides an additional
burst window — traffic consuming tokens from the Be bucket exceeds
the CIR but has not yet violated the PIR. The violate condition
occurs when both buckets are empty. The exceed action
set-dscp-transmit af13 forwards the packet but
raises the drop precedence within the AF1 class from
low (AF11 = DSCP 10) to high (AF13 = DSCP 14) — downstream
WRED queuing will preferentially discard these packets first
under congestion, while conforming AF11 packets are protected.
Policing Actions Reference
| Action Keyword | Effect | Typical Use |
|---|---|---|
transmit |
Forward the packet unchanged — DSCP preserved | Conform action for all classes; occasionally exceed action when soft limits are acceptable |
drop |
Discard the packet — no forwarding, no notification to sender | Violate action; exceed action on strict rate enforcement (VoIP protection, SLA enforcement) |
set-dscp-transmit [value] |
Overwrite DSCP field with specified value, then forward | Exceed action — markdown from AF11 → AF13, or from AF41 → AF43; allows downstream to handle gracefully |
set-prec-transmit [value] |
Set IP Precedence (3-bit legacy field) and forward | Legacy networks using IP Precedence instead of DSCP |
set-clp-transmit |
Set ATM Cell Loss Priority bit and forward | ATM environments — rarely seen in modern labs |
set-qos-transmit [group] |
Set QoS group (internal marker, not visible in IP header) and forward | Multi-stage QoS pipelines where the mark must pass between features without modifying the IP header |
4. Step 2 — Configure Traffic Shaping
Shaping uses the shape average command inside a
policy-map class. Unlike policing, shaping has no explicit
conform/exceed action syntax — excess packets are automatically
buffered in the shaping queue. The average keyword
targets the average rate equal to CIR; the less common
peak keyword allows the average to exceed CIR
by using Be tokens more aggressively:
Basic Output Shaping to CIR
! ════════════════════════════════════════════════════════ ! Policy-map: output shaping on WAN interface ! Shape all traffic to 2 Mbps CIR ! ════════════════════════════════════════════════════════ policy-map PM-SHAPE-WAN class class-default ! ── Shape to 2 Mbps CIR ──────────────────────────── shape average 2000000 ! ! ! ── Apply to WAN egress ─────────────────────────────── interface GigabitEthernet0/0 service-policy output PM-SHAPE-WAN !
shape average 2000000 limits the output rate to
2,000,000 bps (2 Mbps). IOS automatically calculates Bc and Tc:
Bc defaults to CIR/8 = 250,000 bytes, Tc defaults to Bc/CIR×8000
= 1000 ms. A 1-second Tc means shaping is evaluated once per
second — in the first second all 250,000 bytes (2 Mbps worth)
can burst at line rate, then shaping defers remaining packets.
For smoother shaping with less bursty behaviour, reduce Bc by
specifying it explicitly: shape average 2000000 25000
sets Bc to 25,000 bytes giving Tc = 100 ms — tokens are added
every 100 ms for much smoother pacing.
Shaping with Explicit Bc and Be (Burst Control)
! ════════════════════════════════════════════════════════ ! Shape to 2 Mbps CIR, allow burst to 4 Mbps for ~125 ms ! CIR = 2,000,000 bps ! Bc = 25,000 bytes (Tc = 100 ms — smooth shaping) ! Be = 250,000 bytes (can burst 250,000 extra bytes when ! tokens have accumulated while idle) ! ════════════════════════════════════════════════════════ policy-map PM-SHAPE-BURST class class-default shape average 2000000 25000 250000 ! !
Hierarchical Shaping with Child Queuing Policy
The most powerful shaping deployment is hierarchical (parent/child): the parent policy shapes the aggregate WAN output rate; the child policy implements LLQ/CBWFQ queuing within the shaping queue so that when traffic is being shaped, high-priority classes (VoIP) are still served first within the buffer:
! ── Child queuing policy ───────────────────────────── policy-map PM-QUEUE-CHILD ! class CM-VOIP ! ── LLQ: VoIP gets strict priority within the shaper ─ priority 256 ! class CM-VIDEO bandwidth 512 ! class class-default fair-queue ! ! ! ── Parent shaping policy references child ──────────── policy-map PM-SHAPE-PARENT class class-default shape average 2000000 ! ── Attach child queuing policy to shaping queue ──── service-policy PM-QUEUE-CHILD ! ! ! ── Apply parent to WAN interface (output only) ─────── interface GigabitEthernet0/0 service-policy output PM-SHAPE-PARENT !
5. Step 3 — Combined Policing and Shaping on WAN Interface
Real deployments typically combine both mechanisms: policing per traffic class (to protect critical classes from individual over-senders) inside a shaped aggregate (to smooth the total output to the ISP contracted rate). This is implemented as a hierarchical policy where the parent shapes the WAN aggregate and the child polices individual classes:
! ════════════════════════════════════════════════════════ ! Complete WAN QoS policy: ! Parent: shape aggregate output to 2 Mbps CIR ! Child: police per-class, queue by priority ! ════════════════════════════════════════════════════════ ! ! ── Class-maps (matching on DSCP from inbound marking) ─ class-map match-any CM-VOIP match dscp ef class-map match-any CM-VIDEO match dscp af41 class-map match-any CM-BULK match dscp af11 ! ! ── Child policy: per-class policing + queuing ───────── policy-map PM-WAN-CHILD ! ! VoIP: LLQ priority + police to prevent starvation ─── class CM-VOIP priority 256 police rate 256000 bps conform-action transmit exceed-action drop ! ! Video: guaranteed bandwidth + police to 512 kbps ──── class CM-VIDEO bandwidth 512 police rate 512000 bps conform-action transmit exceed-action set-dscp-transmit af43 ! ! Bulk: minimal bandwidth, police + remark exceed ───── class CM-BULK bandwidth 128 police rate 512000 bps conform-action transmit exceed-action set-dscp-transmit cs1 ! ! Default: remaining bandwidth ──────────────────────── class class-default fair-queue ! ! ! ── Parent policy: aggregate shaping + child policy ─── policy-map PM-WAN-PARENT class class-default shape average 2000000 25000 service-policy PM-WAN-CHILD ! ! ! ── Apply to WAN egress interface ───────────────────── interface GigabitEthernet0/0 description WAN-Uplink-to-ISP ip address 10.0.0.1 255.255.255.252 service-policy output PM-WAN-PARENT no shutdown ! NetsTuts-R1(config)#end NetsTuts-R1#wr Building configuration... [OK]
priority 256 inside the child policy reserves
256 kbps (in the context of the 2 Mbps parent shape) as a strict
priority queue for VoIP — this is Low Latency Queuing. The
police rate 256000 within the same class caps VoIP
at exactly that rate, preventing a burst of VoIP traffic from
consuming the entire shaping budget. The bandwidth 512
commands guarantee minimum bandwidth allocation within the shaped
budget for video and bulk classes during congestion. The parent
shaping rate (2 Mbps) is the ceiling for the entire policy —
no traffic can exit faster than 2 Mbps regardless of which class
it belongs to. This combined architecture is Cisco's recommended
WAN QoS design for MPLS or broadband services with contracted CIR.
For interface configuration prerequisites see
Basic Interface
Configuration. Save with
write memory.
6. Step 4 — Observing Burst Behaviour
Token Bucket State During Burst Traffic
Policing — CIR 512 kbps, Bc 64000 bytes, Be 128000 bytes
────────────────────────────────────────────────────────────────
Time 0: Bucket full (idle period) — 64000 tokens (CIR bucket)
+ 128000 tokens (Be bucket)
Burst arrives at 10 Mbps (line rate):
T=0–50ms: Consuming CIR bucket — 64000 tokens → CONFORM
T=50–100ms: CIR bucket empty, consuming Be bucket — EXCEED
(set-dscp-transmit af13 or drop depending on config)
T=100ms+: Both buckets empty — all packets VIOLATE → DROP
T=101ms: Tokens refill at 512 kbps rate = 512 bytes per ms
Result: Hard cliff — traffic above rate is immediately dropped
Shaping — CIR 512 kbps, Bc 64000 bytes, Be 128000 bytes
────────────────────────────────────────────────────────────────
Time 0: Bucket full — 64000 + 128000 = 192000 tokens available
Burst arrives at 10 Mbps:
T=0–50ms: Using CIR tokens — transmit at line rate
T=50ms+: CIR bucket empty — excess packets enter shaping queue
Packets drained from queue at 512 kbps
Result: Smooth ramp-down — no drops, but buffered packets
experience increasing delay (queue latency)
Shaping Queue Depth During Burst — What Latency Looks Like
1500-byte packets arriving at 10 Mbps, shape rate 512 kbps: Arrival rate: 10,000,000 / (1500×8) = 833 packets/sec Drain rate: 512,000 / (1500×8) = 42 packets/sec Queue grows at: 833 - 42 = 791 packets/sec After 1 second: ~791 packets queued Queuing delay: 791 × (1500×8)/512000 = ~18.5 seconds! This illustrates why shaping is INAPPROPRIATE for real-time traffic like VoIP — even with EF marking, shaped VoIP packets can wait hundreds of milliseconds behind bulk data in the shaping queue. Hierarchical shaping with LLQ child policy prevents this: VoIP is always dequeued first from the shaping buffer.
7. Verification
show policy-map interface — Policing Counters
NetsTuts-R1#show policy-map interface GigabitEthernet0/0 output
GigabitEthernet0/0
Service-policy output: PM-WAN-PARENT
Class-map: class-default (match-any)
250180 packets, 375270000 bytes
5 minute offered rate 1980000 bps, drop rate 0000 bps
Match: any
Traffic Shaping
Target/Average Byte Limit SUSTAIN bytes/int EXCESS bytes/int Interval Increment
2000000/2000000 62500 250000 62500 500000 62500 125 31250
Adapt Queue Packets Bytes Packets Bytes Shaping
Active Depth Delayed Delayed FECN BECN
- 12 1824 2736000 0 0 yes
Service-policy : PM-WAN-CHILD
Class-map: CM-VOIP (match-any)
18420 packets, 29472000 bytes
5 minute offered rate 248000 bps, drop rate 0000 bps
Match: dscp ef (46)
Priority: 256 kbps, burst bytes 6400, b/w exceed drops: 0
police:
rate 256000 bps, bc 8000 byte, be 8000 byte
conformed 18420 packets, 29472000 bytes; actions: transmit
exceeded 0 packets, 0 bytes; actions: drop
conformed 248000 bps, exceeded 0000 bps
Class-map: CM-VIDEO (match-any)
8210 packets, 14778000 bytes
5 minute offered rate 492000 bps, drop rate 12000 bps
Match: dscp af41 (34)
bandwidth 512 (kbps), BW exceed drops: 0
police:
rate 512000 bps, bc 64000 byte
conformed 7800 packets, 14040000 bytes; actions: transmit
exceeded 410 packets, 738000 bytes; actions: set-dscp-transmit af43
conformed 480000 bps, exceeded 12000 bps
Class-map: CM-BULK (match-any)
4120 packets, 6592000 bytes
5 minute offered rate 320000 bps, drop rate 0000 bps
Match: dscp af11 (10)
bandwidth 128 (kbps)
police:
rate 512000 bps, bc 64000 byte
conformed 4120 packets, 6592000 bytes; actions: transmit
exceeded 0 packets, 0 bytes; actions: set-dscp-transmit cs1
conformed 320000 bps, exceeded 0000 bps
Class-map: class-default (match-any)
219430 packets, 330241000 bytes
5 minute offered rate 920000 bps, drop rate 0000 bps
Match: any
0 packets, 0 bytes
show policy-map interface — Shaping Detail
NetsTuts-R1#show policy-map interface GigabitEthernet0/0 output class class-default
GigabitEthernet0/0
Service-policy output: PM-WAN-PARENT
Class-map: class-default (match-any)
Traffic Shaping
Target/Average Byte Limit SUSTAIN EXCESS Interval Increment
2000000/2000000 62500 250000 500000 125 31250
Adapt Queue Packets Bytes Packets Bytes Shaping
Active Depth Delayed Delayed FECN BECN
- 0 21840 31752000 0 0 no
shape average). Byte
Limit 62500 is the Bc in bytes (25,000 bits ÷ 8 = no —
this is IOS's internal shaping bucket size). SUSTAIN
250000 is the max tokens held (Bc = 250,000 bits at
this rate setting). Queue Depth 0 means no
packets are currently waiting — the shaper is not active at
this moment. Packets Delayed 21,840 is the
cumulative total of packets that have been buffered since the
policy was applied — even though the queue is empty now,
21,840 packets experienced shaping delay at some point.
Shaping: no means the shaper is not actively
holding packets in the current Tc interval.
show policy-map interface — Before and After Burst
! ── Before burst (idle link) ─────────────────────────────
NetsTuts-R1#show policy-map interface Gi0/0 output | include Delayed
Packets Delayed: 0 Bytes Delayed: 0
! ── During a 10 Mbps burst ───────────────────────────────
NetsTuts-R1#show policy-map interface Gi0/0 output | include Delayed
Packets Delayed: 1240 Bytes Delayed: 1860000
! ── Check queue depth during burst ───────────────────────
NetsTuts-R1#show policy-map interface Gi0/0 output | include Depth
Queue Depth: 84
! ── Policing drop counters during burst ──────────────────
NetsTuts-R1#show policy-map interface Gi0/0 output | include exceeded
exceeded 2840 packets, 4260000 bytes; actions: set-dscp-transmit af43
drop instead of a re-marking
action, and the source would receive TCP retransmits. The shaping
queue absorbs the burst smoothly while the policing enforces
per-class limits within the shaped budget.
Verification Command Summary
| Command | Shows | Key Fields |
|---|---|---|
show policy-map interface [intf] output |
Full hierarchical output policy — shaping stats + per-class policing counters | Queue Depth, Packets Delayed (shaping); conformed/exceeded/violated byte counts (policing) |
show policy-map interface [intf] input |
Input policy — typically marking or ingress policing counters | conformed/exceeded/violated counters with rates in bps |
show policy-map [name] |
Policy-map definition — all classes, actions, and configured rates without live counters | Verify CIR values, Bc/Be, and action keywords before applying to interface |
show traffic-shape [intf] |
Legacy shaping display — shows CIR, Bc, Be, queue depth for legacy Generic Traffic Shaping (GTS) | Use for legacy GTS; for MQC shaping use show policy-map interface |
show traffic-shape statistics |
Per-interface shaping statistics — packets shaped, delayed, dropped | Cumulative counters useful for trend analysis; reset with clear traffic-shape statistics |
show interfaces [intf] |
Interface-level output queue drops — indicates congestion even without QoS policy | Output drops incrementing confirms interface congestion that QoS is meant to address |
8. Troubleshooting Shaping and Policing
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Policing drops all traffic immediately | All classes show high violated/drop counters immediately after policy application; throughput drops to near zero | Police rate configured in wrong unit — specifying police rate 2000000 means 2 Mbps bps (correct), but police rate 2000 means 2000 bps (2 kbps, far too low). CIR and interface speed units are easy to confuse |
Verify the rate value: show policy-map [name] shows the configured rate. Confirm units: bps is the default. To police at 2 Mbps use police rate 2000000 bps or police rate 2 mbps. Check show policy-map interface conformed rate — should be close to the intended CIR when traffic is below the limit |
| VoIP quality poor despite EF marking and shaping | VoIP jitter and latency high; show policy-map interface shows VoIP packets Delayed count incrementing; priority queue drops occurring |
Shaping is applied without a child queuing policy — VoIP EF packets are queued in FIFO behind bulk data inside the shaping buffer. Shaping delay is additive to network latency | Add a hierarchical child policy with priority [kbps] for the VoIP class. Ensure VoIP bandwidth allocation in the child policy matches the police rate for EF traffic. Verify with show policy-map interface — Priority class should show zero delayed packets while bulk classes absorb the shaping delay |
| Shaping not active — all packets forwarded at line rate | show policy-map interface shows Shaping: no and zero Packets Delayed despite traffic above CIR; traffic passes at full interface speed |
Service-policy applied input instead of output — shaping is only supported in the output direction; input shaping silently falls back to no shaping on most platforms | Confirm show policy-map interface [intf] output shows the policy. Remove and re-apply with no service-policy input [name] then service-policy output [name]. Shaping must be output |
| Cannot nest child policy inside parent shaping policy | % service-policy configuration failed or % Child policy cannot have shaping error when configuring hierarchical policy |
Child policy contains a shape command — IOS does not allow shaping inside a child policy; shaping is only valid in the parent. Or the child policy is already attached to another interface |
Move the shape average command to the parent class-default. Ensure the child policy contains only queuing commands (priority, bandwidth, police, fair-queue) but no shape |
| Exceed counter high but traffic not being slowed | Police exceed counter climbs rapidly; traffic throughput remains at line rate rather than being constrained to CIR | Exceed action is transmit (either explicitly or by default on older IOS) — exceeded packets are forwarded unchanged. The counter shows the rate was measured as exceeding but no action is being taken to reduce it |
Change the exceed action to drop or set-dscp-transmit [lower-value]. Verify: show policy-map [name] shows the exceed-action. Note that transmit on exceed is valid for "measure and mark" scenarios but does not limit throughput |
| Shaping queue growing indefinitely — memory exhaustion | Router memory climbing; show policy-map interface shows Queue Depth in thousands; eventually packets are tail-dropped from the shaping queue |
Input traffic rate far exceeds CIR for a sustained period — the shaping queue drains much slower than it fills. Without a queue limit the buffer grows until memory is exhausted or a system limit is reached | Reduce the source traffic rate (upstream policing at the sender) or increase CIR. Add WRED to the shaping queue to probabilistically drop lower-priority packets before the queue fills: add random-detect dscp-based to the class-default in the child policy. Alternatively police the aggregate inbound rate before the shaper to prevent over-subscription |
| Three-rate policing actions not triggering correctly | Expected exceed action (remark) not occurring; or violate action (drop) firing when traffic is only slightly above CIR | Bc and Be values too small — small burst sizes cause rapid bucket depletion. Or PIR not configured — without explicit PIR only CIR and Bc exist, making every exceedance a violate rather than an exceed | Configure explicit Bc and Be values appropriate for the traffic profile: police rate [CIR] bc [Bc-bytes] be [Be-bytes]. As a starting point, Bc = CIR/8 (1 second of tokens), Be = 2×Bc. Verify bucket sizes with show policy-map [name] |
Key Points & Exam Tips
- Policing drops or re-marks excess traffic immediately at the rate limit. No additional latency is added to conforming traffic. TCP detects drops and reduces its sending rate. Use policing for strict rate enforcement, protecting priority queues, and ingress rate limiting.
- Shaping buffers excess traffic and releases it at the CIR rate when tokens become available. No packets are dropped (until the shaping queue itself fills), but latency and jitter increase for buffered packets. Use shaping on WAN egress to smooth output to the ISP contracted rate.
- Both mechanisms use the token bucket model: tokens fill at the CIR rate; conforming packets consume tokens; excess packets are dropped (policing) or queued (shaping). CIR, Bc (committed burst), and Be (excess burst) define the bucket parameters.
- Policing uses a dual token bucket producing three outcomes: conform (within CIR bucket), exceed (beyond CIR bucket, within Be bucket), violate (both buckets empty). Each outcome has an independent action: transmit, drop, or set-dscp-transmit.
- Shaping only supports output direction. Policing supports both input and output. An interface can have one input and one output service-policy simultaneously.
shape average [bps]targets the average rate equal to CIR. Explicitly specify Bc for smoother shaping: smaller Bc = shorter Tc = more frequent token additions = smoother output at the cost of slightly higher overhead.- The hierarchical policy (parent shapes aggregate, child queues per-class) is the recommended WAN QoS architecture. Without a child LLQ policy inside the shaper, VoIP packets wait in the shaping FIFO queue behind bulk data — DSCP EF marking alone does not protect against shaping delay.
- The exceed action
set-dscp-transmit [higher-drop-precedence]implements markdown — AF11 → AF13, AF41 → AF43 — forwarding excess traffic with a higher drop probability rather than dropping it immediately. Downstream WRED queuing then preferentially discards marked packets under congestion. - Key
show policy-map interfacefields: conformed/exceeded/violated packet counts for policing; Queue Depth and Packets Delayed for shaping; Shaping: yes/no for current shaping state. Shaping: yes during a burst confirms the mechanism is actively buffering. - For the CCNA/CCNP exam: know that shaping adds delay (buffering) while policing adds drops; know the three policing outcomes; know that shaping is output only; know that hierarchical policies combine shaping and queuing; and know that DSCP marking must precede any policy that classifies by DSCP.