Packet Classification & QoS Marking — Architecture & Mechanisms
Overview
Packet classification and QoS marking determine how packets are identified, categorized, and labeled so that downstream components—schedulers, shapers, policers, and congestion‑control mechanisms—can apply differentiated treatment. These mechanisms form the foundation of Quality of Service (QoS), enabling networks to prioritize latency‑sensitive traffic, enforce bandwidth guarantees, and isolate flows.
Classification assigns packets to traffic classes or flows.
Marking encodes QoS information into packet headers for use by intermediate nodes.
Together, they define how traffic is recognized and how it should be treated across the network.
Classification Objectives
Packet classification is designed to achieve several goals:
- Identify flows for scheduling, shaping, and policing
- Apply QoS policies based on application requirements
- Enable differentiated services (voice, video, best‑effort, control traffic)
- Support security and access control
- Enable traffic engineering through class‑based routing or prioritization
Classification is the first step in the QoS pipeline.
Architectural Principles
Multi‑Field Classification
Packets are classified by examining multiple header fields, such as:
- source/destination IP
- source/destination port
- protocol type
- VLAN ID
- DSCP/ToS bits
- MPLS labels
- flow identifiers
- application signatures (in advanced systems)
Multi‑field classification enables fine‑grained control.
Hierarchical Classification
Classification may occur at multiple levels:
- per‑packet
- per‑flow
- per‑class
- per‑tenant
- per‑service
Hierarchical classification supports scalable QoS in large networks.
Stateless vs Stateful Classification
- Stateless classification examines only the current packet.
- Stateful classification tracks flow state (e.g., TCP connection, session metadata).
Stateful classification enables more accurate QoS decisions but requires more memory and logic.
Classification Mechanisms
Exact Match Classification
Packets are matched against exact header values.
Use cases: MAC tables, ARP caches, simple ACLs.
Longest Prefix Match (LPM)
Used for IP routing and class‑based forwarding.
Use cases: routing tables, class‑based routing.
Ternary Content‑Addressable Memory (TCAM)
TCAM enables matching with wildcards and masks.
Pros: extremely fast
Cons: high power, limited size
Used in high‑performance switches and routers.
Hash‑Based Classification
Flows are hashed into buckets.
Pros: scalable
Cons: collisions may cause misclassification
Used in load balancers and fair‑queuing systems.
Deep Packet Inspection (DPI)
Examines payload to identify applications.
Pros: accurate application classification
Cons: expensive, privacy concerns, encrypted traffic limits effectiveness
Used in enterprise and carrier networks.
QoS Marking
Purpose of Marking
Marking encodes QoS intent into packet headers so that downstream nodes can apply:
- priority
- bandwidth guarantees
- shaping
- policing
- congestion handling
Marking ensures consistent treatment across the network.
Marking Fields in Common Protocols
Ethernet (802.1Q)
- PCP (Priority Code Point) — 3 bits
Defines 8 priority levels (0–7).
Used in VLAN‑tagged Ethernet frames.
IP (IPv4/IPv6)
- DSCP (Differentiated Services Code Point) — 6 bits
Defines traffic classes such as EF (Expedited Forwarding), AF (Assured Forwarding), and BE (Best Effort). - ECN (Explicit Congestion Notification) — 2 bits
Used for congestion signaling without packet loss.
MPLS
- Traffic Class (TC) — 3 bits
Used for QoS and ECN in MPLS networks.
Wi‑Fi (802.11e/WMM)
- Access Categories (AC)
Maps traffic into four priority classes:
- Voice
- Video
- Best Effort
- Background
QoS Models
Best Effort
No guarantees; all packets treated equally.
Differentiated Services (DiffServ)
Packets are marked with DSCP values; routers apply per‑hop behaviors (PHBs).
Pros: scalable
Cons: coarse‑grained
Integrated Services (IntServ)
Uses per‑flow reservations (RSVP).
Pros: strong guarantees
Cons: not scalable for large networks
Class‑Based QoS
Traffic is grouped into classes with:
- priority
- bandwidth guarantees
- shaping policies
Used in data centers and carrier networks.
Classification in Modern Systems
Data Center Networks
Classification supports:
- tenant isolation
- priority for latency‑sensitive flows
- ECN‑based congestion control (DCTCP)
- traffic engineering
DSCP and VLAN PCP are commonly used.
Carrier and ISP Networks
Classification enables:
- service differentiation
- subscriber QoS
- traffic engineering
- SLAs
MPLS TC and DiffServ are widely deployed.
Wireless Networks
Classification interacts with:
- airtime fairness
- channel‑aware scheduling
- QoS class identifiers (QCIs) in LTE/5G
Wireless systems rely heavily on priority‑based classification.
High‑Speed Interconnects
PCIe, CXL, and NoCs classify traffic into:
- control
- data
- completion
- coherence classes
Scheduling and flow control depend on class identifiers.
Performance Considerations
Latency
Higher‑priority classes receive lower latency.
Misclassification can cause jitter or delay.
Throughput
Weighted classes ensure bandwidth guarantees.
Incorrect marking may cause unfairness.
Scalability
TCAM‑based classification is fast but expensive.
Hash‑based classification scales better but is less precise.
Security
Classification interacts with ACLs and firewall rules.
Incorrect classification may expose attack surfaces.
Comparison of Classification Approaches
| Approach | Precision | Scalability | Complexity | Typical Use |
|---|---|---|---|---|
| Exact Match | High | Medium | Low | MAC tables |
| LPM | Medium | High | Medium | Routing |
| TCAM | Very High | Low | High | QoS, ACLs |
| Hash‑Based | Medium | Very High | Low | Load balancing |
| DPI | Very High | Low | Very Low | Application QoS |
Design Tradeoffs
- Precision vs scalability — TCAM is precise but costly; hashing scales but may collide.
- Latency vs complexity — deeper classification increases latency.
- QoS guarantees vs fairness — strict priority may starve lower classes.
- Security vs performance — DPI improves security but increases overhead.
- Consistency vs flexibility — marking must be consistent across the network.
Related Pages
- Packet Scheduling — Architecture & Algorithms
- Traffic Shaping & Policing — Architecture & Algorithms
- Queue Management & Congestion Control — Architecture & Algorithms
- Protocol Flow Control — Architecture & Mechanisms
- Packet Fragmentation & Reassembly — Architecture & Design Considerations
Summary
Packet classification and QoS marking define how packets are identified and labeled for differentiated treatment across the network. Through multi‑field classification, DSCP/PCP marking, and class‑based QoS models, modern systems enforce fairness, prioritize latency‑sensitive traffic, and maintain predictable performance across diverse environments.