Type Of Service
   HOME

TheInfoList



OR:

The type of service (ToS) field is the second byte of the
IPv4 Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
header. It has had various purposes over the years, and has been defined in different ways by five RFCs. Prior to the redefinition, the ToS field could specify a datagram's priority and request a route for low-latency, high-throughput, or highly-reliable service. Based on these ToS values, a packet would be placed in a prioritized outgoing queue, or take a route with appropriate latency, throughput, or reliability. In practice, the ToS field never saw widespread use outside of
US Department of Defense The United States Department of Defense (DoD, USDOD, or DOD) is an executive department of the U.S. federal government charged with coordinating and supervising the six U.S. armed services: the Army, Navy, Marines, Air Force, Space Force, ...
networks. However, a great deal of experimental, research, and deployment work has focused on how to make use of these eight bits, resulting in the current DS field definition. The modern redefinition of the ToS field (as well as the ''Traffic Class'' field in
IPv6 packet An IPv6 packet is the smallest message entity exchanged using Internet Protocol version 6 (IPv6). Packets consist of control information for addressing and routing and a payload of user data. The control information in IPv6 packets is subdivided ...
s) splits this byte into a 6-bit
Differentiated Services Differentiated services or DiffServ is a computer networking architecture that specifies a mechanism for classifying and managing network traffic and providing quality of service (QoS) on modern IP networks. DiffServ can, for example, be used t ...
(DS) field and a 2-bit
Explicit Congestion Notification Explicit Congestion Notification (ECN) is an extension to the Internet Protocol and to the Transmission Control Protocol and is defined in (2001). ECN allows end-to-end notification of network congestion without dropping packets. ECN is an optio ...
(ECN) field. While Differentiated Services is somewhat backwards compatible with ToS, ECN is not.


History

The Type of Service field in the IP header was originally defined in RFC 791, and has been interpreted for ''IP Precedence'' and ''ToS'' ever since. The definition was largely derived from a US DoD Specification JANAP-128, which defines message multilevel precedence and preemption. It defined a mechanism for assigning a precedence to each IP packet, as well as a mechanism to request specific treatment such as high throughput, high reliability or low latency, etc. In the RFC 1349 update, the Monetary Cost bit is introduced (this bit was previously marked "Reserved for Future Use"). Section 2.4 of RFC 1583 (OSPFv2) introduces a ToS-aware routing method. In practice, only the IP Precedence part of the field was ever used outside US DoD networks: the higher the value of the IP Precedence field, the higher the priority of the IP packet. Some US DoD networks did use the delay bit for route selection between oceanic cable paths and Satellite Communication (SATCOM) paths when both paths existed. IPv6 has never had an IPv4-like "traditional" ToS field, partially because the authors were aware of DiffServ efforts at its drafting (RFC 2460 Section 7). In RFC 2474 the definition of this entire field was changed. It is now called the "DS" (Differentiated Services, "DiffServ") field and the upper 6 bits contain a value called the "DSCP" (Differentiated Services Code Point). The upper 3 bits of DS maintains compatibility with IP Precedence. Since RFC 3168, the remaining two bits (the two least significant bits) are used for Explicit Congestion Notification. RFC 8622 added lower-effort (LE) DS for traffic that may be pre-empted by other traffic (best-effort traffic). It is intended for background traffic of low precedence, such as bulk data transfers with low priority in time.


Allocation


Precedence and ToS

Prior to its deprecation, the Type of Service field was defined as follows from RFC 791: Precedence was a 3 bit field which treats high priority packets as more important than other packets. If a router is congested and needs to discard some packets, it will discard packets having lowest priority first. Although precedence field was part of IP version 4, it was never used. RFC 1349 introduced an additional "lowcost" field. The four available ToS bits now becomes: The naming here follows the convention of
Unix operating system Unix (, ; trademarked as UNIX) is a family of Computer multitasking, multitasking, multi-user software, multi-user computer operating systems that derive from the original AT&T Corporation, AT&T Unix, whose development started in 1969 at the ...
s. RFC 1349 and RFC 1060 only show examples of one bit used at a time for application-default values, although RFC 791 mentions that at most two of the three indications it has should be set nominally. One such use is known from mod_iptos. Because the last three bits went through many definitions prior to RFC 2474 (see below), documentation and implementations may be confusing and contradictory.


DSCP and ECN

RFC 2474 (which was released in December 1998) reserved the first six bits of the DS (or IPv4 ToS) field for the Differentiated Services Code Point (DSCP), and RFC 3168 reserved the last two bits for
Explicit Congestion Notification Explicit Congestion Notification (ECN) is an extension to the Internet Protocol and to the Transmission Control Protocol and is defined in (2001). ECN allows end-to-end notification of network congestion without dropping packets. ECN is an optio ...
. DSCP defines a Class Selector (CS) naming to each value it defines, mirroring what would have been interpreted as the IP Precedence if one follows the older specification: DSCP Nomenclature: ;CS: Class Selector (RFC 2474) ;AFxy: Assured Forwarding (x=class, y=drop precedence) (RFC 2597) ;EF: Expedited Forwarding (RFC 3246) ;LE: Lower-Effort (RFC 8622) The above table, with individual values written out for values of the entire ToS field (not to be confused with the little-used 5-bit part): Note: In the above table, ToS is shown in decimal format. However, many routers express ToS in hex format.


Example: mixed interpretation

Let's start with an IP precedence of 1, or 001 in binary. The entire ToS field would then be 001 00000, assuming that the unused 5 bits are zero. The DSCP can be interpreted by resegmenting to 001000 00, where 001000 = 8 is the DSCP value, corresponding to CS1.


Software support

Although not frequently used, IP ToS definitions are widely found in netinet/ip.h of
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
or
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
operating systems as IPTOS_FIELDNAME macros. The "lowcost" field is commented out in OpenBSD due to its newer use for indicating ECN support. Remnants of the old RFC 1349 terminology can be found in
Transmission Transmission or transmit may refer to: Science and technology * Power transmission ** Electric power transmission ** Transmission (mechanical device), technology that allows controlled application of power *** Automatic transmission *** Manual tra ...
2.93 as well as other tools that support setting this field. An old
Apache The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
module "mod_iptos", once packaged in
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
, notes that a way to use multiple RFC 1349 option bits together emerged after some point.


See also

* Class of service *
Quality of service Quality of service (QoS) is the description or measurement of the overall performance of a service, such as a telephony or computer network, or a cloud computing service, particularly the performance seen by the users of the network. To quantitat ...
*
Explicit Congestion Notification Explicit Congestion Notification (ECN) is an extension to the Internet Protocol and to the Transmission Control Protocol and is defined in (2001). ECN allows end-to-end notification of network congestion without dropping packets. ECN is an optio ...


References


Further reading

* {{cite book , title=Deploying IP and MPLS QoS for Multiservice Networks: Theory and Practice , author=John Evans, Clarence Filsfils , publisher=Morgan Kaufmann , year=2007 , ISBN=978-0123705495


External links


Linux Advanced Routing & Traffic Control. How to set ToS byte via IPChains


Internet terminology