- Read Me First
- IPv6 Quality of Service
- IPv6 QoS: MQC Packet Classification
- Packet Classification Based on Layer 3 Packet Length
- IPv6 QoS: MQC Packet Marking/Remarking
- Marking Network Traffic
- Classifying Network Traffic
- Class-Based Ethernet CoS Matching and Marking
- QoS Group Match and Set for Classification and Marking
- Quality of Service for VPNs
- QoS Match VLAN
- Inbound Policy Marking for dVTI
- QoS Tunnel Marking for GRE Tunnels
- QoS for dVTI
- Classifying and Marking MPLS EXP
- Finding Feature Information
- Prerequisites for Classifying and Marking MPLS EXP
- Restrictions for Classifying and Marking MPLS EXP
- Information About Classifying and Marking MPLS EXP
- How to Classify and Mark MPLS EXP
- Configuration Examples for Classifying and Marking MPLS EXP
- Additional References
- Feature Information for Classifying and Marking MPLS EXP
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
- Prerequisites for Classifying and Marking MPLS EXP
- Restrictions for Classifying and Marking MPLS EXP
- Information About Classifying and Marking MPLS EXP
- How to Classify and Mark MPLS EXP
- Configuration Examples for Classifying and Marking MPLS EXP
- Additional References
- Feature Information for Classifying and Marking MPLS EXP
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 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
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
- MPLS Experimental Field
- Benefits of MPLS EXP Classification and Marking
Classifying and Marking MPLS EXP Overview
- 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
- Marking MPLS EXP on All Imposed Labels
- Marking MPLS EXP on Label Switched Packets
- Configuring Conditional Marking
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). |
1.
enable
2.
configure
terminal
3.
class-map
[match-all |
match-any]
class-map-name
4.
match mpls experimental topmost
mpls-exp-value
5.
end
DETAILED STEPS
Marking MPLS EXP on All Imposed Labels
Perform this task to set the value of the MPLS EXP field on all imposed label entries.
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. |
1.
enable
2.
configure
terminal
3.
policy-map
policy-map-name
4.
class
class-map-name
5.
set mpls
experimental imposition
mpls-exp-value
6.
end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable
Example: Router> enable |
Enables privileged EXEC mode. |
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. |
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. |
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.
The
set mpls experimental
topmost command works only on packets that are already MPLS
encapsulated.
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.
Note
Note
1.
enable
2.
configure
terminal
3.
policy-map
policy-map-name
4.
class
class-map-name
5.
set mpls
experimental topmost
mpls-exp-value
6.
end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable
Example: Router> enable |
Enables privileged EXEC mode. |
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. |
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. |
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:
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
1.
enable
2.
configure
terminal
3.
policy-map
policy-map-name
4.
class
class-map-name
5.
police
cir
bps
bc pir
bps
be
6.
conform-action
[set-mpls-exp-imposition-transmit
mpls-exp-value |
set-mpls-exp-topmost-transmit
mpls-exp-value]
7.
exceed-action
[set-mpls-exp-imposition-transmit
mpls-exp-value |
set-mpls-exp-topmost-transmit
mpls-exp-value]
8.
violate-action
drop
9.
end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable
Example: Router> enable |
Enables privileged EXEC mode. |
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. |
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. |
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 |
|
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. |
Step 8 |
violate-action
drop
Example: Router(config-pmap-c-police)# violate-action drop |
|
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
- Example: Marking MPLS EXP on All Imposed Labels
- Example: Marking MPLS EXP on Label Switched Packets
- Example: Configuring Conditional Marking
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 |
|
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: |
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. |
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.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. |