Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Class Map

Direct answer

A class-map defines which traffic belongs to a class, using match criteria such as DSCP, ACL, protocol (NBAR) or CoS, with match-any or match-all logic.

When to use this

Use it when traffic does not land in the intended QoS class.

First 30 seconds

1. Class-maps classify traffic (match-any/match-all).

2. Match DSCP, ACL, NBAR protocol.

3. class-default catches the rest.

4. Order of classes matters in the policy.

5. Verify counters.

Operational verification

traffic → class-map match → class

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 · Cisco IOS / IOS XE
Key commandclass-map match-any <name>
Scope / prerequisiteUse it when traffic does not land in the intended QoS class.
Show · 1Reference · 5
What next?3 suggested next steps
Catalog command links6
Evidence0
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

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

3 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 Verification and what it shows Verify boundary

Generate traffic with known DSCP/protocol/address characteristics, verify it increments the intended class under the applied service policy and confirm competing classes do not match unexpectedly. A class-map definition shows desired matching logic only; applied policy counters show effective classification for the observed traffic.

Step 2 Verification and output interpretation Verify boundary

Verify the class-map definition first, then confirm which policy references it and where that policy is attached. Use policy/interface counters with representative traffic to show packets are actually entering the class. If counters remain zero, check direction, attachment point and match criteria before changing queue parameters. Compare offered packets/bytes over a time interval because a static zero can simply mean no matching traffic occurred during the observation window.

Step 3 Observation → implication → next check Narrow the fault

Observation → implication → next check: zero class matches with known traffic points to match criteria, direction or policy attachment before scheduler behavior. Matches in the wrong class point to overlapping criteria/order. Correct class counters with bad treatment move to the policy-map action and interface scheduler rather than changing classification.

Command lookup Jump straight to Cisco syntax
Key points
  • A class map defines which traffic belongs to a class using match statements.
  • match-any needs one match; match-all needs all.
  • Unmatched traffic falls into class-default.
Key checks
  • show class-map — class definitions
  • show policy-map interface <interface> — packets matched per class
ReferenceWhy it matters2 sections · depth on demand

When to use it

Use it to express service intent and protect constrained resources under congestion.

How it works in operation

A class map defines packet classification criteria and match-all/match-any behavior; it does not itself queue, police or mark traffic until referenced by a policy map that is applied to an interface or control point. Classification counters are effective-state evidence and should be tied to the direction and traffic tuple being tested.

ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

A class map defines which packets belong to a traffic class

In the Catalyst 9300 QoS guide's MQC model, a class map holds match criteria, and a policy map refers to it to apply actions. Match criteria include access lists, DSCP, IP precedence, CoS, VLAN and QoS group.

C9300(config)# class-map match-any CM-VIDEO
C9300(config-cmap)# match dscp af41 af42 af43
C9300(config-cmap)# match dscp cs4
C9300(config)# class-map match-all CM-VOICE-VLAN20
C9300(config-cmap)# match dscp ef
C9300(config-cmap)# match vlan 20
C9300(config)# class-map match-any CM-SCAVENGER
C9300(config-cmap)# match access-group name ACL-BACKUP
C9300# show class-map CM-VIDEO
 Class Map match-any CM-VIDEO (id 3)
   Match   dscp af41 (34) af42 (36) af43 (38)
   Match   dscp cs4 (32)

match-any versus match-all

KeywordA packet belongs to the class if
match-anyAny one criterion matches
match-all (default)Every criterion matches

Documented rules

RuleConsequence
IPv4 and IPv6 matches can't be mixed in one class mapSeparate class maps per address family
In a policy map, the first matching class winsPut specific classes before general ones
Unmatched traffic goes to class-defaultConfigure it explicitly

Matching with ACLs

ACL entryEffect in a class map
permitTraffic matches the class
denyTraffic doesn't match this class; it continues to the next class

ACL deny in a QoS ACL doesn't drop traffic. It only excludes it from the class.

Naming

Name class maps after what they represent (CM-VOICE, CM-VIDEO, CM-SCAVENGER), not after the queue they use. The same class map can then be reused in input and output policies on different platforms.

Checks

show class-map shows the criteria. show policy-map interface shows how many packets hit each class. A class with zero hits usually means a wrong match or the wrong direction.

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.

Quick reference

A class map defines a traffic class with match criteria such as DSCP, ACL, NBAR protocol or CoS. match-any requires one criterion to match; match-all (default) requires all of them.

class-map match-any VOICE
 match dscp ef
class-map match-any CRITICAL-DATA
 match protocol citrix
 match access-group name ERP-SERVERS

Documented example, not captured output.

Traffic that matches no class falls into class-default. Order matters in the policy map, not in the class map.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

State model and technical mechanics

Classification is the first logical stage of MQC-style QoS policy. A class map can match fields such as DSCP/CoS, ACL-defined addresses/protocols, protocol recognition or other platform-supported attributes. match-all requires all configured match criteria to succeed, while match-any treats any criterion as sufficient. Classification happens at the policy attachment point and direction, so the same packet can be classified differently at different interfaces or before/after another marking function. The class-map name is only a reference object; operational effect begins when a policy map uses it and that policy is attached to traffic. Read the mechanism as a chain of dependent state rather than a single boolean. The same configured object can be healthy locally while an adjacent interface, policy, route, neighbor or endpoint prevents the intended service, so the reference keeps those state boundaries explicit.

Limits and common misconceptions

A class map that parses correctly does not affect forwarding until it is referenced by an active policy. Matching a packet also does not imply the traffic received priority or bandwidth; that depends on the policy action. Likewise, DSCP match semantics do not show the marking is trustworthy—an endpoint can set a value unless the design defines where markings are accepted or rewritten.

ReferenceConfiguration & state1 section · depth on demand

Design and configuration model

Build classes around explicit traffic intent and keep match criteria mutually understandable. Avoid broad ACL or protocol matches that unintentionally absorb traffic intended for another class, and remember that class evaluation order in the policy can matter when matches overlap. Where markings are trusted from upstream, document the trust boundary; where traffic must be identified independently, match on fields appropriate to that boundary. Prefer a small number of explainable classes over a taxonomy so granular that counters cannot be interpreted operationally.

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 IP Services → QoS → Class Map. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc2475.html · confidence 94%
Embedded reference data

Quick lookup tables

Class Map · technical reference

Compact mechanics, configuration and evidence boundaries for fast lookup.

LayerQuestion
Class mapWhich packets match?
Policy mapWhat action applies?
Service policyWhere/direction is it active?
CountersDid real traffic hit the class?
Confirmation

Confirm action

Continue?