Differentiated Services
Reserving resources per flow on every router means state that grows with every conversation. DiffServ, RFC 2475, puts the decision in the packet instead: classify once at the edge, mark the DS field, and every node after reads the mark. Six bits of that octet are the DSCP, a selector for a per-hop behavior. To a core router a call is just a behavior aggregate: packets with one codepoint.
By Arif, founder of Daveth · Updated
The full 9 min walkthrough is in Daveth Pro (Network). See what the plan opens
What this page answers
What is DiffServ?
An architecture for scalable service differentiation: traffic is classified at the edge and marked in the DS field, and each node applies a per-hop behavior selected by the mark, so no per-flow state is kept in the core. Read it in “What it does instead”
How many bits is the DSCP?
Six bits of the DS field, the octet that replaced the IPv4 TOS octet and the IPv6 Traffic Class octet. The remaining two bits were a currently unused field. Read it in “The field”
What is a DiffServ per-hop behavior?
The externally observable forwarding treatment a DiffServ node applies to a behavior aggregate. A DSCP selects a PHB; it is not an instruction about how the device achieves it. Read it in “Codepoints and behaviors”
Why the core cannot remember you
Suppose you want a voice call treated well end to end. The obvious design reserves resources for it along the path: every router holds a record saying this flow gets this treatment. Now scale that to a core router carrying a hundred thousand conversations, each created and torn down as calls come and go. RFC 2475 says what that costs:
In the absence of state aggregation, the amount of state on each node scales in proportion to the number of concurrent reservations
That is the problem DiffServ exists to solve, and its answer is to stop the core remembering anything about you at all.
Notice what that does not fix. Different applications still want different treatment, and they are all still queueing for the same piece of copper. DiffServ adds no capacity. It decides who waits when the link is full, which is a different job entirely, and worth keeping straight from the first page.
What it does instead
This document defines an architecture for implementing scalable service differentiation in the Internet. This architecture achieves scalability by aggregating traffic classification state which is conveyed by means of IP-layer packet marking using the DS field
Read where the state goes. It is not stored in routers; it is carried in the packet. Decide once, at the edge, write the answer into the header, and every node after that reads the answer instead of working it out again. RFC 2475 on per-application flow or per-customer state:
forwarding state need not be maintained within the core of the network.
You have met this design before, at every counter that stamps your paperwork on the way in. Somebody at the entrance looks at your case properly once, writes a handling label on the front, and every desk after that acts on the label without re-opening the file. The expensive judgement happens at the door. The cheap reading happens everywhere else, and that is the only reason the building can process thousands of people a day.
Where it stops is the part worth remembering: no desk is obliged to have a procedure for your label at all. A stamp is not a promise, it never made anyone faster, and a desk that has never been told what your label means will simply serve you in the order you arrived. Everything in the rest of this lesson is about who applies the label and who agreed to honour it.
The field
A replacement header field, called the DS field, is defined, which is intended to supersede the existing definitions of the IPv4 TOS octet [RFC791] and the IPv6 Traffic Class octet [IPv6].
One octet, and the same octet in both protocols: a dual-stack design marks IPv4 and IPv6 with the same values. How many of its eight bits are the codepoint?
Six bits of the DS field are used as a codepoint (DSCP) to select the PHB a packet experiences at each node. A two-bit currently unused (CU) field is reserved and its definition and interpretation are outside the scope of this document.

Six bits, not eight. Counting all eight is an easy mistake, and it is why this lesson has a diagram. Look at the bottom row: it is the reason the old and new schemes can coexist, and it comes back below.
Codepoints and behaviors
Is a higher DSCP value better treatment? A codepoint is not an instruction. It is a selector:
Per-hop Behavior (PHB): a description of the externally observable forwarding treatment applied at a differentiated services-compliant node to a behavior aggregate.
Externally observable forwarding treatment. A PHB describes what you can see happening to packets, not how a device achieves it, so two implementations can reach the same PHB by different machinery.
Codepoint: a specific value of the DSCP portion of the DS field. Recommended codepoints SHOULD map to specific, standardized PHBs. Multiple codepoints MAY map to the same PHB.
Notice the last sentence: the mapping is many-to-one, and what a codepoint selects on a node is that node's configuration. So a DSCP is not a priority number. A higher value does not automatically get better treatment; it selects a different behavior, and what that behavior is depends on what each node has been told.
Say that a second way, because it is the claim people get wrong under pressure: a codepoint selects a behavior, it does not create one. Writing six bits into a header reserves no bandwidth, builds no queue and obliges nobody. Send that packet to a node that has no policy for the value you chose and the bits arrive perfectly intact, having changed nothing.
What the core actually sees
What is your voice call, to a router three hops away? RFC 2475 defines a behavior aggregate as
a collection of packets with the same DS codepoint crossing a link in a particular direction.
That is the architecture in one line. To an interior router your call is not a call; it is a member of a set of packets carrying the same six bits, in one direction, on one link.
So marking is only ever half of a design. The mark travels with the packet. The treatment lives in each node's configuration, one hop at a time, and a router that was never told what to do with your highest codepoint will forward it exactly like everything else.
Nodes within the DS domain select the forwarding behavior for packets based on their DS codepoint, mapping that value to one of the supported PHBs
Who does the work
The architecture divides nodes by position, not capability. A DS boundary node is
a DS node that connects one DS domain to a node either in another DS domain or in a domain that is not DS-capable.
and a DS interior node is
a DS node that is not a DS boundary node.
Boundary nodes do the expensive work; interior nodes read six bits. The boundary has two ways to classify:
The BA (Behavior Aggregate) Classifier classifies packets based on the DS codepoint only. The MF (Multi-Field) classifier selects packets based on the value of a combination of one or more header fields
The MF classifier is the expensive one (addresses, ports, protocol), and it is what you run at the edge when you cannot trust an existing marking. The BA classifier just reads the codepoint. That is the practical heart of QoS design: how far in do you keep classifying on many fields, and where do you start trusting the mark? Look at steps 1 to 3 of the walk: EDGE's table grows with every call, CORE1's never does.
Continue the lesson
The whole lesson, with its drawings and its questions. 5 more sections after the ones above.


