Classifying and Marking MPLS EXP

The QoS EXP Matching feature allows you to classify and mark network traffic by modifying the Multiprotocol Label Switching (MPLS) experimental bits (EXP) field in IP packets. This module contains conceptual information and the configuration tasks for classifying and marking network traffic using the MPLS EXP field.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Prerequisites for Classifying and Marking MPLS EXP

  • The router must be configured as an MPLS provider edge (PE) or provider (P) router, which can include the configuration of a valid label protocol and underlying IP routing protocols.

Restrictions for Classifying and Marking MPLS EXP

  • MPLS classification and marking can only occur in an operational MPLS Network.

  • MPLS EXP classification and marking is supported on the main router interfaces for MPLS packet switching and imposition (simple IP imposition and Ethernet over MPLS (EoMPLS) imposition) and on Ethernet virtual circuits (EVCs) or Ethernet flow points (EFPs) for EoMPLS imposition.

  • MPLS EXP classification or marking for bridged MPLS packets on EVCs or EFPs is not supported.

  • MPLS EXP marking is supported only in the ingress direction.

  • If a packet is classified by IP type of service (ToS) or class of service (CoS) at ingress, it cannot be reclassified by MPLS EXP at egress (imposition case). However, if a packet is classified by MPLS at ingress it can be reclassified by IP ToS, CoS, or Quality of Service (QoS) group at egress (disposition case).

  • If a packet is encapsulated in MPLS, the MPLS payload cannot be checked for other protocols such as IP for classification or marking. Only MPLS EXP marking affects packets encapsulated by MPLS.

Information About Classifying and Marking MPLS EXP

Classifying and Marking MPLS EXP Overview

The QoS EXP Matching feature allows you to organize network traffic by setting values for the MPLS EXP field in MPLS packets. By choosing different values for the MPLS EXP field, you can mark packets so that packets have the priority that they require during periods of congestion. Setting the MPLS EXP value allows you to:
  • Classify traffic

    The classification process selects the traffic to be marked. Classification accomplishes this by partitioning traffic into multiple priority levels, or classes of service. Traffic classification is the primary component of class-based QoS provisioning. For more information, see the “Classifying Network Traffic” module.

  • Police and mark traffic

    Policing causes traffic that exceeds the configured rate to be discarded or marked to a different drop level. Marking traffic is a way to identify packet flows to differentiate them. Packet marking allows you to partition your network into multiple priority levels or classes of service. For more information, see the “Marking Network Traffic” module.

MPLS Experimental Field

The MPLS experimental bits (EXP) field is a 3-bit field in the MPLS header that you can use to define the QoS treatment (per-hop behavior) that a node should give to a packet. In an IP network, the DiffServ Code Point (DSCP) (a 6-bit field) defines a class and drop precedence. The EXP bits can be used to carry some of the information encoded in the IP DSCP and can also be used to encode the dropping precedence.

By default, Cisco IOS Software copies the three most significant bits of the DSCP or the IP precedence of the IP packet to the EXP field in the MPLS header. This action happens when the MPLS header is initially imposed on the IP packet. However, you can also set the EXP field by defining a mapping between the DSCP or IP precedence and the EXP bits. This mapping is configured using the set mpls experimental or police commands. For more information, see the “How to Classify and Mark MPLS EXP” section.

Benefits of MPLS EXP Classification and Marking

If a service provider does not want to modify the value of the IP precedence field in packets transported through the network, they can use the MPLS EXP field value to classify and mark IP packets.

By choosing different values for the MPLS EXP field, you can mark critical packets so that those packets have priority if network congestion occurs.

How to Classify and Mark MPLS EXP

Classifying MPLS Encapsulated Packets


Note

MPLS EXP topmost classification is not supported for bridged MPLS packets on Ethernet virtual circuits (EVC) or Ethernet flow points (EFP).


Procedure

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

class-map [match-all | match-any ] class-map-name

Example:


Router(config)# class-map exp3

Creates a class map to be used for matching traffic to a specified class, and enters class-map configuration mode.

  • Enter the class map name.

Step 4

match mpls experimental topmost mpls-exp-value

Example:


Router(config-cmap)# match mpls experimental topmost 3

Specifies the match criteria.

Note 

The match mpls experimental topmost command classifies traffic on the basis of the EXP value in the topmost label header.

Step 5

end

Example:


Router(config-cmap)# end 

(Optional) Returns to privileged EXEC mode.

Marking MPLS EXP on All Imposed Labels

Perform this task to set the value of the MPLS EXP field on all imposed label entries.

Before you begin

The router supports MPLS EXP marking only in the ingress direction.

