::: d q n e t w o r k s - :::
dq networks

IP Precedence, TOS & DSCP

The IP Type of Service Header Field

The Type of Service field in the IP header was originally defined in RFC 791. It defined a mechanism for assigning a priority to each IP packet as well as a mechanism to request specific treatment such as high throughput, high reliability or low latency.

In practice, only the IP Precedence part of the field was ever used. At its simplest, the higher the value of the IP Precedence field, the higher the priority of the IP packet. Simple...

In RFC 2474 the definition of this entire field was changed. It is now called the "DS" (Differentiated Services) field and the upper 6 bits contain a value called the "DSCP" (Differentiated Services Code Point). Since RFC 3168, the remaining two bits (the two least siginficant bits) are used for Explicit Congestion Notification.

The diagram below illustrates the relationship between the bits in the Type of Services/Differeniated Services field in the IP header:-

Type of Service (TOS) X X X X X X X 0
7 6 5 4 3 2 1 0
Differentiated Services (DS) X X X X X X X X

Interpretation of the TOS/DS Field


RFC791/RFC1349 Interpretation

Bits Meaning
7-5 IP Precedence:
111 Network Control
110 Internetwork Control
101 Critic/ECP
100 Flash Override
011 Flash
010 Immediate
001 Priority
000 Routine
4 1 = Low Delay; 0 = Normal Delay
3 1 = High Throughput; 0 = Normal Throughput
2 1 = High Reliability; 0 = Normal Reliability
1 1 = Minimise monetary cost (RFC 1349)
0 Must be 0

RFC 2474 (Differentiated Services) Interpretation

Bits Meaning
7-2 DSCP
1-0 ECN (Explicit Congestion Notification)

The DSCP

The most signficant three bits of the DSCP (corresponding directly to the IP Precedence) are referred to as the Class Selector.

DSCP <=> IP Precedence Conversion Table

DSCP Name DS Field Value IP Precedence
Binary Decimal
CS0 000 000 0 0
CS1 001 000 8 1
AF11 001 010 10 1
AF12 001 100 12 1
AF13 001 110 14 1
CS2 010 000 16 2
AF21 010 010 18 2
AF22 010 100 20 2
AF23 010 110 22 2
CS3 011 000 24 3
AF31 011 010 26 3
AF32 011 100 28 3
AF33 011 110 30 3
CS4 100 000 32 4
AF41 100 010 34 4
AF42 100 100 36 4
AF43 100 110 38 4
CS5 101 000 40 5
EF 101 110 46 5
CS6 110 000 48 6
CS7 111 000 56 7
CS Class Selector (RFC 2474)
AFxy Assured Forwarding (x=class, y=drop precedence) (RFC2597)
EF Expedited Forwarding (RFC 3246)

References