The Type of Service (ToS) is a field in the IPv4 header that was originally defined to specify the priority and quality of service for IP packets. The concept of ToS was introduced in 1981 to help manage network traffic and ensure that certain types of data receive appropriate handling based on their requirements.
The Type of Service (ToS) field in the IPv4 header was an early attempt to manage and prioritize network traffic based on predefined criteria such as delay, throughput, and reliability. Although largely replaced by the more flexible DSCP, understanding ToS provides insight into the evolution of network quality of service (QoS) mechanisms.
ToS Field Structure
The ToS field is an 8-bit byte in the IPv4 header, which is structured as follows:
- Bits 0-2: Precedence: These three bits are used to define the priority level of the packet. There are eight possible precedence levels, ranging from 000 (Routine) to 111 (Network Control).
- Bits 3: Delay: This bit indicates the desired delay level. A value of 0 means normal delay, while a value of 1 means low delay.
- Bits 4: Throughput: This bit indicates the desired throughput level. A value of 0 means normal throughput, while a value of 1 means high throughput.
- Bits 5: Reliability: This bit indicates the desired reliability level. A value of 0 means normal reliability, while a value of 1 means high reliability.
- Bits 6-7: Reserved: These bits are reserved for future use and are usually set to 0.
ToS Field Breakdown
- Precedence (3 bits):
- 000: Routine
- 001: Priority
- 010: Immediate
- 011: Flash
- 100: Flash Override
- 101: Critical
- 110: Internetwork Control
- 111: Network Control
- Delay (1 bit):
- 0: Normal delay
- 1: Low delay
- Throughput (1 bit):
- 0: Normal throughput
- 1: High throughput
- Reliability (1 bit):
- 0: Normal reliability
- 1: High reliability
Examples of ToS Usage
- Voice over IP (VoIP): VoIP packets might be marked with high precedence, low delay, high throughput, and high reliability to ensure clear and uninterrupted voice communication.
- File Transfer: A large file transfer might be marked with a normal delay and normal reliability but high throughput to ensure the file is transferred quickly.
Transition to DSCP
While ToS provided a way to classify and prioritize network traffic, it had limitations in terms of granularity and flexibility. This led to the development of the Differentiated Services (DiffServ) architecture and the introduction of the Differentiated Services Code Point (DSCP) in 1998.
DSCP uses the same 8-bit byte in the IP header, but it redefines the field to allow for 64 different values (6 bits for DSCP and 2 unused bits), providing more granular and flexible classification and prioritization of network traffic. For a better understanding take a closer look to DSCP, DiffServ and hexadecimal ToS values.
Protocol details can be found on IETF standard RFC1349 : Type of Service in the Internet Protocol Suite
