Course contents

Unit 5: QoS and AppQoELesson 5.2 (2 of 7 in this unit)23 of 63 in the Advanced Cisco SD-WAN course

Ingress/egress classification and scheduling

How an edge classifies traffic into queues and shares a congested link: priority versus weighted scheduling, drop policy, computed shares for each class, and a worked case where video marked as voice overfilled the priority queue.

Advanced · 15 min read

You'll learn to follow a packet from classification to a queue, tell priority scheduling from weighted sharing, work out what each class receives on a congested link, and explain why a priority class must hold only the traffic it was sized for.

Technical definition

Scheduling is the rule that decides which queued packet is sent next when a link cannot send everything waiting. It acts only when a queue exists. On a link that is below its rate, every packet leaves at once and the scheduler changes nothing. Classification comes first: it decides which queue each packet joins.

Classify first, then queue, then schedule

Every packet that leaves a WAN edge passes the same sequence. It is classified, which gives it a forwarding class from its DSCP, an access list match or an application list. The class selects a queue. A scheduler picks which queue sends next. A shaper holds the whole interface to the rate of the circuit, so that the queues, not the provider, decide what waits. The earlier lesson covered the marks. This one covers what the edge does with them.

Diagram
From packet to wire
From packet to wire

Classify the packet, map the class to a queue, let the scheduler choose the next queue, and let the shaper hold the interface to the circuit rate.

  1. ClassifyDSCP, ACL,application
  2. Classforwardingclass
  3. Queueone queueper class
  4. Schedulewho sendsnext
  5. Shapecircuit rate
The shaper is what makes the queues matter: without it the provider's queue forms instead of yours.
Diagram
A scheduler works only when there is a queue
A scheduler works only when there is a queue

On a link below its rate, packets leave at once and the scheduler changes nothing. When the link reaches its rate, packets wait and the scheduler decides the order.

Below the rateNo queue formsNo effect
At the rateQueues formScheduler decides
Test QoS under load. A test on an idle link proves nothing about it.

Priority and weighted queues

Two scheduling styles are used together. A priority queue is served before anything else, so its packets wait the least. A weighted queue gets a share of what remains, in proportion to a weight. Voice goes in the priority queue because it needs low delay. Everything else shares by weight, so that no class is starved.

Diagram
Priority first, then the weighted share
Priority first, then the weighted share

The priority queue is served first, up to its limit, and it holds voice. The weighted queues then share what remains in proportion to their weights, and they hold video, business data and default traffic.

Priority queueServed first, up to a limitVoice
Weighted queuesShare what remains by weightVideo, data, default
Voice gets low delay from the priority queue, and every other class gets a share from the weights.
Diagram
Two scheduling styles
Two scheduling styles
StyleHow it is servedGood forRisk
Priority (low latency)Before every other queue, up to a limitVoice and other small, delay-sensitive packetsTakes room from the others if it is overfilled
WeightedA share of the remaining rate, in proportion to its weightVideo, business data and default trafficA class that offers less than its share frees the rest for the others
A priority queue is normally limited to a set rate while the link is congested, so that it cannot starve the weighted queues. Confirm the behaviour for your platform.

What each class receives, worked out

Take a circuit shaped at 95 Mbps. Voice is 75 calls at 108 kbps each, which is 8.1 Mbps, and it goes in the priority queue. The remaining 86.9 Mbps is shared by three weighted classes, with weights 25 for video, 35 for business data and 20 for default. When every class has more to send than its share, each one gets its weight divided by the total weight, 80, of the 86.9 Mbps. When a class offers less than its share, the unused part is shared among the classes that still want more.

Diagram
From 95 Mbps to each class
From 95 Mbps to each class

The shaped rate is 95 megabits. Voice takes 8.1 from the priority queue, which leaves 86.9 to share. Video takes 18.0, which is less than its share and all it asked for. The remaining 68.9 is split between business data and default in the ratio 35 to 20.

  1. Shaped95 Mbps
  2. Voicetakes 8.1,priority
  3. Shared86.9 Mbps
  4. Videotakes 18.0,all it asks
  5. Split68.9 in theratio 35:20
