1. Scalability of QoS mechanisms
QoS models in IP networks differ in the strength of their guarantees and in the amount of state kept by network devices. The Best-Effort model scales easily because it does not reserve resources for individual flows. Integrated Services (IntServ) uses signaling, such as RSVP, and keeps reservation state for individual flows. Every router on the path must then store information about those flows, which makes IntServ difficult to deploy in networks with a large number of concurrent flows.
The architecture addresses this problem by aggregating traffic into classes. Traffic with similar requirements receives a common marking, and nodes in the domain apply a defined behavior to that class. Classification and conditioning usually take place at the domain boundary, while the core does not need state for every application flow. The design limits core-device state without removing traffic-management rules.
2. Core components of the DiffServ architecture
The DiffServ model separates work between domain-boundary nodes and interior nodes. Boundary nodes classify and condition traffic, while interior nodes select a Per-Hop Behavior (PHB) from the DS field. The DSCP field and the PHB set describe this division.
A. Packet Marking: The DSCP Field
The DS field superseded earlier definitions of the 8-bit Type of Service (ToS) octet in the IPv4 header and the Traffic Class octet in IPv6. Six bits form the DSCP, while RFC 2474 marked the remaining two bits as CU. RFC 3168 used those two bits for the ECN 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. A boundary node sets this value when a packet enters the DiffServ domain. Interior nodes read it to determine how to handle the packet.
- Explicit Congestion Notification (ECN): The last two bits of the DS field form the ECN field. ECT(0) and ECT(1) indicate an ECN-capable transport, while CE indicates congestion. A router can set CE instead of dropping a packet when the transport and devices on the path support ECN.
A DSCP marking selects a PHB through the mapping used by a domain. A boundary node can change the marking, and a conditioner can meter, shape, or drop traffic according to a profile. The DS field does not replace the domain's policy.
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. The PHB describes externally observable behavior, such as low packet delay, and does not mandate a specific internal implementation, such as 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.
An interior node using a BA classifier does not need to analyze the packet's source, destination, or port numbers again. It can perform the following steps:
- Look at the 6-bit DSCP value in the packet's IP header.
- Apply the corresponding, pre-configured PHB (which translates to a specific queueing and scheduling action).
- Forward the packet.
Limiting per-flow state in the core supports DiffServ scalability.
3. The DiffServ Network Boundary: Where Policy is Enforced
The boundary of a DiffServ network, typically at an edge router, is where much of the traffic classification and conditioning takes place. Boundary devices condition incoming traffic to conform to the domain's QoS policies. A traffic conditioner can include a classifier, meter, marker, shaper, or dropper.
- 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 defined common PHBs so that equipment from different vendors can use compatible DSCP mappings and forwarding behaviors.
Default Forwarding (DF PHB) / Best-Effort
This is the baseline forwarding treatment for ordinary traffic. It is commonly selected with DSCP 0. RFC 2474 does not mandate a queueing algorithm, so an implementation can use FIFO or another mechanism consistent with local policy.
Expedited Forwarding (EF) PHB
The EF PHB, defined in RFC 3246, describes treatment for traffic requiring low delay, low jitter, and low packet loss. Its service model resembles a virtual leased line and can be used by Voice over IP.
- Properties: EF specifies treatment with low delay, jitter, and loss when traffic conforms to its profile and the required resources are available.
- Mechanism: A strict is one implementation of EF. The PHB specifies an observable forwarding rate and does not mandate one scheduling algorithm.
- DSCP Marking: The recommended DSCP value for EF traffic is 46 (binary
101110). - Policing: EF traffic should be policed at the domain edge so that its aggregate rate does not exceed a configured limit. This limits the risk of congestion and starvation of other traffic classes.
Assured Forwarding (AF) PHB
The AF PHB, defined in RFC 2597, organizes traffic into four classes and drop-precedence levels. This structure lets a domain define different resource-allocation and congestion policies.
- 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 can be used for bandwidth allocation according to the domain's policy. RFC 2597 leaves that allocation to network configuration. The drop precedence within a class can be used by mechanisms. During congestion, packets with higher drop precedence, such as AF13, are discarded before packets with lower drop precedence, such as AF11, within the same class.
- DSCP Marking: The AF markings follow a pattern. The name is
AFcy, wherecis the class number (1-4) andyis 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 (binary010010), whileAF23(Class 2, High Drop) corresponds to DSCP value 22 (binary010110).
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. Applying the DiffServ model
The Differentiated Services model places classification and conditioning at the domain boundary and applies PHBs to traffic aggregates at interior nodes.
- Scalability: Aggregating traffic into classes limits the state required in core routers. This allows the model to operate in large domains where the number of flows exceeds the practicality of separate reservations.
- 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 standardized DSCP field lets equipment from different vendors select PHBs when domains agree on codepoint mappings and conditioning rules.
DiffServ uses class aggregation and PHBs to simplify differentiated forwarding in large IP networks. It does not provide the mathematical guarantees of an IntServ guaranteed service.