Class of Service · Topic 3 of 4

Policers, Schedulers and Drop Profiles

JN0-650 study page on Junos policers, schedulers and drop profiles: token bucket policing, transmit rate, priority, scheduler maps and WRED curves.

  • 6 min
In a nutshell
  • Policer: token bucket, bandwidth-limit and burst-size-limit, discards or marks, never buffers.
  • Three-color policers use green, yellow and red; single rate and two rate variants.
  • Scheduler: transmit rate, buffer size, priority, drop profile map; applied by a scheduler map to an interface.

What it is

A policer limits the rate of traffic. Traffic above the limit is dropped or marked, so a policer never delays a packet.

A scheduler decides how much bandwidth and what priority each queue gets on an interface. A drop profile tells a queue when to start dropping packets as it fills, so congestion is handled before the queue is full.

TrafficOver its rate?policerMarked or droppedqueueSchedulerBandwidth and prioritydrop profileLink

How it works

Policers

A policer uses a token bucket. Tokens arrive at the configured rate, and each packet needs tokens for its size. If tokens are available the packet conforms. If not, it is out of profile.

ParameterMeaning
bandwidth-limitThe rate, in bits per second (for example 10m)
burst-size-limitThe bucket depth in bytes, which allows short bursts
Action discardDrop out of profile packets
Action loss-priority highKeep the packets but mark them as droppable
Action forwarding-classReassign the class of out of profile packets
set firewall policer LIMIT-10M if-exceeding bandwidth-limit 10m
set firewall policer LIMIT-10M if-exceeding burst-size-limit 100k
set firewall policer LIMIT-10M then discard
set firewall family inet filter RATE term all then policer LIMIT-10M
set interfaces ge-0/0/1 unit 0 family inet filter input RATE

The policer is called from a firewall filter (or applied directly on some interfaces), so it acts on ingress, or on egress if the filter is applied as output.

Three-color policers classify traffic into green, yellow and red. They are either single rate (committed information rate, committed and excess burst) or two rate (committed and peak information rates). Green is conforming, yellow exceeds the committed level and red exceeds the limit. The policer marks packets with different loss priorities, and may drop the red ones.

Watch out

A policer drops excess traffic immediately and cannot buffer it. If a sender needs its bursts smoothed rather than dropped, use a shaper, not a policer.

Schedulers

A scheduler describes the treatment of one queue. A scheduler map links each forwarding class to a scheduler, and the scheduler map is applied to an interface.

Scheduler settingMeaning
transmit-rateThe bandwidth the queue is guaranteed, as a percentage or a rate
buffer-sizeThe share of buffer memory for the queue
priorityThe queue's priority: strict-high, high, medium-high, medium-low or low
drop-profile-mapThe drop profile to use for a loss priority and protocol
shaping-rateA maximum rate for the queue
excess-rateHow leftover bandwidth is shared
set class-of-service schedulers SCH-VOICE transmit-rate percent 30
set class-of-service schedulers SCH-VOICE buffer-size percent 10
set class-of-service schedulers SCH-VOICE priority strict-high
set class-of-service schedulers SCH-DATA transmit-rate percent 60
set class-of-service schedulers SCH-DATA priority low
set class-of-service scheduler-maps SMAP forwarding-class VOICE scheduler SCH-VOICE
set class-of-service scheduler-maps SMAP forwarding-class best-effort scheduler SCH-DATA
set class-of-service interfaces ge-0/0/1 scheduler-map SMAP

The scheduler serves queues in strict priority order first, then shares the remaining capacity among queues of equal priority in proportion to their transmit rates (weighted round robin). Bandwidth that a queue does not use is available to the others.

PriorityBehavior
strict-highServed before all others, as long as it has packets
high, medium-high, medium-low, lowServed in priority order, weighted by transmit rate within a level
Exam tip

A strict-high queue can starve the others. Combine strict priority for voice with a limit on its rate, using the transmit rate or a policer, so that a misbehaving voice stream cannot take all of the link.

Queue 5Voice, strict highfirstLinkQueue 2Business, 30 percentsharesLinkQueue 0Best effort, 60 percentsharesLink

Drop profiles and WRED

A tail drop queue discards every new packet only after it is full. That causes many TCP flows to back off together. Weighted random early detection (WRED) starts dropping a small, random share of packets as the queue fills, so flows slow down gradually.

A drop profile is a curve: for each queue fill level, a drop probability. You write it by listing fill levels and drop probabilities.

set class-of-service drop-profiles DP-DATA interpolate fill-level 40
set class-of-service drop-profiles DP-DATA interpolate fill-level 100
set class-of-service drop-profiles DP-DATA interpolate drop-probability 0
set class-of-service drop-profiles DP-DATA interpolate drop-probability 100
set class-of-service schedulers SCH-DATA drop-profile-map loss-priority high protocol any drop-profile DP-DATA

In the example the queue drops nothing below 40 percent full, and the drop probability rises linearly to 100 percent at 100 percent fill. A higher PLP packet can be given a steeper profile, so it is dropped before low PLP packets.

ItemTail dropWRED
Starts droppingWhen the queue is fullBefore the queue is full
SelectionAll new packetsA probabilistic share
Effect on TCPSynchronized slowdownGradual, desynchronized
Uses PLPNoYes, a profile per PLP

Verification

show class-of-service scheduler-map
show class-of-service drop-profile
show policer
show interfaces queue ge-0/0/1

Common mistakes

Using a policer where a shaper is meant. A policer drops; it does not buffer.

Forgetting to apply the scheduler map to the interface. The default scheduling applies.

Putting strict-high on several heavy queues. The lower queues starve.

Writing a drop profile with unmatched lists. Fill levels and probabilities must pair up.

Expecting WRED to help non-TCP traffic. It relies on senders slowing down.

What to remember for the exam

  • Policer: token bucket, bandwidth-limit and burst-size-limit, discards or marks, never buffers.
  • Three-color policers use green, yellow and red; single rate and two rate variants.
  • Scheduler: transmit rate, buffer size, priority, drop profile map; applied by a scheduler map to an interface.
  • Strict-high is served first and can starve other queues.
  • Drop profile: fill level against drop probability; WRED drops early and randomly.
  • A higher loss priority can get a more aggressive drop profile.

Check yourself

  • What does a policer do with traffic over its limit, and what does it never do?

    It discards or marks it, and it never buffers or delays packets.

  • What links a forwarding class to a scheduler?

    A scheduler map, which is then applied to an interface.

  • Why use WRED instead of tail drop?

    It drops a few packets early so TCP flows slow down gradually instead of all backing off when the queue is full.

Topic 3 of 4 in Class of Service

Test yourself on Class of Service

The full Juniper JNCIP-ENT JN0-650 question bank has 858 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 Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.