DiffServ stands for "Differentiated Services" and is a model that signals the priority of the data packets. DiffServ is based on the Type of Service (ToS) field and uses the same byte in the IP header.
ToS uses the first three bits to denote the precedence of 0 to 7, and four more bits (the ToS bits) to optimize the data flow (including “low delay” and “high reliability”). This model is rather inflexible and has been little used in the past.
The DiffServ model uses the first 6 bits to distinguish different classes. This allows up to 64 differentiated services code points (DSCPs), which allow a finer prioritization of the data flow:
- To ensure backwards compatibility with the ToS implementation, the "Class Selectors" (CS0 to CS7) are used to map the former precedence levels. The level CS0 is also called "Best effort" (BE) and represents the normal transmission of data packets without special treatment.
- The "Assured Forwarding" (AF) classes are used for the certain transmission of data packets. The first digit of the AF class stands for the priority of the transmission (1 to 4), the second digit for "Drop Probability" (1 to 3). Packets marked with AFxx are "assured" of being transmitted and are not dropped.
With the class "Expedited Forwarding" marks those packets that are to be transmitted before all other packets (preferred).
Codepoint | DSCP bits | Dec. | Codepoint | DSCP bits | Dec. | Codepoint | DSCP bits | Dec. | ||
---|---|---|---|---|---|---|---|---|---|---|
CS0 (BE) | 000000 | 0 | AF11 | 001010 | 10 | AF33 | 011110 | 30 | ||
CS1 | 001000 | 8 | AF12 | 001100 | 12 | AF41 | 100010 | 34 | ||
CS2 | 010000 | 16 | AF13 | 001110 | 14 | AF42 | 100100 | 36 | ||
CS3 | 011000 | 24 | AF21 | 010010 | 18 | AF43 | 100110 | 38 | ||
CS4 | 100000 | 32 | AF22 | 010100 | 20 | EF | 101110 | 46 | ||
CS5 | 101000 | 40 | AF23 | 010110 | 22 | |||||
CS6 | 110000 | 48 | AF31 | 011010 | 26 | |||||
CS7 | 111000 | 56 | AF32 | 011100 | 28 |