IP Services · Topic 7 of 9

QoS Per-Hop Behavior

Understand how QoS treats traffic hop by hop, including classification, marking, queuing, congestion avoidance, policing and shaping, in plain English.

  • 4 min
  • Exam objective 4.7
In a nutshell
  • QoS decides treatment when the network is congested.
  • PHB means each device chooses its own treatment from the marking.
  • The order is classification, marking, then queuing, congestion handling and rate limiting.

What it is

QoS lets a network treat some traffic better than other traffic.

Without it, every packet is handled first in, first out. That is fine until the network is busy. Then a video call and a large download compete for the same link, and the call suffers.

QoS protects traffic that is sensitive to four problems:

  • Bandwidth: not enough capacity for everything.
  • Delay: packets take too long to arrive.
  • Jitter: delay that varies from packet to packet, which hurts voice and video.
  • Loss: packets dropped, often because a queue is full.

QoS does not create bandwidth. It decides who goes first and who waits.

Per-hop behavior (PHB) means each device decides on its own how to treat a packet, based on its marking. If one device ignores the marking, the special treatment ends there.

How it works

QoS is a chain of steps that each device applies, in this order.

Packet invoice callclassifyRoutermatch on ACL or markingmarkPacketDSCP EF 46queueLLQpriority queueLLQpriority queuetransmit firstLink outcongested

Classification and marking

Classification sorts traffic into groups, using an access list, a protocol or an existing marking. Marking writes a label on the packet so later devices need not classify it again.

Three common markings:

  • CoS: a 3-bit field in the 802.1Q tag on Layer 2 frames, values 0 to 7.
  • IP Precedence: a 3-bit field in the IP header, values 0 to 7.
  • DSCP: a 6-bit field in the same IP header byte, values 0 to 63. It is the more detailed replacement for IP Precedence.

Well-known DSCP values show how PHBs are named:

  • Default (0): best effort, no special treatment.
  • EF (46): low delay and low loss, used for voice.
  • AF: written AFxy, where x is the class and y is the drop likelihood under congestion. A higher y means dropped sooner.
  • CS: values that match the older IP Precedence.
Exam tip

Voice is EF, DSCP 46. In AFxy, a higher class x gets better treatment, but a higher drop value y means dropped sooner.

Queuing

Queuing decides the order in which waiting packets leave.

MethodIdea
FIFOFirst in, first out, no preference
WFQWeighted fair queuing, shares the link among flows
CBWFQClass based, guarantees bandwidth per traffic class
LLQCBWFQ plus a strict priority queue for voice

Congestion avoidance

Tail drop discards new packets when a queue is full, hitting all traffic equally. WRED drops a few packets early, favouring less important ones, so TCP senders slow down before the queue overflows.

Policing and shaping

Both limit traffic to a rate, but they act differently.

Trafficover the ratepolicingDropped or remarkedTrafficover the rateshapingBufferheld in a queuereleased laterLinksmoothed flow
PolicingShaping
Excess trafficDropped or re-markedHeld and sent later
Effect on delayNone added, more lossAdds delay, smooths flow
DirectionInbound or outboundOutbound only

Shaping is typical when a provider enforces a rate lower than your link speed.

The trust boundary

The trust boundary is the point where you decide to accept markings from a device. A phone on a switch may be trusted, while a PC may not be. Traffic is usually re-marked at the edge so devices further along can rely on the labels.

What to remember for the exam

Nine points matter most.

  • QoS decides treatment when the network is congested.
  • PHB means each device chooses its own treatment from the marking.
  • The order is classification, marking, then queuing, congestion handling and rate limiting.
  • CoS is Layer 2. IP Precedence and DSCP are Layer 3.
  • DSCP has 6 bits. EF, value 46, is the voice marking.
  • LLQ is CBWFQ with a strict priority queue.
  • WRED drops early to avoid the sudden loss of tail drop.
  • Policing drops or re-marks the excess. Shaping delays it.
  • Voice needs low delay, jitter and loss. Cisco's design guidance for voice gives targets of about 150 ms one-way delay, 30 ms jitter and 1 percent loss.

Common mistakes

These five errors are frequent.

Believing QoS adds bandwidth. If a link is permanently too small, QoS cannot fix it.

Mixing up policing and shaping. Shaping buffers and delays. Policing drops or re-marks.

Mixing up CoS and DSCP. CoS lives in the VLAN tag and is lost when a frame is routed. DSCP travels end to end in the IP header.

Assuming markings are global. Each hop decides whether to honour them.

Reading higher AF numbers as always better. Class x is better when higher, but drop value y is worse when higher.

Watch out

Giving every traffic class top priority removes the point of having priorities.

Check yourself

Answer these three prompts.

  • What do classification and marking each do, and why does marking help later devices?

    Classification sorts traffic into groups, and marking writes a label on the packet. Later devices then need not classify it again.

  • How do policing and shaping differ in what happens to excess traffic?

    Policing drops or re-marks the excess traffic. Shaping holds it in a queue and sends it later.

  • Why does voice go in a priority queue, and which DSCP value commonly identifies it?

    Voice needs low delay, jitter and loss, so LLQ gives it a strict priority queue. It is marked EF, DSCP 46.

Topic 7 of 9 in IP Services

Test yourself on IP Services

The full Cisco CCNA 200-301 question bank has 1,206 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.