QoS and Per-Hop Behavior
All packets are equal on the wire — but not all traffic is equal to the business. A dropped VoIP voice stream is a broken conversation; a momentarily delayed email is nothing. Quality of Service (QoS) is the toolkit that sorts traffic into classes and treats each class appropriately at every router in the path. This lesson covers the CCNA’s conceptual framework: classification, marking, queuing, shaping and policing, and congestion avoidance — the per-hop behaviors that make real-time application traffic work.
- Explain why QoS is needed when a converged network carries real-time and bulk traffic together.
- Contrast real-time (voice/video) and elastic (data) application behaviour.
- Describe classification and marking, including CoS at Layer 2, DSCP at Layer 3, and EF 46 for voice.
- Explain queuing, shaping vs policing, and congestion avoidance.
- Discuss the trust boundary and when a device should trust or override markings.
Why QoS exists
Switches and routers treat output as a queue: when more data waits for a link than the link can carry, the excess queues, and when the queue fills, packets are dropped. The defaults are egalitarian — first come, first served, everyone equally dropped under pressure — but the traffic sharing the pipe is anything but equal. Without QoS, a backup pushing gigabytes can stall every phone call in the building, because voice frames wait behind the backup’s packets just like everything else.
Three QoS problems must be solved. Delay (latency) is the time a packet takes to cross the network, and it has fixed components (serialization, propagation, switching) plus a variable one: queuing. Jitter is the variation in delay from packet to packet — worse for real-time than raw delay, because voice decoders need steady spacing. Loss is packets dropped in queues. QoS manages all three by deciding, at each hop, whose packets get the low-delay treatment and whose absorb the waiting.
A key exam phrase: QoS is a per-hop behavior. There is no "guarantee across the whole path" mechanism in classic IP — every router makes local decisions on the packets it holds, and only if every hop applies the same policy does the end-to-end result hold up. That is why markings must survive the journey (the topic of classification and marking) and why mistrusting a marking at one hop quietly destroys a voice class.
Real-time vs elastic traffic
Applications sort into two broad personalities, and QoS policy is designed around the difference:
| Property | Real-time | Elastic (data) |
|---|---|---|
| Examples | Voice calls (RTP), video conferencing, streaming | Web browsing, email, file transfer, backups |
| Delay sensitivity | Very high; latency over ~150 ms one-way degrades calls | Low; TCP applications wait and retry |
| Jitter sensitivity | Extremely high; voice decoders refill jitter buffers only briefly | Negligible |
| Loss handling | Cannot retransmit; a dropped voice packet is heard as distortion | TCP retransmits lost packets |
| Rate shape | Constant bit rate (a G.711 call), low to medium bandwidth | Bursty; expands to fill the pipe |
| QoS goal | Protect it: low delay, low jitter, near-zero loss | Share what remains; absorb the drops |
Classification
Before a router can treat traffic differently it must tell classes apart. Classification is inspecting packets and assigning each to a category. It can match nearly anything visible in the header: the source or destination IP, the transport protocol (UDP/TCP), the port numbers (e.g. RTP audio), or an existing marking — the Layer 2 CoS or IP DSCP field (Section 4). In IOS, classification is commonly done with access lists or with class maps (class-map + match statements) that feed a policy.
Which fields a classifier uses depends on where in the network it is. Deep classification (ports, application signatures) is expensive and belongs at the edge, close to the source. Interior routers should classify on the markings already written — cheap, fast, and uniform. Getting that placement backwards is a classic design error: deep-inspection at the core wastes switching capacity that should be forwarding packets.
Marking: CoS, DSCP, EF
The marks the CCNA expects you to recognise live on two layers:
| Mark | Layer | Where it sits | Range |
|---|---|---|---|
| CoS | Layer 2 | The 3-bit class of service field inside an 802.1Q VLAN tag | 0–7 |
| IPprec | Layer 3 | The original 3-bit precedence in the IPv4 ToS byte | 0–7 |
| DSCP | Layer 3 | The 6-bit Differentiated Services Code Point in the IPv4 ToS / IPv6 traffic-class byte | 0–63 |
A phone call crosses the LAN carrying CoS into the switch and DSCP into the router, and QoS only works when both survive. The phone marks its own calls (typically EF/CoS 5 for audio, CS3/CoS 3 for signalling), and the trust boundary (Section 8) decides whether the access switch accepts those marks or overrides them.
Queuing and scheduling
When a link is congested, every router faces the same choreography: packets wait in queues (queuing) and the interface picks which queue to drain next (scheduling). The default FIFO (first in, first out) is fair in the crudest sense and terrible for real-time traffic, because a burst of bulk data ahead of a voice packet delays the voice packet.
The Cisco answers, in increasing sophistication:
- CBWFQ (Class-Based Weighted Fair Queuing) — many per-class queues, each given a guaranteed bandwidth share. A class can’t starve the others; unused share is redistributed.
- LLQ (Low Latency Queuing) — CBWFQ plus a priority queue that is always drained first, before every other queue. Real-time traffic (EF) is placed in the priority queue so delay and jitter stay near zero. The price of a priority queue is policing of its own rate — otherwise priority traffic could consume every byte and starve the link.
- Drop pedix — when a queue fills, new arrivals may be dropped head-of-line; while CBWFQ guarantees bandwidth, the delay inside a queue is still the congestion reality. That is where congestion avoidance (Section 7) steps in.
Shaping and policing
Both shaping and policing impose a maximum rate on a traffic class using a token bucket, but they behave very differently when the traffic exceeds the allowed rate:
| Feature | Shaping | Policing |
|---|---|---|
| What it does | Delays excess traffic in a queue to smooth it to the configured rate. | Drops (or re-marks) excess traffic immediately. |
| Traffic result | Bursts are buffered and sent later; rate never exceeds the limit. | Bursts are clipped; excess never travels. |
| Effect on TCP | Smooth; TCP sees delay rather than loss, so it adapts gently. | Loss-based; TCP back-off typically triggered by the drops. |
| Buffering/memory | Needs a queue and memory. | Stateless; no buffering. |
| Typical use | Sending to a slower provider or shaping outbound bursts to stay under a WAN contract. | Enforcing a hard committed rate at the edge; anti-spoofing DDoS rate limits. |
Congestion avoidance
Congestion avoidance tries to prevent the tail-end panic by discarding a few packets deliberately before a queue overflows. The classic tool is WRED (Weighted Random Early Detection): the router monitors average queue depth and, as it grows, drops an increasing percentage of packets randomly but weighted — low-priority classes get dropped first. The virtue of random early drops is that they are noticed instead of the alternative: when a full queue tail-drops a whole wind of TCP segments, every TCP flow backs off at once and the link “hits a wall” and then under-utilises (classic TCP global synchronisation). WRED spreads the drops so some flows slow while others continue, holding the queue below the dangerous point.
Notice the deliberate contrast with LLQ: LLQ is a scheduling mechanism that decides the order of service, WRED is an avoidance mechanism that decides who gets dropped before a queue ever fills. The exam wants you to attach each tool to its job and not to confuse “random early drop before congestion” (WRED) with “hard drop when the bucket is empty” (policing) or “hold-it-in-a-buffer” (shaping).
The trust boundary
Markings are only useful if they are truthful. Any host that can write a DSCP or CoS value could mark its traffic EF and jump every queue — an instant way to starve everyone else. QoS therefore defines a trust boundary: the point beyond which markings are believed.
- Inside the boundary (the phone, the IP camera, the trusted server), markings are trusted and forwarded unchanged.
- At/outside the boundary (a student PC, an unmanaged switch, an Internet-facing port), markings are ignored or reset and the device re-marks traffic per policy (typically to best effort, DSCP 0).
Two extensions exams mention: the classification/remark relationship is where a switch, seeing untrusted DSCP, classifies by ACL and re-marks into the correct class as traffic enters; and shaping/policing chain — the same frame that is classified at the edge may be policed there, re-marked, then queued at the next hop. Per-hop behavior means each router only does its slice — classify, mark, queue, shape/police, avoid — and the CCNA expects you to name that slice on sight.
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.