QoS Commands

This chapter contains the following sections:

qos

Use the qos Global Configuration mode command to enable QoS on the device and set its mode. Use the no form of this command to disable QoS on the device.

Syntax

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

no qos

Parameters

  • basic—QoS basic mode. If no option is specified, the QoS mode defaults to the basic mode.

  • advanced—Specifies the QoS advanced mode, which enables the full range of QoS configuration.

  • ports-not-trusted—Relevant for advanced mode only. Indicates that 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—Relevant for advanced mode only. Indicates that 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

QoS basic mode

Command Mode

Global Configuration mode

Examples

Example 1—The following example disables QoS on the device.

switchxxxxxx(config)#  no qos

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

switchxxxxxx(config)# qos advanced

qos advanced-mode trust

Use the qos advanced-mode trust Global Configuration mode command to configure the trust mode in advanced mode. Use the no form of this command to return to default.

Syntax

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

no qos advanced-mode trust

Parameters

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

  • dscp—Classifies ingress packets with the packet DSCP values.

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

Default Configuration

cos-dscp

Command Mode

Global Configuration mode

User Guidelines

The configuration is relevant for 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 for QoS on the device.

switchxxxxxx(config)# qos advanced-mode trust cos

show qos

Use the show qos Privileged EXEC mode command to display the QoS information for the device. The trust mode is displayed for the QoS basic mode.

Syntax

show qos

Default Configuration

Disabled Command Mode

Command Mode

Privileged EXEC mode

User Guidelines

Trust mode is displayed if QoS is enabled in basic mode.

Examples

switchxxxxxx(config)# show qos
Qos: Disabled
switchxxxxxx(config)# show qos
Qos: Basic mode
Basic trust: dscp
switchxxxxxx(config)# show qos
Qos: Advanced mode
Advanced mode trust type: cos
Advanced mode ports state: Trusted

class-map

Use the class-map Global Configuration mode command to create or modify a class map and enter the Class-map Configuration mode (only possible when QoS is in the advanced mode). Use the no form of this command to delete a class map.

Syntax

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

no class-map class-map-name

Parameters

  • class-map-name—Specifies the class map name. (Length: 1–32 characters)

  • match-all—Performs a logical AND of all the criteria of the ACLs belonging to this class map. All match criteria in this class map must be matched. If neither match-all nor match-any is specified, the match-all parameter is selected by default.

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

Default Configuration

No class map.

Command Mode

Global Configuration mode

User Guidelines

The class-map command and its subcommands are used to define packet classification, marking, and aggregate policing as part of a globally-named service policy applied on a per-interface basis.

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.

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

The class-map enters 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 a few match commands, each must point to a different type of ACL, such as: one IP ACL, one IPv6 ACL, and one MAC ACL. The classification is by first match, 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:

  • exit: Exits the Class-map Configuration mode.

  • match: Configures classification criteria.

  • no: Removes 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-all
switchxxxxxx(config-cmap)# match access-group acl-name

show class-map

The show class-map Privileged EXEC mode mode command displays all class maps when QoS is in advanced mode.

Syntax

show class-map [class-map-name]

Parameters

class-map-name—Specifies the name of the class map to be displayed. (Length: 1–32 characters)

Command Mode

Privileged EXEC mode

Example

The following example displays the class map for Class1.

switchxxxxxx(config)# show class-map
Class Map matchAny class1
   Match access-group mac

match

Use the match Class-map Configuration mode. command to bind the ACLs that belong to the class-map being configured. Use the no form of this command to delete the ACLs.

Syntax

match access-group acl-name

no match access-group acl-name

Parameters

acl-name—Specifies the MAC, IP ACL name, or IPv6 ACL name. (Length: 1–32 characters)

Default Configuration

No match criterion is supported.

User Guidelines

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

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 belong to the class map.

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

policy-map

Use the policy-map Global Configuration mode command to creates a policy map and enter the Policy-map Configuration mode. Use the no form of this command to delete a policy map.

Syntax

policy-map policy-map-name

no policy-map policy-map-name

Parameters

policy-map-name—Specifies the policy map name. (Length: 1–32 characters)

Command Mode

Global Configuration mode

User Guidelines

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

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. 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/port-channels. 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.

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)#

class

Use the class Policy-map Configuration mode. command after the policy-map command to attach ACLs to a policy-map. Use the no form of this command to detach a class map from a policy map.

Syntax

class class-map-name [access-group acl-name]

no class class-map-name

