The analysis COS&TOS of QOS
【QOS】:Quality of Service
【COS】:Class of Service
【TOS】:Type Of Service
【DSCP】:Differential Services Code Point
Strictly to say, Cos and Tos are just a mark mechanism of QoS. QoS range is too big, including the mark and classification of import data flow and rate limit, the congestion avoidance and congestion management of backbone network, network export queue scheduling mechanism and so on.
Cos is the priority mark of 802.1 Q (VLAN) data frame, 3 bits, range from 0 to 7; Suitable for the occasion that don't need ***yze Layer 3 header, and need guarantee QoS on the Layer 2 environment.
As shows in chart 1, 802.1 Q tag header with 4 bytes contains 2 bytes TPID (Tag Protocol Identifier, the value is 0x8100) and 2 bytes TCI (Tag Control Information), chart 2 shows the detailed content of 802.1 Q tag header.
Chart 1. The Ethernet frame with 802.1Q tag header
Chart 2. 802.1Q tag header
Why name this priority as 802.1q priority, because these priority application is detailed defined by 802.1q specification.
Tos is the service type mark of Layer 3 packet, the length is 1 byte. IP Precedence and DSCP respectively use the top 3 bit and 6 bit of TOS field. IP Precedence use 3 bit can define eight grades, as the priority tag, other 5 bits is usually not used, such as Delay, Throughput, Reliability and so on indicating characteristic. And RFC2474 redefine the IP message header ToS domain, called the DS domain, and DSCP priority use the first 6 bit (0 ~ 5 bit) of the domain which range from 0~63, last 2 bits (6, 7 bit) is remain bit. Chart 3 shows as follows:
Chart 3 DS domain
When implement QoS policy, Cos often make mapping mechanism between ToS or DSCP.