Courseiva
QoSEthernetIntermediate24 min read

What Does CoS Mean?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security
On This Page

Quick Definition

CoS is a way to tell network switches which data packets are more important. It uses a 3-bit field in the Ethernet header to set priority from 0 to 7. Higher numbers usually get faster handling. This helps with things like voice calls or video not getting interrupted by file downloads.

Commonly Confused With

CoSvsDSCP

DSCP (Differentiated Services Code Point) is a Layer 3 QoS marking in the IP packet header, using 6 bits (64 possible values). CoS is a Layer 2 QoS marking in the Ethernet 802.1Q tag, using 3 bits (8 values). DSCP is used for end-to-end QoS across routers, while CoS is used within a LAN/switched network.

A voice packet leaves a phone with CoS 5 in the Ethernet frame. When it reaches a router, the router looks at the IP header's DSCP, which may be EF (46). If only CoS was set, the router wouldn't see it because it strips the Ethernet header.

CoSvsIP Precedence

IP Precedence is a 3-bit field in the Type of Service (ToS) byte of an IP packet, offering 8 levels (0-7). It was the original QoS marking for IP and is now mostly replaced by DSCP. CoS is at Layer 2, while IP Precedence is at Layer 3. They are not directly compatible without mapping.

A network engineer might map CoS 5 to IP Precedence 5 when a frame enters a router, but the more common modern approach is to map CoS to DSCP.

CoSvs802.1Q

802.1Q is the standard for VLAN tagging that adds a 4-byte tag to an Ethernet frame. That tag contains a 12-bit VLAN ID and a 3-bit PCP field (CoS). CoS is just the priority part of the 802.1Q tag, not the entire tag. VLANs separate traffic logically, while CoS prioritises traffic within or across VLANs.

A frame with 802.1Q tag may have a VLAN ID of 10 and a CoS value of 5. The VLAN ID ensures the frame stays in VLAN 10, while the CoS ensures it gets priority handling. They are independent.

CoSvsQoS (Quality of Service)

QoS is the overarching concept of managing network resources by prioritising traffic. CoS is one specific mechanism within QoS, specifically the marking field in Ethernet frames. QoS includes other elements like traffic policing, shaping, queuing, and congestion avoidance.

When you enable QoS on a switch, you can set trust boundaries, map CoS to queues, and configure bandwidth limits. CoS is just the marking step; the rest of the QoS configuration decides what to do with that marking.

Must Know for Exams

CoS appears in both the CCNA 200-301 exam and other associate-level networking certifications like CompTIA Network+. In the CCNA exam, CoS is covered under the QoS topic within the Network Access domain. Candidates are expected to understand the difference between CoS and DSCP, how to configure CoS trust on a switch interface, and how to verify QoS settings using show commands.

Typical exam objectives include: Identifying the fields in an 802.1Q frame including the PCP bits. Differentiating between Layer 2 QoS (CoS) and Layer 3 QoS (DSCP). Configuring a switch port to trust CoS values from a connected IP phone. The CCNA exam may present a scenario where you have a voice VLAN and a data VLAN on the same port, and you need to ensure voice traffic is prioritised. In such questions, you need to know that the switch must trust the CoS marking from the phone (which is often set to 5 for voice) and that the data traffic from the PC (behind the phone) should retain a lower CoS.

Multiple-choice questions might ask: Which field in an 802.1Q frame is used for Class of Service? (Answer: Priority Code Point). Or: Which CoS value is typically assigned to voice traffic? (Answer: 5). Simlet questions might show an output from "show mls qos interface gigabitEthernet 0/1" and ask you to interpret the trust state or the CoS-to-queue mapping. Troubleshooting scenarios could include a voice quality issue where the problem is that the switch is not trusting the CoS markings, causing voice packets to be treated as best effort.

Outside of CCNA, CoS is also important for the JNCIA-Junos exam and the Cisco CCT exams. In the CCNA, it is a supporting topic rather than a primary focus, but you can expect one or two questions directly related to CoS or QoS concepts. Understanding CoS thoroughly will help you avoid silly mistakes on exam day.

