Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure CoS for MPLS LSPs

The following sections provide an overview of MPLS CoS and describe how to configure the MPLS CoS value:

CoS 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. Junos encodes the CoS value as part of the MPLS header and remains in the packets until the MPLS header is removed when the packets exit the egress router. The routers within the LSP use the CoS value set at the ingress. The CoS value is encoded by means of the CoS bits (also known as the EXP bits). For more information, see MPLS Label Allocation.

MPLS CoS works with the router’s general CoS functionality. If you do not configure any CoS features, the default general CoS settings are used. For MPLS CoS, you might want to configure WRR to prioritize how the transmit queues are serviced. Configure congestion avoidance using RED.

Configure 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 output queue number into which the packet was buffered and the PLP are written into the MPLS header and are used as the packet’s CoS value. This is default behavior and requires no configuration. Default MPLS EXP Classifier explains the default MPLS CoS values and how these 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.

Best Practice:

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 RED Drop Profiles for Congestion Management.

Note:

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

Bits

Transmit Queue

PLP Bit

0

000

0

Not set

1

001

0

Set

2

010

1

Not set

3

011

1

Set

4

100

2

Not set

5

101

2

Set

6

110

3

Not set

7

111

3

Set

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):

  1. 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.

Rewrite IEEE 802.1p Packet Headers with the MPLS CoS Value

You can rewrite both MPLS and IEEE 802.1p CoS values to a configured value. Rewriting these values allows you to pass the configured value to the L2 VLAN path. To rewrite both the MPLS and IEEE 802.1p CoS values, you must include the EXP and IEEE 802.1p rewrite rules in the CoS 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.