Cisco Nexus 1000V Quality of Service Configuration Guide, Release 4.2(1)SV2(2.1)
Configuring Class Based Weighted Fair Queueing
Downloads: This chapterpdf (PDF - 1.32MB) The complete bookPDF (PDF - 2.56MB) | The complete bookePub (ePub - 245.0KB) | Feedback

Configuring Class Based Weighted Fair Queueing

Configuring Class Based Weighted Fair Queueing

This chapter contains the following sections:

Information About Class-Based Weighted Fair Queuing

This feature addresses the following goals:

  • Queuing can ensure that any traffic class does not starve other traffic types.
  • Respect the bandwidth guarantees for each traffic class.
  • Optimize the utilization of the uplink bandwidth.

Class-based weighted fair queuing (CBWFQ) extends the standard weighted fair queuing (WFQ) functionality to provide user-defined traffic classes. For CBWFQ, you define traffic classes based on match criteria including protocols and cos values. Packets that satisfy the match criteria for a class constitute the traffic for that class. A queue is reserved for each class, and traffic that belongs to a class is directed to the queue for that class.

Once a class has been defined according to its match criteria, you can assign its characteristics. To characterize a class, you assign a bandwidth. The bandwidth assigned to a class is the guaranteed bandwidth delivered to the class during congestion.

The traffic that does not match any of the configured classes is given best-effort treatment. Once a packet is classified, all of the standard mechanisms that can also be used to differentiate service among the classes apply.

For CBWFQ, the weight specified for the class becomes the weight of each packet that meets the match criteria of the class. Packets that arrive at the egress interface are classified according to the match criteria filters you define, and then each one is assigned the appropriate weight. The weight for a packet that belongs to a specific class is derived from the bandwidth that you assigned to the class when you configured it; the weight for a class is user-configurable.

After the weight for a packet is assigned, the packet is enqueued in the appropriate class queue. CBWFQ uses the weights assigned to the queued packets to ensure that the class queue is serviced fairly.

Configuring a class policy—configuring CBWFQ—has three processes:

  • Defining traffic classes to specify the classification policy (class maps). This process determines how many types of packets are to be differentiated from one another.
  • Associating policies—that is, class characteristics—with each traffic class (policy maps). This process entails configuration of policies to be applied to packets that belong to one of the classes that were previously defined through a class map. For this process, you configure a policy map that specifies the policy for each traffic class.
  • Attaching policies to interfaces (service policies).

    Note


    A queuing policy map can be applied only on an uplink in the egress (outbound) direction.


    This process requires that you associate an existing policy map, or service policy, with an interface to apply the particular set of policies for the map to that interface.

Policy maps prioritize network traffic by class. You create policy maps to define how to treat each class of traffic so that it is prioritized for the best quality of service.

Licensing Requirement for Class-based Weighted Fair Queuing

This feature does not require a license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.

Prerequisites for Class-based Weight Fair Queuing

You are already logged in to the CLI in EXEC mode.

Guidelines and Limitations

  • A queuing policy can be applied only on an uplink interface in the egress (outbound) direction.
  • Queuing is supported only on ESX or ESXi 5.0 or later hosts.
  • For port-channel interfaces, queuing bandwidth applies on the member ports. The overall performance depends on how the vEthernet interfaces are pinned to member ports and the traffic pattern on the individual ports.
  • We recommend that you reserve 10% bandwidth of the uplink for the control traffic.

Default Settings

Class-based weighted fair queuing is disabled by default.

Configuring Class-based Weighted Fair Queuing

This feature allows the user to differentiate traffic classes and provide appropriate bandwidth guarantees. You can use this procedure to configure class-based weighted fair queuing as follows:

  • Create a queuing class map with protocol or CoS matching criteria.
  • Create a queuing policy map and assign the class map to it.
Before You Begin
  • You are logged in to the CLI in EXEC mode.
  • You know whether you want the queuing class map to match the protocol or CoS.
  • You know the bandwidth that you want to assign to each class of traffic.