Parameters

  • class-map-name—Specifies the name of an existing class map. If the class map does not exist, a new class map is created under the specified name. (Length: 1–32 characters)

  • access-group acl-name—Specifies the name of an IP, IPv6, or MAC Access Control List (ACL). (Length: 1–32 characters)

Default Configuration

No class map is defined for the policy map.

Command Mode

Policy-map Configuration mode.

User Guidelines

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

This is the same as creating a class map and then binding it to the policy map.

You can specify an existing class map in this command, or you can use the access-group parameter to create a new class map.

After the policy-map is defined, use the service-policy command to attach it to a port/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 access-group enterprise

show policy-map

Use the show policy-map Privileged EXEC mode command to display all policy maps or a specific policy map.

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

Syntax

show policy-map [policy-map-name]

Parameters

policy-map-name—Specifies the policy map name. (Length: 1–32 characters)

Default Configuration

All policy-maps are displayed.

Command Mode

Privileged EXEC mode

Example

The following example displays all policy maps.

switchxxxxxx(config)#   show policy-map
Policy Map policy1
class class1
set dscp 7
Policy Map policy2
class class 2
police 96000 4800 exceed-action drop
class class2
redirect gi1/0/2
class class 3
police 96000 4800 exceed-action policed-dscp-transmit peak 128000 9600 violate-action policed-dscp-transmit

trust

Use the trust Policy-map Class Configuration mode. command to configure the trust state. Use the no form of this command to return to the default trust state.

Syntax

trust

no trust

Default Configuration

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

Command Mode

Policy-map Class Configuration mode.

User Guidelines

This command is relevant only when QoS is in 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 the incoming traffic.

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.

switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-ip-al)#  permit ip any any
switchxxxxxx(config-ip-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

set

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

Syntax

set {dscp new-dscp | queue queue-id | cos new-cos}

no set

Parameters

  • dscp new-dscp—Specifies the new DSCP value for the classified traffic. (Range: 0–63)

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

  • cos new-cos—Specifies the new user priority to be marked in the packet. (Range: 0–7)

Command Mode

Policy-map Class Configuration mode.

User Guidelines

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

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

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

The queue keyword is not supported into egress policies.

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-ip-al)# permit ip any any
switchxxxxxx(config-ip-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 dscp 56

redirect

Use the redirect Policy-map Class Configuration mode. command to redirect a traffic flow to a given Ethernet port or port channel.

Syntax

redirect interface-id

no redirect

Parameters

  • interface-id—Specifies an Ethernet port or port channel to which the flow is redirected.

Command Mode

Policy-map Class Configuration mode.

User Guidelines

Use the redirect command to redirect a frame into the VLAN the frame was assigned to.

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

Example

The following example creates an ACL, places it into a class map, places the class map into a policy map and redirects the flow to Ethernet port gi1/0/2:

switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-ip-al)# permit ip any any
switchxxxxxx(config-ip-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)# redirect gi1/0/2
switchxxxxxx(config-pmap-c)# exit
switchxxxxxx(config-pmap)# exit
switchxxxxxx(config)#

mirror

Use the mirror Policy-map Class Configuration mode. command to mirror a traffic flow to an analyzer Ethernet port.

Syntax

mirror session_number

no mirror

Parameters

  • session_number—Specify the session number identified with the SPAN or RSPAN session. Only a value of 1 is allowed.

Command Mode

Policy-map Class Configuration mode.

User Guidelines

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

A frame is mirrored in the same format if it matches to one of the class ACLs regardless the command of this ACL: permit or deny.

Only one source session from VLAN and flow mirroring is supported.

Example

The following example creates an ACL, places it into a class map, places the class map into a policy map and mirrors the flow to an analyzer Ethernet port defined by session 2:

switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-ip-al)# permit ip any any
switchxxxxxx(config-ip-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)# mirror 2
switchxxxxxx(config-pmap-c)# exit
switchxxxxxx(config-pmap)# exit
switchxxxxxx(config)#

police

Use the police Policy-map Class Configuration mode. command to define the policer for classified traffic. This defines another group of actions for the policy map (per class map). Use the no form of this command to remove a policer.

Syntax

police committed-rate-kbps committed-burst-byte [exceed-action action] [peak peak-rate-kbps peak-burst-byte [violate-action action]]

no police

