Use Classification when traffic must be treated differently by QoS: define which packets belong to voice, video, critical or scavenger classes before marking, queuing or policing them.
Classification · QoS
1. Classification identifies traffic for QoS (ACL, DSCP, NBAR).
2. Do it close to the source.
3. Trust boundaries decide which markings to accept.
4. Keep classes few.
5. Verify counters.
traffic → classification → class
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & 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 Verification & troubleshooting Narrow the fault
| Symptom | Command | Look for | Next check |
|---|---|---|---|
| Flow not in the expected class | show policy-map interface Gi1/0/10 input | Packet counters of the intended class increase during the test | show class-map VOICE and show access-lists ERP-SERVERS hit counts |
| Everything lands in class-default | same | Only class-default counters move | match-all vs match-any, DSCP already rewritten upstream, ACL source/destination order |
| NBAR match never hits | show ip nbar protocol-discovery interface Gi1/0/10 | The protocol is recognised on the interface | Match on DSCP or an ACL instead if NBAR is unsupported |
Step 2 Common mistakes Narrow the fault
- Classifying at every hop instead of at the trust boundary.
- Using NBAR on high-speed core links without checking CPU/hardware support.
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.
- Classification identifies traffic types, e.g. voice, video or bulk data.
- It can use ACLs, DSCP, CoS or NBAR application recognition.
- Classify as close to the source as possible.
show policy-map interface <interface>— class countersshow ip nbar protocol-discovery— detected applications
ReferenceWhat it is1 section · depth on demand
What it is
Classification sorts packets into traffic classes so a QoS policy can treat them differently. On Cisco IOS XE (MQC) a class-map matches DSCP or IP precedence, CoS, an ACL, an NBAR protocol or the input interface. match-all (the default) requires every criterion; match-any requires one. Traffic that matches no class falls into class-default.
Classification changes nothing by itself: the actions in the policy-map (mark, queue, police, shape) act on the class.
ReferenceWhy it matters1 section · depth on demand
When to use it
Classify at the trust boundary, the access port or WAN edge, to identify voice, video, business-critical and scavenger traffic, and wherever a device cannot rely on the markings it receives. Classify and mark once, close to the source, so later hops can classify on DSCP alone.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Classification sorts traffic into classes before any QoS action
The Catalyst 9300 QoS guide uses the Modular QoS CLI (MQC): class maps classify, a policy map assigns actions to classes, and a service policy attaches the policy to an interface. Classification can match on access lists, DSCP, IP precedence, CoS, VLAN and QoS group.
C9300(config)# ip access-list extended ACL-VOICE-SIGNAL
C9300(config-ext-nacl)# permit tcp any any eq 5060
C9300(config)# class-map match-any CM-VOICE
C9300(config-cmap)# match dscp ef
C9300(config)# class-map match-any CM-SIGNAL
C9300(config-cmap)# match dscp cs3
C9300(config-cmap)# match access-group name ACL-VOICE-SIGNAL
C9300(config)# policy-map PM-ACCESS-IN
C9300(config-pmap)# class CM-VOICE
C9300(config-pmap-c)# set dscp ef
C9300(config-pmap)# class CM-SIGNAL
C9300(config-pmap-c)# set dscp cs3
C9300(config-pmap)# class class-default
C9300(config-pmap-c)# set dscp default
C9300(config)# interface GigabitEthernet1/0/10
C9300(config-if)# service-policy input PM-ACCESS-IN
Trust (documented default)
| Traffic | Default |
|---|---|
| IP traffic | DSCP is trusted; packets keep their marking |
| Pure Layer 2 traffic | CoS is trusted |
Because markings are trusted by default, an access-port policy that re-marks or validates user traffic is the place to enforce your trust boundary.
Documented classification rules
| Rule | Consequence |
|---|---|
| IPv4 and IPv6 can't be mixed in one class map | Separate class maps per address family |
| The first matching class wins | Order classes from most to least specific |
Unmatched traffic goes to class-default | Give it a deliberate action |
Where to classify
| Place | Purpose |
|---|---|
Access ports, input | Set the trust boundary: re-mark or validate end-host markings |
| Uplinks | Usually trust the markings set at the edge |
Check with show policy-map interface Gi1/0/10 input: the per-class packet counters show whether traffic lands in the expected classes.
Documented example, not captured output.
Quick reference
Classification is the decision that every later QoS action depends on, so its accuracy matters more than any queue setting. Three practical approaches exist, from cheapest to most expensive:
| Method | Accuracy | Cost |
|---|---|---|
| Trust existing DSCP | Depends on the source | None |
| ACL (addresses, ports) | Good for known servers | Low, in hardware |
| NBAR2 (application recognition) | Good for many apps | CPU or specific hardware |
Encrypted traffic limits deep inspection: NBAR2 identifies most applications by DNS, TLS server name and flow behaviour rather than payload, and some applications cannot be told apart. Designs therefore combine methods — trust phones, classify servers by ACL, use NBAR2 for internet applications at the WAN edge.
A simple validation: generate the traffic in question and watch which class counter increases. If class-default grows instead, the match criteria are wrong or the traffic is marked differently than assumed.
show policy-map interface Gi1/0/10 input | include Class-map|packets
show ip nbar protocol-discovery interface Gi0/0/0 top-n 10
ReferenceConfiguration & state1 section · depth on demand
Configuration example (Cisco IOS XE)
class-map match-any VOICE
match dscp ef
match protocol rtp audio
class-map match-all ERP
match access-group name ERP-SERVERS
!
policy-map EDGE-IN
class VOICE
set dscp ef
class ERP
set dscp af21
class class-default
set dscp default
!
interface GigabitEthernet1/0/10
service-policy input EDGE-IN
match protocol needs NBAR support on the platform. 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 IP Services → QoS → Classification. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc2475.html · confidence 94%