Cisco Nexus 1000V Quality of Service Configuration Guide, Release 4.2(1)SV1(5.2)
Configuring Class Based Weighted Fair Queueing
Downloads: This chapterpdf (PDF - 1.31MB) The complete bookPDF (PDF - 2.55MB) | The complete bookePub (ePub - 247.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

With this feature the following goals have been addressed:

  • 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 Qqueuing (CBWFQ) extends the standard Weighted Fair Queuing (WFQ) functionality to provide support for user-defined traffic classes. For CBWFQ, you define traffic classes based on match criteria including protocols, and cos values. Packets satisfying the match criteria for a class constitute the traffic for that class. A queue is reserved for each class, and traffic belonging 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 it bandwidth, and maximum queue limit. The bandwidth assigned to a class is the guaranteed bandwidth delivered to the class during congestion.

To characterize a class, you also specify the queue limit for that class, which is the maximum number of packets allowed to accumulate in the queue for the class. Packets belonging to a class are subject to the bandwidth and queue limits that characterize the class.

After a queue has reached its configured queue limit, enqueuing of additional packets to the class causes tail drop.

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, then each one is assigned the appropriate weight. The weight for a packet belonging to a specific class is derived from the bandwidth you assigned to the class when you configured it; in this sense 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—thus, configuring CBWFQ—entails these 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 belonging to one of the classes 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 only be applied 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 only be applied on an uplink interface in the egress (outbound) direction.
  • Queuing is only supported on ESX or ESXi 4.1.0 or later hosts.
  • For port-channel interfaces, queuing bandwidth applies on the member ports. The overall performance will depend on how the vEthernets 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 protocol or CoS.
  • You know whether you want to designate a minimum queue size for the traffic class.
  • You know whether you want to designate a maximum queue size for the traffic class.
Procedure
     Command or ActionPurpose
    Step 1switch# configure terminal 

    Enters global configuration mode.

     
    Step 2switch(config)# class-map type queuing {match-any | match-all} 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.

    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 protocol, class of service, or both.

    • CoS is specified as a number from 0 to 7. This 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 pre-defined protocol matches:
      • n1k_control
      • n1k_mgmt
      • n1k_packet
      • vmw_ft
      • vmw_iscsi
      • vmw_mgmt
      • vmw_nfs
      • vmw_vmotion
     
    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)# queue-limit number  (Optional)

    Designates the maximum queue size allowed for this class in packets.

    number—Number of packets which are allowed to be queued before dropping, a value between 1 and 55924.

    The default is that no queue limit is set.

     
    Step 9switch(config-pmap-c-que)# show policy-map [{[type qos] [pmap-name-qos]} | {type queuing [pmap-name-que]}]  (Optional)

    Displays the configuration for verification.

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

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

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

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

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

    Creates a port-profile and enters port-profile configuration mode.

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

    Creates a service-policy of type queuing.

     
    Step 14switch(config-port-prof)# show policy-map interface  Displays the status of the global statistics and the configured policy maps on all interfaces. 
    Step 15switch(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.

     
    switch# config terminal
    switch(config)# class-map type queuing match-all class_fin1
    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 class_fin1
    switch(config-pmap-c-que)# bandwidth percent 50
    switch(config-pmap-c-que)# queue-limit 500
    switch(config-pmap-c-que)# 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
    
    switch(config-pmap-c-que)# exit
    switch(config-pmap-que)# exit
    switch(config)# port-profile type ethernet myppte
    switch(config-port-prof)# service-policy type queuing output my_pmtq
    switch(config-port-prof)# show policy-map interface
    switch(config-port-prof)# copy running-config startup-config

    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 displays 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 displays 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 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 displays the policy map on 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 displays service policy on 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 displays service policy on 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% of 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)# 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
    end
    
    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