A class that asks for less than its share frees the rest for the classes that want more.
Diagram
Shares of 86.9 Mbps on a shaped link (computed)
Shares of 86.9 Mbps on a shaped link (computed)
ClassWeightOfferedReceived
Video2518 Mbps18.0 Mbps, all of it
Business data3560 Mbps43.8 Mbps
Default (backups and the rest)2080 Mbps25.1 Mbps
If business offers only 10 Mbps3510 Mbps10.0 Mbps; default then receives 58.9 Mbps
Video asked for less than its share of 27.2 Mbps, so its spare 9.2 Mbps went to the other two in proportion to their weights.

Two points follow. A weight is not a limit: a class can use more than its share when others are quiet. And it is not a guarantee of a fixed number either, because the share depends on which classes are busy. The guarantee is the minimum a class receives when everyone is busy.

What happens when a queue fills

A queue has a finite length. When it is full, something has to be dropped. The simplest rule drops whatever arrives next, which is tail drop. The alternative drops a few packets early and at random as the queue grows.

Diagram
Two ways to drop from a full queue
Two ways to drop from a full queue

Tail drop discards the packets that arrive when the queue is full, so many flows slow down together. Random early detection discards a few packets early, so flows slow down one at a time.

Tail dropDrops when the queue is fullFlows slow together
Random early detectionDrops a few early, at randomFlows slow one by one
Voice does not slow down when a packet is lost, so early drops only add loss to a voice queue.
Diagram
Tail drop and random early detection
Tail drop and random early detection
PolicyWhat it dropsEffect on TCPFits
Tail dropPackets that arrive when the queue is fullMany flows lose packets together and slow down together, then speed up togetherVoice and other traffic that does not slow down
Random early detectionA few packets, at random, as the queue buildsFlows slow down one at a time, which keeps the queue shorterQueues that carry mostly TCP data
Dropping voice early would only hurt, because a voice sender does not slow down when a packet is lost.

Worked example: video marked as voice

Interactive video was breaking up and someone decided that video is important, so the video endpoints were re-marked EF to put them in the priority queue. Voice calls then began to break up as well. The priority class is limited to 20 Mbps while the link is congested. Voice offers 8.1 Mbps and video offers 18 Mbps, together 26.1 Mbps, which is more than the limit.

Diagram
Queue counters at 15:00 (example values)
Queue counters at 15:00 (example values)
QueueClassOfferedLimitSentDropped
PriorityVoice and video, both EF26.1 Mbps20.0 Mbps20.0 Mbps6.1 Mbps (23 percent)
WeightedBusiness data60 Mbpsweight 3547.7 Mbps12.3 Mbps
WeightedDefault80 Mbpsweight 2027.3 Mbps52.7 Mbps
Example counters. Names and layout differ by platform. The priority queue drops 6.1 of 26.1 Mbps, which is 23.4 percent, and it drops voice and video alike.
Diagram
Evidence from the priority case
Evidence from the priority case

Voice broke up after video was marked EF. The priority queue offered 26.1 megabits and may send 20, so it drops 23 percent of everything in it. The loss hits voice as well as video, because the queue does not tell them apart. The fix is to give video its own weighted class.

  1. SymptomVoice breaks up after video was re-markedlink and tunnel look healthy
  2. Offered8.1 Mbps voice plus 18 Mbps video26.1 Mbps in the priority class
  3. Limit20 Mbps while congested6.1 Mbps cannot be sent
  4. Loss6.1 of 26.1 Mbps, 23.4 percentvoice and video lose alike
  5. FixVideo back to AF41, in its ownweighted queue; priority keeps voice
A priority queue cannot hold more than its limit, however important the traffic in it feels.

The repair is to put video in a weighted queue of its own, with a weight that gives it enough in the busy hour, and to keep the priority queue for voice. With video out of the priority class, voice offers 8.1 Mbps against a 20 Mbps limit and loses nothing, and video receives its full 18 Mbps in the sharing table above. The lesson is about sizing: a priority class is a promise for a known amount of traffic, and more than that breaks the promise for all of it.

