Use it when building or checking a policy on a Cisco router or switch, and when a class does not get the treatment intended.
QoS Classification, Marking & Queuing Reference
1. show policy-map interface <interface> — does the priority class count packets?
2. No matches → the marking arriving here is not what the class expects.
3. Any drops at all? If none, the bottleneck is elsewhere — or a shaper to the provider's rate is missing.
4. Drops in the priority class → raise its allocation or reduce the traffic.
5. A policer cutting a class → check rate and burst.
class-map matches the traffic → marking set or trusted → policy-map assigns priority or bandwidth → service-policy attached outbound → congestion occurs → classes served according to the policy
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show policy-map interface GigabitEthernet0/1Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
show policy-map interface GigabitEthernet0/1
show class-map
show policy-map WAN-OUT
show interfaces GigabitEthernet0/1 | include drops|rate
show policy-map interface is the central command. For each class it shows how many packets matched, the rate offered, and how many were dropped; for the priority class also whether its limit was exceeded. The other commands show the definitions and the interface's overall rate and drops.
Check three things in order: does the traffic land in the intended class (match counters), does the interface actually congest (drops in any class), and which class takes the drops.
Known-good: voice packets are counted in the priority class with no drops there, and drops during congestion occur in the classes meant to give way.
Step 2 Typical faults & boundaries Narrow the fault
- The priority class shows no matches. The traffic is not marked as expected — the marking was removed at a trust boundary upstream — or the class matches the wrong value.
- Everything lands in class-default. Classification fails; check the markings arriving on the interface.
- The policy shows no drops, yet voice is poor. This interface is not where the congestion is; look at the slower link further on, or add a shaper to the purchased rate.
- Drops in the priority class. More priority traffic than its limit allows; it is policed during congestion.
- Marking disappears on the way. A device in the path does not trust it and rewrites it to 0.
- CoS markings are lost. The frame crossed an access port or a routed hop; only DSCP survives end to end.
- A policer cuts a class harder than intended. The rate or burst is too small for the traffic's bursts.
- QoS is applied inbound and seems to do nothing. Queuing works on output; inbound policies classify, mark and police.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
On Cisco: class-map selects traffic, policy-map says what to do, service-policy output attaches it. Voice is marked EF (46) and put in the priority queue. Queuing only acts on output and only under congestion. CoS is lost on access ports and routed hops; DSCP survives.
show policy-map interface <interface>— matches, offered rate and drops per class.show class-map— what each class matches.show policy-map <name>— the actions per class.show interfaces <interface> | include rate|drops— the interface totals.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
Quality of service (QoS) is how a router or switch decides which packets go first, and which are delayed or dropped, when more traffic wants to leave an interface than it can carry. It works in three steps: recognise the traffic, label it, and treat each label differently.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
Voice and video tolerate very little delay or loss, while a backup does not care. On a link with spare capacity all get through and QoS changes nothing. The moment a link is full, something must wait — and without QoS it is whatever happens to arrive last. QoS only matters at points of congestion, which is also the first thing to establish when it seems not to work.
ReferenceHow it works1 section · depth on demand
How it works
1. Classification — recognising traffic. By markings already in the packet, by addresses and ports through an access list, or by application.
2. Marking — writing the class into the packet so that later devices need not classify again.
| Field | Where | Size |
|---|---|---|
| DSCP | IP header | 6 bits, values 0–63 |
| CoS | 802.1Q tag — only on trunks | 3 bits, values 0–7 |
Common DSCP values:
| Name | Value | Typical use |
|---|---|---|
| EF | 46 | Voice |
| AF41 | 34 | Interactive video |
| CS3 | 24 | Call signalling |
| AF21 | 18 | Important business data |
| CS0 / default | 0 | Everything else |
| CS1 | 8 | Background traffic, below best effort |
Marking is done as near the source as possible. The point from which markings are believed is the trust boundary: markings from phones and managed switches are accepted, those from PCs are overwritten.
3. Treatment — what happens at a congested interface.
| Tool | Effect |
|---|---|
| Priority queue | Sent before everything else, up to a set limit; for voice |
| Bandwidth guarantee | A class is assured a share of the link when it is congested |
| Policing | Traffic above a rate is dropped or re-marked at once |
| Shaping | Traffic above a rate is held back and sent later, smoothing bursts |
| WRED | Starts dropping selectively before the queue is full, so TCP slows down gradually |
On Cisco routers this is configured in three parts: a class-map to match traffic, a policy-map to say what to do with each class, and service-policy output to attach it to an interface.
class-map match-any VOICE
match dscp ef
policy-map WAN-OUT
class VOICE
priority percent 10
class class-default
fair-queue
interface GigabitEthernet0/1
service-policy output WAN-OUT
Where it applies. Queuing acts on traffic leaving an interface, and only when that interface is congested. When a provider delivers less than the physical speed — 50 Mb/s on a 1 Gb/s port — the router never sees congestion; a shaper set to the purchased rate, with the queuing policy inside it, creates the queue where QoS can act.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
The DS field and DSCP values
QoS marking rests on the DS field, defined in RFC 2474:
- DSCP: six bits of the former IPv4 ToS byte or the IPv6 Traffic Class byte, used to select a per-hop behaviour. The remaining two bits were left unused and are now used by ECN.
- Class Selector codepoints: values of the form xxx000, which stay compatible with the old IP Precedence values. Codepoints 11x000 (CS6 and CS7) must be preferred over 000000, so routing traffic keeps its priority.
- Default PHB: recommended codepoint 000000, which must always exist.
- Unknown codepoints: packets carrying them should be forwarded as default traffic.
Reading DSCP in different formats
| DSCP name | Decimal | Binary | ToS byte (hex) | IP Precedence |
|---|---|---|---|---|
| DF / CS0 | 0 | 000000 | 0x00 | 0 |
| CS1 | 8 | 001000 | 0x20 | 1 |
| AF11 | 10 | 001010 | 0x28 | 1 |
| AF21 | 18 | 010010 | 0x48 | 2 |
| CS3 | 24 | 011000 | 0x60 | 3 |
| AF31 | 26 | 011010 | 0x68 | 3 |
| AF41 | 34 | 100010 | 0x88 | 4 |
| CS5 | 40 | 101000 | 0xA0 | 5 |
| EF | 46 | 101110 | 0xB8 | 5 |
| CS6 | 48 | 110000 | 0xC0 | 6 |
The ToS byte is DSCP × 4, because the DSCP occupies the upper six bits. That is why tcpdump shows EF as tos 0xb8.
Codepoint pools (RFC 2474)
| Pool | Pattern | Use |
|---|---|---|
| 1 | xxxxx0 | Standards (32 codepoints, including all CS, AF and EF values) |
| 2 | xxxx11 | Experimental or local use |
| 3 | xxxx01 | Experimental or local use; standards if pool 1 runs out |
Classification and queuing in brief
| Step | Tool |
|---|---|
| Classify | class-map matching DSCP, ACLs or NBAR |
| Mark | set dscp at the trust boundary |
| Queue | priority, bandwidth, fair-queue per class |
| Drop | Policing, WRED (random-detect dscp-based) |
host$ sudo tcpdump -ni eth0 -v -c 3 'ip[1] & 0xfc == 0xb8'
host$ tshark -r capture.pcap -T fields -e ip.dsfield.dscp | sort | uniq -c | sort -rn
R1# show policy-map interface GigabitEthernet0/0/0 output | include Class-map|dscp|packets
The filter ip[1] & 0xfc == 0xb8 matches EF packets while ignoring the two ECN bits. Masking those bits matters, because ECN-capable traffic would otherwise be missed.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → QoS Classification, Marking & Queuing Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc2475.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
QoS Fast Check
Classification → queue → drop.
show policy-map interface <if>
Read:
- class match counters
- offered rate
- DSCP/CoS marking
- queue depth/drop
- policer conform/exceed
- shaper rate
First find the actual bottleneck. QoS has no magic effect where there is no contention/policy.