Configuring CoS for MPLS
When IP traffic enters a label-switched path (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, each interface has up to eight transmit queues. The CoS value is encoded as part of the Multiprotocol Label Switching (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).
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).
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-servicestatement:class-of-servicecos-value;You can include the
class-of-servicestatement at the following hierarchy levels:
[edit logical-routerslogical-router-nameprotocols rsvp interfaceinterface-namelink-protection][edit logical-routerslogical-router-nameprotocols rsvp interfaceinterface-namelink-protection bypassdestination][edit logical-routerslogical-router-nameprotocols mpls][edit logical-routerslogical-router-nameprotocols mpls label-switched-pathpath-name][edit logical-routerslogical-router-nameprotocols mpls label-switched-pathpath-nameprimarypath-name][edit logical-routerslogical-router-nameprotocols mpls label-switched-pathpath-namesecondarypath-name][edit logical-routerslogical-router-nameprotocols mpls static-pathprefix][edit logical-routerslogical-router-nameprotocols mpls interfaceinterface-namelabel-maplabel-value][edit protocols mpls][edit protocols mpls interfaceinterface-namelabel-maplabel-value][edit protocols mpls label-switched-pathpath-name][edit protocols mpls label-switched-pathpath-nameprimarypath-name][edit protocols mpls label-switched-pathpath-namesecondarypath-name][edit protocols mpls static-pathprefix][edit protocols rsvp interfaceinterface-namelink-protection][edit protocols rsvp interfaceinterface-namelink-protection bypassdestination]For more information, see the JUNOS MPLS Applications Configuration Guide.