Simple Meaning

CoS stands for Class of Service. Imagine a busy hospital emergency room where patients are sorted by how urgent their condition is. A person with a heart attack gets immediate attention, while someone with a minor cut waits longer. CoS works the same way on a network. It labels data packets with a priority level so that switches and routers know which ones to handle first.

In a computer network, not all data is equally important. For example, a video call with your boss needs to arrive smoothly without delays, while a file download can wait a few extra seconds. CoS uses a special 3-bit field inside the Ethernet frame, called the Priority Code Point (PCP). With 3 bits, you can have 8 different priority levels from 0 to 7. The default is usually 0 (best effort), and the highest is 7 (network control).

CoS only works within a single network segment or a trusted environment because it's part of the Ethernet header. When a switch receives a frame with a certain CoS value, it queues that frame in a specific output queue. Higher priority frames get placed in queues that are serviced more often or faster. This is how CoS ensures quality of service without needing complex configuration.

However, CoS does not guarantee delivery. It only provides relative prioritization. If your network is completely congested, even high-priority traffic can get dropped. CoS is just one part of a broader Quality of Service (QoS) strategy. Think of it as a fast lane on a highway, but if the entire highway is jammed, even the fast lane slows down.

Full Technical Definition

Class of Service (CoS) is a 3-bit field located in the Ethernet frame header, specifically in the 802.1Q tag, used to assign priority levels to frames for differentiated handling across network devices. This field is formally known as the Priority Code Point (PCP). The 802.1Q standard (VLAN tagging) defines a 32-bit field that includes a 12-bit VLAN ID, a 1-bit drop eligible indicator (DEI), and the 3-bit PCP. The PCP values range from 0 to 7, with 0 representing best-effort delivery, 1 being background traffic, 2 for standard data, 3 for excellent effort, 4 for controlled load, 5 for video, 6 for voice, and 7 for network control.

CoS operates at Layer 2 of the OSI model (the data link layer). It is used primarily in Ethernet networks where 802.1Q trunking is enabled. When a switch receives a frame with a specific CoS value, it maps that value to a local output queue. Most switches have multiple egress queues (typically 4 or 8). The switch then schedules frames from these queues using algorithms such as Strict Priority Queuing (SPQ), Weighted Round Robin (WRR), or Deficit Weighted Round Robin (DWRR). In SPQ, all frames from higher priority queues are transmitted before lower priority queues get a chance, which can lead to starvation of lower priority traffic if high priority traffic is heavy. WRR and DWRR allocate a percentage of bandwidth to each queue, ensuring fairness while still prioritising critical traffic.

CoS markings are trusted or untrusted by default on switch ports. In a trusted environment, the switch accepts the incoming CoS value and uses it for forwarding decisions. In an untrusted setup, the switch can override or re-mark the CoS to a default value (often 0) unless a specific trust policy is applied. This is important in enterprise networks to prevent end users from simply marking all their traffic as high priority. Cisco switches typically allow configuration of trust boundaries using commands like "mls qos trust cos" on an interface.

One limitation of CoS is that it is only relevant within a Layer 2 domain. Once the frame passes through a router (Layer 3 device), the CoS field is not carried forward in the IP packet. For end-to-end quality of service across different network layers, IP precedence or DSCP (Differentiated Services Code Point) is used at Layer 3. However, many switches can map CoS values to DSCP values at the ingress point to maintain consistency across the network.

In summary, CoS is a fundamental building block for QoS in LAN environments. It is easy to implement because it only requires configuration on switches. It is widely supported and is a standard topic in CCNA exams, where candidates must understand how to configure CoS trust, map CoS to queues, and interpret show commands related to QoS.

Real-Life Example

Think of a busy airport security checkpoint. Passengers are sorted into different lines. First-class and business-class passengers have a priority lane that usually moves faster. Economy passengers have standard lanes. If the airport becomes extremely crowded, even the priority lane slows down, but those passengers still get through ahead of most others because they have a separate, faster-moving queue.