Parameters

  • committed-rate-kbps—Specifies the average traffic rate (CIR) in kbits per second (bps).(Range: 3–maximal port speed)

  • committed-burst-byte—Specifies the normal burst size (CBS) in bytes. (Range: 3000–19173960)

  • exceed-action—Specifies the action taken when the committed rate is exceeded and the peak rate is not exceeded. If the keyword is not configured then the following action is applied:

    • drop, if peak the keyword is not configured.

    • policed-dscp-transmit, if peak the keyword is configured.

  • peak—Specifies the Two-rate Three-color policer. If the peak rate is exceeded the packet is dropped.

  • peak-rate-kbps—Specifies the average traffic rate (CIR) in kbits per second (bps).(Range: 3–maximal port speed)

  • peak-burst-byte—Specifies the peak burst size (PBS) in bytes. (Range: 3000–19173960)

  • violate-action—Specifies the action taken when the peak rate is exceeded. If the keyword is not configured then the drop action is applied.

  • action—Specifies the taken action. The possible values are:

    • drop—Drops the packet.

    • policed-dscp-transmit—Remarks the packet DSCP of IP traffic. The DSCP remarking is configured by the qos map policed-dscp command with the violation keyword for the violation action and without this keyword for the exceed action. DSCP remarking will have effect only if the mode is trust dscp.

Default Usage

No policer

Command Mode

Policy-map Class Configuration mode.

User Guidelines

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

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

Policing uses a token bucket algorithm.

Examples

Example 1. The following example defines a policer for classified traffic. When the traffic rate exceeds 124,000 kbps and the normal burst size exceeds 9600 bytes, 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 cls1
switchxxxxxx(config-pmap-c)# police 124000 9600 exceed-action drop

service-policy

Use the service-policy Interface (Ethernet, Port Channel) Configuration mode mode command to bind a policy map to an interface. Use the no form of this command to detach a policy map from an interface.

Syntax

service-policy {input | output} policy-map-name [default-action {permit-any | deny-any}]

no service-policy input | output

service-policy {input | output} policy-map-name

Parameters

  • input—Specifies an ingress policy.

  • output—Specifies an egress policy.

  • policy-map-name—Specifies the policy map name to apply to the input interface. (Length: 1–32 characters)

  • default-action—Specifies the default action. If the keyword is not configured then the deny-any default action is applied.

  • deny-any—Deny all the packets (which were ingress of the port) that do not meet the rules in a policy.

  • permit-any—Forward all the packets (which were ingress of the port) that do not meet the rules in a policy.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Default

Policy map is not bound.

User Guidelines

This command is only available in QoS advanced mode.

Only one policy map per interface per direction is supported.

The service-policy output command fails if the bound policy contains actions not supported by egress policies.

A policy map cannot be bound as input and output at the same time.

Example

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

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

The following example attaches a policy map called Policy1 to the input interface and forwards all packets that do not meet the rules of the policy.

switchxxxxxx(config-if)# service-policy input policy1 permit-any

The following example attaches a policy map called Policy2 to the output interface.

switchxxxxxx(config-if)# service-policy output policy2

qos aggregate-policer

Use the qos aggregate-policer Global Configuration mode command to define the policer parameters that can be applied to multiple traffic classes. Use the no form of this command to remove an existing aggregate policer.

Syntax

qos aggregate-policer aggregate-policer-name committed-rate-kbps committed-burst-byte [exceed-action action] [peak peak-rate-kbps peak-burst-byte [violate-action action]]

no qos aggregate-policer aggregate-policer-name

Parameters

  • aggregate-policer-name—Specifies the aggregate policer name. (Length: 1–32 characters)

  • committed-rate-kbps—Specifies the average traffic rate (CIR) in kbits per second (bps).(Range: 3–57982058)

  • committed-burst-byte—Specifies the normal burst size (CBS) in bytes. (Range: 3000–19173960)

  • exceed-action—Specifies the action taken when the committed rate is exceeded and the peak rate is not exceeded. If the keyword is not configured then the following action is applied:

    • drop, if peak the keyword is not configured.

    • policed-dscp-transmit, if peak the keyword is configured.

  • peak—Specifies the Two-rate Three-color policer. If the peak rate is exceeded the packet is dropped.

  • peak-rate-kbps—Specifies the average traffic rate (CIR) in kbits per second (bps).(Range: 3–57982058)

  • peak-burst-byte—Specifies the peak burst size (PBS) in bytes. (Range: 3000–19173960)

  • violate-action—Specifies the action taken when the peak rate is exceeded. If the keyword is not configured then the drop action is applied.

  • action—Specifies the taken action. The possible values are:

    • drop—Drops the packet.

    • policed-dscp-transmit—Remarks the packet DSCP of IP traffic. The DSCP remarking is configured by the qos map policed-dscp command with the violation keyword for the violation action and without this keyword for the exceed action. DSCP remarking will have effect only if the mode is trust dscp.

Default Configuration

