To configure CoS for MPLS, you can include the following statements at the [edit class-of-service] hierarchy level of the configuration.
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.
To specify a CoS value for packets in an LSP, include the class-of-service statement:
- class-of-service cos-value;
You can include this statement at the following hierarchy levels:
The class-of-service statement at the [edit protocols mpls label-switch-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 router 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 router 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 (MF) classifier at the [edit firewall] hierarchy level.
We recommend configuring all routers along the LSP to have the same input classifier for EXP, and, if a rewrite rule is configured, all routers 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.
For more information, see the JUNOS MPLS Applications Configuration Guide.