Class of Service (CoS)
What is Class of Service (CoS)?
Class of Service (CoS) is a way of managing traffic in a network by grouping similar types of traffic -- such as email, streaming video, voice over IP and large document file transfer -- together and treating each type as a class with its own level of network service priority.
CoS is used at the data link layer -- Layer 2 -- of the Open Systems Interconnection (OSI) model and consists of a 3-bit field within the 802.1Q virtual local area network (VLAN) or 802.1P frame header.\
How does CoS work?
The three CoS bits can be used to specify a priority value of the frame. The values range between zero and seven, where zero is for the lowest priority traffic and seven is for the highest priority traffic. Once a frame is defined with a priority value, Layer 2 switches that have quality of service (QoS) enabled can use these priority numbers and prioritize the outbound delivery of frames on an interface when a link becomes congested and queuing is required. Network switches can be configured to trust the CoS values or ignore or overwrite them prior to sending them out the destination interface.
Frames that are tagged with higher-priority CoS values are sent out the interface first, while lower-level CoS values will wait in a queue to be sent. This is why CoS is important for real-time streaming data, such as voice and video. CoS helps to prioritize this traffic so it does not get held up in a queue or dropped by the interface, which can cause stuttering or network jitter on the voice or video stream. Alternatively, data flows such as File Transfer Protocol that do not require low-latency transport to operate can be given lower CoS values so that higher-priority traffic can be processed and sent out the interface first.
How are CoS, DSCP and QoS related?
QoS is a queue strategy mechanism on networks that is used to ensure that higher-priority traffic is given preferential treatment on network interfaces when high-link utilization results in a bottleneck. When bottlenecks occur, switching and routing interfaces use memory buffers known as queues to delay the sending of frames or packets until the bottleneck is cleared. QoS consists of the following three processes:
- traffic marking or classification;
- matching of queuing policy based on pre-configured classes; and
- enforcing queuing policy to network interfaces.
The first step -- marking or classifying traffic -- is where both CoS and Differentiated Services Code Point (DSCP) techniques reside within QoS. As mentioned previously, CoS operates at Layer 2 of the OSI model and consists of eight different classification groups to which Ethernet frames can belong. DSCP serves a similar purpose as CoS, but it does so at the network layer -- Layer 3 -- of the OSI model and uses a 6-bit field, as opposed to only 3 bits.
The other two steps in the QoS process are automated by the router or switch as it works to place packets into queuing groups and enforces the transmission, queuing or dropping of frames and packets based on configured classification markings.
With DSCP, the priority values are contained inside the IP header, as opposed to the Ethernet frame with CoS. Additionally, DSCP can be broken into 64 distinct groups -- values zero to 63. That means that DSCP can be used on Layer 3 routed interfaces, and traffic can be separated into more queue groups, providing greater granularity when it comes to traffic prioritization.
In addition to prioritizing network traffic, VLANs offer numerous other benefits to enterprise networks. Learn how to configure and set up a VLAN.