No aggregate policer is defined.

Command Mode

Global Configuration mode

User Guidelines

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

Use the qos aggregate-policer command to define a policer that 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, the 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 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.

Examples

Example 1. 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 or the normal burst size exceeds 9600 bytes, the packet is dropped.

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

Example 2. The following example defines the parameters of a Two-rate Three-color policer called policer2 that can be applied to multiple classes in the same policy map. When the average traffic rate exceeds 124,000 kbps or the normal burst size exceeds 9600 bytes, the packet is remarked. When the average traffic rate exceeds 200,000 kbps or the normal burst size exceeds 9600 bytes, the packet is dropped.

switchxxxxxx(config)# qos aggregate-policer policer2 124000 9600 exceed-action policed-dscp-transmit peak 200000 19200 violate-action policed-dscp-transmit

show qos aggregate-policer

Use the show qos aggregate-policer Privileged EXEC mode mode command to display aggregate policers

This command is only available in QoS advanced mode.

Syntax

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

Parameters

aggregate-policer-name—Specifies the aggregate policer name. (Length: 1–32 characters)

Default Configuration

All policers are displayed.

Command Mode

Privileged EXEC mode

Examples

Example 1. The following example displays the parameters of the aggregate policer called Policer1.

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

not used by any policy map.

police aggregate

Use the police aggregate Policy-map Class Configuration mode. command to apply an aggregate policer to multiple class maps within the same policy map. Use the no form of this command to remove an existing aggregate policer from a policy map.

This command is only available in QoS advanced mode.

Syntax

police aggregate aggregate-policer-name

no police aggregate aggregate-policer-name

Parameters

aggregate-policer-name—Specifies the aggregate policer name. (Length: 1–32 characters)

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 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 9600 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

wrr-queue cos-map

Use the wrr-queue cos-map Global Configuration mode command to map Class of Service (CoS) values to a specific egress queue. Use the no form of this command to restore the default configuration.

Syntax

wrr-queue cos-map queue-id cos0... cos7

no wrr-queue cos-map [queue-id]

Parameters

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

  • cos0... cos7—Specifies up to 8 CoS values to map to the specified queue number. (Range: 0–7)

Default Configuration

The default CoS value mapping to 8 queues is as follows:

CoS value 0 is mapped to queue 1.

CoS value 1 is mapped to queue 2.

CoS value 2 is mapped to queue 3.

CoS value 3 is mapped to queue 6.

CoS value 4 is mapped to queue 5.

CoS value 5 is mapped to queue 8.

CoS value 6 is mapped to queue 8

CoS value 7 is mapped to queue 7

Command Mode

Global Configuration mode

User Guidelines

Use this command to distribute traffic to different queues.

Example

The following example maps CoS value 4 and 6 to queue 2.

switchxxxxxx(config)# wrr-queue cos-map 2 4 6

wrr-queue bandwidth

Use the wrr-queue bandwidth Global Configuration mode command to assign Weighted Round Robin (WRR) weights to egress queues. The weight ratio determines the frequency at which the packet scheduler removes packets from each queue. Use the no form of this command to restore the default configuration.

Syntax

wrr-queue bandwidth weight1 weight2... weighting

no wrr-queue bandwidth

Parameters

weight1 weight1... weighting the ratio of bandwidth assigned by the WRR packet scheduler to the packet queues. See explanation in the User Guidelines. Separate each value by a space. (Range for each weight: 0–255)

Default Configuration

wrr is disabled by default.

Command Mode

Global Configuration mode

User Guidelines

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. It is not recommended to set the weight of a queue to a 0 as it might stop transmission of control-protocols packets generated by the device.

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

Example

The following assigns WRR values to the queues.

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

priority-queue out num-of-queues

Use the priority-queue out num-of-queues Global Configuration mode command to configure the number of expedite queues. Use the no form of this command to restore the default configuration.

Syntax

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

no priority-queue out num-of-queues

Parameters

  • number-of-queues—Specifies the number of expedite (strict priority) queues. Expedite queues are assigned to the queues with the higher indexes. (Range: 0–8 .There must be either 0 wrr queues or more than one.

    If number-of-queues = 0, all queues are assured forwarding (according to wrr weights) If the number-of-queues = 8 , all the queues are expedited (strict priority queues).

Default Configuration

All queues are expedite queues.

Command Mode

Global Configuration mode

User Guidelines

An expedite queue is a strict priority 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

traffic-shape

Use the traffic-shape Interface (Ethernet, Port Channel) Configuration mode command to configure the egress port shaper. Use the no form of this command to disable the shaper.

Syntax

traffic-shape committed-rate [committed-burst]

no traffic-shape

Parameters

  • committed-rate—Specifies the maximum average traffic rate (CIR) in kbits per second (kbps). (Range: GE: 64kbps–maximum port speed ,10GE: 64Kbps–maximum port speed))

  • committed-burst—Specifies the maximum permitted excess burst size (CBS) in bytes. (Range: 4096 - 16670940 bytes)

