Setting a Class of Service Value for the LSP

The 3-bit 'EXP' field in the MPLS header can be used to define a Class of Service (CoS) value for packets traveling through the LSP. The user can manually set a CoS value for the LSP. The CoS value that the user sets is applied to the CoS (EXP) field in the MPLS header of all packets entering this LSP. This lets all packets traveling through an LSP to be treated with the same priority as they travel the MPLS domain. The user can assign the LSP a CoS in the range 0-7.

To assign a CoS value of 7 (highest priority) to all packets traveling through LSP tunnel 1, complete the following steps.
  1. Enable the device for configuration.
    device# configure
  2. Enable the MPLS router.
    device(config)# router mpls
  3. Enable and configure the signaled label switched path (LSP).
    device(config-router-mpls)# lsp tunnel1
    In this example, the specified LSP is named 'tunnel1'.
  4. Assign a value for the CoS.
    device(config-router-mpls-lsp-tunnel1)# cos 7

    The MPLS CoS value is used for determining priority within an MPLS domain only, so when the label is popped, the CoS value in the MPLS header is discarded; it is not copied back to the IP ToS field.

Example

The following example shows how to configure the cos command with a value of 7.

device# configure
device(config)# router mpls
device(config-router-mpls)# lsp tunnel1
device(config-router-mpls-lsp-tunnel1)# cos 7