Class of Service · Topic 2 of 4

Forwarding Classes, Classification and Packet Loss Priority

JN0-650 study page on Junos forwarding classes, BA and multifield classification, classifier configuration and packet loss priority, with show commands.

  • 5 min
In a nutshell
  • A forwarding class maps to a queue; classification assigns class and PLP.
  • Types: BA (one field), MF (firewall filter), fixed (per interface).
  • MF overrides BA when both apply.

What it is

A forwarding class is a name for a group of packets that get the same treatment. It maps to an output queue, so the class decides which queue a packet waits in.

Classification is the step that assigns each incoming packet to a forwarding class. Packet loss priority (PLP) is a second label, set at the same time, that says how readily the packet may be dropped when queues fill up.

PacketDSCP 46BA classifierForwarding class EFQueue 5andPLP lowDropped last

How it works

Forwarding classes and queues

A forwarding class belongs to one queue. Several classes can share a queue on some platforms, but the normal design is one class per queue. The number of queues depends on the platform, and typically there are eight.

Default classTypical use
best-effortOrdinary data
expedited-forwardingVoice or other low delay traffic
assured-forwardingBusiness data that needs a guarantee
network-controlRouting protocol traffic

You can define your own classes by mapping a name to a queue number. On ELS devices the form is:

set class-of-service forwarding-classes class VOICE queue-num 5
set class-of-service forwarding-classes class VIDEO queue-num 4

Older syntax uses forwarding-classes queue 5 VOICE. Some switch platforms also group classes into forwarding class sets so that bandwidth can be assigned to a group of classes together.

Types of classification

TypeHow it worksScope
Behavior aggregate (BA)Reads one header field: DSCP, IP precedence, 802.1p or MPLS EXP, and maps its value to a class and PLPApplied per interface or unit
Multifield (MF)A firewall filter matches on several fields, such as addresses, ports and protocol, and sets the classApplied as an input filter
FixedEvery packet entering an interface gets one classPer interface

If both a BA classifier and an MF filter apply, the MF result overrides the BA result, because the filter runs after the BA classifier.

Configuring a BA classifier

A classifier is a table that maps code points to a forwarding class and loss priority. You then apply it to an interface.

set class-of-service classifiers dscp VOICE-CLASSIFIER forwarding-class VOICE loss-priority low code-points 101110
set class-of-service classifiers dscp VOICE-CLASSIFIER forwarding-class best-effort loss-priority high code-points 000000
set class-of-service interfaces ge-0/0/1 unit 0 classifiers dscp VOICE-CLASSIFIER

The classifier type states which field it reads: dscp, dscp-ipv6, inet-precedence, ieee-802.1 or exp.

You can also define a name for a code point with an alias and use it in the classifier:

set class-of-service code-point-aliases dscp EF 101110
Exam tip

A classifier maps in one direction only, from a code point on the incoming packet to a class and a PLP. The reverse mapping, from class back to code point, is a rewrite rule.

Configuring an MF classifier

An MF classifier is a firewall filter that sets the forwarding class and loss priority in the then clause.

set firewall family inet filter MF term sip from protocol udp
set firewall family inet filter MF term sip from destination-port 5060
set firewall family inet filter MF term sip then forwarding-class VOICE
set firewall family inet filter MF term sip then loss-priority low
set firewall family inet filter MF term sip then accept
set firewall family inet filter MF term rest then accept
set interfaces ge-0/0/1 unit 0 family inet filter input MF

On a switch the filter is in family ethernet-switching and is applied under the interface's family ethernet-switching.

Packet arrivesBA classifierClass AMF filter matchClass B overridesFinal class

Packet loss priority

PLP has up to four values: low, medium-low, medium-high and high. Many switch platforms support only low and high. A classifier or a firewall filter sets it, and a policer can raise it when traffic exceeds its rate.

Where PLP is usedEffect
Drop profileA higher PLP can have a more aggressive drop curve
Rewrite ruleThe rewritten code point can depend on the PLP
PolicerA policer can mark out of profile traffic as high PLP instead of discarding it
Watch out

PLP does not change which queue a packet uses. It only changes how likely the packet is to be dropped inside that queue.

Verification

show class-of-service classifier
show class-of-service forwarding-class
show class-of-service interface ge-0/0/1
show interfaces queue ge-0/0/1

show class-of-service interface shows which classifier and rewrite rule applies to the interface. show interfaces queue shows per queue packet and byte counters, so you can see whether traffic lands in the expected queue.

SymptomLikely cause
All traffic in best-effortClassifier not applied to the interface, or code points do not match
Voice in the wrong queueThe class is mapped to the wrong queue number
MF filter not effectiveFilter not applied as input, or a term before it accepts the packet
No class for a marked packetThe code point is not in the classifier, so the default class is used

Common mistakes

Defining a class but not mapping it to a queue. The class has nowhere to go.

Applying a classifier to the wrong unit or direction. Classification is on ingress.

Expecting BA to beat MF. MF overrides BA.

Thinking PLP selects the queue. The forwarding class does.

Assuming every platform has four PLP values. Many have two.

What to remember for the exam

  • A forwarding class maps to a queue; classification assigns class and PLP.
  • Types: BA (one field), MF (firewall filter), fixed (per interface).
  • MF overrides BA when both apply.
  • BA classifier types: dscp, dscp-ipv6, inet-precedence, ieee-802.1, exp.
  • PLP values: low, medium-low, medium-high, high; it influences drops and rewrite, not the queue.
  • Verify with show class-of-service classifier, forwarding-class and show interfaces queue.

Check yourself

  • Which classification method looks at several header fields, and what is it implemented as?

    Multifield classification, implemented as a firewall filter.

  • A packet matches both a BA classifier and an MF filter. Which one wins?

    The MF filter, because its result overrides the BA classifier.

  • Does packet loss priority decide the queue?

    No, the forwarding class selects the queue; PLP only affects drop likelihood and rewrite.

Topic 2 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.