QoS Queuing Mechanisms
Understand FIFO, PQ, CQ, WFQ, and CBWFQ queuing mechanisms.
1. Executive Summary & Objective
In robust network architectures, interface congestion is an inevitability rather than an anomaly. When the volume of incoming packets surpasses an interfaceβs transmission capacity, the network device must rely on buffering systems to store the excess data. Queuing is the critical QoS mechanism that dictates how these buffered packets are organized, prioritized, and eventually transmitted onto the wire. Without intelligent queuing, modern networks would succumb to indiscriminate packet drops, rendering real-time applications like VoIP and video conferencing unusable during peak load periods.
The objective of this comprehensive module is to dissect the evolution and operational mechanics of various queuing algorithms, ranging from legacy implementations to modern, highly granular class-based systems. By the end of this lesson, you will understand the theoretical differences between First-In-First-Out (FIFO), Priority Queuing (PQ), Weighted Fair Queuing (WFQ), Class-Based Weighted Fair Queuing (CBWFQ), and Low Latency Queuing (LLQ). Furthermore, you will acquire the practical skills necessary to design, configure, and troubleshoot advanced LLQ policies on enterprise routing platforms, ensuring strict priority for latency-sensitive traffic while guaranteeing bandwidth for critical data applications.
2. Core Concept & Theory
Queuing algorithms dictate the scheduling logic applied to a router or switchβs memory buffers during times of congestion. The primary goal is to manage the transmission queue effectively, avoiding starvation of lower-priority traffic while guaranteeing low latency for critical traffic.
The Evolution of Queuing Algorithms
1. First-In, First-Out (FIFO): FIFO is the default, most primitive form of queuing. Packets are placed into a single queue and transmitted strictly in the order they were received. While highly efficient on CPU resources, FIFO offers no prioritization. A single large FTP file transfer can completely fill the FIFO queue, causing tiny, critical voice packets arriving later to be dropped (tail drop) or significantly delayed.
2. Priority Queuing (PQ): PQ introduced multiple queues (typically four: High, Medium, Normal, Low) with strict precedence. The scheduler always empties the High queue completely before even looking at the Medium queue. Flaw: While fantastic for the High queue, PQ frequently leads to βqueue starvation.β If enough High-priority traffic exists, Normal and Low queue traffic will never be transmitted, causing complete failure of non-priority applications.
3. Custom Queuing (CQ): CQ attempted to solve PQβs starvation issue by using a round-robin approach. It cycles through up to 16 queues, transmitting a specific byte count from each before moving to the next. Flaw: While preventing starvation, CQ fails to provide the strict, immediate servicing required for delay-sensitive voice traffic.
4. Weighted Fair Queuing (WFQ): WFQ revolutionized queuing by dynamically identifying βflowsβ based on packet headers (source/dest IP, ports). It allocates bandwidth equitably among all active flows, inherently prioritizing low-volume traffic (like Telnet or Voice) over high-volume, bandwidth-hogging flows (like FTP). Flaw: It lacks administrative control; you cannot arbitrarily decide that Flow A is more important than Flow B.
5. Class-Based Weighted Fair Queuing (CBWFQ): CBWFQ marries administrative control with fair queuing. It allows engineers to define explicit traffic classes (e.g., Database, Web, Email) and assign a guaranteed percentage of interface bandwidth to each class during congestion. Any unallocated bandwidth is distributed fairly.
6. Low Latency Queuing (LLQ): LLQ is the gold standard for modern QoS. It is essentially CBWFQ enhanced with a Strict Priority (SP) queue. Traffic placed in the SP queue (like voice) is serviced immediately, bypassing the CBWFQ scheduler. However, to prevent the PQ starvation problem, the SP queue is strictly policed; if voice traffic exceeds its allocated bandwidth, the excess is aggressively dropped, protecting the rest of the data classes.
3. Architecture & Topology
Consider a Corporate Head Office connected to a remote branch via a 50 Mbps WAN circuit. This link is heavily utilized for IP Telephony (SIP/RTP), ERP database replication, and general internet web browsing.
- Voice Traffic (RTP): Highly sensitive to jitter and delay. Requires immediate transmission.
- ERP Database Sync: Not sensitive to delay, but mission-critical. Requires guaranteed delivery and a large share of bandwidth to complete timely updates.
- Web Browsing: Best effort. Should utilize whatever bandwidth is leftover.
If FIFO were deployed on the WAN interface, a large database sync would flood the 50 Mbps pipe, buffering all incoming packets. The voice packets would sit in the queue behind thousands of database packets, resulting in severe audio degradation (robotic voices or dropped calls).
By deploying LLQ architecture on the WAN router:
- An SP queue is created exclusively for Voice, allocated 10 Mbps. Whenever a voice packet arrives, it immediately jumps to the front of the transmission line, guaranteeing zero jitter.
- A CBWFQ class is created for the ERP Database, guaranteed 20 Mbps of bandwidth. This ensures the database always has room to sync, even if users are heavily browsing the web.
- The remaining bandwidth (20 Mbps) is assigned to a default fair-queue class for web browsing and miscellaneous traffic.
4. Command Execution & Deployment
Configuring LLQ on Cisco IOS utilizes the Modular QoS CLI (MQC). Assuming classification/marking has already occurred upstream (traffic is tagged with DSCP values), we configure the queuing policy on the WAN router.
Step 1: Define Traffic Classes based on DSCP
enable
configure terminal
! Voice is typically marked as Expedited Forwarding (EF)
class-map match-any VOICE
match dscp ef
! Critical data is typically marked Assured Forwarding (AF31/AF32)
class-map match-any CRITICAL-DATA
match dscp af31 af32
Step 2: Configure the Policy Map (The LLQ Scheduler)
This policy dictates the queuing behavior during congestion.
policy-map LLQ-WAN-POLICY
class VOICE
! Assign strict priority for voice (up to 20% of interface bandwidth)
priority percent 20
class CRITICAL-DATA
! Guarantee 40% bandwidth for critical data using CBWFQ
bandwidth percent 40
class class-default
! Apply fair-queuing to all remaining traffic
fair-queue
Crucial Note: The priority command invokes the strict priority queue (LLQ), while the bandwidth command invokes the standard class-based queue (CBWFQ).
Step 3: Apply the Policy to the Egress Interface
Queuing only occurs when packets leave an interface, so the policy is always applied outbound.
interface Serial0/0/0
description 50Mbps WAN Circuit
service-policy output LLQ-WAN-POLICY
exit
5. Verification & Troubleshooting
Validating queuing operations requires generating enough traffic to actually cause congestion; otherwise, packets simply pass through without ever hitting the queues.
Verification Commands
- Check Interface Queuing Strategy:
Router# show interface Serial0/0/0
This output will confirm the queuing strategy applied to the hardware interface (e.g., Queueing strategy: Class-based queueing).
- Monitor Queuing Statistics:
Router# show policy-map interface Serial0/0/0
This is the most critical diagnostic command. Key Metrics to Analyze:
- Strict Priority class (
VOICE): Monitor thedropscounter. Because the priority queue is policed to prevent starvation, any drops here mean your voice traffic volume has exceeded the 20% allocation. You must either increase the allocation or investigate rogue traffic mistakenly marked as EF. - CBWFQ class (
CRITICAL-DATA): Monitor thepkts matchedto ensure classification is working. Checkqueue-depthto see how heavily the buffer is utilized during congestion. class-default: Ensurefair-queueis active. Drops here are acceptable during heavy load, as this is best-effort traffic.
Troubleshooting Scenarios
- Robotic Voice Quality During File Transfers: This indicates the LLQ strict priority queue is failing. Verify that the voice packets are actually matching the
VOICEclass map (check for DSCP EF). If they are falling intoclass-default, they are subject to standard queuing delays. - Output Drops on High-Speed Links: If applying queuing on sub-rate Ethernet links (e.g., a 1Gbps physical port shaped to 50Mbps), you must apply the queuing policy hierarchically inside a shaper, otherwise the routerβs hardware queues will transmit at 1Gbps, bypassing your software QoS queues entirely.
6. Sandbox / Interactive Lab Context
Deploy the following topology to visualize queuing behaviors under extreme load.
Lab Setup:
- Connect Router A and Router B using a low-bandwidth serial link (e.g., configure
clock rate 128000to simulate a 128 kbps link). - Configure IP addresses and a routing protocol.
Task 1: Baseline FIFO Congestion
- Send continuous large pings (size 1500) from PC-1 to PC-2 to simulate a bulk data transfer.
- Simultaneously, send continuous standard pings (size 100) from PC-1 to PC-2 to simulate voice.
- Observe the ping response times of the small packets; they will be highly erratic and suffer high latency due to waiting behind the large packets in the FIFO queue.
Task 2: Implement LLQ
- On Router A, configure an ACL to match the small pings (simulated voice) and assign them to a class map.
- Create an LLQ policy map granting strict
priorityto the voice class, and apply it outbound on the serial link.
Task 3: Validation and Analysis
- Re-run the simultaneous ping tests.
- Observe the dramatic change in response times for the small (voice) pings. They should now be consistently low and stable, regardless of the heavy bulk data transfer occurring concurrently.
- Run
show policy-map interfaceon Router A and watch the counters increment in the priority class, confirming the scheduler is prioritizing the traffic correctly.
π§ͺ Want to practise this on your own computer? See how to set up your lab →