Contents

Class-Based Ethernet CoS Matching and Marking

The Class-Based Ethernet CoS Matching and Marking (801.1p and ISL CoS) feature allows you to mark and match packets using Class of Service (CoS) values.

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 Class-Based Ethernet CoS Matching and Marking

When configuring this feature, you must first create a policy map (sometimes referred to as a service policy or a traffic policy) using the Modular QoS Command-Line Interface (CLI) (MQC). Therefore, you should be familiar with the procedure for creating a policy map using the MQC.

For more information about creating a policy map (traffic policy) using the MQC, see the “Applying QoS Features Using the MQC” module.

Information About Class-Based Ethernet CoS Matching and Marking

Layer 2 CoS Values

Layer 2 (L2) Class of Service (CoS) values are relevant for IEEE 802.1Q and Interswitch Link (ISL) types of frames. The Class-based Ethernet CoS Matching and Marking feature extends Cisco software capabilities to match packets by looking at the CoS value of the packet and marking packets with user-defined CoS values. This feature can be used for L2 CoS to L3 Terms of Service (TOS) mapping. CoS matching and marking can be configured via the Cisco Modular QoS CLI framework.

How to Configure Class-Based Ethernet CoS Matching and Marking

Configuring Class-Based Ethernet CoS Matching

In the following task, classes named voice and video-and-data are created to classify traffic based on the CoS values. The classes are configured in the CoS-based-treatment policy map, and the service policy is attached to all packets leaving Gigabit Ethernet interface 1/0/1.

SUMMARY STEPS

    1.    enable

    2.    configure terminal

    3.    class-map class-map-name

    4.    match cos cos-value

    5.    exit

    6.    class-map class-map-name

    7.    match cos cos-value

    8.    exit

    9.    policy-map policy-map-name

    10.    class {class-name | class-default}

    11.    priority level level

    12.    exit

    13.    class {class-name | class-default}

    14.    bandwidth remaining percent percentage

    15.    exit

    16.    exit

    17.    interface type number

    18.    service-policy {input| output} policy-map-name

    19.    end


