When you open an inherited router config and stumble on a QoS policy, the first reflex is panic.
Don't.
Every QoS configuration on a Cisco router or switch follows the same blueprint, called Modular QoS CLI (MQC).
Once you know how to read it, you can interpret any QoS policy, no matter how complex it looks.
Figure 1 — The MQC framework
MQC splits any QoS policy into three independent building blocks that chain into each other:
class-mapdefines which traffic you care aboutpolicy-mapdefines what action to apply to that trafficservice-policydefines where the policy is attached and in which direction
You already saw this exact three-block model on CoPP in the previous lesson.
The grammar is universal.Answer the question below
Which MQC block defines the interface and direction where the policy is enforced?
Why This Matters for Interpretation
In production, you almost never write the QoS policy yourself.
You inherit it.
Your job is to read it, understand its intent, and explain its behavior.
That is exactly what you will do in the rest of this lesson, on a real enterprise edge config.
Figure 2 — The configuration you will decode
Here is the scene: router R1 sits at the enterprise edge, between your LAN and the WAN provider.
Take a moment to spot each block in the figure:two class-maps,
CLASS-VOICEandCLASS-CRITICAL-DATA, sort the incoming traffica policy-map called
WAN-INapplies actions to each classa service-policy attaches
WAN-INto interface G0/0 in the input direction
Throughout the rest of this lesson, you will decode each of these blocks one at a time.
Answer the question below
Which MQC block defines what action is applied to the matched traffic?
Your first step into the policy is the class-map.
Think of it as a named filter that groups packets sharing one or more characteristics into a single class, so the policy-map can act on them later.
Figure 3 — Two class-maps for two traffic types
Two class-maps live in the WAN-IN policy:
CLASS-VOICEfor voice traffic, andCLASS-CRITICAL-DATAfor business-critical data.
Reading either one answers the same question: which packets does this rule apply to?A Real Class-Map to Decode
Run the show command below to display the class-map block from the running config of R1:
R1# show running-config | section class-map class-map match-any CLASS-VOICE match dscp ef match protocol rtp class-map match-all CLASS-CRITICAL-DATA match access-group name ACL-ERP match dscp af31Two classes appear in the output.
To interpret each one, you read the match logic first (match-any vs match-all), then the criteria below it.Answer the question below
Which DSCP value does CLASS-CRITICAL-DATA require a packet to carry?
Match-Any vs Match-All
The first word right after the class name controls how the criteria below it combine.
Misreading this single keyword is one of the most common QoS mistakes.match-anymeans OR: a packet is classified into the class if it satisfies at least one criterion.
Figure 4 — match-any: OR logic
Apply this to
CLASS-VOICEin your config.
A packet is classified as voice if it carries DSCP EF or if NBAR recognizes it as RTP.
Either match is enough.Answer the question below
Which match line in CLASS-VOICE relies on an existing DSCP marking from upstream?
match-allmeans AND: a packet is classified only if it satisfies every criterion.
Figure 5 — match-all: AND logic
Now look at
CLASS-CRITICAL-DATA.
A packet is classified as critical data only if it is permitted by ACL-ERP and carries DSCP AF31.
Both conditions must be true.Answer the question below
Which keyword turns a class-map into an OR filter that classifies a packet matching at least one criterion?
Verifying Class-Maps with show
To confirm what classes are defined on the router, ask IOS to list them:
R1# show class-map Class Map match-any CLASS-VOICE (id 1) Match dscp ef (46) Match protocol rtp Class Map match-all CLASS-CRITICAL-DATA (id 2) Match access-group name ACL-ERP Match dscp af31 (26) Class Map match-any class-default (id 0) Match anyThree things to spot in this output:
the match logic appears right after the class name (match-any or match-all)
the DSCP value is shown in both name and decimal form (ef = 46, af31 = 26), useful when comparing with packet captures
class-defaultis always present withMatch any. Every policy ends here for unclassified traffic
Answer the question below
In a match-any class-map with two match statements, how many criteria must a packet satisfy to be classified into that class?
Answer the question below
A DSCP af31 packet is neither in ACL-ERP nor RTP: which class does it land in?
You now know which traffic each class targets.
The next question is: what does R1 actually do with that traffic?
That is the role of thepolicy-map, the action layer of MQC.
Figure 6 — Inside the policy-map WAN-IN
Inside
WAN-IN, each class gets its own treatment:CLASS-VOICEis markedCLASS-CRITICAL-DATAis marked and policedclass-defaultis policedReading a policy-map answers one question: what does the router do with traffic in each class?
The WAN-IN Policy
Pull the policy-map from the running config:
R1# show running-config | section policy-map policy-map WAN-IN class CLASS-VOICE set dscp ef class CLASS-CRITICAL-DATA set dscp af31 police 8000000 conform-action transmit exceed-action drop class class-default police 2000000 conform-action transmit exceed-action dropYou see two ingress actions at work: marking with
set, and policing withpolice.
Both are typical at the enterprise edge: classify, mark, and rate-limit anything that could starve more important classes.Answer the question below
Which policy-map action writes a DSCP value into the IP header without slowing the traffic?
Decoding Each Action
You can also list every policy-map structure on the router with the next show command:
R1# show policy-map Policy Map WAN-IN Class CLASS-VOICE set dscp ef Class CLASS-CRITICAL-DATA set dscp af31 police cir 8000000 bc 250000 be 250000 conform-action transmit exceed-action drop Class class-default police cir 2000000 bc 62500 be 62500 conform-action transmit exceed-action dropTwo ingress actions are revealed by this output:
Marking with
setre-marks voice traffic to Expedited Forwarding (DSCP 46) and ERP traffic to Assured Forwarding 31 (DSCP 26).Rate-limiting with
policecaps ERP at 8 Mbps and best-effort at 2 Mbps.
Traffic below the rate is conformed (transmitted), while traffic above is exceeded (dropped or remarked).
Answer the question below
Which QoS action drops excess traffic instead of buffering it?
You have a class-map and a policy-map.
But until you attach them somewhere, they are pure definitions sitting in the config doing nothing.
That is the role of the third block,service-policy, which tells you on which interface the QoS rules are enforced and in which direction.Reading the Service-Policy Line
Display the interface block where the policy is attached:
R1# show running-config interface GigabitEthernet0/0 interface GigabitEthernet0/0 description LAN-facing port ip address 192.168.1.1 255.255.255.0 service-policy input WAN-INRead this single line as: apply policy-map WAN-IN to traffic entering interface G0/0.

