Classification & Marking for QoS

Posted by Bradley | QoS | Tuesday 29 July 2008 16:49

To improve performance of network devices packets should be marked as close to the source of the traffic, all network devices can then make decisions based upon those markings and do not need to reclassify or remark the traffic.

ToS Byte & IPP

RFC 791 defines the ToS (Type of Service) byte for “internet service quality selection”, thats QoS to you and me. The ToS byte initially used the first 3 bits to define the IP Precedence (IPP), the remaining bits where defined (except for the final bit) but rarely used.

Differentiated Services

Later on a standards were created for Differentiated Services (DiffServ), it went a little further and defined what each hop should do with the packet called Per Hop Behavior (PHB). The standard renamed the first 6 bits of the ToS byte to Differentiated Services Code Point (DSCP). The DSCP was used it for the selection of class in DiffServ, the first 3 bits are used for backwards compatibility with IPP. The final 2 bits were not defined but later used for Explicit Congestion Notification (apparently Vista is the first desktop OS which incorporates support for the ECN bits, but I don’t have a source for that info and its just hear say).

Please see the table below for the binary values of IPP/DSCP and the DSCP Class Selector values compared to the IPP names.

IPP Name IPP Binary DSCP Name
Routine 000 CS0 / “Default”
Priority 001 CS1
Immediate 010 CS2
Flash 011 CS3
Flash Override 100 CS4
Critical 101 CS5
Internetwork Control 110 CS6
Network Control 111 CS7

Assured Forwarding

Assured Forwarding (AF) is very common today, it defines the 6 DSCP bits to be used into 12 values. The 12 values for AF allows for 4 classes and 3 levels of drop probability for each class. AF DSCPs are shorted to the following format AFxy, x defines which queue and y defines the drop probability.

This handy table is from Page 410, of CCIE Routing & Switching 3rd Edition from Cisco Press;

Queue Class Low Drop Probability Medium Drop Probability High Drop Probability
Name/Decimal/Binary Name/Decimal/Binary Name/Decimal/Binary
1 AF11 / 10 / 001010 AF12 / 12 / 001100 AF13 / 14 / 001110
2 AF21 / 11 / 010010 AF22 / 20 / 010100 AF23 / 22 / 010110
3 AF31 / 26 / 011010 AF32 / 28 / 011100 AF33 / 30 / 011110
4 AF41 / 34 / 100010 AF42 / 36 / 100100 AF43 / 38 / 100110

Its really easy to turn the binary into the the AFxy format once you realise that the first 3 bits are for class and the final 3 bits in the DSCP field are are drop probability.

I have just gone through some of the methods of marking IP packets but not in that much detail, there are of course many other methods of marking traffic such as with the Discard Eligible (DE) bit in Frame Relay, Cell Loss Priority (CLP) in ATM, the MPLS Experiential bits, & CoS in the trunking headers.