Understanding CoS Classifiers
Packet classification associates incoming packets with a particular CoS servicing level. Classifiers associate packets with a forwarding class and loss priority and, based on the associated forwarding class, assign packets to output queues. There are two general types of classifiers:
- Behavior aggregate (BA) classifiers
- Multifield (MF) classifiers
For a specified interface, you can configure both an MF classifier and a BA classifier without conflicts. In such cases, BA classification is performed first, followed by MF classification. In case of conflict, MF classifier overrides a BA classification result.
![]() |
Note: When a Layer 2 (L2) frame is learned, the frame is always sent out on Queue 0 while egressing from the network interface, irrespective of the classifier applied to the ingress interface. |
Behavior Aggregate Classifiers
The behavior aggregate classifier maps a class-of-service (CoS) value to a forwarding class and loss priority. The forwarding class determines the output queue. The loss priority is used by schedulers to control packet discard during periods of congestion.
There are three types of BA classifiers:
- Differentiated Services code point (DSCP) for IP DiffServ
- IP precedence bits
- IEEE 802.1p CoS bits
BA classifiers are based on fixed-length fields, which makes them computationally more efficient than MF classifiers. Therefore core devices, which handle high traffic volumes, are normally configured to perform BA classification.
In most cases, you need to rewrite a given marker (IP precedence, DSCP, or IEEE 802.1p) at the ingress node to accommodate BA classification by core and egress devices.
![]() |
Note: Although you can configure many classifiers, you can apply only one classifier on the switch. Whenever you apply a new classifier, you must explicitly remove the currently applied classifier and then apply the new classifier. |
JUNOS software automatically assigns implicit default classifiers to all logical interfaces based on the type of interface. Table 1 lists different types of interfaces and the corresponding implicit default classifiers.
Table 1: Default BA Classification
|
Type of Interface |
Default BA Classification |
|---|---|
|
Trunk interface |
ieee8021p-default |
|
Layer 3 interface |
dscp-default |
|
Access interface |
Untrusted |
When you explicitly associate a classifier with a logical interface, you are in effect overriding the implicit default classifier with an explicit classifier.
![]() |
Note: By default, all BA classifiers classify traffic into either best-effort forwarding class or network-control forwarding class. |
Multifield Classifiers
Multifield classifiers examine multiple fields in the packet such as source and destination addresses and source and destination port numbers of the packet. With MF classifiers, you set the forwarding class and loss priority of a packet based on firewall filter rules.
MF classification is normally performed at the network edge because of the general lack of DiffServ Code Point (DSCP) or IP precedence support in end-user applications. On an edge switch, an MF classifier provides the filtering functionality that scans through a variety of packet fields to determine the forwarding class for a packet. Typically, a classifier performs matching operations on the selected fields against a configured value.