Default Configuration

The shaper is disabled.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The egress port shaper controls the traffic transmit rate (Tx rate) on a port.

Example

The following example sets a traffic shaper on gi1/0/1 when the average traffic rate exceeds 64 kbps or the normal burst size exceeds 4096 bytes.

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)#  traffic-shape 64 4096

traffic-shape queue

Use the traffic-shape queue Interface (Ethernet, Port Channel) Configuration mode command to configure the egress queue shaper. Use the no form of this command to disable the shaper.

Syntax

traffic-shape queue queue-id committed-rate [committed-burst]

no traffic-shape queue queue-id

Parameters

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

  • committed-rate—Specifies the average traffic rate (CIR) in kbits per second (kbps). (Range: 64 kbps–maximum port speed)

  • committed-burst—Specifies the excess burst size (CBS) in bytes. (Range: 4096 - 16670940 bytes)

Default Configuration

The shaper is disabled.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

The egress port shaper controls the traffic transmit rate (Tx rate) on a queue on a port.

Example

The following example sets a shaper on queue 1 on gi1/0/1 when the average traffic rate exceeds 124000 kbps or the normal burst size exceeds 9600 bytes.

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)#  traffic-shape queue 1 64 4096

qos wrr-queue wrtd

Use the qos wrr-queue wrtd Global Configuration mode command to enable Weighted Random Tail Drop (WRTD). Use the no form of this command to disable WRTD.

Syntax

qos wrr-queue wrtd

no qos wrr-queue wrtd

Default

Disabled

Command Mode

Global Configuration mode

User Guidelines

The command is effective after reset.

Example

switchxxxxxx(config)# qos wrr-queue wrtd
This setting will take effect only after copying running configuration to startu
p configuration and resetting the device
switchxxxxxx(config)#

show qos wrr-queue wrtd

Use the show qos wrr-queue wrtd Privileged EXEC mode command to display the Weighted Random Tail Drop (WRTD) configuration.

Syntax

show qos wrr-queue wrtd

Command Mode

Privileged EXEC mode

Example

switchxxxxxx(config)# show qos wrr-queue wrtd
 Weighted Random Tail Drop is disabled
 Weighted Random Tail Drop will be enabled after reset

show qos interface

Use the show qos interface Privileged EXEC mode command to display Quality of Service (QoS) information on the interface.

Syntax

show qos interface [buffers | queueing | policers | shapers] [interface-id]

Parameters

  • buffers—Displays the buffer settings for the interface's queues. For GE ports, displays the queue depth for each of the queues.

  • queueing—Displays the queue's strategy (WRR or EF), the weight for WRR queues, the CoS to queue map and the EF priority.

  • policers—Displays all the policers configured for this interface, their settings, and the number of policers currently unused (on a VLAN).

  • shapers—Displays the shaper of the specified interface and the shaper for the queue on the specified interface.

  • interface-id—Specifies an interface ID. The interface ID can be one of the following types: Ethernet port, or Port-channel.

Command Mode

Privileged EXEC mode

User Guidelines

If no parameter is specified with the show qos interface command, the port QoS mode (DSCP trusted, CoS trusted, untrusted, and so on), default CoS value, DSCP-to-DSCP- map (if any) attached to the port, and policy map (if any) attached to the interface are displayed. If a specific interface is not specified, the information for all interfaces is displayed.

In case of Policers, Shapers and Rate Limit - only the ports which are not in the default configuration will be showed.

Examples

Example 1—The following is an example of the output from the show qos interface command.

switchxxxxxx(config)# show qos interface gi1/0/1
Ethernet gi1/0/0/1
Default CoS: 0
Trust mode: disabled
Ingress Policy applied: AV1
Egress Policy applied: AV2
Default ACE ingress action: deny-all
Default ACE egress action: deny-all

Example 2—The following is an example of the output from the show qos interface queueing command for 4 queues.

switchxxxxxx(config)# show qos interface queueing gi1/0/1
Ethernet gi1/0/0/1
wrr bandwidth weights and EF priority:
qid-weights      Ef - Priority
1 - N/A          ena- 1
2 - N/A          ena- 2
3 - N/A          ena- 3
4 - N/A          ena- 4
Cos-queue map:
cos-qid
0 - 1
1 - 1
2 - 2
3 - 3
4 - 3
5 - 4
6 - 4
7 - 4