Figure 7 — service-policy input on G0/0
Follow the packets in the figure: they enter R1 through G0/0, the LAN-facing interface.
The keywordinputtells the router to apply WAN-IN before any routing decision.Answer the question below
On router R1, which direction keyword is used to apply WAN-IN to traffic entering G0/0?
The show Command That Matters Most
Now for the most important command in this lesson.
Theshow policy-map interfacecommand combines the policy structure with live counters, showing exactly what your QoS is doing to real traffic in real time.R1# show policy-map interface GigabitEthernet0/0 GigabitEthernet0/0 Service-policy input: WAN-IN Class-map: CLASS-VOICE (match-any) 184562 packets, 29530000 bytes 5 minute offered rate 478000 bps Match: dscp ef (46) Match: protocol rtp QoS Set dscp ef Packets marked 184562 Class-map: CLASS-CRITICAL-DATA (match-all) 52810 packets, 41200000 bytes 5 minute offered rate 320000 bps, drop rate 0 bps Match: access-group name ACL-ERP Match: dscp af31 (26) QoS Set dscp af31 Packets marked 52810 police: cir 8000000 bps, bc 250000 bytes conformed 52810 packets, 41200000 bytes; actions: transmit exceeded 0 packets, 0 bytes; actions: drop conformed 320000 bps, exceeded 0 bps Class-map: class-default (match-any) 89321 packets, 84500000 bytes 5 minute offered rate 2240000 bps, drop rate 240000 bps Match: any police: cir 2000000 bps, bc 62500 bytes conformed 84800 packets, 80000000 bytes; actions: transmit exceeded 4521 packets, 4500000 bytes; actions: drop conformed 2000000 bps, exceeded 240000 bpsThis output is dense, so focus on what each block reveals:
offered rateis the rate of traffic arriving in that class. Compare it to the police rate to see how close the class is to its cap.Packets markedtells you set is working. Every voice packet was rewritten to DSCP EF, every ERP packet to AF31.conformedandexceededare the two policer counters. Conformed packets pass, while exceeded packets are dropped.class-default exceeded 4521 packetsis the story of this output: the policer is doing its job, dropping bulk traffic that tried to exceed 2 Mbps.
Notice
CLASS-CRITICAL-DATA: 320 kbps offered, 8 Mbps cap,exceeded 0.
Plenty of headroom. The policer only kicks in once traffic crosses the threshold.You can now read any Cisco QoS configuration in production using the same MQC grammar: class-map for which, policy-map for what, service-policy for where.
Answer the question below
In the show policy-map interface output above, how many packets were dropped by the policer in class-default?
The next step is to look under the hood of the
policecommand and understand how the token bucket really decides what to drop.Answer the question below
In show policy-map interface output, which counter increases when traffic is dropped by a policer?
Answer the question below
If CLASS-CRITICAL-DATA offered 9500000 bps, what exceeded rate would its policer report?