DiffServ

DSCP marking and per-hop behavior for scalable QoS implementation.

1. The Scalability Challenge of QoS

The evolution of Quality of Service (QoS) in IP networks has been driven by a fundamental trade-off between the strength of service guarantees and scalability. The earliest model, Best-Effort, is perfectly scalable but offers no guarantees. The subsequent Integrated Services (IntServ) model provides strong, per-flow, end-to-end guarantees using protocols like RSVP, but it suffers from a critical scalability problem. IntServ requires every router in the path to maintain state information for every single data flow, an approach that becomes unsustainable in large networks with millions of concurrent flows.

The architecture was developed specifically to address this challenge. It provides a highly scalable and manageable framework for implementing QoS by abandoning the complex per-flow state management of IntServ. Instead, DiffServ adopts a class-based approach. It aggregates traffic with similar QoS requirements into a small number of classes, and the network treats all packets within a class in the same manner. This moves the complexity to the edges of the network, allowing the core routers to remain simple, fast, and stateless.

2. The Core Components of the DiffServ Architecture

The DiffServ model is defined by a clear division of labor between the edge of the network (the DiffServ domain boundary) and the core. This is achieved through two key components: the DSCP field and Per-Hop Behaviors.

A. Packet Marking: The DSCP Field

The central mechanism for communication in DiffServ is the marking of packets. DiffServ repurposes the 8-bit Type of Service (ToS) field in the IPv4 header (and the corresponding Traffic Class field in IPv6) to create a new field called the Differentiated Services field.

  • Differentiated Services Code Point (DSCP): The first 6 bits of this field are defined as the . The DSCP value is a numerical code that represents the service class of the packet. The edge router sets this value when a packet enters the DiffServ-enabled network. All subsequent core routers simply read this value to determine how to handle the packet.
  • Explicit Congestion Notification (ECN): The last 2 bits of the Differentiated Services field are typically used for Explicit Congestion Notification, a mechanism for signaling congestion without dropping packets.

This act of marking is the only complex decision-making required. Once a packet is marked with a DSCP value, its fate within the network is sealed.

B. Per-Hop Behaviors (PHBs)

A is the specific treatment a core router applies to a packet based on its DSCP marking. A PHB is a description of the forwarding behavior a packet will receive at each "hop" (router) along its path. Importantly, the PHB is the externally observable behavior (e.g., "this packet experiences low delay"), not the specific internal implementation (e.g., "this packet goes into queue number 3"). This abstraction allows different router vendors to implement PHBs in their own way, as long as the resulting forwarding behavior is consistent.

The core routers do not need to analyze the packet's source, destination, or port numbers. Their job is incredibly simple:

  1. Look at the 6-bit DSCP value in the packet's IP header.
  2. Apply the corresponding, pre-configured PHB (which translates to a specific queueing and scheduling action).
  3. Forward the packet.

This stateless approach in the core is the key to DiffServ's scalability.

3. The DiffServ Network Boundary: Where Policy is Enforced

The boundary of a DiffServ network, typically at the edge router, is where all the traffic management intelligence resides. Devices at this boundary are responsible for conditioning incoming traffic to conform to the network's QoS policies. This process involves a set of tools known as traffic conditioners.

  • Classifier: The classifier is responsible for sorting incoming packets into traffic classes. It inspects various fields in the packet header, such as source/destination IP addresses, source/destination port numbers, and protocol type, to determine which service class the packet belongs to. For example, a classifier might be configured to identify all traffic to and from a specific VoIP server as belonging to the "Voice" class.
  • Marker: Once a packet has been classified, the marker (or re-marker) sets the DSCP field in the IP header to the value corresponding to that class. For example, all packets classified as "Voice" might be marked with the DSCP value for Expedited Forwarding.
  • Meter: The meter measures the rate of the classified traffic over time. It checks whether the traffic flow is conforming to a predefined traffic profile (e.g., an average rate and an allowed burst size).
  • Policer/Shaper: Based on the measurement from the meter, the policer or shaper takes action on packets that are out-of-profile (exceeding the agreed-upon rate). A policer will typically either drop the out-of-profile packets or re-mark them to a lower-priority DSCP value. A shaper, in contrast, will buffer the excess packets and delay them to smooth out the traffic flow.

4. Standardized Per-Hop Behaviors (PHBs)

The IETF has standardized several common PHBs to ensure interoperability between different vendors' equipment.

Default PHB (DE PHB) / Best-Effort

This is the baseline forwarding treatment and is backward-compatible with devices that do not support DiffServ. It is typically marked with a DSCP value of 0. Packets with this marking are given the standard best-effort service, meaning they are usually handled by a simple FIFO queue.

Expedited Forwarding (EF) PHB

The EF PHB (defined in RFC 3246) is designed to provide a "virtual leased line" service for critical, low-latency applications like Voice over IP.

  • Guarantee: It guarantees low delay, low jitter, and low packet loss.
  • Mechanism: Packets marked for EF are given absolute priority over all other traffic. In practice, this is almost always implemented using a strict .
  • DSCP Marking: The recommended DSCP value for EF traffic is 46 (binary `101110`).
  • Policing: It is crucial that EF traffic is strictly policed at the network edge to ensure its aggregate rate does not exceed a configured limit. This prevents the EF traffic itself from causing congestion and starving all other traffic classes.

Assured Forwarding (AF) PHB

The AF PHB (defined in RFC 2597) provides a more nuanced service, offering different levels of forwarding assurance. It is more flexible than the all-or-nothing approach of EF.

  • Classes and Drop Precedences: The AF model defines four independent AF classes (Class 1, 2, 3, and 4). Within each class, there are three drop precedences (Low, Medium, and High). This creates a grid of 12 possible treatments.
  • Mechanism: The AF class typically determines the bandwidth allocation for the traffic. A higher AF class (e.g., AF4x) is usually allocated more bandwidth than a lower class (e.g., AF1x). The drop precedence within a class is used by mechanisms. During congestion, packets with a higher drop precedence (e.g., AF13) will be discarded before packets with a lower drop precedence (e.g., AF11) within the same class.
  • DSCP Marking: The AF markings follow a pattern. The name is `AFcy`, where `c` is the class number (1-4) and `y` is the drop precedence (1=Low, 2=Medium, 3=High). The DSCP value is derived from this. For example, `AF21` (Class 2, Low Drop) corresponds to DSCP value 18 (binary `010010`), while `AF23` (Class 2, High Drop) corresponds to DSCP value 22 (binary `010110`).

Class Selector (CS) PHB

The Class Selector PHBs are a special set of DSCP values that are designed for backward compatibility with the older IP Precedence field. The first three bits of a CS value correspond to the old IP Precedence values, and the last three bits are zero. For example, IP Precedence 5 corresponds to Class Selector CS5, which has a DSCP value of 40 (binary `101000`).

5. The DiffServ Advantage

In summary, the Differentiated Services model provides a robust and powerful framework for delivering QoS in complex networks.

  • Scalability: By aggregating traffic into classes and keeping core routers simple and stateless, DiffServ scales effortlessly to the size of the global internet.
  • Flexibility: The combination of classification, marking, and various PHBs provides a flexible toolkit that network administrators can use to implement a wide range of QoS policies tailored to their specific needs.
  • Interoperability: The use of a standardized field (DSCP) in the IP header ensures that QoS policies can be consistently applied across a multi-vendor network environment.

While it may not offer the absolute, mathematical guarantees of the IntServ model, its practical scalability and effectiveness have made DiffServ the dominant and indispensable architecture for implementing Quality of Service in today's IP networks.

    DiffServ | Teleinf Edu