Understanding CoS Classifiers
Packet classification associates incoming packets with a particular class-of-service (CoS) servicing level. Classifiers associate packets with a forwarding class and loss priority and assign packets to output queues based on the associated forwarding class. There are two general types of classifiers:
- Behavior aggregate (BA) classifiers
- Multifield (MF) classifiers
You can configure both a BA classifier and an MF classifier on an interface. If you do this, the BA classification is performed first and then the MF classification. If the two classification results conflict, the MF classification result overrides the BA classification result.
![]() | Note: When a source media access control (MAC) address is learned, the frame that contains the source MAC address is always sent out on queue 0 while egressing from the network interface, irrespective of the classifier applied to the ingress interface. |
On Juniper Networks EX8200 Ethernet Switches, you can specify BA classifiers for bridged multidestination traffic and IP multidestination traffic. The BA classifier for multicast packets is applied to all interfaces on the EX8200 switch.
This topic describes:
Behavior Aggregate Classifiers
The behavior aggregate classifier maps a CoS value to a forwarding class and loss priority. The forwarding class determines the output queue. The loss priority is used by a scheduler 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.
Default Behavior Aggregate Classification
Juniper Networks Junos OS 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 (IPv4) | dscp-default |
Layer 3 interface (IPv6) | dscp-ipv6-default |
Access interface | Untrusted |
Routed VLAN interface (RVI) | No default classification |
When you explicitly associate a classifier with a logical interface, you are in effect overriding the implicit default classifier with an explicit classifier.
On EX3200 and EX4200 switches, you can apply classifier rules for each interface. Table 2 describes the different classifier types you can configure on Layer 2 and Layer 3 interfaces.
Table 2: Allowed BA Classification
Type of Interface | Allowed BA Classification |
|---|---|
Layer 2 interface | IEEE 802.1p, IP Precedence, DSCP, DSCP IPv6 |
Layer 3 interface (IPv4) | IEEE 802.1p, IP Precedence, DSCP |
Layer 3 interface (IPv6) | IEEE 802.1p, IP Precedence, DSCP IPv6 |
You can configure all the allowed classifier types on the same logical interface or on different logical interfaces. If you need to apply all classifier rules on the same logical interface, configure the classifier rules allowed for both IPv4 and IPv6 on the logical interface.
If you have not explicitly associated a classifier with a logical interface, the default classifiers are assigned and classification works as follows:
- If the logical interface is configured with an IPv4 address, DSCP classifier is assigned by default, and IPv4 and IPv6 packets are classified using the DSCP classifier.
- If the logical interface is configured with an IPv6 address, DSCP IPv6 classifier is assigned by default, and IPv4 and IPv6 packets are classified using the DSCP IPv6 classifier.
![]() | Note: On EX8200 switches, only one classifier of type DSCP and of type IEEE 802.1p can be applied to an interface. |
You can configure routed VLAN interfaces (RVIs) to classify packets. After you do this, the User Priority (UP) bits in the incoming packets are rewritten according to the default IEEE 802.1p rewrite rule, except on EX8200 switches. On EX8200 switches, you must explicitly assign the default IEEE 802.1p rewrite rule to RVIs.
![]() | Note: By default, all BA classifiers classify traffic into either the best-effort forwarding class or the network-control forwarding class. |
Multifield Classifiers
Multifield classifiers examine multiple fields in a 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 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.