CoS works similarly. On a network, each data frame is like a passenger. The CoS value tells the switch which queue the frame should go into. Voice and video traffic get high priority (like first-class), while a large software update gets low priority (like economy). The switch services the high-priority queues more frequently, so that a video call doesn't stutter just because someone is downloading a game update.

Now, what if the network is so congested that even the high-priority queue starts to fill up? That is when the switch may drop some frames, but it will drop lower priority frames first (if configured with drop precedence). This is similar to the airline denying boarding to passengers who checked in late on an overbooked economy flight, while first-class passengers always get a seat. CoS doesn't guarantee throughput, but it gives prioritisation, which is often enough to keep critical applications working.

Why This Term Matters

In real-world IT, networks carry a mix of traffic: email, web browsing, file transfers, voice calls, video conferencing, and backup traffic. Without CoS, a large file transfer could completely saturate a link, causing voice calls to break up or video meetings to stutter. This is unacceptable in a business environment. CoS provides a mechanism to treat each type of traffic appropriately so that time-sensitive applications get the bandwidth they need.

CoS is also important for network design. When building a network for an enterprise, you need to determine where to set trust boundaries. You might set the switch port connected to an IP phone to trust the CoS marking from the phone, while a desktop computer port might be set to untrusted, forcing all traffic from that port to a default CoS value. This is critical for security and reliability. Without CoS, the network administrator would have no way to differentiate between an important voice packet and a bulk download.

Furthermore, CoS is a precursor to more advanced QoS mechanisms. Understanding CoS is the first step to understanding DSCP, traffic policing, shaping, and other QoS tools. Many CCNA and network engineer job interviews include questions about CoS because it's a fundamental concept that shows whether a candidate understands how networks prioritise traffic. If you skip CoS, you are missing a core piece of how modern switches work.

How It Appears in Exam Questions

CoS questions in the CCNA exam typically come in three formats: direct recall, scenario-based, and show command interpretation. Direct recall questions are straightforward: "How many bits are used for CoS in an 802.1Q frame?" The answer is 3 bits. Or: "What is the default CoS value for best-effort traffic?" Answer: 0. These are easy points if you have memorised the basics.

Scenario-based questions are more common. For example: You have an IP phone connected to a switch, and behind the phone is a PC. The phone marks its own voice traffic with CoS 5. The PC traffic is untagged. The user reports poor call quality. What should you configure on the switch port? The correct answer is to set the port to trust CoS from the phone. This often appears in a multiple-choice format with four options: one correct and three distractors like "enable spanning tree" or "configure a voice VLAN." You must also know that the phone typically uses CDP (Cisco Discovery Protocol) to negotiate the voice VLAN, but the CoS trust is separate.

Show command questions might ask you to interpret the output of "show mls qos interface fastEthernet 0/2". They will show a table of CoS values mapped to queues, and you might have to identify which queue handles voice traffic. For example, if CoS 5 is mapped to queue 1, and queue 1 is serviced with strict priority, then voice traffic gets highest priority. The question might ask: "Based on the output, which CoS value will receive the highest priority?" Or: "If a frame arrives with CoS 3, which queue will it be placed in?"

Occasionally, questions combine CoS with other QoS features. For instance: "A frame arrives with CoS 5 but the interface is configured to trust DSCP instead. What happens?" The answer is that the CoS value will be ignored, and the switch will use the DSCP value (if present) or the port default. This tests your understanding of trust boundaries.

To answer these questions correctly, focus on the fundamentals: the 3-bit PCP field, the 8 priority levels, the default CoS for best effort, and the common assignments (voice=5, video=4, etc.). Know the difference between Layer 2 and Layer 3 QoS. With that knowledge, you'll be well prepared.

Practise CoS Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

You work as a junior network technician for a medium-sized company. The company uses Cisco switches, and all employees have a desk phone and a PC at their desk. The phones are Cisco IP phones, which have a built-in switch port for the PC to plug into. The management has started receiving complaints that during the daily backup window (between 11 AM and 1 PM), the audio quality on conference calls becomes very poor, with crackling and delays. You are asked to investigate.

