Chapter 1. Overview

Information About Quality of Service

Traffic Classification and Marking

QoS Commands

Default QoS Behavior

Supported RFCs

High Availability Requirements for QoS Features

Commonly Used DSCP Values

IP Precedence Values

QoS Configuration Limits

Chapter 2. Configuring QoS Classification

Information About Traffic Classes

Criteria for Mapping Classes

Prerequisites for Classification

Guidelines and Limitations

Classifying ACL Traffic

Classifying DSCP Traffic

Configuring IP Precedence Classification

Configuring QoS Group Classification

Configuring Discard Class Classification

Configuring Layer 3 Packet Length Classification

Configuring CoS Classification

Configuring IP RTP Classification

Configuring Class Map Classification

Verifying the Classification Configuration

Configuration Example for QoS Classification

Feature History for QoS Classification

Chapter 3. Configuring QoS Marking Policies

Information About Policy Maps

Criteria for Marking Fields

Prerequisites for QoS Marking Policies

Guidelines and Limitations

Creating a DSCP Policy

Creating an IP Precedence Policy

Creating a Class of Service Policy

Creating a QoS Group Policy

Creating a Discard Class Policy

Creating Ingress and Egress Policies

Marking the Port DSCP

Verifying the QoS Policy Configuration

Configuration Example for QoS Marking Policies

Feature History for QoS Marking Policies

Chapter 4. Configuring QoS Policing

Information About Policing

Prerequisites for Policing

Guidelines and Limitations

Police Command and Policer Types

Policer Action

Police Command Data Rates

Police Command Burst Sizes

Configuring 1-Rate and 2-Rate, 2-Color and 3-Color Policing

Configuring Ingress and Egress Policing

Configuring Markdown Policing

Verifying the Policing Configuration

Configuration Example for QoS Policing

Feature History for QoS Policing

Chapter 5. Monitoring QoS Statistics

Information About QoS Statistics

Prerequisites for Monitoring QoS Statistics

Enabling QoS Statistics

Displaying QoS Statistics

Clearing QoS Statistics

Configuration Example for QoS Statistics

Standards

MIBs

RFCs

Technical Assistance

Feature History for QoS Statistics

Chapter 6. Configuring Class Based Weighted Fair Queueing

Information About Class-Based Weighted Fair Queuing

Licensing Requirement for Class-based Weighted Fair Queuing

Prerequisites for Class-based Weight Fair Queuing

Guidelines and Limitations

Default Settings

Configuring Class-based Weighted Fair Queuing

Verifying the Class-based Weighted Fair Queuing Configuration

Configuration Examples for Class-based Weighted Fair Queuing

Preface

Audience

Document Conventions

Related Documentation for Nexus 1000V Series NX-OS Software

Documentation Feedback

Obtaining Documentation and Submitting a Service Request

Copyright Page

Chapter 1. Overview

This chapter contains the following sections:

- Information About Quality of Service

- Traffic Classification and Marking

- QoS Commands

- Default QoS Behavior

- Supported RFCs

- High Availability Requirements for QoS Features

- Commonly Used DSCP Values

- IP Precedence Values

- QoS Configuration Limits

Information About Quality of Service

You can use quality of service (QoS) to provide the most desirable flow of traffic through a network. QoS allows you to classify your network traffic, police and prioritize the traffic flow, and provide congestion avoidance. Traffic is processed based on how you classify it and the QoS policies that you put in place.

You can implement a QoS policy using the following steps:

1. Define a traffic class by using the class-map command. For more information, see Configuring QoS Classification.

2. Create a traffic class by using the policy-map command. A traffic policy defines how specific traffic is to be acted upon to improve the quality of service. For more information, see Configuring QoS Marking Policies.

3. Attach the traffic policy to an interface or port profile by using the service-policy command. For more information, see .

4. Police the traffic. For more information, see Configuring QoS Policing.

Traffic Classification and Marking

QoS classifies network traffic, uses or assigns QoS labels to indicate priority, makes the packets comply with the configured resource usage limits (polices the traffic and marks the traffic), and provides congestion avoidance where resource contention exists. The following table describes these processes.

QoS Method

Description

Command

Mechanism

Traffic Classifications

Groups network traffic based on defined criteria.

match

class maps

Traffic Marking

Modifies traffic attributes by matching the class.

set

policy maps

QoS Commands

QoS configuration commands are shown in the following table.

Command

Configuration

Description

class-map

Global configuration

Defines a class map that represents a class of traffic.

table-map

Global configuration

Defines a table map that represents a mapping from one set of field values to another set of field values. You can reference a table map from a policy map.

policy-map

Global configuration

Defines a policy map that represents a set of policies to be applied to a set of class maps. Policy maps can reference table maps.

match

Class map QoS configuration

Defines the criteria for a class map.

set

Policy map QoS configuration

Defines the action to be taken on the packet.

service-policy

Interface or port profile configuration

Applies a specified policy map to input or output packets on interfaces configured as follows:

- inherited from a port-profile

- port-channel

- Ethernet

- vEthernet

police

Policy map class QoS configuration

Defines the rate at which data traffic is monitored.

Default QoS Behavior

QoS has no default behavior. Policing and prioritization of traffic are implemented only when you apply a policy map to an interface. When you are configuring QoS with an ACL, note that packets are processed as follows:

- QoS ingress processing follows ACL processing.

- QoS egress processing precedes ACL egress processing.

Supported RFCs

The following table lists RFCs that are supported by QoS.

Number

Title

RFC 2475

Architecture for Differentiated Services

RFC 2697

A Single Rate Three Color Marker

RFC 2698

A Dual Rate Three Color Marker

RFC 3289

Management Information Base for the Differentiated Services Architecture

RFC 3550

RTP: A Transport Protocol for Real-Time Applications

High Availability Requirements for QoS Features

QoS recovers its previous state after a software restart, and it is able to switch over from the active supervisor to the standby supervisor without a loss of state.

Commonly Used DSCP Values

You can mark both incoming and outgoing packets. The following commonly used DSCP values are described in RFC 2475.

DSCP Value

Decimal Value

Meaning

Drop Probability

Equivalent IP Precedence Values

101 110

46

High Priority Expedited Forwarding (EF)

N/A

101—Critical

000 000

0

Best effort

N/A

000—Routine

001 010

10

AF11

Low

001—Priority

001 100

12

AF12

Medium

001—Priority

001 110

14

AF13

High

001—Priority

010 010

18

AF21

Low

010—Immediate

010 100

20

AF22

Medium

010—Immediate

010 110

22

AF23

High

010—Immediate

011 010

26

AF31

Low

011—Flash

011 100

28

AF32

Medium

011—Flash

011 119

30

AF33

High

011—Flash

100 010

34

AF41

Low

100—Flash Override

100 100

36

AF42

Medium

100—Flash Override

100 110

38

AF43

High

100—Flash Override

001 000

8

CS1

1

010 000

16

CS2

2

011 000

24

CS3

3

100 000

32

CS4

4

101 000

40

CS5

5

110 000

48

CS6

6

111 000

56

CS7

7

000 000

0

Default

101 110

46

EF

IP Precedence Values

The IP precedence values from least to most important are listed in the following table.

