Configuring Marking

This chapter contains the following sections:

Information About Marking

Marking is a method that you use to modify the QoS fields of the incoming and outgoing packets.

You can use marking commands in traffic classes that are referenced in a policy map. The marking features that you can configure are listed below:

  • DSCP

  • IP precedence

  • CoS

Configuring Marking

Configuring DSCP Marking

For Cisco Nexus devices, you can set the DSCP value in the six most significant bits of the DiffServ field of the IP header to a specified value. You can enter numeric values from 0 to 63, in addition to the standard DSCP values shown in the table below:


Note


You can set DSCP or IP Precedence but you can not set both values because they modify the same field in the IP packet.


Table 1 Standard DSCP Values

Value

List of DSCP Values

af11

AF11 dscp (001010)—decimal value 10

af12

AF12 dscp (001100)—decimal value 12

af13

AF13 dscp (001110)—decimal value 14

af21

AF21 dscp (010010)—decimal value 18

af22

AF22 dscp (010100)—decimal value 20

af23

AF23 dscp (010110)—decimal value 22

af31

AF31 dscp (011010)—decimal value 26

af32

AF40 dscp (011100)—decimal value 28

af33

AF33 dscp (011110)—decimal value 30

af41

AF41 dscp (100010)—decimal value 34

af42

AF42 dscp (100100)—decimal value 36

af43

AF43 dscp (100110)—decimal value 38

cs1

CS1 (precedence 1) dscp (001000)—decimal value 8

cs2

CS2 (precedence 2) dscp (010000)—decimal value 16

cs3

CS3 (precedence 3) dscp (011000)—decimal value 24

cs4

CS4 (precedence 4) dscp (100000)—decimal value 32

cs5

CS5 (precedence 5) dscp (101000)—decimal value 40

cs6

CS6 (precedence 6) dscp (110000)—decimal value 48

cs7

CS7 (precedence 7) dscp (111000)—decimal value 56

default

Default dscp (000000)—decimal value 0

ef

EF dscp (101110)—decimal value 46

