Macro 32 Ramblings

Mind Archive

IP Precedence, TOS & DSCP

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)XXXXXXX0
76543210
Differentiated Services (DS)XXXXXXXX

Interpretation of the TOS/DS Field

RFC791/RFC1349 Interpretation

BitsMeaning
7-5IP Precedence:

111Network Control
110Internetwork Control
101Critic/ECP
100Flash Override
011Flash
010Immediate
001Priority
000Routine
41 = Low Delay; 0 = Normal Delay
31 = High Throughput; 0 = Normal Throughput
21 = High Reliability; 0 = Normal Reliability
11 = Minimise monetary cost (RFC 1349)
0Must be 0

RFC 2474 (Differentiated Services) Interpretation

BitsMeaning
7-2DSCP
1-0ECN (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 NameDS Field ValueIP Precedence
BinaryDecimal
CS0000 00000
CS1001 00081
AF11001 010101
AF12001 100121
AF13001 110141
CS2010 000162
AF21010 010182
AF22010 100202
AF23010 110222
CS3011 000243
AF31011 010263
AF32011 100283
AF33011 110303
CS4100 000324
AF41100 010344
AF42100 100364
AF43100 110384
CS5101 000405
EF101 110465
CS6110 000486
CS7111 000567

CSClass Selector (RFC 2474)
AFxy Assured Forwarding (x=class, y=drop precedence) (RFC2597)
EFExpedited Forwarding (RFC 3246)

References