In typical configurations, marking MPLS packets at imposition is used with ingress classification on IP ToS or CoS fields. However, generic matching with the class default value is supported with other ingress attributes such as vlan .


Note

For IP imposition marking, the IP precedence value is copied to the MPLS EXP value by default.



Note

For EVC configuration, a policy map that performs matching based on the CoS and that sets the EXP imposition value should be used to copy CoS values to the EXP value.



Note

The set mpls experimental imposition command works only on packets that have new or additional MPLS labels added to them.


Procedure

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

policy-map policy-map-name

Example:


Router(config)# policy-map mark-up-exp-2

Specifies the name of the policy map to be created and enters policy-map configuration mode.

  • Enter the policy map name.

Step 4

class class-map-name

Example:


Router(config-pmap)# class prec012

Creates a class map to be used for matching traffic to a specified class, and enters class-map configuration mode.

  • Enter the class map name.

Step 5

set mpls experimental imposition mpls-exp-value

Example:


Router(config-pmap-c)# set mpls experimental imposition 2

Sets the value of the MPLS EXP field on all imposed label entries.

Step 6

end

Example:


Router(config-pmap-c)# end 

(Optional) Returns to privileged EXEC mode.

Marking MPLS EXP on Label Switched Packets

Perform this task to set the MPLS EXP field on label switched packets.

Before you begin


Note

The set mpls experimental topmost command works only on packets that are already MPLS encapsulated.



Note

The router supports MPLS EXP marking in the ingress direction only, and does not support MPLS EXP classification or marking for bridged MPLS packets on EVCs or EFPs.


Procedure

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

policy-map policy-map-name

Example:


Router(config)# policy-map mark-up-exp-2

Specifies the name of the policy map to be created and enters policy-map configuration mode.

  • Enter the policy map name.

Step 4

class class-map-name

Example:


Router(config-pmap)# class-map exp012

Creates a class map to be used for matching traffic to a specified class, and enters class-map configuration mode.

  • Enter the class map name.

Step 5

set mpls experimental topmost mpls-exp-value

Example:


Router(config-pmap-c)# set mpls experimental topmost 2

Sets the MPLS EXP field value in the topmost label on the output interface.

Step 6

end

Example:


Router(config-pmap-c)# end 

(Optional) Returns to privileged EXEC mode.

Configuring Conditional Marking

To conditionally set the value of the MPLS EXP field on all imposed label, perform the following task:

Before you begin


Note

The set-mpls-exp-topmost-transmit action affects MPLS encapsulated packets only. The set-mpls-exp-imposition-transmit action affects any new labels that are added to the packet.


Procedure

  Command or Action Purpose
Step 1

enable

Example:


Router> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

policy-map policy-map-name

Example:


Router(config)# policy-map ip2tag

Specifies the name of the policy map to be created and enters policy-map configuration mode.

  • Enter the policy map name.

Step 4

class class-map-name

Example:


Router(config-pmap)# class iptcp

Creates a class map to be used for matching traffic to a specified class, and enters policy-map class configuration mode.

  • Enter the class map name.

Step 5

police cir bps bc pir bps be

Example:


Router(config-pmap-c)# police cir 1000000 pir 2000000

Defines a policer for classified traffic and enters policy-map class police configuration mode.

Step 6

conform-action [set-mpls-exp-imposition-transmit mpls-exp-value | set-mpls-exp-topmost-transmit mpls-exp-value]

Example:


Router(config-pmap-c-police)# conform-action set-mpls-exp-imposition-transmit 3
Defines the action to take on packets that conform to the values specified by the policer.
  • In this example, if the packet conforms to the committed information rate (cir) or is within the conform burst (bc) size, the MPLS EXP field is set to 3.

Step 7

exceed-action [set-mpls-exp-imposition-transmit mpls-exp-value | set-mpls-exp-topmost-transmit mpls-exp-value]

Example:


Router(config-pmap-c-police)# exceed-action set-mpls-exp-imposition-transmit 2

Defines the action to take on packets that exceed the values specified by the policer.

  • In this example, if the packet exceeds the cir rate and the bc size, but is within the peak burst (be) size, the MPLS EXP field is set to 2.

Step 8

violate-action drop

Example:


Router(config-pmap-c-police)# violate-action drop
Defines the action to take on packets whose rate exceeds the peak information rate (pir) and is outside the bc and be ranges.
  • You must specify the exceed action before you specify the violate action.

  • In this example, if the packet rate exceeds the pir rate and is outside the bc and be ranges, the packet is dropped.

Step 9

end

Example:


Router(config-pmap-c-police)# end 

(Optional) Returns to privileged EXEC mode.

Configuration Examples for Classifying and Marking MPLS EXP

Example: Classifying MPLS Encapsulated Packets

