[Contents] [Prev] [Next] [Index] [Report an Error]


Configure the MPLS CoS Value

When IP traffic enters an LSP tunnel, the ingress router marks all packets with a class-of-service (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.

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). The general CoS features are described in the JUNOS Internet Software Configuration Guide: Interfaces and Class of Service.

When traffic enters an LSP tunnel, the CoS bits in the MPLS header are set in one of two ways. In the first way, 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. The JUNOS Internet Software Configuration Guide: Interfaces and Class of Service explains the IP CoS values, and summarizes how the CoS bits are treated.

In the second way, you set a fixed CoS value on all packets entering the LSP tunnel. This means that all packets entering the LSP receive the same class of service. To do this, include the class-of-service statement at the [edit protocols mpls], [edit protocols mpls label-switched-path lsp-path-name ], or [edit protocols mpls label-switched-path lsp-path-name (primary | secondary)] hierarchy level:

class-of-service cos-value ; 

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 the JUNOS Internet Software Configuration Guide: Interfaces and Class of Service.


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 2 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 the JUNOS Internet Software Configuration Guide: Interfaces and Class of Service.


Table 2: 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.


[Contents] [Prev] [Next] [Index] [Report an Error]