QoS Differentiated Services (DiffServ) Model

Implement the DiffServ architecture for scalable QoS.

1. Executive Summary & Objective

In the early days of network engineering, providing Quality of Service (QoS) relied on the Integrated Services (IntServ) model, which utilized resource reservation protocols (RSVP) to guarantee end-to-end bandwidth for every individual flow. While effective on a small scale, IntServ collapsed under its own weight in large enterprises and the internet core due to the massive overhead of maintaining state for millions of simultaneous connections. Enter the Differentiated Services (DiffServ) model. DiffServ revolutionized QoS by abandoning per-flow state tracking in favor of a highly scalable, class-based architecture that remains the undisputed standard for modern network design.

The objective of this comprehensive module is to dissect the DiffServ architectural model and its operational components. By the end of this lesson, you will possess a thorough understanding of the Differentiated Services Code Point (DSCP) field, Per-Hop Behaviors (PHB), and the philosophy of pushing complexity to the network edge while keeping the core fast and simple. Furthermore, you will gain hands-on expertise in deploying complete DiffServ configurations using the Cisco Modular QoS CLI (MQC), empowering you to architect scalable QoS solutions capable of supporting complex, multi-class traffic profiles across global enterprise networks.

2. Core Concept & Theory

The fundamental philosophy of DiffServ is scalability through simplicity in the core. Instead of asking every router in a path to reserve bandwidth for a specific VoIP call (IntServ), DiffServ groups similar types of traffic into aggregate classes.

The DiffServ Architecture Workflow

  1. Edge Classification & Marking: As traffic enters the network edge (e.g., an access switch), it is deeply inspected (classified) and marked with a specific tag.
  2. Core Forwarding: As the marked packet traverses the high-speed network core, the core routers do not inspect the payload or track the session. They simply look at the tag and apply a pre-defined forwarding treatment (queuing, shaping, or dropping) based on that tag.

The DS Field and DSCP

DiffServ operates primarily at Layer 3. It re-purposed the legacy 8-bit IPv4 Type of Service (ToS) byte (and the IPv6 Traffic Class byte) into the Differentiated Services (DS) field.

  • The first 6 bits constitute the Differentiated Services Code Point (DSCP), allowing for 64 possible markings (0-63).
  • The last 2 bits are reserved for Explicit Congestion Notification (ECN), a mechanism to signal congestion before dropping packets.

Per-Hop Behaviors (PHB)

A DSCP value is just a number; it means nothing unless the router is configured to act on it. The specific action a router takes when encountering a specific DSCP value is called a Per-Hop Behavior (PHB). The IETF standardized several PHBs to ensure interoperability:

  • Default Forwarding (DF): DSCP 0. Best-effort traffic, standard FIFO queuing, no guarantees.
  • Expedited Forwarding (EF): DSCP 46. Designed for strict priority, low latency, low jitter, and low loss. Universally used for Voice (VoIP) traffic. EF traffic must be strictly policed to prevent starving other classes.
  • Assured Forwarding (AF): A matrix of 12 DSCP values defining 4 classes (Queues) and 3 levels of drop precedence within each class. Used for guaranteeing bandwidth to data applications (e.g., Video, ERP, Email).
    • Example: AF31 (DSCP 26) gets a better queue than AF11 (DSCP 10). During congestion, AF33 (high drop precedence) is dropped before AF31 (low drop precedence).
  • Class Selector (CS): DSCP values ending in β€˜000’ (e.g., CS3, CS6). Created strictly for backward compatibility with the legacy 3-bit IP Precedence marking scheme.

3. Architecture & Topology

To visualize DiffServ, imagine a large, multi-campus university network connecting several remote sites over an MPLS backbone provided by an ISP.

The Edge (Access Layer): The Complex Worker An IP phone, a security camera, and a student’s laptop all connect to an Access Switch in a remote building. The switch is the β€œDiffServ Edge Node.” It is configured with complex ACLs and NBAR to inspect the traffic. It marks the phone’s RTP stream with DSCP EF, the camera’s video stream with DSCP AF41, and the student’s web traffic with DSCP 0. This requires significant CPU overhead, but it only happens once per packet.

The Core (Distribution/Core/WAN): The Fast Mover The marked packets travel from the Access Switch up to the Distribution routers, the Core switches, and eventually the WAN edge router facing the MPLS cloud. These devices are β€œDiffServ Interior Nodes.” They are completely ignorant of ACLs or application types. Their configuration is simple:

  • If packet = EF, put it in the Priority Queue.
  • If packet = AF41, guarantee 10 Mbps.
  • If packet = 0, send it best-effort. Because they only read the 6-bit DSCP header, they can process millions of packets per second with virtually zero CPU strain, enabling massive scalability.

4. Command Execution & Deployment

Deploying a complete DiffServ architecture on Cisco IOS using MQC involves three major phases: Classification (Edge), Marking (Edge), and Queuing/Scheduling (Core/WAN).

