The Internetwork Protocol (IP) [RFC791 has defined a best effort network layer service for connecting computers to form a computer network. This original specification defined an IP header field, known as the "Type of Service" (ToS). This field is now used to carry the DSCP and ECN fields. (For historical reference the bottom of this page includes a description of this legacy method).
The DS field is 6-bits and used to assign one of 64 codepoints (DSCP). The field is carried as the upper 6-bits of a byte. The remainder of the byte carries the 2-bit ECN field. The most commonly used DSCP values are standardised. The values are defined in the IANA DSCP Registry. The default codepoint has the value 0 and denotes a best effort service. This mapping to "best effort" forwarding will be applied if network rules are not defined or the devices are non-DSCP compliant. A set of Class Selector (CS) codepoints have been defined. A set of Assured Forwarding (AF) codepoints have also been defined, using one of four AF classes and one of three drop precedence values. It also specifies other codepoints, such as the Expedited Forwarding (EF) codepoint, that has priority access to the link. An operator can also use one of the non-standard codepoints set aside by IANA to provide private operator-sepcific marking.
The Differentiated Services framework is defined in RFC 2474 and RFC 2475. This defines a set of network policies and rules for a network domain. A router reads the DSCP value in each received packet to classify the packet. Once the class has been determined, it is mapped to one of 64 possible forwarding behaviors known as Per Hop Behavior group (PHB group). Multiple DSCPs can be mapped to the same PHB group, but each PHB group has a queue in which the packets are stored prior to forwarding.
Each PHB provides a particular service level (capacity, queuing, and dropping decisions) in accordance with a network policy. The AF group allows packets to be preferentially discarded when a particular AF class is overloaded.
At the edges of a Differentiated Services domain, packets can be conditioned. That is they can be policed (dropped according to a policy), remarked (assigned to a different DSCP) or shaped (delayed with respect to other traffic). This happens at the network edge to enforce the required treatment across the domain. For example, a packet with an EF DSCP can be admission-controlled to protect the network from overload by excessive EF traffic. The DSCP value CS6 and CS7 could also be blocked at the edge, when an operator uses these classes for network control traffic.
Measurements in 2017 suggest it is safe to enable DSCP in enedpoints by setting a suitable value in the IP header. This is based on observations that packets are seldom dropped solely because a non-default DSCP was set. Applications though need to be aware that the DSCP they choose may (or may not) have an assigned PHB - that is the network could decide to ignore the DSCP value, or even to rest the field to another value.
An Ethernet LAN switch can implement multiple queues at layer 2. It can then offer priority to some classes of traffic by assigning these to an appropriate forwarding queue. To enable this packets are typically carried in frames with support for the Tag field. Specifications also exist for this mapping for a WiFi case enabling the DSCP to be used to set the priority in the WiFi layer 2 header. This is used, for example, to give preferential access to the wireless capacity for specifically marked traffic.
Type of Service (ToS) was an early Interent QoS method. The framework prioritized packets based on a hierarchy of different classes of traffic (following common practice in military networks). When these packets were sent on the network, the higher priority packets were transferred first.
The Internet Standards made IP Precedance marking using the ToS field historic in Dec 1988, and this method should no longer be used in the Internet. Measurements in 2017, showed a number of operators still use router configurations with ToS semantics.
The values for the standardised set of DSCP codepoints were chosen to be backwards compatible with the legacy ToS IP precedence bits; so non-DSCP compliant, ToS-enabled devices should not conflict with the DSCP mapping. However ToS configurations can remark parts of the DSCP field to zero, effectively changing the DSCP value. Since ToS methods use an 8-bit field, ToS remarking can not only disrupt the use of DSCP, it can also unhelpfully result in change to the ECN field (which re-used two bits of this 8-bit field).
|ToS Precdence Value||Description (Class)|
|4 (100)||Flash Override|
|6 (110)||Internet Control|
|7 (111)||Network Control|
J. Postel Internet Protocol.(STD0005) RFC791
IP Packet Header
IANA DSCP Registry
IP Packet Processing
Grossman, D., "New Terminology and Clarifications for Diffserv", RFC 3260, April 2002.
Nichols, K., Blake, S., Baker, F., and D. Black, "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", RFC 2474, December 1998.
Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., and W. Weiss, "An Architecture for Differentiated Service", RFC 2475, December 1998.
Heinanen, J., Baker, F., Weiss, W., and J. Wroclawski, "Assured Forwarding PHB Group", RFC 2597, June 1999.
Davie, B., Charny, A., Bennet, J., Benson, K., Le Boudec, J., Courtney, W., Davari, S., Firoiu, V., and D. Stiliadis, "An Expedited Forwarding PHB (Per-Hop Behavior)", RFC 3246, March 2002.