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
- 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.
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 class | Typical use |
|---|---|
| best-effort | Ordinary data |
| expedited-forwarding | Voice or other low delay traffic |
| assured-forwarding | Business data that needs a guarantee |
| network-control | Routing 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
| Type | How it works | Scope |
|---|---|---|
| Behavior aggregate (BA) | Reads one header field: DSCP, IP precedence, 802.1p or MPLS EXP, and maps its value to a class and PLP | Applied per interface or unit |
| Multifield (MF) | A firewall filter matches on several fields, such as addresses, ports and protocol, and sets the class | Applied as an input filter |
| Fixed | Every packet entering an interface gets one class | Per 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
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 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 used | Effect |
|---|---|
| Drop profile | A higher PLP can have a more aggressive drop curve |
| Rewrite rule | The rewritten code point can depend on the PLP |
| Policer | A policer can mark out of profile traffic as high PLP instead of discarding it |
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.
| Symptom | Likely cause |
|---|---|
| All traffic in best-effort | Classifier not applied to the interface, or code points do not match |
| Voice in the wrong queue | The class is mapped to the wrong queue number |
| MF filter not effective | Filter not applied as input, or a term before it accepts the packet |
| No class for a marked packet | The 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-classandshow 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.