The repair has a cost that the counters make visible. The link is full either way, so the extra rate that voice and video receive has to come from the weighted classes that were using it. The table shows who pays.

Diagram
Before and after the fix (computed)
Before and after the fix (computed)
ClassBeforeAfterChange
Voice6.2 Mbps sent8.1 Mbps sent+1.9 Mbps
Video13.8 Mbps sent18.0 Mbps sent+4.2 Mbps
Business data47.7 Mbps43.8 Mbps-3.9 Mbps
Default27.3 Mbps25.1 Mbps-2.2 Mbps
Total95.0 Mbps95.0 Mbps0
Computed by script from this lesson's numbers: 95 Mbps shaped, a 20 Mbps priority limit, weights of 35 and 20 for business and default before the fix and 25, 35 and 20 with video after it. Assumes the priority queue drops voice and video in proportion.

Where classification happens

Classification and queueing happen at different edges. The sending edge classifies on its LAN side, from the marks the hosts set or from its own rules, and queues on its WAN side. The receiving edge classifies the arriving packets again, from the marks that crossed the provider, and queues them for its own LAN. Each edge therefore schedules the direction that leaves it, and an asymmetric circuit needs a shaper for each direction.

Diagram
Where each edge classifies and queues
Where each edge classifies and queues

The sending edge classifies on its LAN side and queues and shapes on its WAN side. The provider carries the marks. The far edge classifies the arriving packets again on its WAN side and queues them for its own LAN.

  1. Send edgeLAN side:classify
  2. Send edgeWAN side:queue, shape
  3. Providercarriesthe marks
  4. Far edgeWAN side:classify
  5. Far edgeLAN side:queue
Each edge schedules the direction that leaves it, so an asymmetric circuit needs a shaper for each direction.

Learn more: QoS Architecture and DSCP MappingQoS Concepts: Marking, Queueing and Shaping

Test yourself

Predict · scenario 1

A link runs at 40 percent of its rate all day. A QoS policy is in place. What does the scheduler do?

Predict · scenario 2

A priority class is limited to 20 Mbps. Voice offers 8.1 Mbps and video offers 18 Mbps, both in that class. What share of the priority traffic is dropped?

Predict · scenario 3

Three weighted classes have weights 25, 35 and 20, and all are busy on 80 Mbps of spare rate. What does the 35 class receive?

Predict · scenario 4

A weighted class offers less than its share. What happens to its unused share?

Predict · scenario 5

Why is random early detection a poor choice for a voice queue?

Predict · scenario 6

In the worked example, video moves out of the priority queue into its own weighted class. What happens to the business-data class?

Predict · scenario 7

A circuit is shaped at 95 Mbps and voice takes 8.1 Mbps from the priority queue. Video has weight 25 out of a total of 80. What is video's share of what is left when every weighted class is busy?

Predict · scenario 8

A branch circuit sends at 20 Mbps and the hub circuit sends toward the branch at 100 Mbps (example rates). Where is each direction shaped?

FAQ

Why do queues not matter when the link is quiet?
A packet only waits when the interface is busy. With no waiting there is nothing to order, so the scheduler has no effect. QoS differences appear in the minutes when the link fills, which is why a test needs load.
How many queues does an edge have?
That depends on the platform and the release. Cisco SD-WAN localized QoS uses a small fixed number of numbered queues, with one that can be made a low-latency queue. Read the figures for your platform in the documentation before designing around a number.
Is a priority queue the right place for voice?
It is the usual place, because it is served first and keeps delay low. The price is that the class must be limited to the traffic it was sized for. Anything else placed in it takes room from the voice.
What does RED do that tail drop does not?
Tail drop discards packets only when the queue is full, which hits many flows at the same moment. Random early detection starts dropping a few packets earlier, which tells TCP senders to slow down one by one. It suits TCP and does not help voice, which does not slow down when a packet is lost.