First, you check the backup server. It is sending a large amount of data continuously during that window. That traffic is competing with the voice traffic on the same switch ports. The backup traffic is best effort (CoS 0) by default. However, the IP phones are marking their voice packets with CoS 5 (voice) and the call control traffic with CoS 3. The problem is that the switch ports are not configured to trust these markings. Instead, the switch is treating all incoming frames as CoS 0, so the voice packets get the same priority as the backup traffic. The result is that voice packets are being delayed or dropped when the link gets busy.

You log into the switch and check the configuration. On the interface connected to an IP phone, you see that QoS is enabled but the trust state is set to "untrusted". You change it with the command "mls qos trust cos". You also verify that the voice VLAN is configured correctly, which it is. After making that change, voice traffic from the phone will be placed in a higher priority queue. The next day during the backup window, no complaints come in. The voice packets are now being handled with priority, and the backup traffic only uses the remaining bandwidth. The problem is solved.

This scenario shows exactly why CoS matters. Without trust configured, your switch treats all traffic equally. With trust, you allow the phone to tell the switch which packets are important. This is a fundamental CCNA skill.

Common Mistakes

Thinking CoS is the same as 802.1Q VLAN tagging.

802.1Q adds a 4-byte tag to an Ethernet frame that contains both a VLAN ID (12 bits) and a Priority Code Point (3 bits). CoS refers specifically to the PCP bits, not the entire tag. Learners often confuse the two because they see the term '802.1Q' and assume everything inside is the VLAN, but the PCP field is separate.

Remember that 802.1Q is the encapsulation standard, and CoS is the 3-bit priority part. You can have CoS without a VLAN (if using port- or interface-based QoS), but in practice, they are both in the same tag.

Believing that CoS guarantees bandwidth or delivery.

CoS only provides relative prioritisation, not a guaranteed service. If the network is fully congested, even high CoS frames can be dropped. CoS does not reserve bandwidth; it just queues frames differently. For guaranteed bandwidth, you need traffic shaping or policing combined with queuing.

Think of CoS as a fast lane on a highway. Even the fast lane can jam if too many cars enter, but you still have an advantage over the slow lane. For guaranteed capacity, you need things like committed information rate (CIR) or bandwidth reservation (e.g., LLQ).

Assuming CoS persists across routed networks (Layer 3).

CoS is a Layer 2 field in the Ethernet header. When a packet traverses a router, the Layer 2 header is stripped and a new one is added. The CoS value is lost. For end-to-end QoS, you need to map CoS to DSCP at the ingress and use DSCP at Layer 3.

Understand the difference between Layer 2 QoS (CoS) and Layer 3 QoS (DSCP/IP precedence). In Cisco devices, you can use 'mls qos map cos-dscp' to translate CoS to DSCP when the frame enters the switch (ingress), so the router can then use that DSCP value.

Setting the same CoS value for all traffic on a port instead of trusting the phone's marking.

If you manually set 'mls qos cos 5' on a port, all traffic from that port, including PC traffic, will be marked as priority 5. This defeats the purpose of QoS because you are not differentiating traffic types. You should only trust CoS from the phone and let the PC traffic remain lower priority.

Use 'mls qos trust cos' on the port connected to an IP phone. This accepts the marking from the phone. For the PC behind the phone, the port should be configured as untrusted or the PC traffic should be given a lower CoS via a policy-map or default CoS.

Forgetting that CoS values have different default meanings than DSCP values.

Some learners mix up CoS and DSCP values. For example, voice in CoS is 5, but in DSCP it is EF (46). They might answer 5 to a question about DSCP for voice. Always check the context: if the question says '802.1Q' or 'frame', think CoS; if it says 'IP packet' or 'ToS byte', think DSCP.

Create a mental map: Layer 2 = CoS (0–7), Layer 3 = DSCP (0–63). Voice typically uses CoS 5 and DSCP 46. Do not interchange the numbers without knowing which layer.