Defining an MPLS EXP Class Map

The following example defines a class map named exp3 that matches packets that contains MPLS experimental value 3:

Router(config)# class-map exp3 
Router(config-cmap)# match mpls experimental topmost 3 
Router(config-cmap)# exit 

Defining a Policy Map and Applying the Policy Map to an Ingress Interface

The following example uses the class map created in the example above to define a policy map. This example also applies the policy map to a physical interface for ingress traffic.

Router(config)# policy-map change-exp-3-to-2
Router(config-pmap)# class exp3
Router(config-pmap-c)# set mpls experimental topmost 2
Router(config-pmap)# exit
Router(config)# interface GigabitEthernet 0/0/0
Router(config-if)# service-policy input change-exp-3-to-2
Router(config-if)# exit

Defining a Policy Map and Applying the Policy Map to an Egress Interface

The following example uses the class map created in the example above to define a policy map. This example also applies the policy map to a physical interface for egress traffic.

Router(config)# policy-map WAN-out
Router(config-pmap)# class exp3
Router(config-pmap-c)# shape average 10000000
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface GigabitEthernet 0/0/0
Router(config-if)# service-policy output WAN-out
Router(config-if)# exit

Example: Marking MPLS EXP on All Imposed Labels

Defining an MPLS EXP Imposition Policy Map

The following example defines a policy map that sets the MPLS EXP imposition value to 2 based on the IP precedence value of the forwarded packet:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# class-map prec012
Router(config-cmap)# match ip prec 0 1 2
Router(config-cmap)# exit
Router(config)# policy-map mark-up-exp-2
Router(config-pmap)# class prec012
Router(config-pmap-c)# set mpls experimental imposition 2
Router(config-pmap-c)# exit
Router(config-pmap)# exit

Applying the MPLS EXP Imposition Policy Map to a Main Interface

The following example applies a policy map to Gigabit Ethernet interface 0/0/0:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface GigabitEthernet 0/0/0
Router(config-if)# service-policy input mark-up-exp-2
Router(config-if)# exit

Applying the MPLS EXP Imposition Policy Map to an EVC

The following example applies a policy map to the Ethernet Virtual Connection specified by the service instance command:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface GigabitEthernet 0/0/0
Router(config-inf)# service instance 100 ethernet
Router(config-if-srv)# xconnect 100.0.0.1 encapsulation mpls 100
Router(config-if-srv)# service-policy input mark-up-exp-2
Router(config-if-srv)# exit
Router(config-if)# exit

Example: Marking MPLS EXP on Label Switched Packets

Defining an MPLS EXP Label Switched Packets Policy Map

The following example defines a policy map that sets the MPLS EXP topmost value to 2 according to the MPLS EXP value of the forwarded packet:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# class-map exp012
Router(config-cmap)# match mpls experimental topmost 0 1 2
Router(config-cmap)# exit
Router(config-cmap)# policy-map mark-up-exp-2
Router(config-pmap)# class exp012
Router(config-pmap-c)# set mpls experimental topmost 2
Router(config-pmap-c)# exit
Router(config-pmap)# exit

Applying the MPLS EXP Label Switched Packets Policy Map to a Main Interface

The following example shows how to apply the policy map to a main interface:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface GigabitEthernet 0/0/0
Router(config-if)# service-policy input mark-up-exp-2
Router(config-if)# exit

Example: Configuring Conditional Marking

The example in this section creates a policer for the iptcp class, which is part of the ip2tag policy map, and attaches the policy map to the Gigabit Ethernet interface.


Router(config)# policy-map ip2tag
Router(config-pmap)# class iptcp
Router(config-pmap-c)# police cir 1000000 pir 2000000
Router(config-pmap-c-police)# conform-action set-mpls-exp-imposition-transmit 3
Router(config-pmap-c-police)# exceed-action set-mpls-exp-imposition-transmit 2
Router(config-pmap-c-police)# violate-action drop
Router(config-pmap-c-police)# exit
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface GigabitEthernet 0/0/1
Router(config-if)# service-policy input ip2tag

Additional References

Related Documents

Related Topic

Document Title

Cisco IOS commands

Cisco IOS Master Commands List, All Releases

QoS commands

Cisco IOS Quality of Service Solutions Command Reference

Classifying network traffic

“Classifying Network Traffic” module

Marking network traffic

“Marking Network Traffic” module

Standards and RFCs

Standard/RFC

Title

No new or modified standards are supported, and support for existing standards has not been modified.

MIBs

MIB

MIBs Link

No new or modified MIBs are supported, and support for existing MIBs has not been modified.

To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

Technical Assistance

Description

Link

The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

http://www.cisco.com/cisco/web/support/index.html