#

Monday, September 9, 2019

ToS, IP Precedence, Differentiated Services, DSCP Values & PHBs

In IP header, there is a special byte for QoS purposes. It was originally called the ToS (Type of Service) byte which is now called DS (Differentiated Services) field.

Back then, when there was this ToS byte, the 1st 3 bits were used to identify a defined traffic class which were called IP Precedence. Even today, DS field is also compatible with this legacy term which will be discussed soon in this post.

DS Field looks like the following..











6 bits out of 8 are used to set a value which is also called Code Points. These code points will affect the Per Hop Behavior (PHB) at each node. The idea behind the code point is that packets that are marked with a certain code point will get a certain QoS treatment.

Worth mentioning that even though the PHB has this word "behavior" in it's name, which feels like the router will start treating QoS automatically after it is marked, that's not how it is. We have to configure the QoS treatment as well.. 

Default PHB

DSCP value of 000000 which will be treated as "best effort"

Class Selector PHB

This is to match the IP Precedence values of the legacy systems. Here, 1st 3 bits are equal to the 1st 3 bits of the legacy ToS byte.

Class Selector Name DSCP value IP Precedence value IP Precedence name
Default / CS0 000000 000 Routine
CS1 001000 001 Priority
CS2 010000 010 Immediate
CS3 011000 011 Flash
CS4 100000 100 Flash Override
CS5 101000 101 Critic/Critical
CS6 110000 110 Internetwork Control
CS7 111000 111 Network Control

Assured Forwarding PHB

AF PHB is defined specially to compare the traffic when Queuing & Congestion Avoidance needs.

It is written as AFxy where x represents the queuing priority and y represents the drop priority.
x can range from 1 to 4, while y can range from 1 to 3.
x is also called the class because it uses the same 3 bits which is used in class selector PHB and y is also called the drop probability and it uses the other 3 bits in DS Field.

So the AF values are,
AF11, AF12, AF13, AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43

The idea is that AF43 has better queuing priority than AF11 as well as better drop probability which means in an event of congestion AF43 will get queued 1st and when the queue is full AF43 will be dropped 1st..

To convert from AF12, AF32 to decimal values use 8x+2y equation..
Ex:- AF12 = 12,  AF32 = 28

Expedited Forwarding PHB

This is where the real-time traffic like VoIP and video should be. EF PHB will normally put into the Priority Queue where they gets the minimum delay.
DSCP value for EF PHB is 101110 which equals to decimal 46

Following snippet shows the DSCP values which can be set by a Policy Map.


No comments:

Post a Comment