Example 3 —The following an example of the output from the show qos interface buffers command for 8 queues.

switchxxxxxx(config)# show qos interface buffers gi1/0/1
gi1/0/1
Notify Q depth:
buffers gi1/0/1
Ethernet gi1/0/1
qid  thresh0  thresh1  thresh2
1    100      100      80
2    100      100      80
3    100      100      80
4    100      100      80
5    100      100      80
6    100      100      80
7    100      100      80
8    100      100      80

Example 4—This is an example of the output from the show qos interface shapers command.f

switchxxxxxx(config)# show qos interface shapers gi1/0/1
gi1/0/1
Port shaper: enable
Committed rate: 64 kbps
Committed burst: 9600 bytes
QID
1
2
3
4
5
6
7
8
Status
Enable
Disable
Enable
Disable
Disable
Disable
Enable
Enable
Target
Committed
Rate [kbps]
64
N/A
N/A
N/A
N/A
N/A
N/A
N/A
Target
Committed
Burst [bytes]
17000
N/A
N/A
N/A
N/A
N/A
N/A
N/A

Example 5—This is an example of the output from show qos interface policer

switchxxxxxx(config)#   show qos interface policer gi1/0/1
Ethernet gi1/0/1
Ingress Policers:
Class map: A
Policer type: aggregate
Commited rate: 19 kbps
Commited burst: 9600 bytes
Exceed-action: policed-dscp-transmit
Class map: B
Policer type: single
Commited rate: 19 kbps
Commited burst: 9600 bytes
Peak rate: 26 kbps
Peak burst: 9600 bytes
Exceed-action: policed-dscp-transmit
Violate-action: drop
Class map: C
Policer type: none
Egress Policers:
Class map: D

qos map policed-dscp

Use the qos map policed-dscp Global Configuration mode command to configure the policed-DSCP map for remarking purposes. Use the no form of this command to restore the default configuration.

Syntax

qos map policed-dscp [violation] dscp-list to dscp-mark-down

no qos map policed-dscp [violation] [dscp-list]

Parameters

  • violation—Specifies the DSCP remapping in the violate action. If the keyword is not configured the the command specifies the DSCP remapping in the exceed action.

  • dscp-list—Specifies up to 8 DSCP values, separated by spaces. (Range: 0–63)

  • dscp-mark-down—Specifies the DSCP value to mark down. (Range: 0–63)

Default Configuration

The default map is the Null map, which means that each incoming DSCP value is mapped to the same DSCP value.

Command Mode

Global Configuration mode

User Guidelines

The original DSCP value and policed-DSCP value must be mapped to the same queue in order to prevent reordering.

Example

The following example marks incoming DSCP value 3 as DSCP value 5 on the policed-DSCP map.

switchxxxxxx(config)# qos map policed-dscp 3 to 5

qos map dscp-queue

Use the qos map dscp-queue Global Configuration mode command to configure the DSCP to queue map. Use the no form of this command to restore the default configuration.

Syntax

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

no qos map dscp-queue [dscp-list]

Parameters

  • dscp-list—Specifies up to 8 DSCP values, separated by spaces. (Range: 0– 63)

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

Default Configuration

The default map for 8 queues is as follows.

DSCP value

9-15

0-8

17-23

32, 41-47

25-31

33-39

16,24,40,48-63

None

Queue-ID

2

1

3

7

4

5

6

8

Command Mode

Global Configuration mode

Example

The following example maps DSCP values 33, 40 and 41 to queue 1.

switchxxxxxx(config)# qos map dscp-queue 33 40 41 to 1

qos trust (Global)

Use the qos trust Global Configuration mode command to configure the system to the basic mode and trust state. Use the no form of this command to return to the default configuration.

Syntax

qos trust {cos | dscp| cos-dscp}

no qos trust

Parameters

  • cos— Specifies that ingress packets are classified with packet CoS values. Untagged packets are classified with the default port CoS value.

  • dscp—Specifies that ingress packets are classified with packet DSCP values.

  • cos-dscp—Specifies that ingress packets are classified with packet DSCP values, if they are IP packets and by CoS value if non IP.

Default Configuration

dscp

Command Mode

Global Configuration mode

User Guidelines

This command can be used only in QoS basic mode.

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 system is configured with trust DSCP, the traffic is mapped to the queue by the DSCP-queue map.

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