Phase 1: Edge Classification and Marking (Ingress)

We classify incoming traffic and mark it with appropriate DSCP values.

enable
configure terminal

! 1. Classify traffic using ACLs
ip access-list extended VOICE-RTP
 permit udp any any range 16384 32767
ip access-list extended VIDEO-STREAM
 permit tcp any any eq 1935

! 2. Create Class Maps
class-map match-any VOICE-CLASS
 match access-group name VOICE-RTP
class-map match-any VIDEO-CLASS
 match access-group name VIDEO-STREAM

! 3. Create Policy Map to Mark traffic
policy-map EDGE-MARKING-POLICY
 class VOICE-CLASS
  set dscp ef
 class VIDEO-CLASS
  set dscp af41
 class class-default
  set dscp default

! 4. Apply inbound to the LAN-facing interface
interface GigabitEthernet0/1
 service-policy input EDGE-MARKING-POLICY
exit

Phase 2: Core/WAN Queuing and Scheduling (Egress)

Now, on the outbound WAN interface, we apply PHBs based purely on the marked DSCP values. Notice we do not use ACLs here.

! 1. Create Class Maps matching purely on DSCP (DiffServ Trust)
class-map match-any CORE-VOICE
 match dscp ef
class-map match-any CORE-VIDEO
 match dscp af41

! 2. Create Policy Map to dictate Per-Hop Behavior (LLQ/CBWFQ)
policy-map WAN-QUEUING-POLICY
 class CORE-VOICE
  ! Expedited Forwarding PHB: Strict Priority, policed to 5 Mbps
  priority 5000
 class CORE-VIDEO
  ! Assured Forwarding PHB: Guaranteed Bandwidth of 20 Mbps
  bandwidth 20000
 class class-default
  ! Default Forwarding PHB: Fair queue the rest
  fair-queue

! 3. Apply outbound to the WAN interface
interface GigabitEthernet0/0/0
 service-policy output WAN-QUEUING-POLICY
exit

5. Verification & Troubleshooting

Validating a DiffServ deployment requires confirming that traffic is being marked correctly at the edge and that the core is honoring those marks during congestion.

Verification Commands

  1. Verify Edge Marking:
EdgeRouter# show policy-map interface GigabitEthernet0/1 input

Look for pkts marked under the VOICE-CLASS and VIDEO-CLASS. If packets are matching but not being marked, check the set commands. If packets aren’t matching at all, troubleshoot your ACLs.

  1. Verify Core PHB/Queuing:
WANRouter# show policy-map interface GigabitEthernet0/0/0 output

This confirms that the WAN router is seeing the DSCP values and placing them into the correct hardware queues. Watch the queue-depth and drops counters during peak traffic hours.

Troubleshooting Scenarios

  • End-to-End DiffServ Failure: Users complain about choppy voice across the WAN. Your edge router is marking EF correctly, and your WAN router is prioritizing EF correctly, but the issue persists. Cause: The Service Provider (ISP) is not trusting your markings. Many ISPs strip customer DSCP markings at the provider edge (resetting them to 0) unless a specific QoS SLA is purchased. Verification: Run a packet capture at the remote branch receiving the traffic. If the IP headers show DSCP 0 instead of 46, the trust boundary has been broken by the transit provider.

6. Sandbox / Interactive Lab Context

Build a three-router topology to witness DiffServ in action across multiple hops.

Lab Setup:

  1. Connect R1 (Edge) -> R2 (Core) -> R3 (Remote Edge).
  2. Establish basic routing (OSPF or EIGRP) so all loopbacks can ping each other.

Task 1: The Edge Marker

  • On R1, configure an MQC policy inbound on a loopback interface (simulating a LAN).
  • Use an ACL to classify ICMP traffic and mark it with DSCP EF (46).

Task 2: The Core Queue

  • On R2, configure the egress interface facing R3 with a bottleneck bandwidth (e.g., bandwidth 1000 kbps).
  • Configure an LLQ policy on R2 that matches dscp ef and grants it strict priority. Apply this outbound towards R3.

Task 3: Validation across the DiffServ Domain

  • From R1, launch an extended ping to R3.
  • On R2, execute show policy-map interface. You should see the ICMP packets incrementing in the dscp ef class, proving that R2 trusted the mark applied by R1 and applied the correct PHB without needing to know that the traffic was ICMP.
  • Bonus: Flood the R2->R3 link with best-effort traffic using a traffic generator. Watch the pings remain stable, validating the DiffServ architecture under load.

πŸ§ͺ Want to practise this on your own computer? See how to set up your lab →

πŸ€–

Need clarification? Ask GT

Hi, I'm GT β€” your AI tutor for QoS Differentiated Services (DiffServ) Model. What would you like to know?
πŸ“

Knowledge Check

1 of 3

How does DiffServ scale QoS compared with IntServ/RSVP?

Report a problem

About: /lessons/qos-diffserv-model