SUMMARY STEPS

    1.    switch# configure terminal

    2.    switch(config)# class-map type queuing {match-any | match-all} class-map-name

    3.    switch(config-cmap-que)# match {cos id} | {protocol name}

    4.    switch(config-cmap-que)# exit

    5.    switch(config)# policy-map type queuing name

    6.    switch(config-pmap-que)# class type queuing name

    7.    switch(config-pmap-c-que)# bandwidth percent percentage

    8.    switch(config-pmap-c-que)# exit

    9.    switch(config-pmap-que)# exit

    10.    switch(config)# port-profile type ethernet name

    11.    switch(config-port-prof)# service-policy type queuing output name

    12.    switch(config-port-prof)# show policy-map interface

    13.    (Optional) switch(config-port-prof)# copy running-config startup-config


DETAILED STEPS
     Command or ActionPurpose
    Step 1switch# configure terminal 

    Enters global configuration mode.

     
    Step 2switch(config)# class-map type queuing {match-any | match-all} class-map-name 

    Creates a CBWFQ class map and enters class map queuing mode for configuring the new class map.

    match-any—Use this option to apply this class map to a packet if it matches any of the matching criteria.

    match-all—Use this option to apply this class map to a packet if it matches all of the matching criteria.

    class-map-name—Up to 40 alphanumeric characters in length and can include the hyphen and underscore characters.

     
    Step 3switch(config-cmap-que)# match {cos id} | {protocol name} 

    Defines whether you want packets for this class map to match the protocol, class of service, or both.

    • CoS is specified as a number from 0 to 7— Matches traffic based on the class of service (CoS) in the IEEE 802.1Q header, defined in IEEE 802.1p. CoS is encoded in the high order 3 bits of the VLAN ID Tag field and is referred to as user priority.
    • The following are predefined protocol matches:
      • n1k_control—Refers to the Cisco Nexus 1000V control traffic.
      • n1k_mgmt—Refers to the Cisco Nexus 1000V management traffic directed to interface management 0.
      • n1k_packet—Refers to the Cisco Nexus 1000V inband traffic.
      • vmw_ft—Refers to the VMware fault tolerance traffic.
      • vmw_iscsi—Refers to the iSCSI traffic.
      • vmw_mgmt—Refers to the traffic directed to the service console of the ESX.
      • vmw_nfs—Refers to the NFS traffic.
      • vmw_vmotion—Refers to the VMotion traffic.
     
    Step 4switch(config-cmap-que)# exit 

    Exits class-map queuing configuration mode and returns you to global configuration mode.

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

    Creates a CBWFQ policy map and enters policy map queuing mode for configuring the new policy map.

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

    Assigns a CBWFQ class to this policy map and enters policy map class queuing configuration mode.

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

    Designates the minimum guaranteed bandwidth for this traffic class as a percentage of total available bandwidth.

     
    Step 8switch(config-pmap-c-que)# exit 

    Exits policy-map type queuing configuration mode and returns you to policy-map configuration mode.

     
    Step 9switch(config-pmap-que)# exit 

    Exits policy-map configuration mode and returns you to global configuration mod.

     
    Step 10switch(config)# port-profile type ethernet name 

    Creates a port profile and enters port profile configuration mode.

     
    Step 11switch(config-port-prof)# service-policy type queuing output name 

    Creates a service policy of type queuing.

     
    Step 12switch(config-port-prof)# show policy-map interface  Displays the status of the global statistics and the configured policy maps on all interfaces. 
    Step 13switch(config-port-prof)# copy running-config startup-config  (Optional)

    Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration.

     

    This example shows how to configure class-based weighted fair queuing:

    switch# configure terminal
    switch(config)# class-map type queuing queue_1
    switch(config-cmap-que)# match protocol n1k_mgmt 
    switch(config-cmap-que)# match protocol n1k_control 
    switch(config-cmap-que)# match protocol vmw_vmotion 
    switch(config-cmap-que)# exit
    switch(config)# policy-map type queuing qpol1
    switch(config-pmap-que)# class type queuing queue_1 
    switch(config-pmap-c-que)# bandwidth percent 30
    switch(config-pmap-c-que)# exit
    switch(config-pmap-que)# exit
    switch(config)# port-profile type ethernet uplink 
    switch(config-port-prof)# service-policy type queuing output qpol1 
    switch(config-port-prof)# sh policy-map interface 
    
    
    Global statistics status :   enabled
    
    port-channel1
    
      Service-policy (queuing) output:   qpol1 
        policy statistics status:   enabled
    
        Class-map (queuing):   queue_1 (match-all)
          Match: protocol n1k_mgmt 
          Match: protocol n1k_control 
          Match: protocol vmw_vmotion 
          bandwidth percent 30 
          queue dropped pkts : 0 
          queue matched pkts : 39 
          queue inrate bytes ( Kbits/sec )  : 0 
          queue outrate bytes ( Kbits/sec ) : 0 
    
    port-channel2
    
      Service-policy (queuing) output:   qpol1 
        policy statistics status:   enabled
    
        Class-map (queuing):   queue_1 (match-all)
          Match: protocol n1k_mgmt 
          Match: protocol n1k_control 
          Match: protocol vmw_vmotion 
          bandwidth percent 30 
          queue dropped pkts : 0 
          queue matched pkts : 208 
          queue inrate bytes ( Kbits/sec )  : 0 
          queue outrate bytes ( Kbits/sec ) : 0 
    
    port-channel4
    
      Service-policy (queuing) output:   qpol1 
        policy statistics status:   enabled
    
        Class-map (queuing):   queue_1 (match-all)
          Match: protocol n1k_mgmt 
          Match: protocol n1k_control 
          Match: protocol vmw_vmotion 
          bandwidth percent 30 
          queue dropped pkts : 0 
          queue matched pkts : 054
          queue inrate bytes ( Kbits/sec )  : 0 
          queue outrate bytes ( Kbits/sec ) : 0 
    
    switch(config)# copy running-config startup-config
    

    Note


    In the Layer 3 mode of operation, both n1k_control and n1k_packet traffic are classified under the n1k_control protocol. The protocol vmw_iscsi can match only with the software iSCSI traffic and not the hardware iSCSI traffic. For any match for VMware protocol traffic, the vmknic that carries that traffic should be assigned to a port profile on the Nexus1000V.


    Verifying the Class-based Weighted Fair Queuing Configuration

    Use one of the following commands to verify the configuration:

    Command

    Description

    show policy map type queuing name

    Displays the queuing policy map configuration.

    show class-map type queuing name

    Displays the queuing class map configuration.

    show policy-map interface

    Displays the policy map interface configuration.

    show running-config ipqos

    Displays the QoS running configuration.

    Show Policy Map Type Example

    This example shows how to display the policy map type queuing for policy vmotion:

    n1000v# show policy-map type queuing Policy-vmotion
    
      Type queuing policy-maps
      ========================
    
      policy-map type queuing Policy-vmotion
        class type queuing Match-vmotion
          bandwidth percent 50

    Show Class Map Example

    This example shows how to display the class map queuing for vmotion:

    n1000v# show class-map type queuing Match-vmotion
    
      Type queuing class-maps
      ========================
    
      class-map type queuing match-any Match-vmotion
        match protocol vmw_vmotion

    This example shows how to display class map type queuing CoS:

    n1000v# show class-map type queuing Match-Cos
      
      Type queuing class-maps
      ========================
    
        class-map type queuing match-all Match-Cos
          match cos 5

    Show Policy Map Interface Examples

    This example shows how to display the policy map on the interface ethernet policy v-motion:

    n1000v# show policy-map interface ethernet 3/3
    
    Global statistics status :   disabled
    
    Ethernet3/3
    
      Service-policy (queuing) output:   Policy-vmotion
        policy statistics status:   enabled 
        
        Class-map (queuing):   Match-vmotion (match-any)
          Match: protocol vmw_vmotion
          bandwidth percent 50

    This example shows how to display the service policy on the interface ethernet policy-CoS:

    n1000v# show policy-map interface ethernet 3/3
    
    Global statistics status :   disabled
    
    Ethernet3/3
    
      Service-policy (queuing) output:   Policy-Cos
        policy statistics status:   enabled
    
        Class-map (queuing):   Match-Cos (match-all)
          Match: cos 5
          bandwidth percent 50

    This example shows how to display the service policy on the interface port channel:

    n1000v# show policy-map interface port-channel 1
    
    Global statistics status :   disabled
    
    port-channel1
    
      Service-policy (queuing) output:   Policy-vmotion
        policy statistics status:   enabled
    
        Class-map (queuing):   Match-vmotion (match-any)
          Match: protocol vmw_vmotion
          bandwidth percent 50

    Configuration Examples for Class-based Weighted Fair Queuing

    This example shows how to allocate 50 percent of the bandwidth for VMotion traffic:

    switch# configure terminal
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)# class-map type queuing match-any Match-vmotion
    switch(config-cmap-que)# match protocol vmw_vmotion 
    switch(config-cmap-que)# exit
    switch(config)# policy-map type queuing Policy-vmotion
    switch(config-pmap-que)# class type queuing Match-vmotion
    switch(config-pmap-c-que)# bandwidth percent 50
    switch(config-pmap-c-que)# exit
    switch(config-pmap-que)# exit
    switch(config)# interface ethernet 3/3
    switch(config-if)# service-policy type queuing output Policy-vmotion

    This example shows how to allocate 50% of bandwidth for Traffic with CoS Value of 5:

    switch# configure terminal
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)# class-map type queuing match-all Match-Cos
    switch(config-cmap-que)# match cos 5
    switch(config-cmap-que)# exit
    switch(config)# policy-map type queuing Policy-Cos
    switch(config-pmap-que)# class type queuing Match-Cos
    switch(config-pmap-c-que)# bandwidth percent 50
    switch(config-pmap-c-que)# exit
    switch(config-pmap-que)# exit
    switch(config)# interface ethernet 3/3
    switch(config-if)# service-policy type queuing output Policy-Cos

    This example shows how to policy-map with multiple traffic classes:

    switch# configure terminal
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)# class-map type queuing match-any class-vmotion
    switch(config-cmap-que)# match protocol vmw_vmotion
    switch(config-cmap-que)# exit
    switch(config)# class-map type queuing match-any class-cos-2
    switch(config-cmap-que)# match cos 2
    switch(config-cmap-que)# exit
    switch(config)# policy-map type queuing policy-priority-vmotion
    switch(config-pmap-que)# class type queuing class-vmotion
    switch(config-pmap-c-que)# bandwidth percent 60
    switch(config-pmap-c-que)# class type queuing class-cos-2
    switch(config-pmap-c-que)# bandwidth percent 40
    switch(config-pmap-c-que)# exit
    switch(config-pmap-que)# exit
    switch(config)# interface po1
    switch(config-if)# service-policy type queuing output policy-priority-vmotion
    switch(config-if)# show policy-map type queuing policy-priority-vmotion
    
      Type queuing policy-maps
      ========================
    
      policy-map type queuing policy-priority-vmotion
        class type queuing class-vmotion
          bandwidth percent 60
        class type queuing class-cos-2
          bandwidth percent 40
    
    switch# configure terminal
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)# interface po1
    switch(config-if)# service-policy type queuing output policy-priority-vmotion
    
    switch(config-if)# show policy-map interface po1
    
    Global statistics status :   disabled
    
    port-channel1
    
      Service-policy (queuing) output:   policy-priority-vmotion
        policy statistics status:   enabled
    
        Class-map (queuing):   class-vmotion (match-any)
          Match: protocol vmw_vmotion
          bandwidth percent 60
    
        Class-map (queuing):   class-cos-2 (match-any)
          Match: cos 2
          bandwidth percent 40