MPLS QoS: Classifying and Marking 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. 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 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 http:/​/​www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

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.

  • MPLS EXP classification and marking is supported only on MPLS enabled interfaces or MPLS traffic on other interfaces.

  • 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

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.

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

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.

Procedure
     Command or ActionPurpose
    Step 1 enable


    Example:
    Switch> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.

     
    Step 2 configure terminal


    Example:
    Switch# configure terminal
     

    Enters global configuration mode.

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


    Example:
    Switch(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:
    Switch(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:
    Switch(config-cmap)# end 
     

    (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 set mpls experimental imposition command works only on packets that have new or additional MPLS labels added to them.


    Procedure
       Command or ActionPurpose
      Step 1 enable


      Example:
      Switch> enable
       

      Enables privileged EXEC mode.

      • Enter your password if prompted.

       
      Step 2 configure terminal


      Example:
      Switch# configure terminal
       

      Enters global configuration mode.

       
      Step 3 policy-map policy-map-name


      Example:
      Switch(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:
      Switch(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:
      Switch(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:
      Switch(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 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.


      Procedure
         Command or ActionPurpose
        Step 1 enable


        Example:
        Switch> enable
         

        Enables privileged EXEC mode.

        • Enter your password if prompted.

         
        Step 2 configure terminal


        Example:
        Switch# configure terminal
         

        Enters global configuration mode.

         
        Step 3 policy-map policy-map-name


        Example:
        Switch(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:
        Switch(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:
        Switch(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:
        Switch(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 ActionPurpose
          Step 1 enable


          Example:
          Switch> enable
           

          Enables privileged EXEC mode.

          • Enter your password if prompted.

           
          Step 2 configure terminal


          Example:
          Switch# configure terminal
           

          Enters global configuration mode.

           
          Step 3 policy-map policy-map-name


          Example:
          Switch(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:
          Switch(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:
          Switch(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 transmit


          Example:
          Switch(config-pmap-c-police)# conform-action 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-topmost-transmit dscp table dscp-table-value


          Example:
          Switch(config-pmap-c-police)# exceed-action set-mpls-exp-topmost-transmit dscp table dscp2exp
           

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

           
          Step 8 violate-action drop


          Example:
          Switch(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:
          Switch(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:

          Switch(config)# class-map exp3 
          Switch(config-cmap)# match mpls experimental topmost 3 
          Switch(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.

          Switch(config)# policy-map change-exp-3-to-2
          Switch(config-pmap)# class exp3
          Switch(config-pmap-c)# set mpls experimental topmost 2
          Switch(config-pmap)# exit
          Switch(config)# interface GigabitEthernet 0/0/0
          Switch(config-if)# service-policy input change-exp-3-to-2
          Switch(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.

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

          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 set mpls experimental imposition command works only on packets that have new or additional MPLS labels added to them.


          Procedure
             Command or ActionPurpose
            Step 1 enable


            Example:
            Switch> enable
             

            Enables privileged EXEC mode.

            • Enter your password if prompted.

             
            Step 2 configure terminal


            Example:
            Switch# configure terminal
             

            Enters global configuration mode.

             
            Step 3 policy-map policy-map-name


            Example:
            Switch(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:
            Switch(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:
            Switch(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:
            Switch(config-pmap-c)# end 
             

            (Optional) Returns to privileged EXEC mode.

             

            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:

            Switch# configure terminal 
            Enter configuration commands, one per line.  End with CNTL/Z.
            Switch(config)# class-map exp012
            Switch(config-cmap)# match mpls experimental topmost 0 1 2
            Switch(config-cmap)# exit
            Switch(config-cmap)# policy-map mark-up-exp-2
            Switch(config-pmap)# class exp012
            Switch(config-pmap-c)# set mpls experimental topmost 2
            Switch(config-pmap-c)# exit
            Switch(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.
            Switch(config)# interface GigabitEthernet 0/0/0
            Switch(config-if)# service-policy input mark-up-exp-2
            Switch(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.

            Switch(config)# policy-map ip2tag
            Switch(config-pmap)# class iptcp
            Switch(config-pmap-c)# police cir 1000000 pir 2000000
            Switch(config-pmap-c-police)# conform-action transmit
            Switch(config-pmap-c-police)# exceed-action set-mpls-exp-imposition-transmit 2
            Switch(config-pmap-c-police)# violate-action drop
            Switch(config-pmap-c-police)# exit
            Switch(config-pmap-c)# exit
            Switch(config-pmap)# exit
            Switch(config)# interface GigabitEthernet 0/0/1
            Switch(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

            Standards and RFCs

            Standard/RFC

            Title

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

            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

            Feature Information for QoS 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 QoS MPLS EXP

            Release

            Modification

            Cisco IOS XE Everest 16.5.1a

            This feature was introduced.