Architecture · Topic 5 of 5

Interpreting QoS Configurations

Read Cisco QoS configs built with the Modular QoS CLI: class maps, policy maps, DSCP marking, policing, shaping, queuing and service policies.

  • 5 min
In a nutshell
  • MQC uses class maps, policy maps and the service-policy command.
  • Policy applies in the input or output direction on an interface.
  • DSCP uses six bits, and EF (46) is the usual value for voice.

What it is

Quality of Service (QoS) is a set of tools that treat some traffic better than other traffic when a link is busy.

Voice and video need low delay and little loss. A large file copy does not. QoS lets you protect the first kind and still give the second a fair share.

On Cisco IOS XE the usual way to configure it is the Modular QoS CLI (MQC). The exam asks you to read such a configuration and say what it does.

Packet infrom LANclassifyClass mapmatch DSCPmark and queuePolicy mapactions per classsent outInterfaceservice policy

How it works

MQC has three building blocks, and they are applied to an interface.

The three MQC steps

  1. A class map says which traffic belongs to a class.
  2. A policy map says what to do with each class.
  3. A service policy attaches the policy map to an interface in the input or output direction.
R1(config)# class-map match-any VOICE
R1(config-cmap)# match dscp ef
R1(config)# class-map match-any VIDEO
R1(config-cmap)# match dscp af41
R1(config)# policy-map WAN-OUT
R1(config-pmap)# class VOICE
R1(config-pmap-c)# priority percent 10
R1(config-pmap)# class VIDEO
R1(config-pmap-c)# bandwidth percent 30
R1(config-pmap)# class class-default
R1(config-pmap-c)# fair-queue
R1(config)# interface GigabitEthernet0/1
R1(config-if)# service-policy output WAN-OUT

Read it from the bottom up. The policy WAN-OUT is applied outbound on the interface.

Voice gets a priority queue limited to 10 percent. Video gets a guaranteed 30 percent. Everything else falls into class-default.

Classification and marking

Classification picks out traffic, using match statements on DSCP, access lists, protocols or other fields. Marking then writes a value into the packet so that later devices need not classify again.

MarkingWhere it livesNotes
CoSLayer 2, in the 802.1Q tagThree bits, values 0 to 7
IP precedenceTop three bits of the ToS byteOlder scheme
DSCPTop six bits of the ToS byteStandard Layer 3 marking

Common DSCP values to know are EF, which is 46 and is used for voice, and the AF classes, such as AF41 (34) for interactive video. Default traffic is DSCP 0.

In AFxy, x is the class and y is the drop precedence. A higher y is dropped first when there is congestion.

You mark with set:

R1(config-pmap)# class VOICE
R1(config-pmap-c)# set dscp ef

A trust boundary is the point where the network starts to believe the markings it receives. Mark traffic close to the source, and re-mark anything from an untrusted device.

Policing and shaping

Both limit the rate of traffic, but they act differently.

ToolExcess trafficEffect
PolicingDropped, or re-markedNo delay added, but may cause drops and bursts
ShapingBuffered and sent laterSmoother output, but adds delay
R1(config-pmap-c)# police cir 8000000 conform-action transmit exceed-action drop
R1(config-pmap-c)# shape average 50000000

Policing can be applied in either direction. Shaping is applied outbound. A common design shapes to the contracted rate of a WAN service, and attaches a child policy to queue inside the shaper.

Queuing and congestion avoidance

When a link is congested, packets wait in queues. The policy decides which queue gets what.

  • Priority queue (LLQ): priority gives strict priority to a class, with a limit so it cannot starve the others. It is meant for voice.
  • Class based weighted fair queuing (CBWFQ): bandwidth guarantees a share of the link to a class when there is congestion.
  • Weighted random early detection (WRED): random-detect drops some packets early, before the queue is full, so TCP flows slow down gradually.

Verifying

R1# show policy-map interface GigabitEthernet0/1
R1# show class-map
R1# show policy-map

show policy-map interface is the most useful. It shows each class, its match counters, and the packets queued or dropped.

What to remember for the exam

Eight facts cover most questions on this topic.

  • MQC uses class maps, policy maps and the service-policy command.
  • Policy applies in the input or output direction on an interface.
  • DSCP uses six bits, and EF (46) is the usual value for voice.
  • Policing drops or re-marks excess traffic. Shaping buffers it.
  • Shaping is applied in the output direction.
  • priority configures a low latency queue. bandwidth configures a guaranteed share.
  • random-detect enables WRED.
  • show policy-map interface shows counters for each class.
Exam tip

When reading a policy map, find the interface and direction first. The same policy can behave differently in or out.

Common mistakes

These four mistakes appear often.

Confusing policing with shaping. Policing drops the excess, while shaping delays it.

Expecting QoS to add bandwidth. QoS only chooses who waits or drops when the link is full.

Forgetting that class maps match in order. A packet takes the first class it matches, so the order in the policy map matters.

Leaving out the service policy. A policy map does nothing until it is attached to an interface.

Watch out

Queuing only acts when there is congestion. On an idle link, a bandwidth guarantee is not enforced as a limit.

Check yourself

Work through these three questions.

  • Which command attaches a policy map to an interface?

    The service-policy command, with the direction input or output.

  • What is the difference between policing and shaping?

    Policing drops or re-marks excess traffic without delay, while shaping buffers excess traffic and sends it later.

  • What does the priority percent 10 line do in a class?

    It gives that class a strict priority queue, limited to 10 percent of the bandwidth.

Topic 5 of 5 in Architecture

Test yourself on Architecture

The full Cisco CCNP 350-401 ENCOR question bank has 854 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.