Lab Objective
Configure a class-map matching voice traffic by protocol, mark it with DSCP EF using a policy-map, apply a second policy-map implementing a strict priority queue for that traffic, and verify both the marking and the queuing statistics.
Lab Purpose
Understanding the Modular QoS CLI (MQC) pattern — class-map defines what to match, policy-map defines what to do, service-policy applies it to an interface — is foundational to virtually every QoS configuration, discussed earlier in this series regarding QoS fundamentals.
Lab Topology
R1 ---- Gi0/1 ---- WAN link toward remote site
Voice traffic identified by RTP protocol range,
generated by an IP phone on the LAN sideTask 1: Create a Class-Map Matching Voice Traffic
Create a class-map matching RTP protocol traffic.
Task 2: Create a Marking Policy-Map
Create a policy-map that sets DSCP EF for traffic matching the voice class-map.
Task 3: Apply the Marking Policy Inbound
Apply the marking policy-map to the LAN-facing interface, inbound.
Task 4: Create a Queuing Policy-Map with Priority
Create a second policy-map applying strict priority queuing to the voice class, with a bandwidth guarantee, and default handling for all other traffic.
Task 5: Apply the Queuing Policy Outbound
Apply the queuing policy-map to the WAN-facing interface, outbound.
Task 6: Generate Traffic and Verify Marking and Queuing
Generate voice traffic and confirm both DSCP marking and priority queue statistics.
Solution and Verification
R1(config)# class-map match-all VOICE-TRAFFIC
R1(config-cmap)# match protocol rtpR1(config)# policy-map MARK-VOICE
R1(config-pmap)# class VOICE-TRAFFIC
R1(config-pmap-c)# set dscp efR1(config)# interface gigabitethernet0/0
R1(config-if)# service-policy input MARK-VOICER1(config)# policy-map QUEUE-POLICY
R1(config-pmap)# class VOICE-TRAFFIC
R1(config-pmap-c)# priority 128
R1(config-pmap)# class class-default
R1(config-pmap-c)# fair-queueR1(config)# interface gigabitethernet0/1
R1(config-if)# service-policy output QUEUE-POLICYIPPhone> [generates an active RTP call]
R1# show policy-map interface gigabitethernet0/0
Service-policy input: MARK-VOICE
Class-map: VOICE-TRAFFIC (match-all)
842 packets, 67360 bytes
QoS Set
dscp ef
Packets marked 842R1# show policy-map interface gigabitethernet0/1
Service-policy output: QUEUE-POLICY
Class-map: VOICE-TRAFFIC (match-all)
Queueing
Strict Priority
Bandwidth 128 (kbps) Burst 3200 (Bytes)
(pkts matched/bytes matched) 842/67360
(total drops) 0
-- Zero drops confirms the voice traffic is
-- being serviced immediately by the strict
-- priority queue, exactly as designedKey Takeaway
The MQC three-step pattern (class-map, policy-map, service-policy) separates classification from action from application — this separation is what allows the same class-map (VOICE-TRAFFIC) to be reused across two entirely different policy-maps in this lab, one for marking and one for queuing, without redefining the matching criteria twice.