Exam Trap — Don't Get Fooled

{"trap":"A CCNA question shows a switch configured with 'mls qos trust cos' on a port, but the connected device is a PC that does not mark any CoS values. The question asks 'What will be the effect on the traffic from the PC?' The incorrect trap answer is 'The traffic will be dropped because it has no CoS marking.'

","why_learners_choose_it":"Learners think that trust means the switch demands a CoS value, and if there is none, the frame is unusable or dropped. They may also confuse 'trust' with a strict requirement that the frame must have a tag.","how_to_avoid_it":"Understand that 'trust cos' means the switch will use the received CoS value if it exists.

If the frame is untagged (no 802.1Q header), the switch will use the default port CoS (usually 0). The frame is not dropped; it is just treated as best effort. The command does not add a new CoS, it just allows the existing one to be used."

Step-by-Step Breakdown

1

Frame Arrives at Switch Port

An Ethernet frame arrives at a switch port. The frame may have an 802.1Q tag containing a 3-bit Priority Code Point (PCP) field. If the frame is untagged (no tag), it is considered to have no CoS value, and the port will apply a default CoS (usually 0).

2

Check Trust State

The switch checks if the port is configured to trust CoS markings. If the port is trusted (with 'mls qos trust cos'), the switch accepts the incoming PCP value. If the port is untrusted, the switch either uses the port default CoS or overrides the marking based on a policy.

3

Map CoS to Queue

The switch consults its CoS-to-queue mapping table. For example, CoS values 0,1,2 might go to Queue 1 (low priority); CoS 3,4 to Queue 2; CoS 5 to Queue 3 (high priority); and CoS 6,7 to Queue 4 (network control). The mapping is configurable and varies by switch model.

4

Frame Placed in Egress Queue

The frame is placed into the appropriate egress queue on the outgoing interface. Multiple queues exist for each port. The queue depth (buffer size) depends on the switch hardware. If the queue is full, the switch may drop the frame (tail drop) or use a congestion-avoidance algorithm like WRED.

5

Queue Scheduling

The switch's scheduler decides which queue to service when transmitting. With Strict Priority Queuing, the scheduler empties the highest priority queue first before moving to the next. With Weighted Round Robin, each queue gets a certain percentage of bandwidth. The scheduler pops frames from queues and sends them out the port.

6

Frame Leaves Switch

The frame is transmitted out the egress port. The CoS value remains in the 802.1Q tag (if present) and can be used by the next switch in the path. If the final device (like a router) strips the tag, the CoS is no longer available.

7

Statistics and Monitoring

Network administrators can use commands like 'show mls qos interface', 'show queueing interface', and 'show mls qos maps cos-output-q' to monitor how frames are being queued and to verify that CoS is working as intended. Statistics can reveal if higher priority queues are being starved or if there are drops.

Practical Mini-Lesson

CoS is a practical tool that every network engineer should understand and be able to configure. In the real world, you will often connect Cisco IP phones to switches. The phone typically uses CDP to tell the switch which VLAN to use for voice traffic (the voice VLAN). But QoS requires separate configuration: the switch port must trust the CoS markings coming from the phone. The phone usually marks its own voice packets with CoS 5. If the port does not trust CoS, those packets get treated as best effort (CoS 0). The result is that during congestion, your voice quality suffers.

To configure trust on a Cisco switch, you first enable QoS globally with 'mls qos'. On the specific interface, you configure the voice VLAN (e.g., 'switchport voice vlan 10') and then set 'mls qos trust cos'. Optionally, you can set a default CoS for untagged traffic using 'mls qos cos 0' on that same interface. This ensures that PC traffic (which comes from the phone's switch port) is marked as best effort, while the phone's voice traffic retains its CoS 5 marking.

What can go wrong? One common issue is that the switch port is connected to a device that does not mark CoS at all, but the port is set to trust. In that case, the switch will use the default CoS (0). That is fine. But if you set the port to trust CoS and there is an attacker that sends frames with CoS 7, they could get higher priority than legitimate traffic. That is why trust boundaries are important: only trust CoS from devices you control, like IP phones or routers.

Another issue is misconfiguration of the CoS-to-queue mapping. By default, most Cisco switches map CoS 5 to an egress queue that uses strict priority. That is correct for voice. But if someone changes the mapping so that CoS 5 goes to a low-priority queue, voice traffic will not get priority. Always verify the mapping with 'show mls qos maps cos-output-q'.

Finally, remember that CoS is only part of the QoS story. For truly robust QoS, you may need to combine CoS with DSCP, configure policing or shaping at the edge, and use queuing algorithms suitable for your traffic mix. But getting CoS right is a basic skill that separates a junior admin from someone who understands network quality.

Memory Tip

CoS = 3 bits, 8 values. Voice = 5, Video = 4, Best Effort = 0. Think: 'CoS is the priority system for the digital delivery truck'.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Related Glossary Terms

Frequently Asked Questions

What is the difference between CoS and DSCP?

CoS is a Layer 2 marking in the Ethernet frame header (3 bits, 8 values). DSCP is a Layer 3 marking in the IP packet header (6 bits, 64 values). CoS is used within LAN switches, while DSCP is used end-to-end across routers. You can map between them.

How many CoS priority levels are there?

There are 8 priority levels, from 0 to 7. CoS 0 is best effort, CoS 5 is typically used for voice, and CoS 7 is for network control traffic.

Does CoS work without VLANs?

CoS is part of the 802.1Q tag, which is most commonly used with VLANs. However, you can have CoS without a VLAN by using port-based QoS or by using 802.1Q trunking with only a default VLAN. In practice, it's almost always used with VLANs.

What command do I use to trust CoS on a Cisco switch port?

First enable global QoS with 'mls qos'. Then on the interface, use 'mls qos trust cos' to accept incoming CoS markings. You can also set a default CoS with 'mls qos cos' on the same interface.

What happens if a frame has no 802.1Q tag and the port is set to trust CoS?

The switch will use the default CoS value configured on that port (usually 0). The frame is not dropped; it is treated as best effort. The trust command only reads the CoS if it exists; otherwise, it falls back to the default.

Why does voice use CoS 5 and not 7?

CoS 7 is reserved for network control traffic like routing protocol updates, which require the highest priority. Voice traffic uses CoS 5, which is the highest user-accessible priority. Using 7 for voice could interfere with the network's control plane.

Can I set CoS on a router interface?

Routers typically operate at Layer 3 and use DSCP for QoS. However, a router can also be a Layer 2 switch (like a Cisco ISR with a switch module) and then it can use CoS. In general, CoS is a switch feature.

Is CoS a reliable way to guarantee voice quality?

CoS alone cannot guarantee voice quality if the link is fully congested. It provides relative prioritisation, which greatly improves performance, but for guaranteed quality you need admission control, traffic shaping, and bandwidth reservation (e.g., LLQ). CoS is a necessary but not sufficient condition for good QoS.

Summary

Class of Service (CoS) is a 3-bit priority field within the 802.1Q VLAN tag, allowing Ethernet frames to be marked with one of 8 priority levels. This marking enables switches to place frames into different output queues, giving higher priority to time-sensitive traffic such as voice and video. CoS operates at Layer 2 and is essential for managing congestion in LAN environments.

In the context of IT certifications like the CCNA, understanding CoS is important for configuring QoS on switch ports, especially when connecting IP phones. The exam expects you to know the field structure (3-bit PCP), common CoS values (voice=5, video=4, best effort=0), and the difference between Layer 2 and Layer 3 QoS. You must also be able to interpret show commands and configure trust boundaries.

CoS is just one component of a broader QoS strategy. While it provides a simple way to prioritise traffic, it does not guarantee bandwidth or delivery. For end-to-end QoS, CoS is often mapped to DSCP at the network edge. In practice, every network engineer should be comfortable with CoS because it is a foundational concept that appears in daily configuration and troubleshooting. Mastering CoS will help you build more reliable networks and give you an edge in certification exams.