Value

Description

000 (0)

Routine or Best Effort

001 (1)

Priority

010 (2)

Immediate

011 (3)

Flash (mainly used for voice signaling or for video)

100 (4)

Flash Override

101 (5)

Critical (mainly used for voice RTP)

110 (6)

Internet

111 (7)

Network

QoS Configuration Limits

The configuration limits are documented in the Cisco Nexus 1000V Resource Availability Reference.

Chapter 2. Configuring QoS Classification

This chapter contains the following sections:

- Information About Traffic Classes

- Criteria for Mapping Classes

- Prerequisites for Classification

- Guidelines and Limitations

- Verifying the Classification Configuration

- Configuration Example for QoS Classification

- Feature History for QoS Classification

Information About Traffic Classes

Traffic classes are categories of traffic (packets) that are grouped on the basis of similarity of traffic are called class maps. Classifying network traffic allows you to enable a quality of service (QoS) strategy in your network.

Criteria for Classifying Network Traffic

Identifying and categorizing network traffic into traffic classes (that is, classifying packets) enables you to handle different types of traffic by separating network traffic into different categories.

Classifying network traffic allows you to see the kinds of traffic you have and treat some types of traffic differently than others. Identifying and organizing network traffic allows you to allocate network resources to deliver the best performance for each type of traffic.

You can place network traffic with a specific IP precedence into one traffic class, while you place traffic with a specific differentiated services code point (DSCP) value into another traffic class. Each traffic class can be given a different QoS treatment, which you configure in a policy map later.

You define each class of traffic in a class map based upon criteria, such as the IP precedence or Class of Service (CoS). The allowable criteria for mapping classes of traffic is listed in Criteria for Mapping Classes section. You can match the criteria to your traffic as follows:

- Matching all

- Matching or not matching one

- Matching or not matching multiple

- Matching or not matching another class map

Some of the criteria used in traffic class maps relates only to one direction of traffic—either ingress or egress. For example, the internal label QoS group has no meaning on ingress traffic because it has not yet been assigned a value.

Traffic that fails to match any traffic class in a QoS policy map is assigned to a default class of traffic. called class-default. The class-default can be referenced in a QoS policy map to select this unmatched traffic.

Criteria for Mapping Classes

The allowable criteria for the mapping traffic classes are as follows:

Class Criteria

Description

CoS

Class of service (CoS) field in the IEEE 802.1Q header.

IP precedence

Precedence value within the type of service (ToS) byte of the IP header.

For details see the IP Precedence Values table.

Differentiated Services Code Point (DSCP)

DSCP value within the DIffServ field of the IP header. The standard DSCP values are listed in Commonly Used DSCP Values.

QoS group

Locally significant QoS values that can be manipulated and matched within the system. The range is from 0 to 126.

Discard class

Locally significant values that can be matched and manipulated within the system. The range is from 0 to 63.

ACL

IP access control list (ACL) or MAC ACL name.

If you configure the class to match-all and ACL used as match-criteria, then no other match criteria, except the packet length, can be specified.

If you configure the class to match-any and ACL used as match-criteria, then you can also match ACLs and any other match criteria.

Packet length

Size range of Layer 3 packet lengths.

IP RTP

Applications that are using the Real-time Transport Protocol (RTP) are identified by UDP port number range.

Class map

Criteria that are specified in a named class-map object.

Prerequisites for Classification

You are logged in to the CLI in EXEC mode.

Guidelines and Limitations

- You can specify a maximum of 32 match criteria in a class map.

- You can configure a maximum of 64 classes for use in a single policy map, if no policers are configured.

- When you match on an ACL, the only other match that you can specify is the Layer 3 packet length in a match-all class.

- You can classify traffic on Layer 2 ports based on the port policy of the incoming packet.

Classifying ACL Traffic

You can classify traffic by matching packets based on existing access control lists (ACLs).

Before You Begin

- QoS does not use the permit-deny functions of ACLs. The permit and deny ACL keywords are ignored when matching.

- QoS does not support the not form of this command.

- If you configure the class to match-all and ACL used as match-criteria, then no other match criteria, except the packet length, can be specified.

- If you configure the class to match-any and ACL used as match-criteria, then you can match ACLs and any other match criteria also.

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

- Tunneled IP packets are not matched unless the tunneling protocol is also IP, and then the match applies to the outer IP header and not the encapsulated IP header.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match access-group name ac1-name

Configures and saves the access group to match for this class in the running configuration.

Note:
The permit and deny keywords are ignored when matching the ACL.

The not form of this command is not supported.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration.

Step 5

switch(config-cmap-qos)# copy running-config startup-config

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

The following example shows how to classify the ACL traffic:

switch# config terminal
switch(config)# class-map class_acl
switch(config-cmap-qos)# match access-group name my_acl
switch(config-cmap-qos)# show class-map class_acl1
switch(config-cmap-qos)# copy running-config startup-config

Classifying DSCP Traffic

You can classify traffic based on the DSCP value in the DiffServ field of the IP header. The standard DSCP values are found in the Commonly Used DSCP Values and IP Precedence Values.

Note

Tunneled IP packets are not matched unless the tunneling protocol is also IP, and then the match applies to the outer IP header and not the encapsulated IP header.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] dscp dscp_list

Configures the traffic class by matching packets that are based on dscp-values. The standard DSCP values are listed in the Commonly Used DSCP Values and IP Precedence Values.

Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration.

Step 5

switch(config-cmap-qos)# 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 class_dscp
switch(config-cmap-qos)# match dscp-af21, af32
switch(config-cmap-qos)# show class-map class_dscp
switch(config-cmap-qos)# copy running-config startup-config

Configuring IP Precedence Classification

You can classify traffic based on the precedence value in the type of service (ToS) byte field of the IP header. Precedence values can be found in the Commonly Used DSCP Values and IP Precedence Values tables.

Note

Tunneled IP packets are not matched unless the tunneling protocol is also IP, and then the match applies to the outer IP header and not the encapsulated IP header.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] precedence values

Configures the traffic class by matching packets that are based on precedence-values listed in the following table:

Value

Description

000 (0)

Routine or Best Effort

001 (1)

Priority

010 (2)

Immediate

011 (3)

Flash (mainly used for voice signaling or for video)

100 (4)

Flash Override

101 (5)

Critical (mainly used for voice RTP)

110 (6)

Internet

111 (7)

Network

Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration.

Step 5

switch(config-cmap-qos)# copy running-config startup-config

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

The following example shows how to configure the IP precedence classification:

switch# config terminal
switch(config)# class-map class_ip_precedence
switch(config-cmap-qos)# match precedence 1-2, 5-7
switch(config-cmap-qos)# show class-map class_ip_precedence
switch(config-cmap-qos)# copy running-config startup-config

Configuring QoS Group Classification

You can classify traffic based on the QoS group internal label, which is not part of the packet payload or any packet header. You can set the value of the QoS group within a policy map using the set qos-group command as described in the Creating a QoS Group Policy.

Note

You match on the QoS group only in egress policies because its value is undefined until you set it in an ingress policy.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] qos-group multi-range-qos-group-values

Configures the traffic class by matching packets that are based on a list of QoS group values. Values can range from 0 to 126. The default QoS group value is 0. Use thenot keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration for the specified traffic class name.

Step 5

switch(config-cmap-qos)# 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 class_qos_group
switch(config-cmap-qos)# match qos-group 4, 80-90
switch(config-cmap-qos)# show class-map class_qos_group
switch(config-cmap-qos)# copy running-config startup-config

Configuring Discard Class Classification

You can classify traffic based on the value of the discard class internal label, which is not part of the packet payload or any packet header. You can set the value of the discard class within a policy map using the set discard-class command as described in the Creating a Discard Class Policy.

Note

You match on the discard class only in egress policies because its value is undefined until you set it in an ingress policy.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] discard-class multi-range-discard-group-values

Configures the traffic class by matching packets that are based on a list of discard-class values. Values can range from 0 to 63. The default discard class value is 0. Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration for the specified traffic class name.

Step 5

switch(config-cmap-qos)# 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 class_discard_class
switch(config-cmap-qos)# match discard-class 4, 60-62
switch(config-cmap-qos)# show class-map class-discard-class
switch(config-cmap-qos)# copy running-config startup-config

Configuring Layer 3 Packet Length Classification

You can classify You can classify Layer 3 traffic based on various packet lengths.

Note

This feature is designed for IP packets only.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] packet-length packet-length-list

Configures the traffic class by matching packets that are based on various packet lengths. Values can range from 1 to 9198. Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration for the specified traffic class name.

Step 5

switch(config-cmap-qos)# 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 class_packet_length
switch(config-cmap-qos)# match packet length 2000
switch(config-cmap-qos)# show class-map class_packet_length
switch(config-cmap-qos)# copy running-config startup-config

Configuring CoS Classification

Traffic classification allows you to organize traffic (packets) into traffic classes or categories on the basis of whether the traffic matches the criteria you specify. The values used to classify traffic are called match criteria. When you define a traffic class, you can specify multiple match criteria, you can choose to not match on a particular criterion, or you can determine the traffic class by matching any or all criteria.

You can classify traffic based on the class of service (CoS) in the IEEE 1Q header. This 3-bit field is defined in IEEE.802.1p to support QoS traffic classes. CoS is encoded in the high order 3 bits of the VAN ID Tag field and is referred to as user_priority.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] cos cos-list

Configures the traffic class by matching packets that are based on a list of CoS values. Values can range from 0 to 7. Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration for the specified traffic class name.

Step 5

switch(config-cmap-qos)# 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 class_cos
switch(config-cmap-qos)# match cos 4, 5-6
switch(config-cmap-qos)# show class-map class-cos
switch(config-cmap-qos)# copy running-config startup-config

Configuring IP RTP Classification

The IP Real-time Transport Protocol (RTP) is a transport protocol for real-time applications that transmits data such as audio or video and is defined by RFC 3550 . Although RTP does not use a common TCP or UDP port, you typically configure RTP to use ports 16384 to 32767. UDP communications use an even port and the next higher odd port is used for RTP Control Protocol (RTCP) communications.

You can configure classification based on UDP port ranges, which are likely to target applications using RTP.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] ip rtp udp-port-values

Configures the traffic class by matching packets that are based on the range of lower and upper UDP port number, which is likely to target applications using RTP. Values can range from 2000 to 65535. Use the not keyword to match on values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration for the specified traffic class name.

Step 5

switch(config-cmap-qos)# 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 class_rtp
switch(config-cmap-qos)# match ip rtp 2000-21000, 4000-4100
switch(config-cmap-qos)# show class-map class-rtp
switch(config-cmap-qos)# copy running-config startup-config

Configuring Class Map Classification

You can classify traffic based on the match criteria in another class map.

Before You Begin

- The referenced class map must be created prior to its reference.

- You can reference the same class map in multiple policies.

- You can configure only one level of nesting of class maps. You cannot reference a class map that references another class map.

- Before you delete a referenced class map, you should delete all references to that class map.

- To perform a logical OR with the class map that is specified in the match class-map command, use the match-any keyword. The match-any or match-all specification of the matched class map is ignored.

- To perform a logical AND with the class map that is specified in the match class-map command, use the match-all keyword. The match-any or match-all specification of the matched class map is ignored.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type qos] [match-any | match-all] class_map_name

Places you into class map QoS configuration mode for the specified class map and configures and saves the map name in the running configuration.

The class_map_name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-cmap-qos)# match [not] class-map class_map_name

Configures the traffic class by matching packets that are based on the match criteria in another class map. Because match-all is the default for the class-map command, the match criteria that is specified in class_map3 are ANDed with match criteria in class_class_map. Use the not keyword to find values that do not match the specified range.

Step 4

switch(config-cmap-qos)# show class-map class_map_name

Displays the class map configuration.

Step 5

switch(config-cmap-qos)# copy running-config startup-config

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

The following example shows how to configure the class map classification:

switch# config terminal
switch(config)# class-map class_class_map
switch(config-cmap-qos)# match class-map class-map3
switch(config-cmap-qos)# show class-map class_class_map
switch(config-cmap-qos)# copy running-config startup-config

Verifying the Classification Configuration

To verify the classification configuration, use the commands in the following table:

Command

Description

show class-map name

Displays the class map configuration for all class maps or for a specified class map.

show ip access-lists name

Displays all IPv4 access control lists (ACLs) or a specific IPv4 ACL.

Configuration Example for QoS Classification

This example shows how to configure classification for the class map named cmap1, which matches DSCP traffic AF21 and AF32:

switch(config)# class-map type qos match-all cmap1
switch(config-cmap-qos)# match dscp af21 af32
switch(config-cmap-qos)# exit

Feature History for QoS Classification

This section provides the QoS Classification release history.

Feature Name

Release

Feature Information

QoS Classification

4.0.

This feature was introduced

Chapter 3. Configuring QoS Marking Policies

This chapter contains the following sections:

- Information About Policy Maps

- Criteria for Marking Fields

- Prerequisites for QoS Marking Policies

- Guidelines and Limitations

- Verifying the QoS Policy Configuration

- Configuration Example for QoS Marking Policies

- Feature History for QoS Marking Policies

Information About Policy Maps

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.

Marking is the process of marking packets, that is, changing one of the following in the packet for QoS purposes:

- Differentiated services code point (DSCP)

- Precedence

- CoS

You can map a traffic class to a DSCP, which is an indicator of the service level for a specified frame. The DSCP value ranges from 0 to 63, and the default is 0. A DSCP value of 46 is disallowed.

Service policies are specified using policy maps. Policy maps provide an ordered mapping of class maps to service levels. You can specify multiple class maps within a policy map, and map a class map to a high, medium, or low service level. The default priority is low. The policy map name is restricted to 63 alphanumeric characters.

The order of the class maps within a policy map is important to determine the order in which the frame is compared to class maps. The first matching class map has the corresponding priority marked in the frame.

Packet Fields Available for Marking

Marking is the setting of QoS information that is related to a packet. You can set the value of standardt QoS fields IP precedence, DSCP and Class of Service (CoS), and internal labels that can be used in subsequent actions such as policing.

Once your traffic classes are defined, you can reference them in the policy map where you also define how they should be marked. We recommend that you keep the policy simple by using no more than four classes.

Criteria for Marking Fields

Fields that are available for marking are listed in the following table:

Field

Description

DSCP

Layer 3 differentiated services code point (DSCP).

Note:
f you mark DSCP, you cannot mark Discard Class.

IP precedence

Layer 3 IP precedence.

Note:
IP precedence uses only the lower 3 bits of the type of service (ToS) field. The device overwrites the first 3 bits of the ToS field to 0.

CoS

Layer 2 class of service (CoS).

QoS group

Local QoS values that can be marked and matched as needed.

The range is from 0 to 126.

Discard class

Local QoS values that can be matched and marked as needed. The range is from 0 to 63.

Note:
If you mark Discard Class, you cannot mark DSCP.

Ingress and egress ports

The marking applies to incoming or outgoing packets.

For a single class, you can set operations on any two out of the following five fields: CoS, IP Precedence, DSCP, QoS Group, and Discard Class. Unless noted as a restriction, you can mark both incoming and outgoing packets.

Prerequisites for QoS Marking Policies

Marking has the following prerequisites:

- You must have already classified your network traffic. For more information, see Configuring QoS Classification.

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

Guidelines and Limitations

- The set cos command is applicable only to 802.1Q interfaces. So, although you can use the set cos command on an ingress interface, the setting is only applied if a packet eventually egresses an 802.1Q compliant interface.

- For a single class, you can set operations on any two out of the following five fields: CoS, IP Precedence, DSCP, QoS Group, and Discard Class.

- You can only use the set qos-group command in ingress policies.

- You can only use the set discard-class command in ingress policies.

- When designing your QoS and access control list (ACL) policies, note that ACLs referenced within a QoS policy are processed as follows as part of the QoS policy:

- QoS ingress processing follows ACL processing.

- QoS egress processing precedes ACL egress processing.

Creating a DSCP Policy

You can create a policy that marks the DSCP value in the IP header packet to prioritize traffic in a particular class.

Before You Begin

- DSCP is described in RFC 2475.

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

- If you use DSCP marking, you cannot use Discard Class marking. For more information, see Creating a Discard Class Policy.

- You can mark the DSCP field as a numeric value between 0 and 63 or as one of the commonly used values listed in the Commonly Used DSCP Values and IP Precedence Values.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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

The class_map_name argument is a unique alphabetic string that can be up to 40 case-insensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 4

switch (config-pmap-c-qos)# set dscp value

Define the DSCP value that should be used in all IP headers for the specified class and saves it in the running configuration.

You can use a numeric value from 1 to 60 or one of the standard values from Commonly Used DSCP Values and IP Precedence Values.

In the example below, the standard value of af31 is used.

Step 5

switch(config-pmap-c-qos)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 6

switch(config-pmap-c-qos)# 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 create a DSCP policy:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap)# class class1
switch(config-pmap-c-qos)# set dscp af31
switch(config-pmap-c-qos)# show policy-map policy1
switch(config-pmap-c-qos)# copy running-config startup-config

Creating an IP Precedence Policy

Before You Begin

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

- The RFC 791 precedence values from least to most important are as listed in IP Precedence Values table.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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-qos)# set precedence value

Adds the precedence value that should be used in all IP headers for the specified class and saves it in the running configuration.

You can use a numeric value from 0 to 7 as shown in the following table:

Value

Description

000 (0)

Routine or Best Effort

001 (1)

Priority

010 (2)

Immediate

011 (3)

Flash (mainly used for voice signaling or for video)

100 (4)

Flash Override

101 (5)

Critical (mainly used for voice RTP)

110 (6)

Internet

111 (7)

Network

Step 5

switch(config-pmap-c-qos)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 6

switch(config-pmap-c-qos)# 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 create an IP precedence policy:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap)# class class1
switch(config-pmap-c-qos)# set precedence 3
switch(config-pmap-c-qos)# show policy-map policy1
switch(config-pmap-c-qos)# copy running-config startup-config

Creating a Class of Service Policy

You can mark the CoS field in the IEEE 802.1Q header for all traffic in a specific class. If you mark this field in an ingress or egress policy, it will only be set when a packet egresses an IEEE 802.1Q-capable interface.

Before You Begin

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

- You can set CoS in ingress and egress policies.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name | class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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-qos)# set cos cos-value

Sets the CoS value to cos-value. The value can range from 0 to 7. You can use this command only in egress policies.

Step 5

switch(config-pmap-c-qos)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 6

switch(config-pmap-c-qos)# 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 create a class of service policy:

This example shows how to create a class of service policy.
switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class1
switch(config-pmap-c-qos)# set cos 3
switch(config-pmap-c-qos)# show policy-map policy1

Type qos policy-maps
====================

policy-map type qos policy1
class  class1
set dscp 26
set cos 3
class  class2
set dscp 14
class  class-default
set dscp 20
police cir 256000 bps bc 300 ms pir 256000 bps be 300 ms conform transmit exceed set dscp dscp table cir-mar kdown-map violate drop

Creating a QoS Group Policy

Before You Begin

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

- You can mark the QoS group value only in ingress policies.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name | class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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-qos)# set qos-group qos-group-value

Sets the QoS group value to qos-group-value. The value can range from 0 to 126.

Step 5

switch(config-pmap-c-qos)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 6

switch(config-pmap-c-qos)# 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 create a QoS group policy:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class1
switch(config-pmap-c-qos)# set qos-group 100
switch(config-pmap-c-qos)# show policy-map policy1
switch(config-pmap-c-qos)# copy running-config startup-config

Creating a Discard Class Policy

You can set a local internal label discard class policy.

Before You Begin

- If you configure a local internal label discard class policy, you cannot create a DSCP policy. For more information about DSCP policies, see the Creating a DSCP Policy.

- You can set a discard class only in ingress policies.

- To reference the local discard class in a policy or in traffic classification, use the match discard-class command. For more information, see Configuring Discard Class Classification.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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-qos)# set discard-class discard-class-value

Sets the discard-class value to discard-class-value. The value ranges from 0 to 63.

Step 5

switch(config-pmap-c-qos)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 6

switch(config-pmap-c-qos)# 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 create a discard class policy:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class1
switch(config-pmap-c-qos)# set discard-class 40
switch(config-pmap-c-qos)# show policy-map policy1
switch(config-pmap-c-qos)# copy running-config startup-config

Creating Ingress and Egress Policies

You can attach a policy map to an interface or a port profile so that the marking instructions are applied to the ingress or egress packets.

Before You Begin

- The interface or port profile have been created.

- The policy map that you want to use has been defined.

Note

You can attach only one input policy and one output policy to an interface or port profile.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

Enter one of the following commands:

- switch (config)# interface type number

- switch (config)# port-profile name

Places you into configuration mode for the specified Ethernet or vEthernet interface or port profile.

Step 3

switch (config-if)# service-policy [type qos] {input | output} policy-map-name [no stats]

(Optional) Attaches a policy map name that will be added to the input or output packets of the interface or port profile.
Note:
You can attach only one input policy and one output policy to an interface or port profile.

The policy_map_name argument is an alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters.

Step 4

switch(config-if)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

The policy_map_name argument is an alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters.

Step 5

switch(config-if)# 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 an ingress policy on an Ethernet interface:

switch# configure terminal
switch(config-if)# interface port-channel 1
switch(config-if)# service-policy input policy1
switch(config-if)# show policy-map interface port-channel 1 input

Global statistics status :   enabled

port-channel1

Service-policy (qos) input:   policy1
policy statistics status:   enabled

Class-map (qos):   class1 (match-all)
283 packets
Match: access-group testacl1
Match: packet length 3-6000
set dscp af31

switch(config-if)# copy running-config startup-config

This example shows how to configure an egress policy on a port profile:

switch# configure terminal
switch(config)# port-profile 2225-ephe
switch(config-port-prof)# service-policy output policy1
switch(config)# show policy-map interface vethernet 1

Global statistics status :   enabled

Vethernet1

Service-policy (qos) output:   policy1
policy statistics status:   enabled

Class-map (qos):   class1 (match-all)
0 packets
Match: access-group testacl1
Match: packet length 3-6000
set dscp af31

switch(config-if)# copy running-config startup-config

Marking the Port DSCP

You can mark the DSCP port for each class of traffic that is defined in a specified ingress or egress policy map.

Before You Begin

- The default behavior is to preserve the DSCP value, or to trust DSCP. To make the port untrusted, change the DSCP value.

- Unless you configure a QoS policy and attach that policy to specified interfaces, the DSCP value is preserved.

- The class map that you want to use has been defined. For more information, see Configuring QoS Classification.

Note

You can attach only one input policy and one output policy to an interface or port profile.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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

The class_map_name argument is a unique alphabetic string that can be up to 40 case-insensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 4

switch (config-pmap-c-qos)# set dscp value

Sets a DSCP value. for the valid values for DSCP see Commonly Used DSCP Values, and IP Precedence Values

Step 5

Repeat step 3 and step 4 for each class map that you want to create.

Step 6

switch (config-pmap-c-qos)# exit

Returns you to the policy map configuration mode.

Step 7

switch (config-pmap)# exit

Returns you to global configuration mode.

Step 8

Enter one of the following commands:

- switch (config)# interface type number

- switch (config)# port-profile name

Places you into the configuration mode for the specified Ethernet or vEthernet interface or port profile.

Step 9

switch (config-if)# service-policy [type qos] {input | output} policy-map-name [no stats]

(Optional)
Attaches a policy map name that will be added to the input or output packets of the interface or port profile.
Note:
You can attach only one input policy and one output policy to an interface or port profile.

Step 10

switch(config-if)# show policy-map policy-map-name

Displays the policy map configuration for the specified map name.

Step 11

switch(config-if)# 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 mark the DSCP port for each class of traffic defined in an ingress policy map on an Ethernet interface:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class1
switch(config-pmap-c-qos)# set dscp af31
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# exit
switch(config)# interface ethernet 1/1
switch(config-if)#service-policy input policy1
switch(config-if)# show policy-map policy1
Type qos policy-maps
====================

policy-map type qos policy1
class  class1
set dscp af31
class  class2
set dscp af13
class  class-default
set dscp af22

switch(config-if)# copy running-config startup-config

This example shows how to mark the DSCP port for each class of traffic defined in an ingress policy map on an Ethernet interface:

switch# config terminal
switch(config)# policy-map policy1
switch(config-pmap)# class class1
switch(config-pmap-c-qos)# set dscp af31
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# class class2
switch(config-pmap-c-qos)# set dscp af13
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# class class-default
switch(config-pmap-c-qos)# set dscp af22
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# exit
switch(config)# interface ethernet 1/1
switch(config-if)# service-policy input policy1
switch(config-if)# show policy-map policy1
Type qos policy-maps
====================

policy-map type qos policy1
class  class1
set dscp af31
class  class2
set dscp af13
class  class-default
set dscp af22

switch(config-if)# copy running-config startup-config

This example shows how to mark the DSCP port for each class of traffic defined in an ingress policy map on a port profile:

switch(config)# config terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class1
switch(config-pmap-c-qos)# set dscp af31
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# class class2
switch(config-pmap-c-qos)# set dscp af13
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# class class-default
switch(config-pmap-c-qos)# set dscp af22
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# exit
switch(config)# port-profile accessprofile
switch(config-port-prof)# service-policy input policy1
switch(config-port-prof)# show policy-map policy1

Type qos policy-maps
====================

policy-map type qos policy1
class  class1
set dscp af31
class  class2
set dscp af13
class  class-default
set dscp af22

switch(config-if)# copy running-config startup-config

Verifying the QoS Policy Configuration

Use one of the following commands to verify the configuration:

Command

Description

show policy-map [type qos] [name policy_map_name]

Displays the policy map configuration.

show table-map name

Displays the table map configuration.

Configuration Example for QoS Marking Policies

This example shows how to display a specific policy-map policy:

switch(config)# show policy-map policy-ipacl

Type qos policy-maps
====================
policy-map type qos policy-ipacl
class  class-ipacl
set dscp 10

This example shows how to display policy maps for all interfaces:

switch# show policy-map interface brief

Interface/VLAN [Status]:INP QOS       OUT QOS       INP QUE       OUT QUE
================================================================================
Vethernet1      [Active]:              media
Vethernet10     [Active]:              media
Vethernet13     [Active]:web_policer
Vethernet15     [Active]:iperf
Vethernet16     [Active]:              iperf_policer
Vethernet17     [Active]:ixia_in       ixia_out
Vethernet18     [Active]:              media
Vethernet19     [Active]:iperf
Vethernet20     [Active]:              iperf_policer
Vethernet21     [Active]:netperf_polic
================================================================================

Feature History for QoS Marking Policies

Feature Name

Release

Feature Information

QoS Marking Policies

4.0

This feature was introduced.

QoS Marking Policies

4.0(4)SV1(2)

DSCP and Discard Class are no longer mutually exclusive. For a single class, you can set operations on any two out of the following five fields: CoS, IP Precedence, DSCP, QoS Group, and Discard Class.

Chapter 4. Configuring QoS Policing

This chapter contains the following sections:

- Information About Policing

- Prerequisites for Policing

- Guidelines and Limitations

- Verifying the Policing Configuration

- Configuration Example for QoS Policing

- Feature History for QoS Policing

Information About Policing

Policing is the monitoring of data rates for a particular class of traffic. Cisco Nexus 1000V can also monitor associated burst sizes.

Three conditions, are determined by the policer depending on the data rate parameters supplied: conform (green), exceed (yellow), or violate (red). You can configure only one action for each condition. When the data rate exceeds the user-supplied values, packets are either marked down or dropped.

You can define single-rate or dual-rate policers. Single-rate policers monitor the specified committed information rate (CIR) of traffic. Dual-rate policers monitor both CIR and peak information rate (PIR) of traffic. For more information about policies, see RFC 2697, RFC 2698, and RFC4115.

Policing Condition and Types

The following conditions trigger actions by the policer depending on the defined data rate:

Policer Actions for Exceed or Violate

Condition

Color

Description

Policer Action(only one allowed per condition)

Conform

Green

The packet traffic data rate is within the defined boundaries.

The policer either transmits these packets as is, or changes the value in the header (DSCP, precedence, or CoS), and then transmits these packets.

Exceed

Yellow

The packet traffic data rate exceeds the defined boundary.

The policer can drop or mark down these packets.

Violate

Red

The packet traffic data rate violates the defined boundaries.

The policer can drop or mark down these packets.

Prerequisites for Policing

- You are logged on to the CLI in EXEC mode.

- You must be familiar with RFC 2698.

Guidelines and Limitations

Each module polices independently, which might affect a policer that is applied to traffic distributed across more than one module, such as in the case of a port channel interface.

Police Command and Policer Types

Police Command Arguments

The type of policer that is created by the Cisco Nexus 1000V is based on a combination of the police command arguments.

Note

Specify the identical value for pir and cir to configure 1-rate 3-color policing.

Argument

Description

cir

Committed information rate (cir), or desired bandwidth, specified as a bit rate or a percentage of the link rate. Although a value for cir is required, the argument itself is optional. The range of values is from 1 to 80000000000; the range of policing values that are mathematically significant is 8000 to 80 Gbps.

percent

Specifies the rate as a percentage of the interface rate. The range of values is from 1 to 100%.

bc

Indication of how much the cir can be exceeded, either as a bit rate or an amount of time at cir. The default is 200 milliseconds of traffic at the configured rate. The default data rate units are bytes, and the Gigabit per second (gbps) rate is not supported for this parameter.

pir

Peak information rate (pir), which is specified as a PIR bit rate or a percentage of the link rate. There is no default. The range of values is from 1 to 80000000000; the range of policing values that are mathematically significant is from 8000 to 80 Gbps. The range of percentage values is from 1 to 100%.

be

Indication of how much the pir can be exceeded, either as a bit rate or an amount of time at pir. When the bc value is not specified, the default is 200 milliseconds of traffic at the configured rate. The default data rate units are bytes, and the Gigabit per second (gbps) rate is not supported for this parameter.
Note:
You must specify a value for pir before the device displays this argument.

conform

Single action to take if the traffic data rate is within bounds. The basic actions are transmit or one of the set commands listed in th table. The default is transmit.

exceed

Single action to take if the traffic data rate exceeds the specified boundaries. The basic actions are drop or markdown. The default is drop.

violate

Single action to take if the traffic data rate violates the configured rate values. The basic actions are drop or markdown. The default is drop.

Although all the arguments in the above table are optional, you must specify a value for cir. In this section, cir indicates what is its value but not necessarily the keyword itself. The combination of these arguments and the resulting policer types and actions are described in the following table.

Police Arguments Present

Policer Type

Policer Action

cir, but not pir, be, or violate

1-rate, 2-color

≤ cir, then conform; otherwise violate

cir and pir

1-rate, 3-color

You must specify identical values for cir and pir.

cir and pir

2-rate, 3-color

≤ cir, then conform; ≤ pir, then exceed; otherwise violate

Policer Action

You can take the following actions when the packet exceeds the parameters or violates the parameters:

Action

Description

drop

Drops the packet. This action is available only when the packet exceeds or violates the parameters.

set dscp dscp table {cir-markdown-map | pir-markdown-map}

Sets the specified fields from a table map and transmits the packet. For more information on the system-defined, or default table maps, see Configuring QoS Marking Policies. This is available only when the packet exceeds the parameters (use the cir-markdown-map) or violates the parameters (use the pir-markdown-map).

Action

Description

transmit

Transmits the packet. This action is available only when the packet conforms to the parameters.

set-prec-transmit

Sets the IP precedence field to a specified value and transmits the packet. This action is available only when the packet conforms to the parameters.

set-dscp-transmit

Sets the DSCP field to a specified value and transmits the packet. This action is available only when the packet conforms to the parameters.

set-cos-transmit

Sets the CoS field to a specified value and transmits the packet. This action is available only when the packet conforms to the parameters.

set-qos-transmit

Sets the QoS group internal label to specified value and transmits the packet. This action can be used only in input policies and is available only when the packet conforms to the parameters.

set-discard-class-transmit

Sets the discard-class internal label to a specified value and transmits the packet. This action can be used only in ingress policies and is available only when the packet conforms to the parameters.

Police Command Data Rates

The policer can only drop or mark down packets that exceed or violate the specified parameters. For information see, Configuring QoS Marking Policies on marking down packets.

The police command uses the following data rates:

Data Rates for the police Command

Rate

Description

bps

Bits per second (default)

kbps

1,000 bits per seconds

mbps

1,000,000 bits per second

gbps

1,000,000,000 bits per second

Police Command Burst Sizes

The police command uses the following Burst sizes:

Speed

Description

bytes

bytes

kbytes

1,000 bytes

mbytes

1,000,000 bytes

ms

milliseconds

us

microseconds

Configuring 1-Rate and 2-Rate, 2-Color and 3-Color Policing

Note

You must specify the identical value for pir and cir to configure 1-rate, 3-color policing.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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

Step 4

switch(config-pamp-c-qos)# police[cir] {committed-rate [data-rate] | percent cir-link-percent} [bc committed-burst-rate [link-speed]][pir] {peak-rate [data-rate] | percent cir-link-percent} [be peak-burst-rate [link-speed]] [conform {transmit | set-prec-transmit | set-dscp-transmit | set-cos-transmit | set-qos-transmit | set-discard-class-transmit} [exceed {drop | set dscp dscp table {cir-markdown-map}} [violate {drop | set dscp dscp table {pir-markdown-map}}]}

Polices cir in bits or as a percentage of the link rate. The conform action is taken if the data rate is ≤cir. If be and pir are not specified, all other traffic takes the violate action. If be or violate are specified, the exceed action is taken if the data rate ≤ pir; otherwise. The actions are described in Information About Policing. The data rates and link speeds are described in Police Command Data Rates and Police Command Burst Sizes.

Step 5

switch(config-pamp-c-qos)# show policy-map [type qos] [policy-map-name]

(Optional)
Displays information about all configured policy maps or a selected policy map of type QoS.

Step 6

switch(config-pmap-c-qos)# 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 a 1-rate, 2-color policer that transmits if the data rate is within 200 milliseconds of traffic at 256000 bps and marks IP precedence to 6 if the data rate is exceeded.

switch# configure terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class-default
switch(config-pmap-c-qos)# police cir 256000 conform transmit violate set dscp dscp table pir-markdown-map
switch(config-pmap-c-qos)#

This example shows how to configure a 1-rate, 3-color policer that transmits if the data rate is within 200 milliseconds of traffic at 256000 bps, and marks DSCP to 6 if the data rate is within 300 milliseconds of traffic at 256000bps, and drops packets otherwise.

Note

You must specify identical values for cir and pir for a 1R3C policer.

switch# configure terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class-default
switch(config-pmap-c-qos)# police cir 256000 pir 256000 conform transmit exceed set dscp dscp table cir-markdown-map violate drop
switch(config-pmap-c-qos)#

Configuring Ingress and Egress Policing

You can apply the policing instructions in a QoS policy map to ingress or egress packets by attaching that QoS policy map to an interface or port profile. To select ingress or egress, you specify either the input or output keyword in the service-policy command. For an example of how to use the service-policy command, see Creating Ingress and Egress Policies.

Configuring Markdown Policing

Markdown policing is the setting of a QoS field in a packet when traffic exceeds or violates the policed data rates. You can configure markdown policing by using the set commands for conform described in Configuring 1-Rate and 2-Rate, 2-Color and 3-Color Policing.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type qos] [match-first] policy-map-name

Places you into policy map QoS configuration mode for the specified policy map and configures the map name in the running configuration.

The policy-map-name argument is a unique alphabetic string that can be up to 40 case-sensitive characters long, including hyphen (-) and underscore (_) characters. The map name must be unique across class-maps and policy-maps. For example, you cannot have a class-map and a policy-map with the same name of HR_Map.

Step 3

switch(config-pmap-qos)# class [type qos] {class_map_name |class-default}

Creates a reference to class-map-name and enters policy-map class QoS configuration mode for the specified class map. By default, the class is added to the end of the policy map. Changes are saved in the running configuration.

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

Step 4

switch(config-pamp-c-qos)# police[cir] {committed-rate [data-rate] | percent cir-link-percent} [bc committed-burst-rate [link-speed]][pir] {peak-rate [data-rate] | percent cir-link-percent} [be peak-burst-rate [link-speed]] [conform action [exceed {drop | set dscp dscp table cir-markdown-map} [violate {drop | set dscp dscp table pir-markdown-map}]]}}

Polices cir in bits or as a percentage of the link rate. The conform action is taken if the data rate is ≤ cir. If be and pir are not specified, all other traffic takes the violate action. If be or violate are specified, then the exceed action is taken if the data rate ≤ pir, and the violate action is taken otherwise.

Step 5

switch(config-pamp-c-qos)# show policy-map [type qos] [policy-map-name]

(Optional)
Displays information about all configured policy maps or a selected policy map of type QoS.

Step 6

switch(config-pmap-c-qos)# 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 a 1-rate, 3-color policer that transmits if the data rate is within 300 milliseconds of traffic at 256000 bps; marks down DSCP using the system-defined table map if the data rate is within 300 milliseconds of traffic at 256000 bps; and drops packets otherwise:

switch# config termnal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class class-default
switch(config-pmap-c-qos)# police cir 256000 bps bc 300 ms pir 256000 conform transmit exceed set dscp dscp table cir-markdown-map violate drop
switch(config-pmap-c-qos)# show policy-map policy1

Type qos policy-maps
====================

policy-map type qos policy1
class  class-default
police cir 256000 bps bc 300 ms pir 256000 bps be 300 ms conform transmit
exceed set dscp dscp table cir-markdown-map violate drop

switch(config-pmap-c-qos)# copy running-config startup-config

Verifying the Policing Configuration

Use the following command to verify the configuration:

Command

Description

show policy-map

Displays information about policy maps and policing.

Configuration Example for QoS Policing

The following example shows how to configure a 1-rate, 2-color policer:

switch# configure terminal
switch(config)# policy-map policy1
switch(config-pmap-qos)# class one_rate_2_color_policer
switch(config-pmap-c-qos)# police cir 256000 conform transmit violate drop

The following example shows how to configure a 1-rate, 2-color policer with DSCP mark down:

switch# configure terminal
switch(config)# policy-map policy2
switch(config-pmap-qos)# class one_rate_2_color_policer_with_dscp_markdown
switch(config-pmap-c-qos)# police cir 256000 conform set-dscp-transmit af11 violate set dscp dscp table pir-markdown-map

The following example shows how to configure a 1-rate, 3-color policer:

switch# configure terminal
switch(config)# policy-map policy3
switch(config-pmap-qos)# class one_rate_3_color_policer
switch(config-pmap-c-qos)# police cir 256000 pir 256000 conform transmit exceed set dscp dscp table cir-markdown-map violate drop

Feature History for QoS Policing

This section provides the QoS policing release history.

Feature Name

Release

Feature Information

QoS Policing

4.0

This feature was introduced

Chapter 5. Monitoring QoS Statistics

This chapter contains the following sections:

- Information About QoS Statistics

- Prerequisites for Monitoring QoS Statistics

- Enabling QoS Statistics

- Displaying QoS Statistics

- Clearing QoS Statistics

- Configuration Example for QoS Statistics

- Standards

- MIBs

- RFCs

- Technical Assistance

- Feature History for QoS Statistics

Information About QoS Statistics

Statistics are maintained for each policy, class action, and match criteria per interface. You can enable or disable the collection of statistics globally using the [no] qos statistics command. You can display statistics using the show policy-map interface command, and you can clear statistics based on an interface or policy map with the clear qos statistics command. Statistics are enabled by default and can be disabled globally.

Prerequisites for Monitoring QoS Statistics

You are logged in to the CLI in EXEC mode.

Enabling QoS Statistics

You can enable or disable QoS statistics for all interfaces on the device.

Note

By default, QoS statistics are enabled.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# qos statistics

Enables QoS statistics on all interfaces.

Step 3

switch(config)# show policy-map interface

(Optional)
Displays the status of the global statistics and the configured policy maps on all interfaces.

Step 4

switch(config)# 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)# qos statistics
switch(config)# show policy-map interface
switch(config)# copy running-config startup-config

Displaying QoS Statistics

Before You Begin

You know the interface for which statistics are needed.

Note

Statistics for individual interfaces are often the most useful.

Procedure

Command or Action

Purpose

Step 1

switch# show policy-map [policy-map-name | interface [brief | ethernet interface_number | output type qos | port-channel number | vethernet interface_number | input type qos] | type qos]

Displays the specified statistics.

To achieve the best result when your system has a large number of policies, use this command with specific arguments, such as specifying a particular interface or port channel.

- Use the interface keyword with the following keywords to display the service policy on an interface:

- brief—displays a brief report of all policies attached to interfaces

- ethernet—displays statistics for an Ethernet interface.

- input type qos—displays statistics for QoS input policies.

- output type qos—displays statistics for QoS output policies.

- port-channel—displays statistics for a port channel interface.

- vethernet—displays the statistics for a vEthernet interface.

- Use the type qos keyword to display the type of policy map.

switch# show policy-map interface ethernet 2/1

Clearing QoS Statistics

Procedure

Command or Action

Purpose

Step 1

switch # clear qos statistics [interface {ethernet interface_number | port-channel number | vethernet interface_number | output type qos | input type qos}]

Clears the specified QoS statistics.

switch# clear qos statistics type qos

Configuration Example for QoS Statistics

This example shows how to display statistics for policy maps that are configured on interfaces:

switch(config)# show policy-map interface

Global statistics status :   enabled

Vethernet3

Service-policy (qos) input:   new-policy
policy statistics status:   enabled

Class-map (qos):   class-default (match-any)
59610700 packets
set prec 5

Vethernet5

Service-policy (qos) output:   new-policer
policy statistics status:   enabled

Class-map (qos):   new-class (match-all)
344661013 packets
Match: precedence 5
police cir 900 mbps bc 200 ms
conformed 505953339796 bytes, 899924196 bps action: transmit
violated 12285218014 bytes, 22283000 bps action: drop

This example shows how to display statistics for a specific IPv4 access control list (ACL):

switch(config)# show ip access-lists protoacl

IP access list protoacl
statistics per-entry
10 permit icmp 7.120.1.10/32 7.120.1.20/32
20 permit tcp 7.120.1.10/32 7.120.1.20/32 dscp af11
30 permit udp 7.120.1.10/32 7.120.1.20/32 precedence critical
50 permit ip 7.120.1.20/32 7.120.1.10/32
60 permit ip 7.120.1.20/32 7.120.1.10/32 dscp af11
70 permit ip 7.120.1.20/32 7.120.1.10/32 precedence critical

This example shows how to display the status of the global statistics and the configured policy maps on a specific interface:

switch(config)# show policy-map interface vethernet 3

Global statistics status :   enabled

Vethernet3

Service-policy (qos) input:   policy-protoacl
policy statistics status:   enabled

Class-map (qos):   class-protoacl (match-any)
132 packets
Match: access-group protoacl
132 packets
set qos-group 100

Standards

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

MIBs

MIBS

MIBs Link

CISCO-PROCESS-MIB

To locate and download MIBs, go to the following URL: Click Here

RFCs

No RFCs are supported by this feature.

Technical Assistance

Description

Link

Technical Assistance Center (TAC) home page, contains 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

Click Here

Feature History for QoS Statistics

This section provides the QoS statistics release history.

Feature Name

Release

Feature Information

QoS Statistics

4.0

This feature was introduced

Chapter 6. Configuring Class Based Weighted Fair Queueing

This chapter contains the following sections:

- Information About Class-Based Weighted Fair Queuing

- Licensing Requirement for Class-based Weighted Fair Queuing

- Prerequisites for Class-based Weight Fair Queuing

- Guidelines and Limitations

- Default Settings

- Configuring Class-based Weighted Fair Queuing

- Verifying the Class-based Weighted Fair Queuing Configuration

- Configuration Examples for Class-based Weighted Fair Queuing

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 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 the protocol or CoS.

- You know the bandwidth that you want to assign to each class of traffic.

Procedure

Command or Action

Purpose

Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(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 3

switch(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 4

switch(config-cmap-que)# exit

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

Step 5

switch(config)# policy-map type queuing name

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

Step 6

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

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

Step 7

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

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

Step 8

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

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

Step 9

switch(config-pmap-que)# exit

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

Step 10

switch(config)# port-profile type ethernet name

Creates a port profile and enters port profile configuration mode.

Step 11

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

Creates a service policy of type queuing.

Step 12

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

Displays the status of the global statistics and the configured policy maps on all interfaces.

Step 13

switch(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

Preface

This preface contains the following sections:

- Audience

- Document Conventions

- Related Documentation for Nexus 1000V Series NX-OS Software

- Documentation Feedback

- Obtaining Documentation and Submitting a Service Request

Audience

This publication is for experienced network administrators who configure and maintain Cisco Nexus devices .

This guide is for network administrators and server administrators with the following experience and knowledge:

- An understanding of virtualization

- Using VMware software to create a virtual machine and configure a VMware vSwitch

Note

Knowledge of VMware vNetwork Distributed Switch is not required.

Document Conventions

Command descriptions use the following conventions:

Convention

Description

bold

Bold text indicates the commands and keywords that you enter literally as shown.

Italic

Italic text indicates arguments for which the user supplies the values.

[x]

Square brackets enclose an optional element(keyword or argument).

[x | y]

Square brackets enclosing keywords or arguments separated by a vertical bar indicate an optional choice.

{x | y}

Braces enclosing keywords or arguments separated by a vertical bar indicate a required choice.

[x {y | z}]

Nested set of square brackets or braces indicate optional or required choices within optional or required elements. Braces and a vertical bar within square brackets indicate a required choice within an optional element.

variable

Indicates a variable for which you supply values, in context where italics cannot be used.

string

A nonquoted set of characters. Do not use quotation marks around the string or the string will include the quotation marks.

Examples use the following conventions:

Convention

Description

screen font

Terminal sessions and information the switch displays are in screen font.

boldface screen font

Information you must enter is in boldface screen font.

italic screen font

Arguments for which you supply values are in italic screen font.

< >

Nonprinting characters, such as passwords, are in angle brackets.

[ ]

Default responses to system prompts are in square brackets.

!, #

An exclamation point (!) or a pound sign (#) at the beginning of a line of code indicates a comment line.

This document uses the following conventions:

Note

Means reader take note. Notes contain helpful suggestions or references to material not covered in the manual.

Caution

Means reader be careful. In this situation, you might do something that could result in equipment damage or loss of data.

Related Documentation for Nexus 1000V Series NX-OS Software

This section lists the documents used with the Cisco Nexus 1000V and available on Cisco.com at the following URL:

Click Here

General Information

Cisco Nexus 1000V Documentation Roadmap

Cisco Nexus 1000V Release Notes

Cisco Nexus 1000V and VMware Compatibility Information

Install and Upgrade

Cisco Nexus 1000V Installation and Upgrade Guide

Configuration Guides

Cisco Nexus 1000V High Availability and Redundancy Configuration Guide

Cisco Nexus 1000V Interface Configuration Guide

Cisco Nexus 1000V Layer 2 Switching Configuration Guide

Cisco Nexus 1000V License Configuration Guide

Cisco Nexus 1000V Network Segmentation Manager Configuration Guide

Cisco Nexus 1000V Port Profile Configuration Guide

Cisco Nexus 1000V Quality of Service Configuration Guide

Cisco Nexus 1000V Security Configuration Guide

Cisco Nexus 1000V System Management Configuration Guide

Cisco Nexus 1000V VXLAN Configuration Guide

Programming Guide

Cisco Nexus 1000V XML API Configuration Guide

Reference Guides

Cisco Nexus 1000V Command Reference

Cisco Nexus 1000V MIB Quick Reference

Troubleshooting and Alerts

Cisco Nexus 1000V Troubleshooting Guide

Cisco Nexus 1000V Password Recovery Procedure

Cisco NX-OS System Messages Reference

Virtual Services Appliance Documentation

The Cisco Nexus Virtual Services Appliance documentation is available at Click Here .

Virtual Security Gateway Documentation

The Cisco Virtual Security Gateway for Nexus 1000V Series Switch documentation is available at Click Here .

Virtual Wide Area Application Services (vWAAS) Documentation

The Virtual Wide Area Application Services documentation is available at Click Here .

ASA 1000V Cloud Firewall Documentation

The ASA 1000V Cloud Firewall documentation is available at Click Here .

Documentation Feedback

To provide technical feedback on this document, or to report an error or omission, please send your comments to . We appreciate your feedback.

Obtaining Documentation and Submitting a Service Request

For information on obtaining documentation, submitting a service request, and gathering additional information, see the monthly What's New in Cisco Product Documentation, which also lists all new and revised Cisco technical documentation, at:

Click Here

Subscribe to the What's New in Cisco Product Documentation as a Really Simple Syndication (RSS) feed and set content to be delivered directly to your desktop using a reader application. The RSS feeds are a free service and Cisco currently supports RSS version 2.0.

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.

THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.

The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.

NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.

IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: Click Here . Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)