DETAILED STEPS
     Command or ActionPurpose
    Step 1 enable


    Example:
    Device> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.
     
    Step 2 configure terminal


    Example:
    Device# configure terminal
     

    Enters global configuration mode.

     
    Step 3 class-map class-map-name


    Example:
    Device(config)# class-map voice
     

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

     
    Step 4 match cos cos-value


    Example:
    Device(config-cmap)# match cos 7
     

    Configures the class map to match traffic on the basis of the CoS value.

     
    Step 5 exit


    Example:
    Device(config-cmap)# exit
     

    (Optional) Exits class-map configuration mode.

     
    Step 6 class-map class-map-name


    Example:
    Device(config)# class-map video-and-data
     

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

    • Enter the class map name.
     
    Step 7 match cos cos-value


    Example:
    Device(config-cmap)# match cos 5
     

    Configures the class map to match traffic on the basis of the CoS value.

     
    Step 8 exit


    Example:
    Device(config-cmap)# exit
     

    (Optional) Exits class-map configuration mode.

     
    Step 9 policy-map policy-map-name


    Example:
    Device(config)# policy-map cos-based-treatment
     

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

     
    Step 10 class {class-name | class-default}


    Example:
    Device(config-pmap)# class voice
     

    Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

     
    Step 11 priority level level


    Example:
    Device(config-pmap-c)# priority level 1
    
     

    Specifies the level of the priority service.

     
    Step 12 exit


    Example:
    Device(config-pmap-c)# exit
     

    (Optional) Exits policy-map class configuration mode.

     
    Step 13 class {class-name | class-default}


    Example:
    Device(config-pmap)# class video-and-data
     

    Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

     
    Step 14 bandwidth remaining percent percentage


    Example:
    Device(config-pmap-c)# bandwidth remaining percent 20
    
     

    Specifies the amount of bandwidth assigned to the class.

     
    Step 15 exit


    Example:
    Device(config-pmap-c)# exit
     

    (Optional) Exits policy-map class configuration mode.

     
    Step 16 exit


    Example:
    Device(config-pmap)# exit
     

    (Optional) Exits policy-map configuration mode.

     
    Step 17 interface type number


    Example:
    Device(config)# interface gigabitethernet 1/0/1 
     

    Configures an interface (or subinterface) type and enters interface configuration mode.

     
    Step 18 service-policy {input| output} policy-map-name

    Example:
    Device(config-if)# service-policy output cos-based-treatment
     

    Specifies the name of the policy map to be attached to either the input or output direction of the interface.

    Note   

    Policy maps can be configured on ingress or egress devices. They can also be attached in the input or output direction of an interface. The direction (input or output) and the device (ingress or egress) to which the policy map should be attached vary according your network configuration. When using the service-policy command to attach the policy map to an interface, be sure to choose the device and the interface direction that are appropriate for your network configuration.

     
    Step 19 end


    Example:
    Device(config-if)# end
     

    (Optional) Exits interface configuration mode and returns to privileged EXEC mode.

     

    Configuring Class-Based Ethernet CoS Marking

    In the following task, the policy map called cos-set is created to assign different CoS values for different types of traffic.


    Note


    This task assumes that the class maps called voice and video-and-data have already been created.


    SUMMARY STEPS

      1.    enable

      2.    configure terminal

      3.    policy-map policy-map-name

      4.    class {class-name | class-default}

      5.    set cos cos-value

      6.    exit

      7.    class {class-name | class-default}

      8.    set cos cos-value

      9.    end


    DETAILED STEPS
       Command or ActionPurpose
      Step 1 enable


      Example:
      Device> enable
       

      Enables privileged EXEC mode.

      • Enter your password if prompted.
       
      Step 2 configure terminal


      Example:
      Device# configure terminal
       

      Enters global configuration mode.

       
      Step 3 policy-map policy-map-name


      Example:
      Device(config)# policy-map cos-set
       

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

       
      Step 4 class {class-name | class-default}


      Example:
      Device(config-pmap)# class voice
       

      Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

       
      Step 5 set cos cos-value


      Example:
      Device(config-pmap-c)# set cos 1
      
       

      Sets the packet’s CoS value.

       
      Step 6 exit


      Example:
      Device(config-pmap-c)# exit
       

      Exits policy-map class configuration mode.

       
      Step 7 class {class-name | class-default}


      Example:
      Device(config-pmap)# class video-and-data
       

      Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

       
      Step 8 set cos cos-value


      Example:
      Device(config-pmap-c)# set cos 2
      
       

      Sets the packet’s CoS value.

       
      Step 9 end


      Example:
      Device(config-pmap-c)# end
       

      (Optional) Exits policy-map class configuration mode and returns to privileged EXEC mode.

       

      Configuration Examples for Class-Based Ethernet CoS Matching and Marking

      Example: Configuring Class-Based Ethernet CoS Matching

      This example creates two classes, voice and video-and-data, to classify traffic based on the CoS values. The CoS-based-treatment policy map is used to set priority and bandwidth values for the classes. The service policy is attached to all packets leaving interface Gigabit Ethernet1/0/1.


      Note


      The service policy can be attached to any interface that supports service policies.


      Device(config)# class-map voice
      Device(config-cmap)# match cos 7
      Device(config-cmap)# exit
      Device(config)# class-map video-and-data
      Device(config-cmap)# match cos 5
      Device(config-cmap)# exit
      Device(config)# policy-map cos-based-treatment
      Device(config-pmap)# class voice
      Device(config-pmap-c)# priority level 1
      Device(config-pmap-c)# exit
      Device(config-pmap)# class video-and-data
      Device(config-pmap-c)# bandwidth remaining percent 20
      Device(config-pmap-c)# exit
      Device(config-pmap)# exit
      Device(config)#  interface gigabitethernet1/0/1
      Device(config-if)# service-policy output cos-based-treatment
      

      Example: Class-Based Ethernet CoS Marking

      Device(config)# policy-map cos-set
      Device(config-pmap)# class voice
      Device(config-pmap-c)# set cos 1
      Device(config-pmap-c)# exit
      Device(config-pmap)# class video-and-data
      Device(config-pmap-c)# set cos 2
      Device(config-pmap-c)# end  
            

      Additional References for Class-Based Ethernet CoS Matching and Marking

      Related Documents

      Related Topic

      Document Title

      Cisco commands

      Cisco IOS Master Command List, All Releases

      QoS commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples

      Cisco IOS Quality of Service Solutions Command Reference

      Classifying network traffic

      “Classifying Network Traffic” module

      MQC

      “Applying QoS Features Using the MQC” module

      Marking network traffic

      “Marking Network Traffic” module

      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 Class-Based Ethernet CoS Matching & Marking

      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 Class-Based Ethernet CoS Matching and Marking

      Feature Name

      Releases

      Feature Information

      Class-Based Ethernet CoS Matching and Marking

      12.2(5)T

      15.0(1)S

      Cisco IOS XE Release 2.1

      Cisco IOS XE Release 3.2SE

      This feature allows you to mark and match packets using Class of Service (CoS) values.

      The following commands were introduced or modified: match cos, set cos.

      User Priority Based QoS Marking for Wireless Deployments

      Cisco IOS XE Release 3.2SE

      This features allows you to mark and match packets on wireless deployments using the user-priority (CoS) vlaues.


      Class-Based Ethernet CoS Matching and Marking

      Class-Based Ethernet CoS Matching and Marking

      The Class-Based Ethernet CoS Matching and Marking (801.1p and ISL CoS) feature allows you to mark and match packets using Class of Service (CoS) values.

      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 Class-Based Ethernet CoS Matching and Marking

      When configuring this feature, you must first create a policy map (sometimes referred to as a service policy or a traffic policy) using the Modular QoS Command-Line Interface (CLI) (MQC). Therefore, you should be familiar with the procedure for creating a policy map using the MQC.

      For more information about creating a policy map (traffic policy) using the MQC, see the “Applying QoS Features Using the MQC” module.

      Information About Class-Based Ethernet CoS Matching and Marking

      Layer 2 CoS Values

      Layer 2 (L2) Class of Service (CoS) values are relevant for IEEE 802.1Q and Interswitch Link (ISL) types of frames. The Class-based Ethernet CoS Matching and Marking feature extends Cisco software capabilities to match packets by looking at the CoS value of the packet and marking packets with user-defined CoS values. This feature can be used for L2 CoS to L3 Terms of Service (TOS) mapping. CoS matching and marking can be configured via the Cisco Modular QoS CLI framework.

      How to Configure Class-Based Ethernet CoS Matching and Marking

      Configuring Class-Based Ethernet CoS Matching

      In the following task, classes named voice and video-and-data are created to classify traffic based on the CoS values. The classes are configured in the CoS-based-treatment policy map, and the service policy is attached to all packets leaving Gigabit Ethernet interface 1/0/1.

      SUMMARY STEPS

        1.    enable

        2.    configure terminal

        3.    class-map class-map-name

        4.    match cos cos-value

        5.    exit

        6.    class-map class-map-name

        7.    match cos cos-value

        8.    exit

        9.    policy-map policy-map-name

        10.    class {class-name | class-default}

        11.    priority level level

        12.    exit

        13.    class {class-name | class-default}

        14.    bandwidth remaining percent percentage

        15.    exit

        16.    exit

        17.    interface type number

        18.    service-policy {input| output} policy-map-name

        19.    end


      DETAILED STEPS
         Command or ActionPurpose
        Step 1 enable


        Example:
        Device> enable
         

        Enables privileged EXEC mode.

        • Enter your password if prompted.
         
        Step 2 configure terminal


        Example:
        Device# configure terminal
         

        Enters global configuration mode.

         
        Step 3 class-map class-map-name


        Example:
        Device(config)# class-map voice
         

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

         
        Step 4 match cos cos-value


        Example:
        Device(config-cmap)# match cos 7
         

        Configures the class map to match traffic on the basis of the CoS value.

         
        Step 5 exit


        Example:
        Device(config-cmap)# exit
         

        (Optional) Exits class-map configuration mode.

         
        Step 6 class-map class-map-name


        Example:
        Device(config)# class-map video-and-data
         

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

        • Enter the class map name.
         
        Step 7 match cos cos-value


        Example:
        Device(config-cmap)# match cos 5
         

        Configures the class map to match traffic on the basis of the CoS value.

         
        Step 8 exit


        Example:
        Device(config-cmap)# exit
         

        (Optional) Exits class-map configuration mode.

         
        Step 9 policy-map policy-map-name


        Example:
        Device(config)# policy-map cos-based-treatment
         

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

         
        Step 10 class {class-name | class-default}


        Example:
        Device(config-pmap)# class voice
         

        Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

         
        Step 11 priority level level


        Example:
        Device(config-pmap-c)# priority level 1
        
         

        Specifies the level of the priority service.

         
        Step 12 exit


        Example:
        Device(config-pmap-c)# exit
         

        (Optional) Exits policy-map class configuration mode.

         
        Step 13 class {class-name | class-default}


        Example:
        Device(config-pmap)# class video-and-data
         

        Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

         
        Step 14 bandwidth remaining percent percentage


        Example:
        Device(config-pmap-c)# bandwidth remaining percent 20
        
         

        Specifies the amount of bandwidth assigned to the class.

         
        Step 15 exit


        Example:
        Device(config-pmap-c)# exit
         

        (Optional) Exits policy-map class configuration mode.

         
        Step 16 exit


        Example:
        Device(config-pmap)# exit
         

        (Optional) Exits policy-map configuration mode.

         
        Step 17 interface type number


        Example:
        Device(config)# interface gigabitethernet 1/0/1 
         

        Configures an interface (or subinterface) type and enters interface configuration mode.

         
        Step 18 service-policy {input| output} policy-map-name

        Example:
        Device(config-if)# service-policy output cos-based-treatment
         

        Specifies the name of the policy map to be attached to either the input or output direction of the interface.

        Note   

        Policy maps can be configured on ingress or egress devices. They can also be attached in the input or output direction of an interface. The direction (input or output) and the device (ingress or egress) to which the policy map should be attached vary according your network configuration. When using the service-policy command to attach the policy map to an interface, be sure to choose the device and the interface direction that are appropriate for your network configuration.

         
        Step 19 end


        Example:
        Device(config-if)# end
         

        (Optional) Exits interface configuration mode and returns to privileged EXEC mode.

         

        Configuring Class-Based Ethernet CoS Marking

        In the following task, the policy map called cos-set is created to assign different CoS values for different types of traffic.


        Note


        This task assumes that the class maps called voice and video-and-data have already been created.


        SUMMARY STEPS

          1.    enable

          2.    configure terminal

          3.    policy-map policy-map-name

          4.    class {class-name | class-default}

          5.    set cos cos-value

          6.    exit

          7.    class {class-name | class-default}

          8.    set cos cos-value

          9.    end


        DETAILED STEPS
           Command or ActionPurpose
          Step 1 enable


          Example:
          Device> enable
           

          Enables privileged EXEC mode.

          • Enter your password if prompted.
           
          Step 2 configure terminal


          Example:
          Device# configure terminal
           

          Enters global configuration mode.

           
          Step 3 policy-map policy-map-name


          Example:
          Device(config)# policy-map cos-set
           

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

           
          Step 4 class {class-name | class-default}


          Example:
          Device(config-pmap)# class voice
           

          Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

           
          Step 5 set cos cos-value


          Example:
          Device(config-pmap-c)# set cos 1
          
           

          Sets the packet’s CoS value.

           
          Step 6 exit


          Example:
          Device(config-pmap-c)# exit
           

          Exits policy-map class configuration mode.

           
          Step 7 class {class-name | class-default}


          Example:
          Device(config-pmap)# class video-and-data
           

          Specifies the name of the class whose policy you want to create and enters policy-map class configuration mode. This class is associated with the class map created earlier.

           
          Step 8 set cos cos-value


          Example:
          Device(config-pmap-c)# set cos 2
          
           

          Sets the packet’s CoS value.

           
          Step 9 end


          Example:
          Device(config-pmap-c)# end
           

          (Optional) Exits policy-map class configuration mode and returns to privileged EXEC mode.

           

          Configuration Examples for Class-Based Ethernet CoS Matching and Marking

          Example: Configuring Class-Based Ethernet CoS Matching

          This example creates two classes, voice and video-and-data, to classify traffic based on the CoS values. The CoS-based-treatment policy map is used to set priority and bandwidth values for the classes. The service policy is attached to all packets leaving interface Gigabit Ethernet1/0/1.


          Note


          The service policy can be attached to any interface that supports service policies.


          Device(config)# class-map voice
          Device(config-cmap)# match cos 7
          Device(config-cmap)# exit
          Device(config)# class-map video-and-data
          Device(config-cmap)# match cos 5
          Device(config-cmap)# exit
          Device(config)# policy-map cos-based-treatment
          Device(config-pmap)# class voice
          Device(config-pmap-c)# priority level 1
          Device(config-pmap-c)# exit
          Device(config-pmap)# class video-and-data
          Device(config-pmap-c)# bandwidth remaining percent 20
          Device(config-pmap-c)# exit
          Device(config-pmap)# exit
          Device(config)#  interface gigabitethernet1/0/1
          Device(config-if)# service-policy output cos-based-treatment
          

          Example: Class-Based Ethernet CoS Marking

          Device(config)# policy-map cos-set
          Device(config-pmap)# class voice
          Device(config-pmap-c)# set cos 1
          Device(config-pmap-c)# exit
          Device(config-pmap)# class video-and-data
          Device(config-pmap-c)# set cos 2
          Device(config-pmap-c)# end  
                

          Additional References for Class-Based Ethernet CoS Matching and Marking

          Related Documents

          Related Topic

          Document Title

          Cisco commands

          Cisco IOS Master Command List, All Releases

          QoS commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples

          Cisco IOS Quality of Service Solutions Command Reference

          Classifying network traffic

          “Classifying Network Traffic” module

          MQC

          “Applying QoS Features Using the MQC” module

          Marking network traffic

          “Marking Network Traffic” module

          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 Class-Based Ethernet CoS Matching & Marking

          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 Class-Based Ethernet CoS Matching and Marking

          Feature Name

          Releases

          Feature Information

          Class-Based Ethernet CoS Matching and Marking

          12.2(5)T

          15.0(1)S

          Cisco IOS XE Release 2.1

          Cisco IOS XE Release 3.2SE

          This feature allows you to mark and match packets using Class of Service (CoS) values.

          The following commands were introduced or modified: match cos, set cos.

          User Priority Based QoS Marking for Wireless Deployments

          Cisco IOS XE Release 3.2SE

          This features allows you to mark and match packets on wireless deployments using the user-priority (CoS) vlaues.