Procedure
     Command or ActionPurpose
    Step 1config t
     

    Enters configuration mode.

     
    Step 2 policy-map type qos qos-policy-map-name
     

    Creates or accesses the policy map named policy-map-name, and then enters policy-map mode. The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

     
    Step 3 class [type qos] {class-map-name | class-default}
     

    Creates a reference to class-map-name, and enters policy-map class configuration mode. Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

     
    Step 4 set dscp dscp-value
     

    Sets the DSCP value to dscp-value. See the Standards DSCP Values table.

     
    Step 5 set qos-group y
     

    Specifies the qos-group. The group value can be from 1 to 5.

    Note   

    Traffic in the class-default system class (qos-group 0), cannot be marked with DSCP.

     

    This example shows how to set the DSCP value to 10 and specify the qos-group to 2.

     policy-map type qos test-bulkdata
        class type qos bulkdata
          set dscp 10
          set qos-group 2
    

    Configuring IP Precedence Marking

    You can set the value of the IP precedence field in bits 0 to 2 of the IPv4 type of service (ToS) field or the equivalent Traffic Class field for IPv6 of the IP header. The following table shows the precedence values:


    Note


    You can set IP Precedence or DSCP but you can not set both values because they modify the same field in the IP packet.


    Table 2 Precedence Values

    Value

    List of Precedence Values

    <0-7>

    IP precedence value

    critical

    Critical precedence (5)

    flash

    Flash precedence (3)

    flash-override

    Flash override precedence (4)

    immediate

    Immediate precedence (2)

    internet

    Internetwork control precedence (6)

    network

    Network control precedence (7)

    priority

    Priority precedence (1)

    routine

    Routine precedence (0)

    Procedure
       Command or ActionPurpose
      Step 1config t
       

      Enters configuration mode.

       
      Step 2 policy-map [type qos] qos-policy-map-name
       

      Creates or accesses the policy map named policy-map-name, and then enters policy-map mode. The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

       
      Step 3 class [type qos] {class-map-name | class-default}
       

      Creates a reference to class-map-name, and enters policy-map class configuration mode. Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

       
      Step 4 set precedence precedence-value
       

      Sets the IP precedence value to precedence-value. You can enter one of the values shown in the Precedence Values table.

       
      switch(config)# policy-map type qos my_policy
      switch(config-pmap-qos)# class type qos my_class
      switch(config-pmap-c-qos)# set precedence 5
      switch(config-pmap-c-qos)#
      

      Configuring CoS Marking

      The value of the CoS field is recorded in the high-order three bits of the VLAN ID Tag field in the IEEE 802.1Q header.

      Procedure
         Command or ActionPurpose
        Step 1switch# configure terminal  

        Enters global configuration mode.

         
        Step 2 switch(config) # policy-map [type network-qos] policy-map name
         

        Creates or accesses the policy map named policy-map-name and enters policy-map mode.

        The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

         
        Step 3 switch(config-pmap-nq) # class [type network-qos] {class-map name |class-default}
         

        Creates a reference to the class-map-name and enters policy-map class configuration mode.

        Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

         
        Step 4 switch(config-pmap-c-nq) # set cos cos-value
         

        Specifies the CoS value to cos-value.

        The cos-value can range from 0 to 7.

        Note   

        This command is supported only for egress policies.

         

        Required CoS Marking Configuration in a Layer 3 Topology

        In Layer 3 topologies, you must configure each QoS group in the network-qos policy with a unique cos value.

        Procedure
           Command or ActionPurpose
          Step 1switch# show policy-map system  

          Displays the already configured policy maps and CoS values.

          In Layer 3 topologies, each qosgroup must have a unique CoS value. Use the show policy-map system command to view CoS values that have been used and that are unavailable for QoS groups.

           
          Step 2switch# configure terminal  

          Enters global configuration mode.

           
          Step 3switch(config) # policy-map [type network-qos] policy-map name  

          Creates or accesses the policy map named policy-map-name and enters policy-map mode.

          The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

           
          Step 4switch(config-pmap-nq) # class [type network-qos] {class-map name |class-default}  

          Creates a reference to the class-map-name and enters policy-map class configuration mode.

          Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

           
          Step 5switch(config-pmap-nq-c) # set cos cos-value  

          Specifies the CoS value.

          The value can range from 0 to 7.

          Note   

          You can use this command only in egress policies.

          In Layer 3 topologies, each qos-group must have a unique cos configuration.

           

          This example shows how to set the CoS value to 4 in a Layer 3 topology:

          switch# show policy-map system
            Type network-qos policy-maps
            ===============================
           
            policy-map type network-qos pn-01
              class type network-qos cn-01      match qos-group 1
                mtu 8500
                pause no-drop 
                set cos 2
              class type network-qos cn-02      match qos-group 2
                set cos 4
                mtu 9216
              class type network-qos cn-03      match qos-group 3 
                mtu 8000
                set cos 6
              class type network-qos cn-04      match qos-group 4 
                mtu 8750
                set cos 7
              class type network-qos cn-ip-multicast      match qos-group 5
                set cos 5
                mtu 7500
              class type network-qos class-default      match qos-group 0 
                mtu 1500
                set cos 1
          ...
          switch# configure terminal 
          switch(config)# policy-map type network-qos pn-01 
          switch(config-pmap-nq)# class type network-qos cn-05 
          switch(config-pmap-c-nq)# set cos 3

          Verifying the Marking Configuration

          Use one of the following commands to verify the configuration:

          Command

          Purpose

          show class-map

          Displays the class maps defined on the switch.

          show policy-map [name]

          Displays the policy maps defined on the switch. Optionally, you can display the named policy only.

          running-config ipqos

          Displays information about the running configuration for QoS.

          startup-config ipqos

          Displays informationa bout the startup configuration for QoS.