Defining CoS Classifiers (CLI Procedure)
Packet classification associates incoming packets with a particular 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. JUNOS Software supports two general types of classifiers:
- Behavior aggregate or CoS value traffic classifiers—Examines the CoS value in the packet header. The value in this single field determines the CoS settings applied to the packet. BA classifiers allow you to set the forwarding class and loss priority of a packet based on the Differentiated Services code point (DSCP) value, IP precedence value, orIEEE 802.1p value.
- Multifield traffic classifiers—Examines multiple fields in the packet such as source and destination addresses and source and destination port numbers of the packet. With multifield classifiers, you set the forwarding class and loss priority of a packet based on firewall filter rules.
The following example describes how to configure a BA classifier ba-classifier as the default DSCP map and apply it to either a specific Gigabit Ethernet interface or to all the Gigabit Ethernet interfaces on the switch. The BA classifier assigns loss priorities, as shown in Table 1, to incoming packets in the four forwarding classes.
You can use the same procedure to set multifield classifiers (except that you would use firewall filter rules).
Table 1: BA-classifier Loss Priority Assignments
To configure a DSCP BA classifier named ba-classifier as the default DSCP map:
- Associate code point 000001 with forwarding class be and loss priority high:
[edit class-of-service classifiers]
user@switch# set dscp ba-classifier import default forwarding-class be loss-priority high code-points 000001 - Associate code point 101110 with forwarding class ef and loss priority high:
[edit class-of-service classifiers]
user@switch# set dscp ba-classifier forwarding-class ef loss-priority high code-points 101110 - Associate code point 001100 with forwarding class af and loss priority high:
[edit class-of-service classifiers]
user@switch# set dscp ba-classifier forwarding-class af loss-priority high code-points 001100 - Associate code point 110001 with forwarding class nc and loss priority high:
[edit class-of-service classifiers]
user@switch# set dscp ba-classifier forwarding-class nc loss-priority high code-points 110001 - Apply the classifier to a specific interface or to all
Gigabit Ethernet interfaces on the switch.
- To apply the classifier to a specific interface:
[edit class-of-service interfaces]
user@switch# set ge-0/0/0 unit 0 classifiers dscp ba-classifier - To apply the classifier to all Gigabit Ethernet interfaces
on the switch, use wildcards for the interface name and the logical-interface
(unit) number:
[edit class-of-service interfaces]
user@switch# set ge-* unit * classifiers dscp ba-classifier
- To apply the classifier to a specific interface: