Configuring Class of Service for MPLS LSPs
The following sections provide an overview of MPLS class of service (CoS) and describe how to configure the MPLS CoS value:
Class of Service for MPLS Overview
When IP traffic enters an LSP tunnel, the ingress router marks all packets with a CoS value, which is used to place the traffic into a transmission priority queue. On the router, for SDH/SONET and T3 interfaces, each interface has four transmit queues. The CoS value is encoded as part of the MPLS header and remains in the packets until the MPLS header is removed when the packets exit from the egress router. The routers within the LSP utilize the CoS value set at the ingress router. The CoS value is encoded by means of the CoS bits (also known as the EXP or experimental bits). For more information, see MPLS Label Allocation.
MPLS class of service works in conjunction with the router’s general CoS functionality. If you do not configure any CoS features, the default general CoS settings are used. For MPLS class of service, you might want to prioritize how the transmit queues are serviced by configuring weighted round-robin, and to configure congestion avoidance using random early detection (RED)..
Configuring the MPLS CoS Values
When traffic enters an LSP tunnel, the CoS value in the MPLS header is set in one of three ways:
The number of the output queue into which the packet was buffered and the packet loss priority (PLP) bit are written into the MPLS header and are used as the packet’s CoS value. This behavior is the default, and no configuration is required. Default MPLS EXP Classifier explains the default MPLS CoS values, and summarizes how the CoS values are treated.
You set a fixed CoS value on all packets entering the LSP tunnel. A fixed CoS value means that all packets entering the LSP receive the same class of service.
You set an MPLS EXP rewrite rule to override the default behavior.
To set a fixed CoS value on all packets entering the LSP, include the class-of-service statement:
You can include this statement at the following hierarchy levels:
[edit protocols mpls]
[edit protocols mpls label-switched-path path-name]
[edit protocols mpls label-switched-path path-name primary path-name]
[edit protocols mpls label-switched-path path-name secondary path-name]
[edit protocols rsvp interface interface-name link-protection]
[edit protocols rsvp interface interface-name link-protection bypass destination]
[edit logical-systems logical-system-name protocols mpls]
[edit logical-systems logical-system-name protocols mpls label-switched-path path-name]
[edit logical-systems logical-system-name protocols mpls label-switched-path path-name primary path-name]
[edit logical-systems logical-system-name protocols mpls label-switched-path path-name secondary path-name]
[edit logical-systems logical-system-name protocols rsvp interface interface-name link-protection ]
[edit logical-systems logical-system-name protocols rsvp interface interface-name link-protection bypass destination]
The CoS value set using the class-of-service statement at the [edit protocols mpls] hierarchy level supersedes the CoS value set at the [edit class-of-service] hierarchy level for an interface. Effectively, the CoS value configured for an LSP overrides the CoS value set for an interface.
The class-of-service statement at the [edit protocols mpls label-switched-path] hierarchy level assigns an initial EXP value for the MPLS shim header of packets in the LSP. This value is initialized at the ingress routing device only and overrides the rewrite configuration established for that forwarding class. However, the CoS processing (weighted round robin [WRR] and RED) of packets entering the ingress routing device is not changed by the class-of-service statement on an MPLS LSP. Classification is still based on the behavior aggregate (BA) classifier at the [edit class-of-service] hierarchy level or the multifield classifier at the [edit firewall] hierarchy level.
We recommend configuring all routing devices along the LSP to have the same input classifier for EXP, and, if a rewrite rule is configured, all routing devices should have the same rewrite configuration. Otherwise, traffic at the next LSR might be classified into a different forwarding class, resulting in a different EXP value being written to the EXP header.
The CoS value can be a decimal number from 0 through 7. This number corresponds to a 3-bit binary number. The high-order 2 bits of the CoS value select which transmit queue to use on the outbound interface card.
The low-order bit of the CoS value is treated as the PLP bit and is used to select the RED drop profile to use on the output queue. If the low-order bit is 0, the non-PLP drop profile is used, and if the low-order bit is 1, the PLP drop profile is used. It is generally expected that RED will more aggressively drop packets that have the PLP bit set. For more information about RED and drop profiles, see Managing Congestion Using RED Drop Profiles and Packet Loss Priorities.
Configuring the PLP drop profile to drop packets more aggressively (for example, setting the CoS value from 6 to 7) decreases the likelihood of traffic getting through.
Table 1 summarizes how MPLS CoS values correspond to the transmit queue and PLP bit. Note that in MPLS, the mapping between the CoS bit value and the output queue is hard-coded. You cannot configure the mapping for MPLS; you can configure it only for IPv4 traffic flows, as described in Understanding How Forwarding Classes Assign Classes to Output Queues.
Table 1: MPLS CoS Values
MPLS CoS Value
Because the CoS value is part of the MPLS header, the value is associated with the packets only as they travel through the LSP tunnel. The value is not copied back to the IP header when the packets exit from the LSP tunnel.
To configure class of service (CoS) for Multiprotocol Label Switching (MPLS) packets in a label-switched path (LSP):
- Specify the CoS value
If you do not specify a CoS value, the IP precedence bits from the packet’s IP header are used as the packet’s CoS value.
Rewriting IEEE 802.1p Packet Headers with the MPLS CoS Value
For Ethernet interfaces installed on a T Series router or an M320 router with a peer connection to an M Series router or a T Series router, you can rewrite both MPLS CoS and IEEE 802.1p values to a configured value (the MPLS CoS values are also known as the EXP or experimental bits). Rewriting these values allows you to pass the configured value to the Layer 2 VLAN path. To rewrite both the MPLS CoS and IEEE 802.1p values, you must include the EXP and IEEE 802.1p rewrite rules in the class of service interface configuration. The EXP rewrite table is applied when you configure the IEEE 802.1p and EXP rewrite rules.
For information about how to configure the EXP and IEEE 802.1p rewrite rules, see Rewriting Packet Headers to Ensure Forwarding Behavior.