Layer 3 QoS Classification with DSCP

From the beginning, IP packets have always had a type of service (ToS) byte that can be used to mark packets. This byte is divided into a 3-bit IP Precedence value and a 4-bit ToS value. This offers a rather limited mechanism for QoS because only the 3 bits of IP Precedence are used to describe the per-hop QoS behavior.

The DiffServ model keeps the existing IP ToS byte but uses it in a more scalable fashion. This byte also is referred to as the Differentiated Services (DS) field, with a different format, as shown in Figure 14-3. The 6-bit DS value is known as the Differentiated Service Code Point (DSCP) and is the one value that is examined by any DiffServ network device.

Don't be confused by the dual QoS terminology—the ToS and DS bytes are the same, occupying the same location in the IP header. Only the names are different, along with the way the value is interpreted. In fact, the DSCP bits have been arranged to be backward compatible with the IP precedence bits so that a non-DiffServ device still can interpret some QoS information.

Figure 14-3 ToS and DSCP Byte Formats

To S Byte:

P2

P1

P0

T3

T2

T1

T0

Zero

DS Byte:

DS5

DS4

DS3

DS2

DS1

DS0

ECN1

ECN0

(Class Selector)

(Drop Precedence)

The DSCP value is divided into a 3-bit class selector and a 3-bit Drop Precedence value. Refer to Table 14-4 to see how the IP precedence, DSCP per-hop behavior, and DSCP codepoint names and numbers relate.

Table 14-4 Mapping of IP Precedence and DSCP Fields

IP Precedence (3 Bits)

DSCP (6 Bits)

Name

Value

Bits

Per-Hop Behavior

Precedence

Codepoint Name

DSCP Bits (Decimal)

Routine

0

000

Default

Default

000 000 (0)

Priority

1

001

AF

1

1: Low

AF11

001 010 (10)

2: Medium

AF12

001 100 (12)

3: High

AF13

001 110 (14)

Immediate

2

010

AF

2

1: Low

AF21

010 010 (18)

2: Medium

AF22

010 100 (20)

3: High

AF23

010 110 (22)

Table 14-4 Mapping of IP Precedence and DSCP Fields (Continued)

IP Precedence (3 Bits)

DSCP (6 Bits)

Name

Value

Bits

Per-Hop Behavior

Precedence

Codepoint Name

DSCP Bits (Decimal)

Flash

3

011

AF

3

1: Low

AF31

011 010 (26)

2: Medium

AF32

011 100 (28)

3: High

AF33

011 110 (30)

Flash Override

4

100

AF

4

1: Low

AF41

100 010 (34)

2: Medium

AF42

100 100 (36)

3: High

AF43

100 110 (38)

Critical

5

101

EF

(46)*

Internetwork Control

6

110

(48-55)

Network Control

7

111

(56-63)

*IP precedence value 5 (DSCP EF) corresponds to the range of DSCP bits 101000 through 101111, or 40-47. However, only the value 101110 or 46 is commonly used and is given the EF designation.

*IP precedence value 5 (DSCP EF) corresponds to the range of DSCP bits 101000 through 101111, or 40-47. However, only the value 101110 or 46 is commonly used and is given the EF designation.

The three class selector bits (DS5 through DS3) coarsely classify packets into one of seven classes:

■ Class 0, the default class, offers only best-effort forwarding.

■ Classes 1 through 4 are called Assured Forwarding (AF) service levels. Higher AF class numbers indicate the presence of higher-priority traffic.

Packets in the AF classes can be dropped, if necessary, with the lower-class numbers the most likely to be dropped. For example, packets with AF Class 4 will be delivered in preference to packets with AF Class 3.

■ Class 5 is known as Expedited Forwarding (EF), with those packets given premium service. EF is the least likely to be dropped, so it always is reserved for time-critical data such as voice traffic.

■ Classes 6 and 7 are called Internetwork Control and Network Control, respectively, and are set aside for network control traffic. Usually, routers and switches use these classes for things such as the Spanning Tree Protocol and routing protocols. This ensures timely delivery of the packets that keep the network stable and operational.

Each class represented in the DSCP also has three levels of drop precedence, contained in bits DS2 through DS0 (DS0 is always zero):

Within a class, packets marked with a higher drop precedence have the potential for being dropped before those with a lower value. In other words, a lower drop precedence value gives better service. This gives finer granularity to the decision of what packets to drop when necessary.

TIP The DSCP value can be given as a codepoint name, with the class selector providing the two letters and a number followed by the drop precedence number. For example, class AF Level 2 with drop precedence 1 (low) is written as AF21. The DSCP commonly is given as a decimal value. For AF21, the decimal value is 18. The relationship is confusing, and Table 14-2 should be a handy aid.

You should try to remember a few codepoint names and numbers. Some common values are EF (46) and most of the classes with low drop precedences: AF41 (34), AF31 (26), AF21 (18), and AF11 (10). Naturally, the default DSCP has no name (0).

Was this article helpful?

+1 0

Post a comment