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 OS supports two general types of classifiers:

  • Behavior aggregate (BA) classifier—Examine 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, or IEEE 802.1p value. EX Series switches except EX4300 switches support two types of loss priorities: high and low. EX4300 switches support three types of loss priorities: high, medium-high, and low.

    You can configure BA classifiers for the following CoS marker types:

    • dscp and dscp-ipv6—Handles incoming IPv4 and IPv6 packets, respectively.

    • ieee-802.1—Handles Layer 2 CoS.

    • inet-precedence—Handles incoming IPv4 packets. IP precedence mapping requires only the higher order three bits of the DSCP field.

  • Multifield (MF) classifier—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.

Note

Juniper Networks EX8200 Ethernet Switches implement the on-demand ternary content addressable memory (TCAM) allocation of memory so that when additional TCAM space is required for CoS, the space is allocated from the free TCAM space or from the unused TCAM space. An error log message is generated when you configure CoS classifiers beyond the available TCAM space that includes both the free and unused space.

The following example describes how to configure a BA classifier (ba-classifier) as the default DSCP map for handling IPv4 traffic and to apply the BA classifier 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 MF classifiers (except that you would use firewall filter rules).

Table 1: BA-classifier Loss Priority Assignments

Forwarding ClassFor CoS Traffic Typeba-classifier Assignment

be

Best-effort traffic

High-priority code point: 000001

ef

Expedited-forwarding traffic

High-priority code point: 101110

af

Assured-forwarding traffic

High-priority code point: 001100

nc

Network-control traffic

High-priority code point: 110001

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
      Note

      On EX8200 switches, it can take a long time to install code-point classifiers on multiple interfaces (for example, approximately 25 minutes to install 64 code-point classifiers on multiple interfaces in the order of 280 or more).