When packets travel through a network, they are assigned a forwarding behavior – what is known in the tech world as per hop behaviors, or PHBs. This type of traffic management is known as differentiated services, or DiffServ. DiffServ uses a 6-bit code that is used for classification in the process. This code is known as the Differentiated Services Code Point, or DSCP.
Understanding DiffServ
Sound confusing? It can be. But an easy way to begin understanding this networking concept is to break down what DiffServ really does, and that can be done using an analogy. Imagine that you are planning a trip. You can select from several different modes of transportation. Depending on your itinerary, budget, degree of comfort, and other criteria, you opt to choose one type of transportation. For example, you’re planning a cross-country trip. Taking a plane is the most logical option. If you’re traveling a few hundred miles and you’re on a tight budget, you’d likely drive your own vehicle, take a bus, or use another more affordable mode of transportation. DiffServ works much in the same way.
When packets are transmitted through a network, each is marked with a value that tells routers how to forward it. Because DSCP is 6 bits, there are 64 possible values (0-63). Each value maps to a per-hop behavior (PHB) - essentially the priority and handling a given flow of packets should receive at each router along the path.
What is DSCP?
These behaviors are signaled using the DS (Differentiated Services) field of the IP header. The 6-bit DSCP value lives in that field; the remaining 2 bits are used for Explicit Congestion Notification (ECN).
Although there are 64 possible values, only a handful of standardized PHBs are commonly used: Default, Expedited Forwarding, Assured Forwarding, and Class Selector.
- Default (DSCP 0) - best-effort forwarding. This is the only required PHB and is what untagged traffic gets.
- Expedited Forwarding (EF, DSCP 46) - low loss, low delay, and low jitter, ideal for voice, video, and other real-time services.
- Assured Forwarding (AF) - a set of values (such as AF11 through AF43) that assure delivery as long as traffic stays within its subscribed rate.
- Class Selector (CS0 through CS7) - values that map to the older IP Precedence levels, used to mark priority traffic.
There are other classifications, but these cover the cases you’ll encounter most often.