DSCP Marking & Classification
Every packet on your network competes for the same queues at every router hop. Without a way to express priority, a VoIP call and a bulk file transfer receive identical treatment — the call breaks up while the file transfer barely notices. DSCP (Differentiated Services Code Point) is the 6-bit field in the IP header's ToS byte that carries a packet's QoS intent across the network. Marking traffic at the ingress edge — the first router the packet touches — with the correct DSCP value allows every downstream router to make forwarding and queuing decisions without re-classifying the traffic from scratch.
Cisco IOS implements DSCP marking and classification through the
MQC (Modular QoS CLI) framework: a
class-map identifies traffic, a policy-map
defines what to do with it (mark, police, queue), and a
service-policy applies the policy to an interface.
Classification can use ACLs for well-known port numbers, or
NBAR (Network-Based Application Recognition) for
deep-packet inspection that identifies applications by payload
signature rather than port alone. This lab covers both approaches
and verifies that markings survive all the way across the network.
DSCP marking feeds directly into the queuing and scheduling step that determines how marked traffic is served — see CBWFQ and LLQ Configuration for the queuing policy that consumes DSCP values. For the broader QoS model see QoS Overview, QoS Queuing, and QoS Marking. For the MQC framework foundations see MQC QoS Basics. For traffic policing and shaping applied after marking see Traffic Policing and Shaping. For ACL classification concepts see ACL Overview and Extended ACL Configuration.
1. DSCP — Core Concepts
The IP Header ToS Byte and DSCP Field
IP Header — Byte 1 (Type of Service / DSCP+ECN byte):
┌─────┬─────┬─────┬─────┬─────┬─────┬───┬───┐
│ DS5 │ DS4 │ DS3 │ DS2 │ DS1 │ DS0 │ECN│ECN│
└─────┴─────┴─────┴─────┴─────┴─────┴───┴───┘
◄──────────── DSCP (6 bits) ──────────────► ◄ ECN ►
Bit 7 (MSB) Bit 2 Bits 1-0
DSCP value expressed as decimal: bits DS5–DS0 read left to right
e.g. EF = 101110 binary = 46 decimal
AF41 = 100010 binary = 34 decimal
CS3 = 011000 binary = 24 decimal
BE = 000000 binary = 0 (default — no marking)
DSCP Per-Hop Behaviour Classes
| Class | DSCP Name | Decimal | Binary | Typical Use |
|---|---|---|---|---|
| EF | Expedited Forwarding | 46 | 101110 | VoIP RTP media — requires strict low latency, low jitter, low loss. Gets LLQ/priority treatment at every hop |
| CS3 | Class Selector 3 | 24 | 011000 | VoIP call signalling (SIP, H.323, SCCP) — needs low latency but slightly less critical than media |
| AF41 | Assured Forwarding 4-1 | 34 | 100010 | Interactive video (telepresence, video calls) — high priority, low drop probability within the class |
| AF31 | Assured Forwarding 3-1 | 26 | 011010 | Critical business applications (SAP, ERP, SQL) — guaranteed bandwidth, low drop probability |
| AF21 | Assured Forwarding 2-1 | 18 | 010010 | Transactional data (web-based apps, HTTPS business) — moderate priority |
| AF11 | Assured Forwarding 1-1 | 10 | 001010 | Bulk data (email, FTP, backups) — best-effort with some assurance |
| CS1 | Class Selector 1 | 8 | 001000 | Scavenger / low-priority — peer-to-peer, consumer video streaming. Gets less-than-best-effort treatment |
| CS0 / BE | Best Effort / Default | 0 | 000000 | Unmarked traffic — default treatment. Most internet traffic arrives here |
AF Class Structure — Drop Precedence
Assured Forwarding classes (AF) have an internal structure: the class number (1–4) defines the bandwidth allocation tier, and the drop precedence (1–3) defines which packets within a class are dropped first under congestion:
| AF Class | Drop Low (x1) | Drop Medium (x2) | Drop High (x3) |
|---|---|---|---|
| AF4x (video) | AF41 = 34 | AF42 = 36 | AF43 = 38 |
| AF3x (critical apps) | AF31 = 26 | AF32 = 28 | AF33 = 30 |
| AF2x (transactional) | AF21 = 18 | AF22 = 20 | AF23 = 22 |
| AF1x (bulk) | AF11 = 10 | AF12 = 12 | AF13 = 14 |
MQC Framework — Three-Object Model
┌────────────────┐ ┌──────────────────────┐ ┌──────────────────────────┐
│ class-map │────►│ policy-map │────►│ service-policy │
│ │ │ │ │ │
│ Matches traffic│ │ Defines action for │ │ Binds policy to an │
│ by ACL, DSCP, │ │ each class: │ │ interface in a direction:│
│ NBAR protocol, │ │ set dscp ef │ │ │
│ QoS group, │ │ set dscp af31 │ │ interface Gi0/0 │
│ interface, etc.│ │ police ... │ │ service-policy input │
│ │ │ bandwidth ... │ │ MARK-INBOUND │
└────────────────┘ └──────────────────────┘ └──────────────────────────┘
Traffic flow direction:
input service-policy → marks/classifies as packet enters the interface
output service-policy → queues/schedules as packet exits the interface
Best practice: MARK inbound (input), QUEUE outbound (output)
Trust Boundary
The trust boundary is the point where the network stops trusting DSCP markings set by endpoints and begins enforcing its own policy. End-user devices (PCs, phones) should not be trusted to self-mark their traffic — a PC can mark everything as EF 46, starving legitimate VoIP. The trust boundary is typically the access layer switch or the WAN edge router. Traffic arriving inbound is re-marked or verified at this boundary. For VoIP VLAN configuration that separates phone traffic see Voice VLAN and Voice VLAN Configuration. For VLAN segmentation that creates the user, voice, and server segments see VLANs.
2. Lab Topology & Traffic Profile
[IP Phones — VLAN 10] [PC users — VLAN 20] [Servers — VLAN 30]
│ │ │
└──────────────────────┴──────────────────────┘
│
Gi0/0 (LAN in)
NetsTuts-R1
(Edge Router — Trust Boundary)
Gi0/1 (WAN out)
│
WAN / MPLS core
│
NetsTuts-R2 (Core)
Gi0/0 (WAN in)
Gi0/1 (LAN out)
Traffic to classify and mark on R1 Gi0/0 inbound:
VoIP RTP UDP 16384–32767 from VLAN 10 → DSCP EF (46)
SIP UDP/TCP 5060 from VLAN 10 → DSCP CS3 (24)
Video call UDP 49152–65535 from VLAN 20 → DSCP AF41 (34)
SAP/ERP TCP 3200, 3600 from VLAN 30 → DSCP AF31 (26)
HTTPS TCP 443 from any → DSCP AF21 (18)
Scavenger (YouTube NBAR) from any → DSCP CS1 (8)
All other → DSCP BE (0) — re-mark to zero
3. Step 1 — ACL-Based Classification
ACLs are the most common classification method. Define permit statements that match the specific source IP ranges, protocols, and port numbers for each traffic type. A packet that matches a permit entry is classified into that class:
NetsTuts-R1>en NetsTuts-R1#conf t ! ── ACL: match VoIP RTP (UDP 16384–32767 from phone VLAN) ─ ip access-list extended ACL-VOIP-RTP permit udp 192.168.10.0 0.0.0.255 any range 16384 32767 ! ! ── ACL: match SIP signalling ──────────────────────────── ip access-list extended ACL-SIP permit udp 192.168.10.0 0.0.0.255 any eq 5060 permit tcp 192.168.10.0 0.0.0.255 any eq 5060 ! ! ── ACL: match video conferencing ──────────────────────── ip access-list extended ACL-VIDEO permit udp 192.168.20.0 0.0.0.255 any range 49152 65535 ! ! ── ACL: match SAP/ERP application ports ───────────────── ip access-list extended ACL-SAP permit tcp 192.168.30.0 0.0.0.255 any eq 3200 permit tcp 192.168.30.0 0.0.0.255 any eq 3600 ! ! ── ACL: match HTTPS ───────────────────────────────────── ip access-list extended ACL-HTTPS permit tcp any any eq 443 !
permit statements —
a matching packet is classified into the class; no implicit deny
affects packet forwarding. The ACL is only evaluated for
classification purposes, not for filtering. Port ranges use the
range [low] [high] keyword. Multiple permit statements
in the same ACL are OR'd together — a packet matching any line
is classified. VoIP RTP port ranges (16384–32767 for Cisco, or
the wider 16384–65535 for interoperability) should match only
from the phone VLAN subnet to prevent desktop traffic from
self-marking into the EF class. For detailed ACL configuration
see ACL Overview and
Extended ACL Configuration.
4. Step 2 — Class-Maps
A class-map references one or more ACLs (or NBAR protocols, DSCP
values, or QoS groups) to define what traffic belongs to a class.
The match-any keyword means a packet matching
any match statement is classified into the class.
match-all (the default) requires all statements to match:
! ── Class-map: VoIP RTP ────────────────────────────────── class-map match-any CM-VOIP-RTP match access-group name ACL-VOIP-RTP ! ! ── Class-map: SIP signalling ──────────────────────────── class-map match-any CM-SIP match access-group name ACL-SIP ! ! ── Class-map: Video ───────────────────────────────────── class-map match-any CM-VIDEO match access-group name ACL-VIDEO ! ! ── Class-map: SAP/ERP ─────────────────────────────────── class-map match-any CM-SAP match access-group name ACL-SAP ! ! ── Class-map: HTTPS ───────────────────────────────────── class-map match-any CM-HTTPS match access-group name ACL-HTTPS ! ! ── Class-map: re-trust already-marked EF (from trusted phones) ── class-map match-any CM-TRUST-EF match dscp ef !
class-default always exists and matches all traffic
not caught by any other class — it is used to re-mark untrusted or
unclassified traffic to DSCP 0 (Best Effort). The
match dscp ef class-map example shows how to
re-classify traffic that is already marked — useful at a trust
boundary where IP phones self-mark and the edge router validates
the marking.
5. Step 3 — NBAR-Based Classification
NBAR (Network-Based Application Recognition) classifies traffic by application signature — payload patterns, port negotiation, and protocol behaviour — rather than just port numbers. This is essential for applications that use dynamic ports, encrypted payloads with known patterns, or that share ports with other applications. NBAR is particularly effective at identifying consumer video streaming (YouTube, Netflix) for scavenger marking:
Enable NBAR Protocol Discovery (Optional — for visibility)
! ── Enable on the inbound interface to discover what's flowing ─
interface GigabitEthernet0/0
ip nbar protocol-discovery
!
! ── After traffic has flowed, check what NBAR sees ────────
NetsTuts-R1#show ip nbar protocol-discovery interface GigabitEthernet0/0 top-n 10
GigabitEthernet0/0
Input Output
----- ------
Protocol Packet Count Packet Count
Byte Count Byte Count
30sec Bit Rate (bps) 30sec Bit Rate (bps)
30sec Max Bit Rate (bps) 30sec Max Bit Rate (bps)
------------------------ ------------------------ ------------------------
youtube 48291 102
62813300 8160
1450000 0
2100000 128
rtp 12045 10832
19272000 17331200
892000 802000
1050000 920000
http 8821 7654
11467300 9950200
224000 196000
380000 310000
ip nbar protocol-discovery enables real-time monitoring
of application traffic. After running for a few minutes during
peak hours, show ip nbar protocol-discovery top-n 10
reveals the top 10 applications by packet or byte count. This is
invaluable during QoS policy design — it confirms which applications
are actually present before writing class-maps, and reveals
unexpected traffic (e.g. peer-to-peer applications) that should
be scavenger-marked. Disable after the survey by removing
ip nbar protocol-discovery — it consumes CPU cycles
on every packet and should not run indefinitely in production.
NBAR Class-Maps for Application Recognition
! ── Class-map: YouTube (scavenger) using NBAR ──────────── class-map match-any CM-SCAVENGER match protocol youtube match protocol netflix match protocol bittorrent match protocol kazaa2 ! ! ── Class-map: Webex video — NBAR knows the signature ──── class-map match-any CM-WEBEX match protocol webex-media match protocol cisco-webex ! ! ── Class-map: DNS — needed to prevent DNS from being ! ── classified as generic UDP and under-prioritised ─────── class-map match-any CM-DNS match protocol dns ! ! ── Class-map: SNMP/NTP management traffic ─────────────── class-map match-any CM-MGMT match protocol snmp match protocol ntp match protocol ssh match protocol telnet !
youtube, netflix,
bittorrent, webex-media,
ms-lync, rtp, sip,
http, ssl, and hundreds more. Use
show ip nbar protocol-pack active to list all
available protocols on the router. NBAR and ACL match statements
can be combined in the same class-map using match-any —
a packet matching either the NBAR protocol or the ACL is classified
into the class. For NTP configuration see
NTP Configuration and for
SNMP see SNMP v2c/v3
Configuration.
Custom NBAR Protocol (PDLM or Custom Signatures)
! ── Custom port-based protocol definition ──────────────── ! ── Use when NBAR does not have a built-in signature ────── ip nbar custom CUSTOM-APP tcp port 8080 8443 class-map match-any CM-CUSTOM-APP match protocol CUSTOM-APP !
6. Step 4 — Policy-Map with DSCP Marking
The policy-map references class-maps and applies actions. For
marking, the action is set dscp [value]. Class order
in the policy-map determines match priority — place specific
classes before general ones. The mandatory class class-default
at the end catches all unmatched traffic:
! ════════════════════════════════════════════════════════════ ! Policy-map: inbound marking at the trust boundary ! Applied INPUT on the LAN-facing interface ! ════════════════════════════════════════════════════════════ ! policy-map PM-MARK-INBOUND ! ! ── Highest priority: VoIP RTP → EF ────────────────────── class CM-VOIP-RTP set dscp ef ! ! ── VoIP signalling → CS3 ──────────────────────────────── class CM-SIP set dscp cs3 ! ! ── Video conferencing → AF41 ──────────────────────────── class CM-VIDEO set dscp af41 ! ! ── SAP/ERP → AF31 ─────────────────────────────────────── class CM-SAP set dscp af31 ! ! ── HTTPS business traffic → AF21 ──────────────────────── class CM-HTTPS set dscp af21 ! ! ── Scavenger (YouTube, P2P) → CS1 ─────────────────────── class CM-SCAVENGER set dscp cs1 ! ! ── WebEx → AF41 (same as video) ───────────────────────── class CM-WEBEX set dscp af41 ! ! ── DNS → CS2 (needs to get through quickly) ───────────── class CM-DNS set dscp cs2 ! ! ── Management protocols → CS2 ─────────────────────────── class CM-MGMT set dscp cs2 ! ! ── Everything else: re-mark to BE 0 (untrusted) ───────── class class-default set dscp default ! !
set dscp default in the class-default explicitly sets
DSCP to 0 (Best Effort) — this erases any self-marking
from untrusted endpoints. Without this, a desktop PC that sets its
own DSCP to EF would have that marking preserved through the network.
The re-marking to zero enforces the trust boundary. Each
class statement in the policy-map is evaluated against
the packet in top-to-bottom order; the first match wins and the
packet is not re-evaluated against subsequent classes. Use
set dscp [name] (e.g. set dscp ef) rather
than the numeric form (set dscp 46) for readability —
IOS accepts both.
7. Step 5 — Apply Service-Policy to Interface
A policy-map becomes active only when bound to an interface with
service-policy. Marking policies apply
inbound (on the ingress interface as the packet
enters the router). Queuing and scheduling policies apply
outbound (on the egress interface as the packet
leaves):
! ── Apply marking policy INBOUND on LAN interface ──────── interface GigabitEthernet0/0 description LAN-Trust-Boundary ip address 192.168.1.1 255.255.255.0 service-policy input PM-MARK-INBOUND no shutdown ! ! ── WAN egress interface: queuing policy goes here ──────── ! ── (covered in CBWFQ/LLQ lab) ─────────────────────────── interface GigabitEthernet0/1 description WAN-Uplink ip address 10.0.0.1 255.255.255.252 ! service-policy output PM-QUEUE-OUTBOUND ← queuing policy no shutdown ! NetsTuts-R1(config)#end NetsTuts-R1#wr Building configuration... [OK]
input direction is
preferred for marking because it stamps the DSCP value as early as
possible — all subsequent processing (routing, ACL, NAT) sees
the correct marked value. Re-marking on output is possible but
means routing decisions were made with incorrect DSCP values.
After applying the policy save the configuration with
write memory.
Verify Policy is Attached
NetsTuts-R1#show policy-map interface GigabitEthernet0/0
GigabitEthernet0/0
Service-policy input: PM-MARK-INBOUND
Class-map: CM-VOIP-RTP (match-any)
0 packets, 0 bytes
5 minute offered rate 0000 bps, drop rate 0000 bps
Match: access-group name ACL-VOIP-RTP
QoS Set
dscp ef
Packets marked 0
Class-map: CM-SIP (match-any)
0 packets, 0 bytes
...
QoS Set
dscp cs3
Packets marked 0
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0000 bps, drop rate 0000 bps
Match: any
QoS Set
dscp default
Packets marked 0
8. Step 6 — Verification with Live Traffic
show policy-map interface — With Traffic Flowing
NetsTuts-R1#show policy-map interface GigabitEthernet0/0
GigabitEthernet0/0
Service-policy input: PM-MARK-INBOUND
Class-map: CM-VOIP-RTP (match-any)
18420 packets, 29472000 bytes
5 minute offered rate 892000 bps, drop rate 0000 bps
Match: access-group name ACL-VOIP-RTP
18420 packets, 29472000 bytes
QoS Set
dscp ef
Packets marked 18420
Class-map: CM-SIP (match-any)
342 packets, 68400 bytes
5 minute offered rate 2800 bps, drop rate 0000 bps
Match: access-group name ACL-SIP
342 packets, 68400 bytes
QoS Set
dscp cs3
Packets marked 342
Class-map: CM-VIDEO (match-any)
8210 packets, 14778000 bytes
5 minute offered rate 592000 bps, drop rate 0000 bps
Match: access-group name ACL-VIDEO
8210 packets, 14778000 bytes
QoS Set
dscp af41
Packets marked 8210
Class-map: CM-SAP (match-any)
1520 packets, 2432000 bytes
5 minute offered rate 98000 bps, drop rate 0000 bps
Match: access-group name ACL-SAP
1520 packets, 1520000 bytes
QoS Set
dscp af31
Packets marked 1520
Class-map: CM-SCAVENGER (match-any)
24800 packets, 31000000 bytes
5 minute offered rate 1240000 bps, drop rate 0000 bps
Match: protocol youtube
22100 packets
Match: protocol bittorrent
2700 packets
QoS Set
dscp cs1
Packets marked 24800
Class-map: class-default (match-any)
42100 packets, 53370000 bytes
5 minute offered rate 2100000 bps, drop rate 0000 bps
Match: any
QoS Set
dscp default
Packets marked 42100
show policy-map interface — Output Across the Network (R2)
! ── On R2 (core router), verify R1's markings arrived intact ─
NetsTuts-R2#show policy-map interface GigabitEthernet0/0 input
GigabitEthernet0/0
Service-policy input: PM-VERIFY-DSCP
Class-map: CM-CHECK-EF (match-any)
18419 packets, 29473600 bytes
Match: dscp ef (46)
18419 packets, 29473600 bytes
Class-map: CM-CHECK-AF41 (match-any)
12215 packets, 21987000 bytes
Match: dscp af41 (34)
12215 packets
Class-map: CM-CHECK-CS1 (match-any)
24800 packets, 31000000 bytes
Match: dscp cs1 (8)
24800 packets
Class-map: class-default (match-any)
42100 packets, 53370000 bytes
Match: any
show policy-map
interface to isolate where the marking is being altered.
Verify DSCP Value on a Specific Packet (Embedded Packet Capture)
! ── Capture packets on the WAN interface to verify DSCP ── ip access-list extended CAP-VOIP permit udp 192.168.10.0 0.0.0.255 any range 16384 32767 monitor capture CAP1 access-list CAP-VOIP interface GigabitEthernet0/1 out monitor capture CAP1 start ! ── After a few seconds ────────────────────────────────── monitor capture CAP1 stop show monitor capture CAP1 buffer brief ---------------------------------------------------------------------------- # size sec usec srcIP dstIP 1 214 0 000000 192.168.10.10 10.20.0.5 2 214 0 000100 192.168.10.10 10.20.0.5 show monitor capture CAP1 buffer detail Frame 1: DSCP: 46 (EF) ← confirmed — DSCP EF preserved on WAN egress Protocol: UDP Src Port: 20480 Dst Port: 20480
show ip nbar protocol-discovery — Confirm NBAR Classifications
NetsTuts-R1#show ip nbar protocol-discovery interface GigabitEthernet0/0 stats packet-count top-n 5 GigabitEthernet0/0 Protocol Input Packets Output Packets ------------------------ ------------- -------------- youtube 22100 0 rtp 18420 16834 http 5201 4892 bittorrent 2700 0 dns 1840 1820 ! ── Confirm NBAR is correctly identifying scavenger apps ─
Verification Command Summary
| Command | What It Shows | Key Field |
|---|---|---|
show policy-map interface [intf] |
Per-class packet/byte counts, offered rate, drop rate, and packets marked for each set action | "Packets marked" must equal matched packets — confirms every matched packet was re-marked |
show policy-map interface [intf] input |
Only the input direction policy — useful on interfaces with both input and output policies | Class-default count shows unclassified traffic volume — large number may indicate missing class-maps |
show class-map [name] |
Class-map definition — match criteria and type (match-any/all) | Confirms correct ACL or NBAR protocol names are referenced |
show policy-map [name] |
Policy-map definition — all classes and their configured actions without live counters | Verify set dscp values and class order before applying to interface |
show ip nbar protocol-discovery |
Per-protocol packet and byte counts on NBAR-enabled interfaces | Confirms NBAR is classifying target applications; use top-n 10 for ranking |
show ip nbar protocol-pack active |
Currently loaded NBAR Protocol Pack version and all available protocol names | Verify a specific NBAR protocol name (e.g. youtube) is available before referencing in class-map |
show interfaces [intf] | include DSCP |
Interface-level DSCP trust state (relevant on switches) | Confirms whether the interface trusts or overwrites incoming DSCP values |
9. Step 7 — Ensuring DSCP Preservation Across the Network
Marking traffic at the edge is only valuable if every intermediate device preserves the DSCP value. Several scenarios can corrupt or erase markings in transit:
Scenario A — Verifying a Core Router Is Not Re-Marking
! ── On a core router with NO QoS policy, DSCP passes through unchanged ─ ! ── Verify by checking the interface has no service-policy ──────────── NetsTuts-CORE#show interfaces GigabitEthernet0/0 | include policy No input service-policy No output service-policy ! ── Good: no policy = no re-marking, DSCP preserved ─────────────────
Scenario B — VPN Tunnel Preserving DSCP (GRE/IPsec)
! ── GRE tunnel: copy inner DSCP to outer IP header ─────── interface Tunnel0 tunnel mode gre ip ! ── Copy inner IP header DSCP to outer GRE header ──────── tunnel dscp propagate ! ! ── IPsec: ensure DSCP is copied from inner to outer header ─ crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmac mode transport ! ! ── For IPsec tunnel mode, QoS pre-classify ────────────── interface GigabitEthernet0/1 qos pre-classify !
tunnel dscp propagate copies the inner
DSCP to the outer header, allowing WAN routers to queue the
GRE-encapsulated packet based on its application class. For
IPsec in tunnel mode, qos pre-classify on the
physical interface tells IOS to look inside the IPsec packet
at the inner IP header's DSCP before the packet is encrypted,
allowing the output queuing policy to operate on the true
application DSCP rather than 0. For DMVPN with IPsec transport
mode, DSCP is naturally preserved since the outer GRE header
is the transport header. See
GRE Tunnel Configuration
and Site-to-Site IPsec VPN
for the underlying tunnel configuration.
Scenario C — Monitoring Policy to Detect DSCP Corruption
! ── Lightweight verification policy: match by DSCP, count only ── class-map match-any CM-EF-CHECK match dscp ef class-map match-any CM-CS1-CHECK match dscp cs1 policy-map PM-DSCP-AUDIT class CM-EF-CHECK ! ── no action — just count ─────────────────────────────── class CM-CS1-CHECK ! class class-default ! interface GigabitEthernet0/0 service-policy input PM-DSCP-AUDIT ! ── Check counts match expected values from upstream router ─ NetsTuts-R2#show policy-map interface GigabitEthernet0/0 input
set, no
police, no bandwidth) is a pure
counting policy — it classifies traffic into classes and
increments counters without affecting the packets. This is
a low-impact way to audit DSCP values at any point in the
network without deploying a full queuing policy. Apply it
on the inbound interface of each core router during a DSCP
audit, compare the class counts to the marking output at R1,
and identify exactly which hop is corrupting the markings.
Remove the policy after the audit to avoid unnecessary
classification overhead.
10. Troubleshooting DSCP Marking
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Class shows 0 matched packets despite live traffic | show policy-map interface shows 0 packets for a class while traffic is clearly flowing from the source subnet |
ACL does not match the traffic — wrong source subnet, wrong port number, wrong protocol (TCP vs UDP); class-map references wrong ACL name; service-policy applied in wrong direction (output instead of input) | Test the ACL independently: show ip access-lists ACL-VOIP-RTP — if match counts are zero, the ACL itself does not match the traffic. Verify source addresses with debug ip packet briefly. Confirm service-policy input (not output) on the ingress interface |
| All traffic landing in class-default | Only class-default has packet counts; all other classes show zero | Class-maps are not matching — ACL names misspelled, NBAR not enabled, or match-any/match-all logic incorrect; policy-map references wrong class-map names |
Run show class-map to verify class-map definitions. Check ACL names exactly match the match access-group name reference. For NBAR classes, confirm ip nbar protocol-discovery is active and run show ip nbar protocol-discovery to confirm traffic is being seen |
| NBAR class matches 0 packets | NBAR class-map for youtube or other protocol shows no matches despite confirmed traffic | Protocol Pack does not include the protocol; protocol name misspelled; NBAR not fully initialised on the interface; NBAR PDL (Protocol Description Language) file not loaded | Run show ip nbar protocol-pack active to list available protocols. Confirm spelling exactly matches. Update Protocol Pack with ip nbar protocol-pack flash:pp-adv-isrg2-154-7.tar if a newer pack is available |
| DSCP markings lost at downstream router | R1 marks correctly but R2 receives everything as DSCP 0 or a different value | An intermediate device has a policy-map on the WAN interface that re-marks to default; GRE/IPsec tunnel not propagating DSCP to outer header; ISP service provider is remarking DSCP at their edge | Check each hop: show interfaces [intf] | include policy and show policy-map interface on each transit device. For GRE tunnels add tunnel dscp propagate. For IPsec tunnels add qos pre-classify on the physical interface. Contact ISP if remarking occurs in their network |
| Cannot apply second service-policy to interface | % Service policy [name] already attached error when adding a second service-policy |
An interface can only have one input and one output service-policy — attempting to add a second in the same direction fails | Remove the existing policy: no service-policy input [existing-policy] then apply the new one. To combine marking and queuing on the same interface, use a hierarchical policy-map (parent with child) — covered in CBWFQ/LLQ configuration |
| High CPU from NBAR | Router CPU spikes after enabling NBAR; show processes cpu shows ip_nbar as top consumer |
NBAR performs deep packet inspection on every classified packet — high traffic volume causes significant CPU load, especially on older ISR platforms | Limit NBAR to specific interfaces and traffic classes. Use ACL-based classification for well-known port applications and reserve NBAR for only the protocols that truly need DPI (e.g. YouTube, P2P). Disable ip nbar protocol-discovery after the traffic survey — it adds per-packet overhead beyond what class-map matching requires |
| VoIP traffic marked EF but still experiencing jitter | DSCP EF is correctly applied at ingress; downstream routers show EF class matching; but calls have jitter and packet loss | DSCP marking alone does not prevent jitter — it only tags the traffic. The queuing policy (LLQ priority queue) at each egress interface must consume the EF marking and give those packets strict priority. Without a queuing policy, DSCP is decorative | Apply a queuing policy-map with priority (LLQ) on outbound interfaces that match EF traffic. See CBWFQ and LLQ Configuration. Verify with show policy-map interface [egress-intf] output |
Key Points & Exam Tips
- DSCP is a 6-bit field in the IP header's ToS byte, giving 64 possible values (0–63). The remaining 2 bits are the ECN field. DSCP values are expressed as names (EF, AF41, CS3) or decimal numbers (46, 34, 24).
- Key DSCP values to memorise: EF = 46 (VoIP media, strict priority), CS3 = 24 (VoIP signalling), AF41 = 34 (interactive video), AF31 = 26 (critical data), CS1 = 8 (scavenger), BE/CS0 = 0 (default).
- AF classes have a class tier (1–4) and a drop precedence (1–3). Higher class number = higher priority tier. Higher drop precedence = dropped first under congestion within the same class. AF41 has lower drop probability than AF43.
- The MQC three-object model:
class-map(match traffic) →policy-map(define action) →service-policy(apply to interface). All three are required. - Marking policies apply input on the ingress interface. Queuing policies apply output on the egress interface. An interface can have one input and one output service-policy simultaneously.
- The trust boundary is where the network takes ownership of DSCP markings. Untrusted endpoints must be re-marked at ingress. Always include
class class-default → set dscp defaultto erase self-markings from endpoints. - NBAR classifies by application signature, not port number. Use it for applications with dynamic ports or shared ports. NBAR consumes CPU — use only where ACL classification is insufficient.
- DSCP marking alone does not guarantee QoS. Marking tags the packet; a queuing/scheduling policy (LLQ for EF, CBWFQ for AF classes) at egress interfaces must consume the tags to actually differentiate treatment.
- For DSCP to survive end-to-end, every device in the path must preserve the DSCP field. GRE tunnels require
tunnel dscp propagate; IPsec tunnel-mode interfaces requireqos pre-classify. - On the CCNA/CCNP exam: know the EF, AF, CS class purposes; understand the MQC three-step process; know the difference between
match-anyandmatch-allin class-maps; understand why class-default must set DSCP to 0 at a trust boundary.