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.
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 at the end of this module.
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 Cisco ASR 903 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
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.
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 topmostmpls-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 Cisco ASR 903 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.
SUMMARY STEPS
1.enable
2.configureterminal
3.policy-mappolicy-map-name
4.classclass-map-name
5.set mpls experimental impositionmpls-exp-value
6.end
DETAILED STEPS
Command or Action
Purpose
Step 1
enable
Example:
Router> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2
configureterminal
Example:
Router# configure terminal
Enters global configuration mode.
Step 3
policy-mappolicy-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
classclass-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 impositionmpls-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 Cisco ASR 903 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.
SUMMARY STEPS
1.enable
2.configureterminal
3.policy-mappolicy-map-name
4.classclass-map-name
5.set mpls experimental topmostmpls-exp-value
6.end
DETAILED STEPS
Command or Action
Purpose
Step 1
enable
Example:
Router> enable
Enables privileged EXEC mode.
Enter your password if prompted.
Step 2
configureterminal
Example:
Router# configure terminal
Enters global configuration mode.
Step 3
policy-mappolicy-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
classclass-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 topmostmpls-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.
Note
The Cisco ASR 903 Router supports conditional marking in the ingress direction only.
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.
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.
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.
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 sepecified 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.
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.
Feature Information for Classifying and Marking MPLS EXP
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
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.
Table 1 Feature Information for Classifying and Marking MPLS EXP
Feature Name
Releases
Feature Information
QoS EXP Matching
Cisco IOS XE Release 3.5S
QoS EXP matching allows you to classify and mark packets using the MPLS EXP field.
In Cisco IOS XE Release 3.5S, this feature was introduced on the Cisco ASR 903 Router.