Hi Everyone,
Let's have a brief introduction about TOS and their types of service.
What is QoS?
Massive developments in the field of telecommunication & boom in the world of internet has given birth to many products and services built upon IP network. In addition to internet connectivity, Over the Top Apps (OTTs) and VoIP has joined the mainstream as well. This has put a huge pressure on Bandwidth. Quality of Service (QoS) is a mechanism through which various types of traffics can be identified and priority can be set for each traffic for enhances user experience. This identification of traffic can be done with IP packet header, Deep packet Inspection (DPI) tools or more advanced algorithms of Machine Learning (ML). With the help of these technologies, bandwidth optimization is achieved and in case of any happening situation, most important traffic is given priority of access to a specific user. To cut it short, QoS is a way to divide the bandwidth in terms of traffic category to optimize the bandwidth and ensure user satisfaction as per user priority.

Introduction to IPv4 Packet header:
For understanding & implementation of QoS, understanding of IPv4 headers is imperative. Packet header performs the same function for the data as an envelope does for the letter. It carries comprehensive information about the routing of data. IPv4 header is part of a packet that consists on header, body and trailer. IPv4 header is 32 bits long and contains 20 byte of data. This data is about the usage, source & destinations of the IPs. More precisely, an IPv4 header holds the information about the version (four bits), , Type of Service (TOS), Internet header length datagram size, data identification, Flags, Time to Live (TLL), Header Checksum, Padding, Source address, destination address and, last but not the least, Options packet header.

Overview of TOS Field:
TOS is a field in the IPv4 header that is used for QoS for the resolution of network congestion and ensuring quality data transmission to and from the end user. TOS if 8 bit long and further divided into three sections. The first section of 8 bits long TOS is called Precedence. Precedence is 3 bits long and defines the priority in a range of 0-7 (Zero being the lowest priority and 7 being the highest priority). Default tag value is kept at lowest priority, whereas, network control or routing control is assigned highest priority.

The TOS bits under the Type of Service Header are three bits long. Each bit has its own specific function to perform. These bits are names as D, T & R. D is for delay. 0 is assigned for a normal delay, whereas, 1 is assigned for low delay. T is for throughput, 0 depicts a normal throughput and 1 depicts high throughput. Lastly, R bit refers to reliability. 0 value of R means normal reliability, on the other hand, 1 values mean high reliability. The third section in TOS header is MBZ. MBZ is two bits long and reserved for use in future.
The first 6 bits, that are called DSCP (Differentiated Services Code Point), are used to set or identify the QoS Priority. RFC1349, RFC 2474 and RFC-1122 are relevant references that define the TOS Field and functionality of each of bits in detail.
Thank You for reading.