For an inter-QoS domain boundary, configure the port to the DSCP-trusted state and apply the DSCP-to-DSCP-mutation map if the DSCP values are different in the QoS domains.

Example

The following example configures the system to the DSCP trust state.

switchxxxxxx(config)# qos trust dscp

qos trust (Interface)

Use the qos trust Interface (Ethernet, Port Channel) Configuration mode command to enable port trust state while the system is in the basic QoS mode. Use the no form of this command to disable the trust state on each port.

Syntax

qos trust

no qos trust

Default Configuration

Each port is enabled while the system is in basic mode.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example configures gi1/0/1 to the default trust state.

switchxxxxxx(config)#  interface gi1/0/1
switchxxxxxx(config-if)# qos trust

qos cos

Use the qos cos Interface (Ethernet, Port Channel) Configuration mode command to define the default CoS value of a port. Use the no form of this command to restore the default configuration.

Syntax

qos cos default-cos

no qos cos

Parameters

default-cos—Specifies the default CoS value (VPT value) of the port. If the port is trusted and the packet is untagged, then the default CoS value become the CoS value. (Range: 0–7)

Default Configuration

The default CoS value of a port is 0.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

User Guidelines

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

Example

The following example defines the port gi1/0/1 default CoS value as 3.

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)#  qos cos 3

qos dscp-mutation

Use the qos dscp-mutation Global Configuration mode command to apply the DSCP Mutation map to system DSCP trusted ports. Use the no form of this command to restore the trusted port with no DSCP mutation.

Syntax

qos dscp-mutation

no qos dscp-mutation

Default Configuration

Disabled

Command Mode

Global Configuration mode

User Guidelines

Apply the DSCP-to-DSCP-mutation map to a port at the boundary of a Quality of Service (QoS) administrative domain. If two QoS domains have different DSCP definitions, use the DSCP-to-DSCP-mutation map to translate a set of DSCP values to match the definition of another domain. Apply the map to ingress and to DSCP-trusted ports only. Applying this map to a port causes IP packets to be rewritten with newly mapped DSCP values at the ingress ports. If applying the DSCP mutation map to an untrusted port, to class of service (CoS), or to an IP-precedence trusted port.

Global trust mode must be DSCP or CoS-DSCP. In advanced CoS mode, ports must be trusted.

Example

The following example applies the DSCP Mutation map to system DSCP trusted ports.

switchxxxxxx(config)# qos dscp-mutation

show qos map

Use the show qos map Privileged EXEC mode command to display the various types of QoS mapping.

Syntax

show qos map [dscp-queue | dscp-dp| dscp-mutation | policed-dscp | policed-cos]

Parameters

  • dscp-queue—Displays the DSCP to queue map.

  • dscp-dp—Displays the DSCP to Drop Precedence map.

  • policed-dscp—Displays the DSCP to DSCP remark table.

  • dscp-mutation—Displays the DSCP-DSCP mutation table.

Default Configuration

Display all maps.

Command Mode

Privileged EXEC mode

Examples

Example 1. The following example displays the QoS mapping information:

switchxxxxxx(config)# show qos map dscp-queue
Dscp-queue map:
     d1 : d2 0  1  2  3  4  5  6  7  8  9
     ------------------------------------
      0 :   01 01 01 01 01 01 01 01 01 01
      1 :   01 01 01 01 01 01 02 02 02 02
      2 :   02 02 02 02 02 02 02 02 02 02
      3 :   02 02 03 03 03 03 03 03 03 03
      4 :   03 03 03 03 03 03 03 03 04 04
      5 :   04 04 04 04 04 04 04 04 04 04
      6 :   04 04 04 04

Example 2. The following example displays the dscp remapping information:

switchxxxxxx(config)# show qos map policed-dscp
Policed-dscp map (exceed):
     d1 : d2 0  1  2  3  4  5  6  7  8  9
     ------------------------------------
      0 :   00 01 02 03 04 05 06 07 08 09
      1 :   10 11 12 13 14 15 16 17 18 19
      2 :   20 21 22 23 24 25 26 27 28 29
      3 :   30 31 32 33 34 35 36 37 38 39
      4 :   40 41 42 43 44 45 46 47 48 49
      5 :   50 51 52 53 54 55 56 57 58 59
      6 :   21  21 21
Policed-dscp map (violate):
     d1 : d2 0  1  2  3  4  5  6  7  8  9
     ------------------------------------
      0 :   00 01 02 03 04 05 06 07 08 09
      1 :   10 11 12 13 14 15 16 17 18 19
      2 :   20 21 22 23 24 25 26 27 28 29
      3 :   30 31 32 33 34 35 36 37 38 39
      4 :   40 41 42 43 44 45 46 47 48 49
      5 :   50 51 52 53 54 55 56 57 58 59
      6 :   11  11 11

clear qos statistics

Use the clear qos statistics Privileged EXEC mode command to clear the QoS statistics counters.

Syntax

clear qos statistics

Command Mode

Privileged EXEC mode

Example

The following example clears the QoS statistics counters.

switchxxxxxx(config)#  clear qos statistics

qos statistics policer

Use the qos statistics policer Interface (Ethernet, Port Channel) Configuration mode mode command to enable counting in-profile and out-of-profile. Use the no form of this command to disable counting.

This command is relevant only when policers are defined.

Syntax

qos statistics policer policy-map-name class-map-name

no qos statistics policer policy-map-name class-map-name

Parameters

  • policy-map-name—Specifies the policy map name. (Length: 1–32 characters)

  • class-map-name—Specifies the class map name. (Length: 1–32 characters)

Default Configuration

Counting in-profile and out-of-profile is disabled.

Command Mode

Interface (Ethernet, Port Channel) Configuration mode

Example

The following example enables counting in-profile and out-of-profile on the interface.

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# qos statistics policer policy1 class1

qos statistics aggregate-policer

Use the qos statistics aggregate-policer Global Configuration mode command to enable counting in-profile and out-of-profile. Use the no form of this command to disable counting.

Syntax

qos statistics aggregate-policer aggregate-policer-name

no qos statistics aggregate-policer aggregate-policer-name

Parameters

aggregate-policer-name—Specifies the aggregate policer name. (Length: 1–32 characters)

Default Configuration

Counting in-profile and out-of-profile is disabled.

Command Mode

Global Configuration mode

Example

The following example enables counting in-profile and out-of-profile on the interface.

switchxxxxxx(config)# qos statistics aggregate-policer policer1

clear queue statistics

Use the clear queue statistics Privileged EXEC mode command to clear the queue statistics.

Syntax

clear queue statistics [interface-id]

Parameters

  • interface-id—Specifies an Ethernet port which queue statistics are cleared.

Command Mode

Privileged EXEC mode

User Guidelines

Use the clear queue statistics interface-id command to clear the queue statistics of the given port.

Use the clear queue statistics command to clear the queue statistics of all ports.

Example

The following example clears queue statistics of Ethernet port gi1/0/2:

switchxxxxxx# clear queue statistics gi1/0/2

show queue statistics

Use the show queue statistics Privileged EXEC mode command to display the queue statistics.

Syntax

show queue statistics [interface-id]

Parameters

  • interface-id—Specifies an Ethernet port which queue statistics are displayed.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

User Guidelines

Use the show queue statistics interface-id command to display the queue statistics of the given port.

Use the show queue statistics command to display the queue statistics of all ports.

Example

The following example displays queue statistics of Ethernet port gi1/0/2:

switchxxxxxx# show queue statistics gi1/0/2

Interface

---------------

gi1/0/2

gi1/0/2

gi1/0/2

gi1/0/2

gi1/0/2

gi1/0/2

gi1/0/2

gi1/0/2

Queue

-----

1

2

3

4

5

6

7

8

Tx Pkts

--------

2700221

0

0

1850

233017

0

0

0

Tx Bytes

--------

0

0

0

257369

50313150

0

0

0

Tail

Dropped

Pkts

--------

44543278

0

0

0

12

0

0

0

Tail

Dropped

Bytes

--------

0

0

0

0

10234

0

0

0

show qos statistics

Use the show qos statistics Privileged EXEC mode command to display Quality of Service statistical information.

Syntax

show qos statistics

Command Mode

Privileged EXEC mode

User Guidelines

Use the show qos statistics command to display QoS statistics.

Up to 16 sets of counters can be enabled for policers. The counters can be enabled in the creation of the policers.

Example

The following example displays Quality of Service statistical information.

switchxxxxxx# show qos statistics
Policers
---------

Interface

----------------

gi1/0/1

gi1/0/1

gi1/0/2

gi1/0/2

Policy

Map

----------

Policy1

Policy1

Policy1

Policy1

Class

Map

----------

Class1

Class2

Class1

Class2

In-Profile

Bytes

---------

756457

8759

75457

5326

Peak

Bytes

--------

5427

14

5

Violate

Bytes

---------

12

12

2

12

Aggregate Policers

-------------------

Name

----------

Policer

In-Profile

Bytes

---------

756457

Peak

Bytes

--------

5427

Violate

Bytes

---------

12