QoS Classification and Marking

1. Introduction

Quality of Service (QoS) ensures that critical traffic like VoIP, video streaming, and business applications get higher priority over less important traffic like bulk data transfers or web browsing.

Key Concepts


2. QoS Classification

What is Classification?

Classification identifies and groups network traffic based on parameters such as:
Source/Destination IP or Port
Application type (VoIP, Video, Web, FTP)
Protocol (TCP, UDP, ICMP)
Interface (LAN, WAN, VPN)

Traffic Classification Methods

MethodExample
Access Control Lists (ACLs)Match traffic based on IP, protocol, or port
Class MapsDefine traffic classes in QoS policies
Network-Based Application Recognition (NBAR)Identifies applications dynamically (Skype, Zoom, etc.)
802.1p (CoS)Layer 2 VLAN tagging
Differentiated Services Code Point (DSCP)Layer 3 IP header marking

📌 Example of Traffic Classification Using ACLs:

ip access-list extended VOICE-TRAFFIC
permit udp any any range 16384 32767

📌 Using Class Maps to Classify Traffic:

class-map MATCH-VOICE
match access-group name VOICE-TRAFFIC

3. QoS Marking

What is Marking?

Marking assigns priority values to packets so that network devices (routers, switches) can prioritize traffic accordingly.

Common Marking Methods

Marking TypeLayerBitsValue Range
802.1p (CoS)Layer 2 (VLAN)3 bits0-7
DSCP (Differentiated Services Code Point)Layer 3 (IP)6 bits0-63
IP PrecedenceLayer 3 (IP)3 bits0-7

📌 Marking Traffic with DSCP (Layer 3):

class-map MATCH-VOICE
match ip dscp 46 # Expedited Forwarding (EF) for VoIP

📌 Marking Traffic with CoS (Layer 2 VLAN):

class-map MATCH-VIDEO
match cos 5 # High priority video

4. DSCP Marking Values

DSCP values define traffic priority levels:

DSCP ClassDSCP ValueTraffic Type
EF (Expedited Forwarding)46VoIP (Low Latency)
AF41, AF42, AF4334, 36, 38Video Streaming
AF31, AF32, AF3326, 28, 30Mission-Critical Apps
AF21, AF22, AF2318, 20, 22Bulk Data
CS0 (Default)0Best Effort

📌 Example Configuration – Mark VoIP Traffic as EF (DSCP 46):

policy-map MARK-VOICE
class MATCH-VOICE
set dscp ef

📌 Trust DSCP on a Switch Port:

interface GigabitEthernet1/0/1
mls qos trust dscp

5. Applying Classification and Marking on an Interface

1️⃣ Create an ACL to Match VoIP Traffic

ip access-list extended VOICE-TRAFFIC
permit udp any any range 16384 32767

2️⃣ Create a Class Map

class-map MATCH-VOICE
match access-group name VOICE-TRAFFIC

3️⃣ Create a Policy Map to Mark Traffic

policy-map MARK-VOICE
class MATCH-VOICE
set dscp ef

4️⃣ Apply QoS Policy to an Interface

interface GigabitEthernet1/0/1
service-policy input MARK-VOICE

6. Summary

StepCommand
Classify Trafficclass-map MATCH-VOICE
Mark DSCP Valuesset dscp ef
Mark CoS Valuesset cos 5
Apply to Interfaceservice-policy input MARK-VOICE

Conclusion:

renjithbs Avatar

Posted by

Leave a comment