Cisco Nexus 5000 NX-OS Quality of Service Configuration Guide, Release 5.1(3)N2(1)
Configuring Policy Maps
Downloads: This chapterpdf (PDF - 1.2MB) The complete bookPDF (PDF - 2.57MB) | Feedback

Configuring Policy Maps

Configuring Policy Maps

This chapter contains the following sections:

Information About Policy Types

The device supports a number of policy types. You create class maps in the policy types.

There are three policy types
  • Network-qos
  • Queuing
  • QoS

Before you enable FCoE on the Cisco Nexus 5500 Series device running Cisco NX-OS Release 5.0(2)N1(1), you must enable class-fcoe in the three types of qos policies (network QoS, queuing, and QoS) by entering the type qos policy maps command and applying at least one FCoE QoS policy under system QoS.

The following QoS parameters can be specified for each type of class:

  • Type network-qos—A network-qos policy is used to instantiate system classes and associate parameters with those classes that are of system-wide scope.
    • Classification—The traffic that matches this class are as follows:
      • QoS Group—A class map of type network-qos identifies a system class and is matched by its associated qos-group.
    • Policy—The actions that are performed on the matching traffic are as follows:

      Note


      A network-qos policy can only be attached to the system QoS target.


      • MTU—The MTU that needs to be enforced for the traffic that is mapped to a system class. Each system class has a default MTU and the system class MTU is configurable.
      • Multicast optimization—This configuration specifies if the performance of multicast traffic mapped to this class will be optimized.
      • Pause no-drop—No drop specifies lossless service for the system class. Drop specifies that tail drop is used (arriving packets are dropped when the queue reaches its allocated size) when a queue for this system class is full. An additional parameter pfc-cos can be configured. This parameter identifies the class of service (CoS) values to assert priority flow control (PFC) when traffic for a no-drop system class is not mapped based purely on CoS experiences congestion.
      • You can change the buffer for the no-drop class.
      • Queue Limit—This configuration specifies the number of buffers that need to be reserved to the queues of this system class. This option is not configurable for no-drop system classes.
      • Set CoS value—This configuration is used to mark 802.1p values for all traffic mapped to this system class. For the Cisco Nexus 5020 switch and the Cisco Nexus 5010 switch, the marking value for a system class needs to be unique and cannot be used as a marking value for any other system class. The marking value does not need to be unique for the Cisco Nexus 5500 Series device.
  • Type queuing—A type queuing policy is used to define the scheduling characteristics of the queues associated with system classes.

    Note


    Some configuration parameters when applied to an EtherChannel are not reflected on the configuration of the member ports.


    • Classification—The traffic that matches this class are as follows:
      • QoS Group—A class map of type queuing identifies a system class and is matched by its associated QoS group.
    • Policy—The actions that are performed on the matching traffic are as follows:

      Note


      These policies can be attached to the system qos target or to any interface. The output queuing policy is used to configure output queues on the device associated with system classes. The input queuing policy is used to configure scheduling for queues in the CNA. The input queuing policy parameters are signaled to the CNA over the DCBX protocol.


      • Bandwidth—Sets the guaranteed scheduling deficit weighted round robin (DWRR) percentage for the system class.
      • Priority—Sets a system class for strict-priority scheduling. Only one system class can be configured for priority in a given queuing policy.
  • Type qos—A type QoS policy is used to classify traffic that is based on various Layer 2, Layer 3, and Layer 4 fields in the frame and to map it to system classes.

    Note


    Some configuration parameters when applied to an EtherChannel are not reflected on the configuration of the member ports.


    • Classification—The traffic that matches this class are as follows:
      • Access Control Lists—Classifies traffic based on the criteria in existing ACLs.
      • Class of Service—Matches traffic based on the CoS field in the frame header.
      • DSCP—Classifies traffic based on the Differentiated Services Code Point (DSCP) value in the DiffServ field of the IP header.
      • IP Real Time Protocol—Classifies traffic on the port numbers used by real-time applications.
      • Precedence—Classifies traffic based on the precedence value in the type of service (ToS) field of the IP header.
      • Protocol—Classifies traffic based on the IPv4 Protocol field or the IPv6 Next Header field of the IP header.
    • Policy—The actions that are performed on the matching traffic are as follows:

      Note


      This policy can be attached to the system or to any interface. It applies to input traffic only.


      • QoS Group—Sets the QoS group that corresponds to the system class this traffic flow is mapped to.

    Configuring Policy Maps

    Creating Policy Maps

    The policy-map command is used to create a named object that represents a set of policies that are to be applied to a set of traffic classes.

    The device provides two default system classes: a no-drop class for lossless service (class-fcoe) and a drop class for best-effort service (class-default). You can define up to four additional system classes for Ethernet traffic.

    The following predefined policy maps are used as default service policies:

    • network-qos: default-nq-policy
    • Input qos: default-in-policy
    • Input queuing: default-in-policy
    • Output queuing: default-out-policy
    • service-policy type qos input fcoe-default-in-policy
    • service-policy type queuing input fcoe-default-in-policy
    • service-policy type queuing output fcoe-default-out-policy
    • service-policy type network-qos fcoe-default-nq-policy

    When class-fcoe is not included in the qos policies, vFC interfaces do not come up and increased drops occur.

    You need to create a policy map to specify the policies for any user-defined class. In the policy map, you can configure the QoS parameters for each class. You can use the same policy map to modify the configuration of the default classes.

    The device distributes all the policy-map configuration values to the attached network adapters.

    Before You Begin

    Before creating the policy map, define a class map for each new system class.

    Procedure
        Command or Action Purpose
      Step 1 switch# configure terminal
       

      Enters configuration mode.

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

      Creates a named object representing a set of policies that are to be applied to a set of traffic classes. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

      The three policy-map configuration modes are as follows:

      • network-qos—Network-wide (global) mode. CLI prompt: switch(config-pmap-nq)#
      • qos—Classification mode; this is the default mode. CLI prompt: switch(config-pmap-qos)#
      • queuing—Queuing mode. CLI prompt: switch(config-pmap-que)#
       
      Step 3 switch(config)# no policy-map [type {network-qos | qos | queuing}] policy-name
       
      (Optional)

      Deletes the specified policy map.

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

      Associates a class map with the policy map, and enters configuration mode for the specified system class. The three class-map configuration modes are as follows:

      • network-qos—Network-wide (global) mode. CLI prompt: switch(config-pmap-c-nq)#
      • qos—Classification mode; this is the default mode. CLI prompt: switch(config-pmap-c-qos)#
      • queuing—Queuing mode. CLI prompt: switch(config-pmap-c-que)#
      Note   

      The associated class map must be the same type as the policy-map type.

       
      Step 5 switch(config-pmap)# no class [type {network-qos | qos | queuing}] class-name
       
      (Optional)

      Deletes the class map association.

       

      Configuring Type QoS Policies

      Type qos policies are used for classifying the traffic of a specific system class identified by a unique qos-group value. A type qos policy can be attached to the system or to individual interfaces (including Fabric Extender host interfaces) for ingress traffic only.

      You can set a maximum of five QoS groups for ingress traffic.

      Procedure
          Command or Action Purpose
        Step 1 switch# configure terminal 

        Enters global configuration mode.

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

        Creates a named object that represents a set of policies that are to be applied to a set of traffic classes. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

         
        Step 3 switch(config-pmap-qos)# [class | class-default] type qos class-name  

        Associates a class map with the policy map, and enters configuration mode for the specified system class.

        Note   

        The associated class map must be the same type as the policy map type.

         
        Step 4 switch(config-pmap-c-qos)# set qos-group qos-group-value  

        Configures one or more qos-group values to match on for classification of traffic into this class map. The list below identifies the ranges of the qos-group-value . There is no default value.

         
        Step 5 switch(config-pmap-c-qos)# no set qos-group qos-group-value   (Optional)

        Removes the qos-group values from this class.

         

        This example shows how to define a type qos policy map:

        switch# configure terminal switch(config)# policy-map type qos policy-s1
        switch(config-pmap-qos)# class type qos class-s1
        switch(config-pmap-c-qos)# set qos-group 2

        Configuring Type Network QoS Policies

        Type network qos policies can only be configured on the system qos attachment point. They are applied to the entire switch for a particular class.

        Procedure
            Command or Action Purpose
          Step 1 switch# configure terminal 

          Enters global configuration mode.

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

          Creates a named object that represents a set of policies that are to be applied to a set of traffic classes. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

           
          Step 3 switch(config-pmap-nq)# class type network-qos class-name
           

          Associates a class map with the policy map, and enters configuration mode for the specified system class.

          Note   

          The associated class map must be the same type as the policy map type.

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

          Specifies the MTU value in bytes.

          Note   

          The mtu-value that you configure must be less than the value set by the system jumbomtu command.

           
          Step 5 switch(config-pmap-c-nq)# no mtu
           
          (Optional)

          Resets the MTU value in this class.

           
          Step 6 switch(config-pmap-c-nq)# multicast-optimize
           

          Enables multicast optimization. Multicast traffic in this class will be served by all available multicast queues.

          Note   

          Only one class in a policy map can be configured for multicast optimization.

          Note   

          For the Cisco Nexus 5500 Series device, multicast optimization is enabled by default on class-default. You must remove it from class-default before enabling it on a user-defined class.

           
          Step 7 switch(config-pmap-c-nq)# no multicast-optimize
           
          (Optional)

          Disables multicast optimization.

           
          Step 8 switch(config-pmap-c)# pause no-drop [pfc-cos pfc-cos-value]
           

          Configures a no-drop class. If you do not specify this command, the default policy is drop.

          Note   

          The operation for the drop policy is a simple tail drop, where arriving packets will be dropped if the queue increases to its allocated size.

          The pfc-cos-value range is from 0 to 7. This option is supported only for for a ACL-based system class (which filters traffic using criteria other than cos-based matches).

          Caution   

          The list of CoS values can potentially include the CoS value that is used for FCoE traffic in class-fcoe. You must determine if this is desired behavior for your topology.

           
          Step 9 switch(config-pmap-c-nq)# no pause no-drop
           
          (Optional)

          Removes the no-drop option from this class.

           
          Step 10 switch(config-pmap-c-nq)# queue-limit number-bytes bytes
           

          Specifies the tail drop threshold on this interface. The threshold range is from 20480 to 204800 bytes. For the Cisco Nexus 5500 Series device, the range is from 20480 to 426880 bytes.

          Note   

          The queue limit can only be configured on drop classes. If you try to configure a queue limit on a no-drop class, or try to configure no-drop on a class where a queue limit is already defined, the CLI will return an error.

          Use the pause no-drop buffer size option to change the buffer size and pause threshold for the no-drop class.

           
          Step 11 switch(config-pmap-c-nq)# no queue-limit number-bytes bytes
           
          (Optional)

          Disables the queue limit specification in this class.

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

          Specifies a 802.1Q CoS value which is used to mark packets on this interface. The value range is from 0 to 7.

           
          Step 13 switch(config-pmap-c-nq)# no set cos cos-value
           
          (Optional)

          Disables the marking operation in this class.

           

          This example shows how to define a type network-qos policy map:

          switch# configure terminal
          switch(config)# policy-map type network-qos policy-que1
          switch(config-pmap-nq)# class type network-qos class-que1
          switch(config-pmap-c-nq)# mtu 5000
          switch(config-pmap-c-nq)# set cos 4

          Configuring Type Queuing Policies

          Type queuing policies are used for scheduling and buffering the traffic of a specific system class. A type queuing policy is identified by its QoS group and can be attached to the system or to individual interfaces (except for Fabric Extender host interfaces) for input or output traffic.

          Procedure
              Command or Action Purpose
            Step 1 switch# configure terminal 

            Enters global configuration mode.

             
            Step 2 switch(config)# policy-map type queuing policy-name
             

            Creates a named object that represents a set of policies that are to be applied to a set of traffic classes. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

             
            Step 3 switch(config-pmap-que)# class type queuing class-name
             

            Associates a class map with the policy map, and enters configuration mode for the specified system class.

             
            Step 4 switch(config-pmap-c-que)# bandwidth percent percentage
             

            Specifies the guaranteed percentage of interface bandwidth allocated to this class. By default, no bandwidth is specified for a class.

            Note   

            Before you can successfully allocate bandwidth to the class, you must first reduce the default bandwidth configuration on class-default and class-fcoe.

             
            Step 5 switch(config-pmap-c-que)# no bandwidth percent percentage
             
            (Optional)

            Removes the bandwidth specification from this class.

             
            Step 6 switch(config-pmap-c-que)# priority
             

            Specifies that traffic in this class is mapped to a strict priority queue.

            Note   

            Only one class in each policy map can have strict priority set on it.

             
            Step 7 switch(config-pmap-c-que)# no priority
             
            (Optional)

            Removes the strict priority queuing from the traffic in this class.

             

            This example shows how to define a type queuing policy map:

            switch# configure terminal
            switch(config)# policy-map type queuing policy-queue1
            switch(config-pmap-que)# class type queuing class-queue1
            switch(config-pmap-c-que)# bandwidth 20

            Verifying the Policy Map Configuration

            Command

            Purpose

            show policy-map [name]

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

            show policy-map interface [interface number]

            Displays the policy map settings for an interface or all interfaces.

            show policy-map system

            Displays the policy map settings attached to the system qos.

            show policy-map type {network-qos | qos | queuing} [name]

            Displays the policy map settings for a specific policy type. Optionally, you can display the named policy only.

            running-config ipqos

            Displays information about the running configuration for QoS.

            startup-config ipqos

            Displays information about the startup configuration for QoS.