Layer 3 Marking for QoS
IP packets are classified for QoS in the Type of Service (ToS) byte, the original method of marking was with IP Precedence (IPP), its defined in the early RFC791. The 3 high order bits were used to define the precedence and their meanings are summarized in the table below;
| Value | Binary | Precedence |
|---|---|---|
| 0 | 000 | Routine |
| 1 | 001 | Priority |
| 2 | 010 | Immediate |
| 3 | 011 | Flash |
| 4 | 100 | Flash Override |
| 5 | 101 | CRITIC/ECP |
| 6 | 110 | Internetwork Control |
| 7 | 111 | Network Control |
The next 3 bits after the precedence were flags in bit order for Delay, throughput, and reliability, where if they were set to 1 would request either low delay, low throughput or low reliability. The final 2 low order bits were reserved.
Then along came Differentiated Services (DiffServ) with RFC2475, which needed more than 3 bits to correctly classify the information so the upper 6 bits in the ToS byte were replaced with Differentiated Services Code Point (DSCP), and the lower 2 bits used for QoS Explicit Congestion Notification (ECN). The DSCP and associated actions are termed Per Hop Behavior (PHB).
There are 4 main types of PHB, ill go through each one in turn.
Default PHB – This is for traffic that does not meet the other criterion and is essentially a best effort method of forwarding. The DSCP value to request this is 000000.
Expedited Forwarding (EF) – Expedited forwarding if a fancy term for getting that packet across the network as quickly as possible, the EF queue is usually policed to ensure that the queue does not utilize to much bandwidth and starve other queues.
Assured Forwarding (AF) – Assured forwarding has 4 classes of of queuing priority and 3 drop priorities, AF classes are represented in the format AF(1-4)(1-3) eg AF41 represents a class with a high priority and a low drop probability.
This 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 |
Class Selector PHBs – This is for backwards compatibility with IPP, each Class Selector is equivalent to the binary value of the 3 precedence bits eg CS0 is 000, and CS7 is 111
