QoS Marking- Confusion lifted

QoS Marking- Confusion lifted

This is a short overview QoS marking used in provision of network QoS. The purpose of this article is to try and remove confusions regarding QoS marking at layer 2 and layer 3 by explaining it in simple terms.

QoS markings can be done on both layer 2 (both access and trunk traffic) and layer 3 (on IP packets) Some work and standardization has been done to keep these markings uniform across the network, however, some more provision is also done on layer 3 to provide a more granular structure of QoS marking.

Let's us start with layer 2 QoS marking

Layer 2 QoS Marking

Layer 2 traffic would be of two types. Traffic in trunk with 802.1q header and access traffic without 802.1q.

802.1q Trunk marking

802.1q tag on layer 2 header adds 4 bytes to the header to provide with a VLAN ID. Out of those 4 bytes, 3 bits are called 'Priority bits (PRI)'. These bits provide 8 combinations (2^3) and they are termed as CoS (Class of Service) tags. It means we have 0 to 7 markings available now to mark the traffic and treat it on devices. However, Cisco says that we should keep class 6 and 7 reserved for the network protocol traffic. Hence, we can only use number from 0 to 5.

These markings are termed as COS0 to COS7 classes. COS-0 is termed as default class or best effort class, which simply means it has the lowest priority in traffic.

No alt text provided for this image

802.1p access traffic marking

However, what if traffic is not in a trunk and coming from a device, and you want that device to set the marking of the traffic it is originating. In that case, you need a device that is enabled with 802.1p marking. 802.1p tag is similar to 802.1q tag (4bytes), it will set the PRI value according to CoS marking and leave the VLAN ID as all zeroes.

Layer 3 - IP traffic marking

Layer 2 markings are lost when the packet moves from hop to hop and L2 header keeps changing. Hence, QoS marking on layer 3 can help as it can go all the way through the path.

IPv4 packet header has a field called 'Type of Service (TOS)'. It is a 8 bit field. These 8 bits are used in QoS toolkit. IPv6 has a similar 8 bit field called 'Traffic Class'.

IPv4  header with TOS field and IPv6 header with Traffic Class field.

There are two models of marking the traffic.

  1. IP Precedence (uses only 3 bits for marking)
  2. DSCP (uses 6 bits for marking)

IP Precedence

IP precedence uses first (left or most significant) 3 bits of those 8 bits TOS field to provide classes exactly like COS of layer 2 header. Some devices simply translate that COS field from the layer 2 header into IP precedence bit by bit. Rest of the bits in the TOS field are set as zero or ignored.

Differentiated Services Control Point

However, both COS and IPP are using only 3 bits of the TOS field not providing enough classes and granularity. That is where DSCP marking is used which takes 6 first (left or most significant bits) of the TOS field. This provides us with 64 possible markings of traffic from 0 to 63 in decimal. Now these are way too many values for marking. Hence, IETF came up with a standard use of DSCP marking by introducing 21 preselected values. These markings are referred to as PHB (Per Hop Behavior) markings. These markings are given names for our easy understanding and coordination. Note that the last bit of these six bits is always set to zero in any of the markings.

No alt text provided for this image


These classes are

  1. Default-class 0 (000 000)- This is equivalent to the COS0 class, which means default or best effort class.
  2. EF - 46 (101 110)- Explicit forwarding class is reserved for the most important delay sensitive traffic which is usually voice. EF class is usually mapped to Priority Queue which is serviced completely before any other queues.
  3. CS-1 to 7- Class selector values use 3 most significant bits of the 6 bits while other bits are set to zero. Which means CS1 is 001000 and class 7 is 111 000 in binary. CS0 is not used as it is similar to default class. CS is similar to IP precedence and can be used to map COS marking bit by bit. Hence, CS model can be used where some routers on the path are only configured to work on IP precedence.
  4. AF (Assured Forwarding)- Assured forwarding use 5 bits instead of 3 and provide something called 'drop preference or precedence' in addition to class. There are 4 classes and 3 drop probabilities. Drop probability tells the queue congestion avoidance tool (like RED or WRED) to drop the traffic with highest drop precedence, then medium and then low probability. Important point to note here is that WRED will drop the traffic with high drop precedence even it belongs to a higher class before dropping a packet from a lower assured forwarding class with lower drop precedence. In AF naming structure, the last bit of 6 bits is always zero, the first 3 bits indicates the first of AF class number, while remaining two bits maps to the second number of class. First digit thus tell the class ID, while second digit tells the drop precedence. A higher second digit means higher chances of getting dropped.
No alt text provided for this image

Note: The last 2 bits of the TOS field are used for explicit congestion notification (ECN). If ECN bits are 11, it means the sender devices has congestion in its queue and it wants the receiver to slow down. 00 means the device is not enabled for ECN and 01,10 means it is enabled but there is no congestion.

Conclusion

We have concluded that layer 2 markings can be done on both trunk and access port using 3 bits of COS. We noticed that these 3 COS bits can be translated into IP precedence to carry on layer 3 networks. We found that using 3 bits for QoS is where COS-0 is for default and COS-6 and 7 are reserved for network routing, we are only left with 5 classes which could be less. So, we used DSCP 6 bit values to get more granular and hierarchical 64 values. But since 64 values we way too many for a model (Cisco recommends less than 11 classes), IETF standardized the use by pre-selected 21 class of default-class, Explicit Forwarding (EF) for voice, Class Selector (CS-1 to CS-7) and Assured Forwarding (AF) 12 classes. AF came with Drop Precedence for congestion avoidance algorithm to prioritize dropping the packets. We noticed that CS and IP precedence at same in representation and can be used for interoperability. CS and IP precedence can also be mapped easily with COS.

All of this can be summarized in the table below.

No alt text provided for this image



For questions, please leave a comment and I will get back to you.


Authored by

Adnan Shabbir

Senior IP Engineer

Now IT Solutions, QLD, Australia

June 2, 2020




要查看或添加评论,请登录

社区洞察

其他会员也浏览了