Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

QoS Classification, Marking & Queuing Reference

Direct answer

QoS works in three steps: classify traffic into classes, mark the class in the packet (DSCP in the IP header, CoS in the VLAN tag), and treat the classes differently at a congested interface — priority, guaranteed bandwidth, shaping, policing.

When to use this

Use it when building or checking a policy on a Cisco router or switch, and when a class does not get the treatment intended.

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commandshow policy-map interface GigabitEthernet0/1
Scope / prerequisiteUse it when building or checking a policy on a Cisco router or switch, and when a class does not get the treatment inte…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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.

Key checks
  • 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.

FieldWhereSize
DSCPIP header6 bits, values 0–63
CoS802.1Q tag — only on trunks3 bits, values 0–7

Common DSCP values:

NameValueTypical use
EF46Voice
AF4134Interactive video
CS324Call signalling
AF2118Important business data
CS0 / default0Everything else
CS18Background 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.

ToolEffect
Priority queueSent before everything else, up to a set limit; for voice
Bandwidth guaranteeA class is assured a share of the link when it is congested
PolicingTraffic above a rate is dropped or re-marked at once
ShapingTraffic above a rate is held back and sent later, smoothing bursts
WREDStarts 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 nameDecimalBinaryToS byte (hex)IP Precedence
DF / CS000000000x000
CS180010000x201
AF11100010100x281
AF21180100100x482
CS3240110000x603
AF31260110100x683
AF41341000100x884
CS5401010000xA05
EF461011100xB85
CS6481100000xC06

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)

PoolPatternUse
1xxxxx0Standards (32 codepoints, including all CS, AF and EF values)
2xxxx11Experimental or local use
3xxxx01Experimental or local use; standards if pool 1 runs out

Classification and queuing in brief

StepTool
Classifyclass-map matching DSCP, ACLs or NBAR
Markset dscp at the trust boundary
Queuepriority, bandwidth, fair-queue per class
DropPolicing, 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 2475

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%
Terminology layer

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.

Aliases that resolve here
qosdscpcospolicy-mappolicingshapingqueue
Embedded quick reference

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.

Confirmation

Confirm action

Continue?