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. This module contains conceptual information and the configuration tasks for classifying and marking network traffic using the MPLS EXP field.
Prerequisites for Classifying and Marking MPLS EXP
-
The switch 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.
-
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).
-
To apply QoS on traffic across protocol boundaries, use QoS-group. You can classify and assign ingress traffic to the QoS-group. Thereafter, you can the QoS-group at egress to classify and apply QoS.
-
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
This section provides 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.
Note |
A policy map configured with set ip dscp is not supported on the provider edge device because the policy action for MPLS label imposition node should be based on set mpls experimental imposition value. However, a policy map with action set ip dscp is supported when both the ingress and egress interfaces are Layer 3 ports. |
You can perform MPLS EXP marking operations using table-maps. It is recommended to assign QoS-group to a different class of traffic in ingress policy and translate QoS-group to DSCP and EXP markings in egress policy using table-map.
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
This section provides information about how to classify and mark MPLS EXP:
Classifying MPLS Encapsulated Packets
You can use the match mpls experimental topmost command to define traffic classes based on the packet EXP values, inside the MPLS domain. You can use these classes to define services policies to mark the EXP traffic using the police command.
SUMMARY STEPS
- enable
- configure terminal
- class-map [match-all | match-any ] class-map-name
- match mpls experimental topmost mpls-exp-value
- end
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
class-map [match-all | match-any ] class-map-name Example:
|
Creates a class map to be used for matching traffic to a specified class, and enters class-map configuration mode.
|
||
Step 4 |
match mpls experimental topmost mpls-exp-value Example:
|
Specifies the match criteria.
|
||
Step 5 |
end Example:
|
(Optional) Returns to privileged EXEC mode. |
Marking MPLS EXP on the Outermost Label
Perform this task to set the value of the MPLS EXP field on imposed label entries.
Before you begin
In typical configurations, marking MPLS packets at imposition is used with ingress classification on IP ToS or CoS fields.
Note |
For IP imposition marking, the IP precedence value is copied to the MPLS EXP value by default. |
Note |
The egress policy on provider edge works with MPLS EXP class match, only if there is a remarking policy at ingress. The provider edge at ingress is an IP interface and only DSCP value is trusted by default. If you do not configure remarking policy at ingress the label for queueing is generated based on DSCP value and not MPLS EXP value. However, a transit provider router works without configuring remarking policy at ingress as the router works on MPLS interfaces. |
Note |
The set mpls experimental imposition command works only on packets that have new or additional MPLS labels added to them. |
SUMMARY STEPS
- enable
- configure terminal
- policy-map policy-map-name
- class class-map-name
- set mpls experimental imposition mpls-exp-value
- end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
policy-map policy-map-name Example:
|
Specifies the name of the policy map to be created and enters policy-map configuration mode.
|
Step 4 |
class class-map-name Example:
|
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:
|
Sets the value of the MPLS EXP field on top label. |
Step 6 |
end Example:
|
(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 marks EXP for the outermost label of MPLS traffic. Due to this marking at ingress policy, the egress policy must include classification based on the MPLS EXP values. |
SUMMARY STEPS
- enable
- configure terminal
- policy-map policy-map-name
- class class-map-name
- set mpls experimental topmost mpls-exp-value
- end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
policy-map policy-map-name Example:
|
Specifies the name of the policy map to be created and enters policy-map configuration mode.
|
Step 4 |
class class-map-name Example:
|
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:
|
Sets the MPLS EXP field value in the topmost label on the output interface. |
Step 6 |
end Example:
|
(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. |
SUMMARY STEPS
- enable
- configure terminal
- policy-map policy-map-name
- class class-map-name
- police cir bps bc pir bps be
- conform-action transmit
- exceed-action set-mpls-exp-topmost-transmit dscp table dscp-table-value
- violate-action drop
- end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
policy-map policy-map-name Example:
|
Specifies the name of the policy map to be created and enters policy-map configuration mode.
|
Step 4 |
class class-map-name Example:
|
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:
|
Defines a policer for classified traffic and enters policy-map class police configuration mode. |
Step 6 |
conform-action transmit Example:
|
Defines the action to take on packets that conform to the values specified by the policer.
|
Step 7 |
exceed-action set-mpls-exp-topmost-transmit dscp table dscp-table-value Example:
|
Defines the action to take on packets that exceed the values specified by the policer. |
Step 8 |
violate-action drop Example:
|
Defines the action to take on packets whose rate exceeds the peak information rate (pir) and is outside the bc and be ranges.
|
Step 9 |
end Example:
|
(Optional) Returns to privileged EXEC mode. |
Configuration Examples for Classifying and Marking MPLS EXP
This section provides 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:
Device(config)# class-map exp3
Device(config-cmap)# match mpls experimental topmost 3
Device(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.
Device(config)# policy-map change-exp-3-to-2
Device(config-pmap)# class exp3
Device(config-pmap-c)# set mpls experimental topmost 2
Device(config-pmap)# exit
Device(config)# interface GigabitEthernet 0/0/0
Device(config-if)# service-policy input change-exp-3-to-2
Device(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.
Device(config)# policy-map WAN-out
Device(config-pmap)# class exp3
Device(config-pmap-c)# shape average 10000000
Device(config-pmap-c)# exit
Device(config-pmap)# exit
Device(config)# interface GigabitEthernet 0/0/0
Device(config-if)# service-policy output WAN-out
Device(config-if)# exit
Example: Marking MPLS EXP on Outermost Label
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:
Device# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Device(config)# class-map prec012
Device(config-cmap)# match ip prec 0 1 2
Device(config-cmap)# exit
Device(config)# policy-map mark-up-exp-2
Device(config-pmap)# class prec012
Device(config-pmap-c)# set mpls experimental imposition 2
Device(config-pmap-c)# exit
Device(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:
Device# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Device(config)# interface GigabitEthernet 0/0/0
Device(config-if)# service-policy input mark-up-exp-2
Device(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:
Device# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Device(config)# class-map exp012
Device(config-cmap)# match mpls experimental topmost 0 1 2
Device(config-cmap)# exit
Device(config-cmap)# policy-map mark-up-exp-2
Device(config-pmap)# class exp012
Device(config-pmap-c)# set mpls experimental topmost 2
Device(config-pmap-c)# exit
Device(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:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Device(config)# interface GigabitEthernet 0/0/0
Device(config-if)# service-policy input mark-up-exp-2
Device(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.
Device(config)# policy-map ip2tag
Device(config-pmap)# class iptcp
Device(config-pmap-c)# police cir 1000000 pir 2000000
Device(config-pmap-c-police)# conform-action transmit
Device(config-pmap-c-police)# exceed-action set-mpls-exp-imposition-transmit 2
Device(config-pmap-c-police)# violate-action drop
Device(config-pmap-c-police)# exit
Device(config-pmap-c)# exit
Device(config-pmap)# exit
Device(config)# interface GigabitEthernet 0/0/1
Device(config-if)# service-policy input ip2tag
Additional References
Related Documents
Related Topic |
Document Title |
---|---|
QoS commands |
Cisco IOS Quality of Service Solutions Command Reference |
Feature History for QoS MPLS EXP
This table provides release and related information for features explained in this module.
These features are available on all releases subsequent to the one they were introduced in, unless noted otherwise.
Release |
Feature |
Feature Information |
---|---|---|
Cisco IOS XE Gibraltar 16.11.1 |
QoS MPLS EXP |
The QoS EXP Matching feature allows you to classify, mark and queue network traffic by modifying the Multiprotocol Label Switching (MPLS) experimental bits (EXP) field. |
Use Cisco Feature Navigator to find information about platform and software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn.