QoS Commands

This chapter contains the following sections:

class

To attach an access control list (ACL) to a policy map, use the class Policy-map Configuration mode command.

To detach a class map from a policy map, use the no form of this command.


Note

This command is available only when the switch is in quality of service (QoS) advanced mode.


Syntax

class class-map-name

no class class-map-name

Parameters

class-map-name—Enter the name for an existing class map. If the class map does not exist, a new class map is created under the specified name.

Default Configuration

No class map is defined for the policy map.

Command Mode

Policy-map Configuration mode

User Guidelines

This command is the same as creating a class map and then binding it to the policy map. After the policy map is defined, use the service-policy command to attach it to a port or port channel.

Example

The following example defines a traffic classification (class map) called class1 containing an ACL called enterprise. The class is in a policy map called policy1. The policy-map policy1 now contains the ACL enterprise.

switchxxxxxx(config)# policy-map policy1
switchxxxxxx(config-pmap)# class class1

class-map

To create or modify a class map and enter the Class-Map Configuration mode, use the class-map Global Configuration mode command and its subcommands.

To delete a class map, use the no form of this command.


Note

All class map commands are available only when the switch is in QoS advanced mode.


Syntax

class-map class-map-name [match-any]

no class-map class-map-name

Parameters

class-map-name—The class map name.

match-any—(Optional) Performs a logical OR of the criteria of ACLs belonging to this class map. Only a single match criteria in this class map must be matched.

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

A class map consists of one or more ACLs. It defines a traffic flow by determining which packets match some or all of the criteria specified in the ACLs.

The class-map command enters the Class-map Configuration mode. In this mode, up to two match commands can be entered to configure the criteria for this class. Each match specifies an ACL.

When using two match commands, each must point to a different type of ACL, such as one IP-based ACL and one MAC-based ACL. The classification is by first matching, therefore, the order of the ACLs is important.

Error messages are generated in the following cases:

  • There is more than one match command in a match-all class map.

  • There is a repetitive classification field in the participating ACLs.

After entering the Class-map Configuration mode, the following configuration commands are available:

  • do—Run the EXEC commands in the Class-map Configuration mode.

  • end—End the current mode and return to the Privileged EXEC mode.

  • exit—Exit the Class-map Configuration mode and return to the Global Configuration mode.

  • match—Configure the match criteria to classify traffic.

  • no—Remove a match statement from a class map.

Example

The following example creates a class map called Class1 and configures it to check that packets match all classification criteria in the ACL specified:

switchxxxxxx(config)# class-map class1 match-any
switchxxxxxx(config-cmap)# match access-group acl-name

match

To bind an ACL to the class map being configured, use the match Class-map Configuration mode command.

To delete the match criteria, use the no form of this command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

match access-group acl-name

no match access-group acl-name

Parameters

access-group acl-name—Specifies the name of a MAC-based ACL, IPv4-based ACL, or IPv6-based ACL.

Default Configuration

No match criterion is supported.

Command Mode

Class-Map Configuration mode

Example

The following example defines a class map called Class1. Class1 contains an ACL called enterprise. Only traffic matching all criteria in enterprise belongs to the class map.

switchxxxxxx(config)# class-map class1
switchxxxxxx(config-cmap)# match access-group enterprise

police

To define a policer for classified traffic, use the police Policy-map Class Configuration mode command. This command defines another group of actions for the policy map (per class map).

To remove a policer, use the no form of this command.

This command is used after the policy-map and class commands.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

police committed-rate-kbps [exceed-action {drop | forward}]

no police

Parameters

committed-rate-kbps—The average traffic rate (CIR) in kbits per second (kbps). (Range: 16 to 10000000)

exceed-action {drop | forward}—(Optional) Specifies the action to be taken when the rate is exceeded. The possible values are:

  • drop—Drops the packet.

  • forward—Forwards the packet.

Default Usage

N/A

Command Mode

Policy-map Class Configuration mode

User Guidelines

Policing uses a token bucket algorithm. CIR represents the speed with which the token is added to the bucket.

Example

The following example defines a policer for classified traffic. When the traffic rate exceeds 124,000 kbps, the packet is dropped. The class is called class1 and is in a policy map called policy1.

switchxxxxxx(config)# policy-map policy1
switchxxxxxx(config-pmap)# class class1
switchxxxxxx(config-pmap-c)# police 124000 exceed-action drop

police aggregate

To apply an aggregate policer to multiple class maps within the same policy map, use the police aggregate Policy-map Class Configuration mode command.

To remove an existing aggregate policer from a policy map, use the no form of this command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

police aggregate aggregate-policer-name

no police aggregate

Parameters

aggregate-policer-name—The aggregate policer name.

Command Mode

Policy-map Class Configuration mode

User Guidelines

An aggregate policer can be applied to multiple classes in the same policy map. An aggregate policer cannot be applied across multiple policy maps or interfaces.

Use the exit command to return to the Global Configuration mode. Use the end command to return to the Privileged EXEC mode.

Example

The following example applies the aggregate policer called Policer1 to a class called class1 in a policy map called policy1 and class2 in policy map policy2:

switchxxxxxx(config)# qos aggregate-policer policer1 124000 exceed-action drop
switchxxxxxx(config)# policy-map policy1
switchxxxxxx(config-pmap)# class class1
switchxxxxxx(config-pmap-c)# police aggregate policer1
switchxxxxxx(config-pmap-c)# exit
switchxxxxxx(config-pmap)# exit
switchxxxxxx(config)# policy-map policy2
switchxxxxxx(config-pmap)# class class2
switchxxxxxx(config-pmap-c)# police aggregate policer1

policy-map

To create a policy map and enter the Policy-map Configuration mode, use the policy-map Global Configuration mode command.

To delete a policy map, use the no form of this command.


Note

This command is only available when the switch is in QoS advanced mode.


Syntax

policy-map policy-map-name

no policy-map policy-map-name

Parameters

policy-map-name—The policy map name. (Range: 0 to 32 characters)

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

A policy map contains one or more class maps and an action that is taken if the packet matches the class map. Policy maps may be bound to ports or port channels.

Use the policy-map Global Configuration mode command to specify the name of the policy map to be created, added to, or modified before configuring policies for classes whose match criteria are defined in a class map.

Entering the Policy-map Global Configuration mode also enables configuring or modifying the class policies for that policy map. Class policies in a policy map can be configured only if the classes have match criteria defined for them.

Policy map is applied on the ingress path.

The match criteria is for a class map. Only one policy map per interface is supported. The same policy map can be applied to multiple interfaces and directions.

The service-policy command binds a policy map to a port or a port channel.

Example

The following example creates a policy map called Policy1 and enters the Policy-map Configuration mode:

switchxxxxxx(config)# policy-map policy1
switchxxxxxx(config-pmap)#

priority-queue out num-of-queues

To set the number of expedite queues, use the priority-queue out num-of-queues Global Configuration mode command.

Syntax

priority-queue out num-of-queues number-of-queues

Parameters

number-of-queues—The number of queues to be expedite (SP) queues. The expedite queues would be the queues with the higher indexes. (Range: 0 to 8)

There must be either 0 WRR queues or more than one. If the number-of-queues is set to 0, all queues are assured forwarding (according to the WRR weights). If the number-of-queues is set to 8, all queues are expedited (SP queues).

Default Configuration

All queues are expedite queues.

Command Mode

Global Configuration mode

User Guidelines

An expedite queue is a Strict Priority (SP) queue, which is serviced until empty before the other lower priority queues are serviced.

The weighted round robin (WRR) weight ratios are affected by the number of expedited queues, because there are fewer queues participating in WRR. This indicates that the corresponding weight in the wrr-queue bandwidth Interface Configuration mode command is ignored (not used in the ratio calculation).

Example

The following example configures the number of expedite queues as 2:

switchxxxxxx(config)# priority-queue out num-of-queues 2

qos

To enable QoS on the switch and set its operation mode, use the qos Global Configuration mode command.

To disable QoS on the switch, use the no form of this command.

Syntax

qos [basic | advanced [ports-not-trusted | ports-trusted]]

no qos

Parameters

basic—(Optional) Enables QoS basic mode. If no option is specified, the QoS mode is set to the basic mode by default.

advanced—(Optional) Enables QoS advanced mode, which enables the full range of QoS configuration.

ports-not-trusted—(Optional and relevant for advanced mode only) Indicates that the packets, which are not classified by policy map rules to a QoS action, are mapped to egress queue 0. This is the default setting in advanced mode.

ports-trusted—(Optional and relevant for advanced mode only) Indicates that the packets, which are not classified by policy map rules to a QoS action, are mapped to an egress queue based on the packet's fields. Use the qos advanced-mode trust command to specify the trust mode.

Default Configuration

If qos is entered without any keywords, the QoS basic mode is enabled.

If qos advanced is entered without a keyword, the default is ports-not-trusted.

Command Mode

Global Configuration mode

Examples

Example 1—The following example enables QoS basic mode on the switch:

switchxxxxxx(config)# qos basic

Example 2—The following example enables QoS advanced mode on the switch with the ports-not-trusted option:

switchxxxxxx(config)# qos advanced
This action will cause loss of configuration.Proceed?(y)  (Y/N)[Y]

qos advanced-mode trust

To configure the trust mode in QoS advanced mode, use the qos advanced-mode trust Global Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

qos advanced-mode trust {cos | cos-dscp | dscp | ip-precedence}

no qos advanced-mode trust

Parameters

cos—Classifies ingress packets with the packet CoS values. For untagged packets, the port default CoS is used.

cos-dscp—Classifies ingress packets with the packet DSCP values for IP packets. For other packet types, use the packet CoS values.

dscp—Classifies ingress packets with the packet DSCP values.

ip-precedence—Classifies ingress packets with the packet precedence values.

Default Configuration

The default trust mode is cos.

Command Mode

Global Configuration mode

User Guidelines

The configuration is relevant for QoS advanced mode in the following cases:

  • ports-not-trusted mode—For packets that are classified to the QoS action trust.

  • ports-trusted mode—For packets that are not classified to any QoS action or classified to the QoS action trust.

Example

The following example sets CoS as the trust mode in QoS advanced mode:

switchxxxxxx(config)# qos advanced-mode trust cos

qos aggregate-policer

To define the policer parameters that can be applied to multiple traffic classes within the same policy map, use the qos aggregate-policer Global Configuration mode command.

To remove an existing aggregate policer, use the no form of this command.


Note

This command is only available when the switch is in QoS advanced mode.


Syntax

qos aggregate-policer name committed-rate-kbps [exceed-action {drop | forward}]

no qos aggregate-policer name

Parameters

name—The aggregate policer name.

committed-rate-kbps—The average traffic rate (CIR) in kbits per second (kbps). (Range: 16 to 1000000)

exceed-action {drop | forward}—(Optional) Specifies the action to be taken when the rate is exceeded. The possible values are:

  • drop—Drops the packet.

  • forward—Forwards the packet.

Default Configuration

No aggregate policer is defined.

Command Mode

Global Configuration mode

User Guidelines

Define an aggregate policer if the policer aggregates traffic from multiple class maps.

Aggregate policers cannot aggregate traffic from multiple devices. If the aggregate policer is applied to more than one device, traffic on each device is counted separately and is limited per device.

Traffic from two different ports on the same device can be aggregated for policing purposes.

An aggregate policer can be applied to multiple classes in the same policy map.

An aggregate policer cannot be deleted if it is being used in a policy map. The no police aggregate Policy-map Class Configuration mode command must first be used to delete the aggregate policer from all policy maps before using the no mls qos aggregate-policer command.

Policing uses a token bucket algorithm. CIR represents the speed with which the token is added to the bucket. CBS represents the depth of the bucket.

Example

The following example defines the parameters of a policer called Policer1 that can be applied to multiple classes in the same policy map. When the average traffic rate exceeds 124,000 kbps, the packet is dropped.

switchxxxxxx(config)# qos aggregate-policer test1 124000 exceed-action drop

qos cos

To define the default CoS value for an interface, use the qos cos Interface Configuration mode command.

Syntax

qos cos default-cos

Parameters

default-cos—The default CoS value (VPT value) of the interface. If the interface is trusted and the packet is untagged, then the default CoS value becomes the CoS value. (Range: 0 to 7)

Default Configuration

The default CoS value of an interface is 0.

Command Mode

Interface Configuration mode

User Guidelines

Use the default CoS value to assign a CoS value to all untagged packets entering the interface.

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# qos cos 5

qos map cos-queue

To map assigned CoS values to an egress queue, use the qos map cos-queue Global Configuration mode command.

Syntax

qos map cos-queue cos0...cos7 to queue-id

Parameters

cos0... cos7—Up to eight CoS values to map to the specified queue number. (Range: 0 to 7)

to queue-id—Specifies the queue number to which the CoS values are mapped.

Default Configuration

CoS-to-Queue mapping matrix

COS

0

1

2

3

4

5

6

7

Queue

2

1

3

4

5

6

7

8

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map cos-queue 2 to 7

qos map dscp-queue

To configure the DSCP-to-CoS map, use the qos map dscp-queue Global Configuration mode command.

Syntax

qos map dscp-queue dscp-list to queue-id

Parameters

dscp-list—Up to eight DSCP values, separated by spaces to map to the specified queue number. (Range: 0 to 63)

to queue-id—Specifies the queue number to which the DSCP values are mapped.

Default Configuration

DSCP-to-Queue mapping matrix

DSCP value

0-7

8-15

16-23

24-31

32-39

40-47

48-55

56-63

Queue

1

2

3

4

5

6

7

8

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map dscp-queue 3 to 6

qos map precedence-queue

To configure the IP precedence-to-queue map, use the qos map precedence-queue Global Configuration mode command.

Syntax

qos map precedence-queue ip-precedence-list to queue-id

Parameters

ip-precedence-list—Up to eight IP precedence values, separated by spaces, to map to the specified queue number. (Range: 0 to 7)

to queue-id—Specifies the queue number to which the IP precedence values are mapped.

Default Configuration

IP precedence-to-queue mapping matrix

IP Precedence

0

1

2

3

4

5

6

7

Queue

1

2

3

4

5

6

7

8

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map precedence-queue 2 to 7

qos map queue-cos

To configure the queue-to-CoS map, use the qos map queue-cos Global Configuration mode command.

Syntax

qos map queue-cos queue-list to cos-id

Parameters

queue-list—Up to eight queue numbers to map to the specified CoS value. (Range:1 to 8)

to cos-id —Specifies the CoS value to which the queue values are mapped.

Default Configuration

Queue-to-CoS mapping matrix

Queue

1

2

3

4

5

6

7

8

COS

1

0

2

3

4

5

6

7

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map queue-cos 7 to 2

qos map queue-dscp

To configure the queue-to-DSCP map, use the qos map queue-dscp Global Configuration mode command.

Syntax

qos map queue-dscp queue-list to dscp-id

Parameters

queue-list—Up to eight queue numbers to map to the specified DSCP values. (Range:1 to 8)

to dscp-id —Specifies the DSCP values to which the queue values are mapped.

Default Configuration

Queue-to-DSCP mapping matrix

Queue

1

2

3

4

5

6

7

8

DSCP

0-7

8-16

16-23

24-31

32-39

40-47

48-55

56-63

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map queue-dscp 7 to 50

qos map queue-precedence

To configure the queue-to-precedence map, use the qos map queue-precedence Global Configuration mode command.

Syntax

qos map queue-precedence queue-list to ip-precedence-id

Parameters

queue-list—Up to eight queue numbers to map to the specified IP precedence value. (Range:1 to 8)

to ip-precedence-id —Specifies the precedence value to which the queue values are mapped.

Default Configuration

Queue-to-precedence mapping matrix

Queue

1

2

3

4

5

6

7

8

IP Precedence

0

1

2

3

4

5

6

7

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# qos map queue-precedence 8 to 7

qos remark

To configure the remarking state of each interface, use the qos remark Interface Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

qos remark {cos | dscp | ip-precedence}

no qos remark {cos | dscp | ip-precedence}

Parameters

cos—Remarks the ingress packets with the CoS value.

dscp—Remarks the ingress packets with the DSCP value.

ip-precedence—Remarks the ingress packets with the IP precedence value.

Default Configuration

No any remarking is defined.

Command Mode

Interface Configuration mode

Example

switchxxxxxx(config)# interface gi10
switchxxxxxx(config-if)# qos remark dscp

qos trust (Global)

To configure the trust state for QoS basic mode, use the qos trust Global Configuration mode command.

To revert to its default setting, use the no form of this command.


Note

This command is available only when the switch is in QoS basic mode.


Syntax

qos trust {cos | cos-dscp | dscp | ip-precedence}

no qos trust

Parameters

cos—Classifies the ingress packets with packet CoS value. Untagged packets are classified with the default port CoS value.

cos-dscp—Classifies the ingress packets with packet CoS-DSCP value.

dscp—Classifies the ingress packets with packet DSCP value.

ip-precedence—Classifies the ingress packets with packet IP precedence value.

Default Configuration

The default trust mode is dscp.

Command Mode

Global Configuration mode

User Guidelines

Packets entering a QoS domain are classified at its edge. When the packets are classified at the edge, the switch port within the QoS domain can be configured to one of the trusted states because there is no need to classify the packets at every switch within the domain.

Use this command to specify whether the port is trusted and which fields of the packet to use to classify traffic.

When the switch is configured with trust DSCP, the traffic is mapped to the queue by the DSCP-to-queue map.

When the switch is configured with trust CoS, the traffic is mapped to the queue by the CoS-to-queue map.

Example

switchxxxxxx(config)# qos trust cos

qos trust (Interface)

To enable the trust state on an interface when the switch is in QoS basic mode, use the qos trust Interface Configuration mode command.

To disable the trust state on an interface, use the no form of this command.

Syntax

qos trust

no qos trust

Parameters

N/A

Default Configuration

Trust state is enabled on each interface when the switch is in QoS basic mode.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# qos trust

service-policy

To bind a policy map to a port or port channel, use the service-policy Interface Configuration mode command.

To detach a policy map from an interface, use the no form of this command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

service-policy input policy-map-name

no service-policy input

Parameters

input policy-map-name—Specifies the policy map to apply to the input interface.

Command Mode

Interface Configuration (Ethernet, port channel) mode

User Guidelines

Only one policy map per interface per direction is supported.

Example

The following example attaches a policy map called Policy1 to the input interface:

switchxxxxxx(config-if)# interface gi11
switchxxxxxx(config-if)# service-policy input policy1

set

To select the value that QoS uses as the DSCP value, the egress queue, or to set user priority values, use the set Policy-map Class Configuration mode command.

To revert to its default setting, use the no form of this command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

set queue queue-id

no set queue

Parameters

queue queue-id—Specifies the egress queue. (Range: 1 to 8)

Command Mode

Policy-map Class Configuration mode

User Guidelines

The set and trust commands are mutually exclusive within the same policy map.

To return to the Global Configuration mode, use the exit command. To return to the Privileged EXEC mode, use the end command.

Example

The following example creates an ACL, places it into a class map, places the class map into a policy map, and sets the DSCP value in the packet to 56 for classes in the policy map called p1:

switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-mac-al)# permit ip any any
switchxxxxxx(config-mac-al)# exit
switchxxxxxx(config)# class-map c1
switchxxxxxx(config-cmap)# match access-group ip1
switchxxxxxx(config-cmap)# exit
switchxxxxxx(config)# policy-map p1
switchxxxxxx(config-pmap)# class c1
switchxxxxxx(config-pmap-c)# set queue 2

show class-map

To show information for all class maps or for a specific class map when the switch is in QoS advanced mode, use the show class-map Privileged EXEC mode command.

Syntax

show class-map [class-map-name]

Parameters

class-map-name—(Optional) The class map name.

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show class-map class1
Class Map match-any class1 (id4)
Match IP dscp 11 21

show policy-map

To show information for all policy maps or for a specific policy map, use the show policy-map Privileged EXEC mode command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

show policy-map [policy-map-name]

Parameters

policy-map-name—(Optional) The policy map name.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show policy-map
Policy Map policy1
class class1
set IP dscp 7
Policy Map policy2
class class 2
police 96000 exceed-action drop
class class3
police 124000 exceed-action policed-dscp-transmit

show policy-map interface

To show the policy map that is applied to an interface, use the show policy-map interface Privileged EXEC mode command.

Syntax

show policy-map interface interface-id

Parameters

interface-id—An interface ID or a list of interface IDs. The interface can be one of these types: Ethernet port or port channel.

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show policy-map interface fa5
Interface        Input Policy
---------        -------------
fa5              pmap1

show qos

To show the QoS settings on the switch, use the show qos Privileged EXEC mode command.

Syntax

show qos

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Examples

Example 1—The following example displays QoS attributes when the switch is in QoS basic mode:

switchxxxxxx# show qos
Basic trust: dscp
Qos: basic

Example 2—The following example displays QoS attributes when the switch is in QoS advanced mode:

switchxxxxxx# show qos
QoS Mode: advanced
Advanced mode trust type: cos
Advanced mode ports state: Not trusted

show qos aggregate-policer

To show information for specific aggregate policers, use the show qos aggregate-policer Privileged EXEC mode command.


Note

This command is available only when the switch is in QoS advanced mode.


Syntax

show qos aggregate-policer [aggregate-policer-name ]

Parameters

aggregate-policer-name—(Optional) The aggregate policer name.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show qos aggregate-policer policer1
aggregate-policer policer1 96000 exceed-action drop

show qos interfaces

To show the QoS configuration on all interfaces or on an interface, use the show qos interfaces Privileged EXEC mode command.

Syntax

show qos interfaces interface-id

Parameters

interface-id—An interface ID or a list of interface IDs. The interface can be one of these types: Ethernet port or port channel.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

User Guidelines

If a specific interface is not specified, information for all interfaces is displayed.

Example

switchxxxxxx# show qos interface gi1
Port|CoS|Trust State|Remark Cos|Remark DSCP|Remark IP Prec
----+---+-----------+----------+-----------+----------------
gi1 | 0 |  enabled   | disabled |  disabled |    disabled

show qos map

To show information for various types of QoS mapping, use the show qos map Privileged EXEC mode command.

Syntax

show qos map [{cos-queue | dscp-queue | ip-precedence-queue | queue-cos | queue-dscp | queue-precedence}]

Parameters

cos-queue—(Optional) Displays the CoS-to-queue mapping.

dscp-queue—(Optional) Displays the DSCP-to-queue mapping.

ip-precedence-queue—(Optional) Displays the IP precedence-to-queue mapping.

queue-cos—(Optional) Displays the queue-to-CoS mapping.

queue-dscp—(Optional) Displays the queue-to-DSCP mapping.

queue-precedence—(Optional) Displays the queue-to-precedence mapping.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show qos map
CoS to Queue mappings
   COS   0  1  2  3  4  5  6  7
--------------------------------
 Queue   2  1  3  4  5  6  7  8
DSCP to Queue mappings
d1: d2  0  1  2  3  4  5  6  7  8  9
--------------------------------------
 0:      1  1  1  1  1  1  1  1  2  2
 1:      2  2  2  2  2  2  3  3  3  3
 2:      3  3  3  3  4  4  4  4  4  4
 3:      4  4  5  5  5  5  5  5  5  5
 4:      6  6  6  6  6  6  6  6  7  7
 5:      7  7  7  7  7  7  8  8  8  8
 6:      8  8  8  8
IP Precedence to Queue mappings
 IP Precedence   0  1  2  3  4  5  6  7
----------------------------------------
         Queue     2  1  3  4  5  6  7  8
Queue to CoS mappings
 Queue   1  2  3  4  5  6  7  8
--------------------------------
   CoS   1  0  2  3  4  5  6  7
Queue to DSCP mappings
 Queue   1  2  3  4  5  6  7  8
--------------------------------
  DSCP   0  8 16 24 32 40 48 56
Queue to IP Precedence mappings
 Queue   1  2  3  4  5  6  7  8
--------------------------------
ipprec   0  1  2  3  4  5  6  7

show qos queueing

To show the QoS queuing information, use the show qos queueing Privileged EXEC mode command.

Syntax

show qos queueing

Parameters

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show qos queueing
qid-weights    Ef - Priority
1 - N/A         ena- 1
2 - N/A         ena- 2
3 - N/A         ena- 3
4 - N/A         ena- 4
5 - N/A         ena- 5
6 - N/A         ena- 6
7 - N/A         ena- 7
8 - N/A         ena- 8

show rate-limit vlan

To show the port rate limit for a specific VLAN or for all VLANs, use the show rate-limit vlan Privileged EXEC mode command.

Syntax

show rate-limit vlan vlan-id

Parameters

vlan-id—The VLAN ID.

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show rate-limit vlan 1
VLAN  |  Port  | rate-limit [Kbps]
--------+--------+-------------------
     1  |  ANY   |          N/A      |

traffic-shape

To configure the maximum permitted excess burst size of egress port and queue shaper, use the traffic-shape Interface Configuration mode command.

To disable the shaper, use the no form of this command.

Syntax

traffic-shape burst [queue] committed-burst

no traffic-shape

Parameters

queue—(Optional) The queue number to which the shaper is assigned.

committed-burst—The maximum permitted excess burst size (CBS) in bytes. (Range: 128 to 56319 bytes)

Default Configuration

The default shaper burst is 768 bytes.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

The following example sets a traffic shaper burst size 9600 bytes:

switchxxxxxx(config)# traffic-shape burst 9600
switchxxxxxx(config)# traffic-shape burst queue 9600

trust-shape (Interface)

To configure the egress port shaper, use trust-shape Interface Configuration mode command. The egress port shaper controls the traffic transmit rate (Tx rate).

To disable the shaper, use the no form of this command.

Syntax

traffic-shape committed-rate

no traffic-shape

Parameters

committed-rate—The maximum average traffic rate in 16 kbits per second (kbps). (Range: 16 to 1000000 kbps)

Default Configuration

The shaper is disabled.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

The following example sets a traffic shaper on fa5 when the average traffic rate exceeds 124000 kbps:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# traffic-shape 124000

traffic-shape queue

To configure the egress queue shaper on a specific queue, use the traffic-shape queue Interface Configuration mode command. The egress port shaper controls the traffic transmit rate (Tx rate) on a queue on an interface.

To disable the shaper, use the no form of this command.

Syntax

traffic-shape queue queue-id committed-rate

no traffic-shape queue queue-id

Parameters

queue-id—The queue number to which the shaper is assigned. (Range: 1 to 8)

committed-rate—The average traffic rate in 16 kbits per second (kbps). (Range: 16 to 1000000)

Default Configuration

The shaper is disabled.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

The following example sets a shaper on queue 1 when the average traffic rate exceeds 124000 kbps:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# traffic-shape queue 1 124000

trust

To configure the trust state, use the trust Policy-map Class Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

trust

no trust

Parameters

N/A

Default Configuration

The default state is according to the mode selected in the qos command (advanced mode). The type of trust is determined in qos advanced-mode trust.

Command Mode

Policy-map Class Configuration mode

User Guidelines

This command is relevant only when the switch is in QoS advanced, ports-not-trusted mode. Trust indicates that traffic is sent to the queue according to the packet’s QoS parameters (UP or DSCP).

Use this command to distinguish the QoS trust behavior for certain traffic from others. For example, incoming traffic with certain DSCP values can be trusted. A class map can be configured to match and trust the DSCP values in incoming traffic.

The type of trust is determined in the qos advanced-mode trust command.

Trust values set with this command supersede trust values set on specific interfaces with the qos trust (Interface) Interface Configuration mode command.

The trust and set commands are mutually exclusive within the same policy map.

Policy maps, which contain set or trust commands or that have ACL classification to an egress interface, cannot be attached by using the service-policy Interface Configuration mode command.

If specifying trust CoS, QoS maps a packet to a queue, the received or default port CoS value, and the CoS-to-queue map.

Example

The following example creates an ACL, places it into a class map, places the class map into a policy map, and configures the trust state using the DSCP value in the ingress packet:

switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-mac-al)# permit ip any any
switchxxxxxx(config-mac-al)# exit
switchxxxxxx(config)# class-map c1
switchxxxxxx(config-cmap)# match access-group ip1
switchxxxxxx(config-cmap)# exit
switchxxxxxx(config)# policy-map p1
switchxxxxxx(config-pmap)# class c1
switchxxxxxx(config-pmap-c)# trust

rate-limit (Interface)

To limit the incoming traffic rate on an interface, use the rate-limit Interface Configuration mode command.

To disable the rate limit on an interface, use the no form of this command.

Syntax

rate-limit committed-rate-kbps

no rate-limit

Parameters

committed-rate-kbps—The maximum ingress traffic on an Ethernet interface in kilobits per second (kbps). (Range: 16 to 1000000)

Default Configuration

Rate limiting is disabled.

Command Mode

Interface Configuration (Ethernet) mode

Example

The following example limits the incoming traffic rate on fa5 to 100000 kbps:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# rate-limit 100000

rate-limit (VLAN)

To limit the incoming traffic rate for a VLAN, use the rate-limit VLAN Global Configuration mode command.

To disable the rate limit for a VLAN, use the no form of this command.

Syntax

rate-limit committed-rate vlan vlan-id

no rate-limit vlan vlan-id

Parameters

committed-rate—The average traffic rate (CIR) in kbps. (Range: 16 to 1000000)

vlan vlan-id—Specifies the VLAN ID.

Default Configuration

Rate limiting is disabled.

Command Mode

Global Configuration mode

User Guidelines

Traffic policing in a policy map takes precedence over the VLAN rate limiting. If a packet is subject to traffic policing in a policy map and is associated with a VLAN that is rate limited, the packet is counted only in the traffic policing of the policy map.

Example

The following example limits the rate on VLAN 11 to 100000 kbps:

switchxxxxxx(config)# rate-limit 100000 vlan 11

wrr-queue bandwidth

To assign WRR weights to egress queues, use the wrr-queue bandwidth Global Configuration command.

Syntax

wrr-queue bandwidth weight1 weight2... weightN

Parameters

weight1 weight1... weightN—The ratio of bandwidth assigned by the WRR packet scheduler to the packet queues. Separate each value by a space. (Range for each weight: 1 to 127)

Default Configuration

WRR is disabled by default. The default WRR weight is 1 for all queues.

Command Mode

Global Configuration mode

User Guidelines

The weight ratio determines the frequency at which the packet scheduler removes packets from each queue.

The ratio for each queue is defined as the queue weight divided by the sum of all queue weights (the normalized weight). This sets the bandwidth allocation of each queue.

A weight of 0 indicates that no bandwidth is allocated for the same queue, and the shared bandwidth is divided among the remaining queues. We do not recommend that you set the weight of a queue to 0 as it might stop transmission of control-protocols packets generated by the device.

All three queues participate in the WRR, excluding the expedite queues, whose corresponding weight is not used in the ratio calculation.

An expedite (SP) queue is a priority queue, which is serviced until empty before the other queues are serviced. The expedite queues are designated by the priority-queue out num-of-queues command.

Example

switchxxxxxx(config)# priority-queue out num-of-queues 4
switchxxxxxx(config)# wrr-queue bandwidth 6 6 6 6