Cisco 2960X QoS Configuration Guide
Cisco 2960X QoS Configuration Guide
Cisco 2960X QoS Configuration Guide
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
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: http://
www.cisco.com/go/trademarks. 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)
Preface Preface ix
Document Conventions ix
Related Documentation xi
Obtaining Documentation and Submitting a Service Request xi
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 iii
Contents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
iv OL-32578-01
Contents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 v
Contents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
vi OL-32578-01
Contents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 vii
Contents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
viii OL-32578-01
Preface
This book describes configuration information and examples for Quality of Service (QoS) on the switch.
Document Conventions
This document uses the following conventions:
Convention Description
^ or Ctrl Both the ^ symbol and Ctrl represent the Control (Ctrl) key on a keyboard. For
example, the key combination ^D or Ctrl-D means that you hold down the Control
key while you press the D key. (Keys are indicated in capital letters but are not
case sensitive.)
bold font Commands and keywords and user-entered text appear in bold font.
Italic font Document titles, new or emphasized terms, and arguments for which you supply
values are in italic font.
Courier font Terminal sessions and information the system displays appear in courier font.
Bold Courier font Bold Courier font indicates text that the user must enter.
... An ellipsis (three consecutive nonbolded periods without spaces) after a syntax
element indicates that the element can be repeated.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 ix
Preface
Document Conventions
Convention Description
[x | y] Optional alternative keywords are grouped in brackets and separated by vertical
bars.
[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.
string A nonquoted set of characters. Do not use quotation marks around the string or
the string will include the quotation marks.
!, # An exclamation point (!) or a pound sign (#) at the beginning of a line of code
indicates a comment line.
Note Means reader take note. Notes contain helpful suggestions or references to material not covered in the
manual.
Tip Means the following information will help you solve a problem.
Caution Means reader be careful. In this situation, you might do something that could result in equipment damage
or loss of data.
Timesaver Means the described action saves time. You can save time by performing the action described in the
paragraph.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
x OL-32578-01
Preface
Related Documentation
Related Documentation
Note Before installing or upgrading the switch, refer to the release notes.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 xi
Preface
Obtaining Documentation and Submitting a Service Request
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
xii OL-32578-01
CHAPTER 1
Using the Command-Line Interface
• Information About Using the Command-Line Interface, page 1
• How to Use the CLI to Configure Features, page 6
Command Modes
The Cisco IOS user interface is divided into many different modes. The commands available to you depend
on which mode you are currently in. Enter a question mark (?) at the system prompt to obtain a list of commands
available for each command mode.
You can start a CLI session through a console connection, through Telnet, a SSH, or by using the browser.
When you start a session, you begin in user mode, often called user EXEC mode. Only a limited subset of
the commands are available in user EXEC mode. For example, most of the user EXEC commands are one-time
commands, such as show commands, which show the current configuration status, and clear commands,
which clear counters or interfaces. The user EXEC commands are not saved when the switch reboots.
To have access to all commands, you must enter privileged EXEC mode. Normally, you must enter a password
to enter privileged EXEC mode. From this mode, you can enter any privileged EXEC command or enter
global configuration mode.
Using the configuration modes (global, interface, and line), you can make changes to the running configuration.
If you save the configuration, these commands are stored and used when the switch reboots. To access the
various configuration modes, you must start at global configuration mode. From global configuration mode,
you can enter interface configuration mode and line configuration mode.
This table describes the main command modes, how to access each one, the prompt you see in that mode, and
how to exit the mode.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 1
Using the Command-Line Interface
Command Modes
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
2 OL-32578-01
Using the Command-Line Interface
Using the Help System
SUMMARY STEPS
1. help
2. abbreviated-command-entry ?
3. abbreviated-command-entry <Tab>
4. ?
5. command ?
6. command keyword ?
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 3
Using the Command-Line Interface
Understanding Abbreviated Commands
DETAILED STEPS
Example:
Switch# sh conf<tab>
Switch# show configuration
Example:
Switch> show ?
Example:
Switch(config)# cdp holdtime ?
<10-255> Length of time (in sec) that receiver
must keep this packet
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
4 OL-32578-01
Using the Command-Line Interface
No and Default Forms of Commands
% Incomplete command. You did not enter all of the Reenter the command followed by
keywords or values required by this a question mark (?) with a space
command. between the command and the
question mark.
The possible keywords that you can
enter with the command appear.
% Invalid input detected at You entered the command Enter a question mark (?) to display
‘^’ marker.
incorrectly. The caret (^) marks the all of the commands that are
point of the error. available in this command mode.
The possible keywords that you can
enter with the command appear.
Configuration Logging
You can log and view changes to the switch configuration. You can use the Configuration Change Logging
and Notification feature to track changes on a per-session and per-user basis. The logger tracks each
configuration command that is applied, the user who entered the command, the time that the command was
entered, and the parser return code for the command. This feature includes a mechanism for asynchronous
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 5
Using the Command-Line Interface
How to Use the CLI to Configure Features
notification to registered applications whenever the configuration changes. You can choose to have the
notifications sent to the syslog.
SUMMARY STEPS
DETAILED STEPS
Recalling Commands
To recall commands from the history buffer, perform one of the actions listed in this table. These actions are
optional.
Note The arrow keys function only on ANSI-compatible terminals such as VT100s.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
6 OL-32578-01
Using the Command-Line Interface
Enabling and Disabling Editing Features
SUMMARY STEPS
DETAILED STEPS
Step 2 Ctrl-N or use the down arrow key Returns to more recent commands in the history buffer after recalling commands
with Ctrl-P or the up arrow key. Repeat the key sequence to recall successively
more recent commands.
Step 3 show history Lists the last several commands that you just entered in privileged EXEC mode.
The number of commands that appear is controlled by the setting of the terminal
Example: history global configuration command and the history line configuration
Switch# show history command.
SUMMARY STEPS
1. terminal no history
DETAILED STEPS
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 7
Using the Command-Line Interface
Enabling and Disabling Editing Features
SUMMARY STEPS
1. terminal editing
2. terminal no editing
DETAILED STEPS
Step 2 terminal no editing Disables the enhanced editing mode for the current terminal
session in privileged EXEC mode.
Example:
Switch# terminal no editing
Note The arrow keys function only on ANSI-compatible terminals such as VT100s.
Ctrl-B or use the left arrow key Moves the cursor back one character.
Ctrl-F or use the right arrow key Moves the cursor forward one character.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
8 OL-32578-01
Using the Command-Line Interface
Enabling and Disabling Editing Features
Delete or Backspace key Erases the character to the left of the cursor.
Ctrl-U or Ctrl-X Deletes all characters from the cursor to the beginning
of the command line.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 9
Using the Command-Line Interface
Searching and Filtering Output of show and more Commands
Note The arrow keys function only on ANSI-compatible terminals such as VT100s.
The following example shows how to wrap a command line that extends beyond a single line on the screen.
SUMMARY STEPS
1. access-list
2. Ctrl-A
3. Return key
DETAILED STEPS
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
10 OL-32578-01
Using the Command-Line Interface
Accessing the CLI on a Switch Stack
SUMMARY STEPS
DETAILED STEPS
Note We recommend using one CLI session when managing the switch stack.
If you want to configure a specific stack member port, you must include the stack member number in the CLI
command interface notation.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 11
Using the Command-Line Interface
Accessing the CLI Through a Console Connection or Through Telnet
• Use any Telnet TCP/IP or encrypted Secure Shell (SSH) package from a remote management station.
The switch must have network connectivity with the Telnet or SSH client, and the switch must have an
enable secret password configured.
• The switch supports up to 16 simultaneous Telnet sessions. Changes made by one Telnet user are
reflected in all other Telnet sessions.
• The switch supports up to five simultaneous secure SSH sessions.
After you connect through the console port, through the Ethernet management port, through a Telnet
session or through an SSH session, the user EXEC prompt appears on the management station.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
12 OL-32578-01
CHAPTER 2
Configuring QoS
• Finding Feature Information, page 13
• Prerequisites for QoS, page 13
• Restrictions for QoS, page 16
• Information About QoS, page 16
• How to Configure QoS, page 41
• Monitoring Standard QoS, page 103
• Configuration Examples for QoS, page 104
• Where to Go Next, page 114
• Additional References, page 114
• Feature History and Information for QoS, page 115
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 13
Configuring QoS
QoS ACL Guidelines
You can configure QoS on physical ports and on switch virtual interfaces (SVIs). Other than to apply policy
maps, you configure the QoS settings, such as classification, queueing, and scheduling, the same way on
physical ports and SVIs. When configuring QoS on a physical port, you apply a nonhierarchical policy map.
When configuring QoS on an SVI, you apply a nonhierarchical or a hierarchical policy map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
14 OL-32578-01
Configuring QoS
Policing Guidelines
policy map must first be removed from the SVI. You also cannot add or remove a class map
specified in the hierarchical policy map.
Policing Guidelines
• The port ASIC device, which controls more than one physical port, supports 256 policers (255
user-configurable policers plus 1 policer reserved for system internal use). The maximum number of
user-configurable policers supported per port is 63. Policers are allocated on demand by the software
and are constrained by the hardware and ASIC boundaries.
For example, you could configure 32 policers on a Gigabit Ethernet port and 7 policers on a 10-Gigabit
Ethernet port, or you could configure 64 policers on a Gigabit Ethernet port and 4 policers on a 10-Gigabit
Ethernet port. Policers are allocated on demand by the software and are constrained by the hardware
and ASIC boundaries.
You cannot reserve policers per port; there is no guarantee that a port will be assigned to any policer.
• Only one policer is applied to a packet on an ingress port. Only the average rate and committed burst
parameters are configurable.
• You can create an aggregate policer that is shared by multiple traffic classes within the same
nonhierarchical policy map. However, you cannot use the aggregate policer across different policy maps.
• On a port configured for QoS, all traffic received through the port is classified, policed, and marked
according to the policy map attached to the port. On a trunk port configured for QoS, traffic in all VLANs
received through the port is classified, policed, and marked according to the policy map attached to the
port.
• If you have EtherChannel ports configured on your switch, you must configure QoS classification,
policing, mapping, and queueing on the individual physical ports that comprise the EtherChannel. You
must decide whether the QoS configuration should match on all ports in the EtherChannel.
• If you need to modify a policy map of an existing QoS policy, first remove the policy map from all
interfaces, and then modify or copy the policy map. After you finish the modification, apply the modified
policy map to the interfaces. If you do not first remove the policy map from all interfaces, high CPU
usage can occur, which, in turn, can cause the console to pause for a very long time.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 15
Configuring QoS
Restrictions for QoS
Running these features with 8 egress queue enabled in a single configuration is not supported on the
switch.
• The switch supports 3 templates: default, vlan, and IPv4. Both the default and vlan templates support
IPv6. The IPv4 template does not support IPv6.
• You can configure only individual policers on an SVI.
• For the class-map [match-all | match-any] class-map-name global configuration command, because
only one match command per class map is supported, the match-all and match-any keywords function
the same.
QoS Implementation
Typically, networks operate on a best-effort delivery basis, which means that all traffic has equal priority and
an equal chance of being delivered in a timely manner. When congestion occurs, all traffic has an equal chance
of being dropped.
When you configure the QoS feature, you can select specific network traffic, prioritize it according to its
relative importance, and use congestion-management and congestion-avoidance techniques to provide
preferential treatment. Implementing QoS in your network makes network performance more predictable and
bandwidth utilization more effective.
The QoS implementation is based on the Differentiated Services (Diff-Serv) architecture, a standard from the
Internet Engineering Task Force (IETF). This architecture specifies that each packet is classified upon entry
into the network.
The classification is carried in the IP packet header, using 6 bits from the deprecated IP type of service (ToS)
field to carry the classification (class) information. Classification can also be carried in the Layer 2 frame.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
16 OL-32578-01
Configuring QoS
QoS Implementation
The special bits in the Layer 2 frame or a Layer 3 packet are shown in the following figure:
Figure 1: QoS Classification Layers in Frames and Packets
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 17
Configuring QoS
QoS Basic Model
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
18 OL-32578-01
Configuring QoS
QoS Basic Model
• Classifying a distinct path for a packet by associating it with a QoS label. The switch maps the CoS or
DSCP in the packet to a QoS label to distinguish one kind of traffic from another. The QoS label that
is generated identifies all future QoS actions to be performed on this packet.
• Policing determines whether a packet is in or out of profile by comparing the rate of the incoming traffic
to the configured policer. The policer limits the bandwidth consumed by a flow of traffic. The result is
passed to the marker.
• Marking evaluates the policer and configuration information for the action to be taken when a packet is
out of profile and determines what to do with the packet (pass through a packet without modification,
marking down the QoS label in the packet, or dropping the packet).
• Queueing evaluates the QoS label and the corresponding DSCP or CoS value to select into which of the
two ingress queues to place a packet. Queueing is enhanced with the weighted tail-drop (WTD) algorithm,
a congestion-avoidance mechanism. If the threshold is exceeded, the packet is dropped.
• Scheduling services the queues based on their configured shaped round robin (SRR) weights. One of
the ingress queues is the priority queue, and SRR services it for its configured share before servicing
the other queue.
Note Queueing and scheduling are only supported at egress and not at ingress on the switch.
Classification Overview
Classification is the process of distinguishing one kind of traffic from another by examining the fields in the
packet. Classification is enabled only if QoS is globally enabled on the switch. By default, QoS is globally
disabled, so no classification occurs.
During classification, the switch performs a lookup and assigns a QoS label to the packet. The QoS label
identifies all QoS actions to be performed on the packet and from which queue the packet is sent.
The QoS label is based on the DSCP or the CoS value in the packet and decides the queueing and scheduling
actions to perform on the packet. The label is mapped according to the trust setting and the packet type as
shown in Classification Flowchart, on page 22.
You specify which fields in the frame or packet that you want to use to classify incoming traffic.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 19
Configuring QoS
QoS Basic Model
Trust the DSCP or trust IP precedence value Trust the DSCP or trust IP precedence value in the incoming
frame. These configurations are meaningless for non-IP
traffic. If you configure a port with either of these options
and non-IP traffic is received, the switch assigns a CoS value
and generates an internal DSCP value from the CoS-to-DSCP
map. The switch uses the internal DSCP value to generate
a CoS value representing the priority of the traffic.
Perform classification based on configured Perform the classification based on a configured Layer 2
Layer 2 MAC ACL MAC access control list (ACL), which can examine the
MAC source address, the MAC destination address, and
other fields. If no ACL is configured, the packet is assigned
0 as the DSCP and CoS values, which means best-effort
traffic. Otherwise, the policy-map action specifies a DSCP
or CoS value to assign to the incoming frame.
After classification, the packet is sent to the policing, marking, and the ingress queueing and scheduling stages.
After classification, the packet is sent to the policing and marking stages.
IP Traffic Classification
The following table describes the IP traffic classification options for your QoS configuration.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
20 OL-32578-01
Configuring QoS
QoS Basic Model
Trust the IP precedence value Trust the IP precedence value in the incoming packet (configure the port
to trust IP precedence), and generate a DSCP value for the packet by using
the configurable IP-precedence-to-DSCP map. The IP Version 4
specification defines the 3 most-significant bits of the 1-byte ToS field as
the IP precedence. IP precedence values range from 0 for low priority to
7 for high priority.
You can also classify IP traffic based on IPv6 precedence.
Trust the CoS value Trust the CoS value (if present) in the incoming packet, and generate a
DSCP value for the packet by using the CoS-to-DSCP map. If the CoS
value is not present, use the default port CoS value.
IP standard or an extended ACL Perform the classification based on a configured IP standard or an extended
ACL, which examines various fields in the IP header. If no ACL is
configured, the packet is assigned 0 as the DSCP and CoS values, which
means best-effort traffic. Otherwise, the policy-map action specifies a
DSCP or CoS value to assign to the incoming frame.
Override configured CoS Override the configured CoS of incoming packets, and apply the default
port CoS value to them. For IPv6 packets, the DSCP value is rewritten by
using the CoS-to-DSCP map and by using the default CoS of the port. You
can do this for both IPv4 and IPv6 traffic.
After classification, the packet is sent to the policing, marking, and the ingress queueing and scheduling stages.
After classification, the packet is sent to the policing and marking stages.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 21
Configuring QoS
QoS Basic Model
Classification Flowchart
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
22 OL-32578-01
Configuring QoS
QoS Basic Model
In the QoS context, the permit and deny actions in the access control entries (ACEs) have different meanings
from security ACLs:
• If a match with a permit action is encountered (first-match principle), the specified QoS-related action
is taken.
• If a match with a deny action is encountered, the ACL being processed is skipped, and the next ACL is
processed.
• If no match with a permit action is encountered and all the ACEs have been examined, no QoS processing
occurs on the packet, and the switch offers best-effort service to the packet.
• If multiple ACLs are configured on a port, the lookup stops after the packet matches the first ACL with
a permit action, and QoS processing begins.
Note When creating an access list, note that by default the end of the access list contains an
implicit deny statement for everything if it did not find a match before reaching the end.
After a traffic class has been defined with the ACL, you can attach a policy to it. A policy might contain
multiple classes with actions specified for each one of them. A policy might include commands to classify
the class as a particular aggregate (for example, assign a DSCP) or rate-limit the class. This policy is then
attached to a particular port on which it becomes effective.
You implement IP ACLs to classify IP traffic by using the access-list global configuration command; you
implement Layer 2 MAC ACLs to classify non-IP traffic by using the mac access-list extended global
configuration command.
Related Topics
Creating an IP Standard ACL for IPv4 Traffic, on page 55
Creating an IP Extended ACL for IPv4 Traffic, on page 57
Creating an IPv6 ACL for IPv6 Traffic, on page 59
Creating a Layer 2 MAC ACL for Non-IP Traffic, on page 61
Examples: Classifying Traffic by Using ACLs, on page 105
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 23
Configuring QoS
QoS Basic Model
When you enter the class-map command, the switch enters the class-map configuration mode. In this mode,
you define the match criterion for the traffic by using the match class-map configuration command.
You can configure a default class by using the class class-default policy-map configuration command.
Unclassified traffic (traffic specified in the other traffic classes configured on the policy-map) is treated as
default traffic.
You create and name a policy map by using the policy-map global configuration command. When you enter
this command, the switch enters the policy-map configuration mode. In this mode, you specify the actions to
take on a specific traffic class by using the class, trust, or set policy-map configuration and policy-map class
configuration commands.
The policy map can contain the police and police aggregate policy-map class configuration commands, which
define the policer, the bandwidth limitations of the traffic, and the action to take if the limits are exceeded.
To enable the policy map, you attach it to a port by using the service-policy interface configuration command.
You can apply a nonhierarchical policy map to a physical port or an SVI. However, a hierarchical policy map
can only be applied to an SVI. A hierarchical policy map contains two levels. The first level, the VLAN level,
specifies the actions to be taken against a traffic flow on the SVI. The second level, the interface level, specifies
the actions to be taken against the traffic on the physical ports that belong to the SVI. The interface-level
actions are specified in the interface-level policy map.
Related Topics
Classifying Traffic by Using Class Maps, on page 63
Classifying Traffic by Using Class Maps and Filtering IPv6 Traffic, on page 66
Examples: Classifying Traffic by Using Class Maps, on page 106
Note All traffic, regardless of whether it is bridged or routed, is subjected to a policer, if one is configured. As
a result, bridged packets might be dropped or might have their DSCP or CoS fields modified when they
are policed and marked.
You can configure policing (either individual or aggregate policers) on a physical port or an SVI. When
configuring policy maps on an SVI, you can create a hierarchical policy map and can define an individual
policer only in the secondary interface-level policy map.
After you configure the policy map and policing actions, attach the policy to an ingress port or SVI by
using the service-policy interface configuration command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
24 OL-32578-01
Configuring QoS
QoS Basic Model
Related Topics
Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 80
Examples: Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 110
Policing uses a token-bucket algorithm. As each frame is received by the switch, a token is added to the bucket.
The bucket has a hole in it and leaks at a rate that you specify as the average traffic rate in bits per second.
Each time a token is added to the bucket, the switch verifies that there is enough room in the bucket. If there
is not enough room, the packet is marked as nonconforming, and the specified policer action is taken (dropped
or marked down).
How quickly the bucket fills is a function of the bucket depth (burst-byte), the rate at which the tokens are
removed (rate-bps), and the duration of the burst above the average rate. The size of the bucket imposes an
upper limit on the burst length and limits the number of frames that can be transmitted back-to-back. If the
burst is short, the bucket does not overflow, and no action is taken against the traffic flow. However, if a burst
is long and at a higher rate, the bucket overflows, and the policing actions are taken against the frames in that
burst.
You configure the bucket depth (the maximum burst that is tolerated before the bucket overflows) by using
the burst-byte option of the police policy-map class configuration command or the mls qos aggregate-policer
global configuration command. You configure how fast (the average rate) that the tokens are removed from
the bucket by using the rate-bps option of the police policy-map class configuration command or the mls qos
aggregate-policer global configuration command.
The following figure shows the policing and marking process when these types of policy maps are configured:
• A nonhierarchical policy map on a physical port.
• The interface level of a hierarchical policy map attached to an SVI. The physical ports are specified in
this secondary policy map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 25
Configuring QoS
QoS Basic Model
Related Topics
Classifying, Policing, and Marking Traffic on Physical Ports by Using Policy Maps, on page 68
Examples: Classifying, Policing, and Marking Traffic on Physical Ports Using Policy Maps, on page 107
Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 80
Examples: Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 110
SVI Policing
Note Before configuring a hierarchical policy map with individual policers on an SVI, you must enable
VLAN-based QoS on the physical ports that belong to the SVI. Though a policy map is attached to the
SVI, the individual policers only affect traffic on the physical ports specified in the secondary interface
level of the hierarchical policy map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
26 OL-32578-01
Configuring QoS
QoS Basic Model
A hierarchical policy map has two levels. The first level, the VLAN level, specifies the actions to be taken
against a traffic flow on an SVI. The second level, the interface level, specifies the actions to be taken against
the traffic on the physical ports that belong to the SVI and are specified in the interface-level policy map.
When configuring policing on an SVI, you can create and configure a hierarchical policy map with these two
levels:
• VLAN level—Create this primary level by configuring class maps and classes that specify the port trust
state or set a new DSCP or IP precedence value in the packet. The VLAN-level policy map applies only
to the VLAN in an SVI and does not support policers.
• Interface level—Create this secondary level by configuring class maps and classes that specify the
individual policers on physical ports the belong to the SVI. The interface-level policy map only supports
individual policers and does not support aggregate policers. You can configure different interface-level
policy maps for each class defined in the VLAN-level policy map.
The following figure shows the policing and marking process when hierarchical policy maps on an SVI.
Figure 5: Policing and Marking Flowchart on SVIs
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 27
Configuring QoS
QoS Basic Model
Related Topics
Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps, on page 72
Examples: Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps, on
page 108
Policing During policing stage, QoS can assign another DSCP value to an IP or a non-IP packet
(if the packet is out of profile and the policer specifies a marked-down value). This
configurable map is called the policed-DSCP map.
You configure this map by using the mls qos map policed-dscp global configuration
command.
Pre-scheduling Before the traffic reaches the scheduling stage, QoS stores the packet in an ingress
and an egress queue according to the QoS label. The QoS label is based on the DSCP
or the CoS value in the packet and selects the queue through the DSCP input and
output queue threshold maps or through the CoS input and output queue threshold
maps. In addition to an ingress or an egress queue, the QOS label also identifies the
WTD threshold value.
You configure these maps by using the mls qos srr-queue {input output} dscp-map
and the mls qos srr-queue {input output} cos-map global configuration commands.
The CoS-to-DSCP, DSCP-to-CoS, and the IP-precedence-to-DSCP maps have default values that might or
might not be appropriate for your network.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
28 OL-32578-01
Configuring QoS
QoS Basic Model
The default DSCP-to-DSCP-mutation map and the default policed-DSCP map are null maps; they map an
incoming DSCP value to the same DSCP value. The DSCP-to-DSCP-mutation map is the only map you apply
to a specific port. All other maps apply to the entire switch.
Related Topics
Mapping DSCP or CoS Values to an Egress Queue and to a Threshold ID, on page 94
Examples: Configuring Egress Queue Characteristics, on page 113
Note The switch supports 4 egress queues by default and there is an option to enable a total of 8 egress queues.
The 8 egress queue configuration is only supported on a standalone switch.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 29
Configuring QoS
QoS Basic Model
The following figure shows an example of WTD operating on a queue whose size is 1000 frames. Three drop
percentages are configured: 40 percent (400 frames), 60 percent (600 frames), and 100 percent (1000 frames).
These percentages indicate that up to 400 frames can be queued at the 40-percent threshold, up to 600 frames
at the 60-percent threshold, and up to 1000 frames at the 100-percent threshold.
Figure 7: WTD and Queue Operation
In the example, CoS values 6 and 7 have a greater importance than the other CoS values, and they are assigned
to the 100-percent drop threshold (queue-full state). CoS values 4 and 5 are assigned to the 60-percent threshold,
and CoS values 0 to 3 are assigned to the 40-percent threshold.
Suppose the queue is already filled with 600 frames, and a new frame arrives. It contains CoS values 4 and
5 and is subjected to the 60-percent threshold. If this frame is added to the queue, the threshold will be exceeded,
so the switch drops it.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
30 OL-32578-01
Configuring QoS
QoS Basic Model
Figure 8: Queueing and Scheduling Flowchart for Egress Ports on the Switch
Note If the expedite queue is enabled, SRR services it until it is empty before servicing the other three queues.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 31
Configuring QoS
QoS Basic Model
Related Topics
Allocating Buffer Space to and Setting WTD Thresholds for an Egress Queue-Set
Configuring SRR Shaped Weights on Egress Queues, on page 96
Configuring SRR Shared Weights on Egress Queues, on page 98
Configuring the Egress Expedite Queue, on page 100
Limiting the Bandwidth on an Egress Interface, on page 102
Examples: Configuring Egress Queue Characteristics, on page 113
Note If the expedite queue is enabled, SRR services it until it is empty before servicing the other three queues.
The buffer space is divided between the common pool and the reserved pool. The switch uses a buffer allocation
scheme to reserve a minimum amount of buffers for each egress queue, to prevent any queue or port from
consuming all the buffers and depriving other queues, and to control whether to grant buffer space to a
requesting queue. The switch detects whether the target queue has not consumed more buffers than its reserved
amount (under-limit), whether it has consumed all of its maximum buffers (over limit), and whether the
common pool is empty (no free buffers) or not empty (free buffers). If the queue is not over-limit, the switch
can allocate buffer space from the reserved pool or from the common pool (if it is not empty). If there are no
free buffers in the common pool or if the queue is over-limit, the switch drops the frame.
Figure 9: Egress Queue Buffer Allocation
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
32 OL-32578-01
Configuring QoS
QoS Basic Model
Note The switch supports 4 egress queues by default, although there is an option to enable a total of 8 egress
queues. Use the mls qos srr-queue output queues 8 global configuration command to enable all 8 egress
queues. Once 8 egress queues are enabled, you are able to configure thresholds and buffers for all 8 queues.
The 8 egress queue configuration is only supported on a standalone switch.
Note The switch supports 4 egress queues by default, although there is an option to enable a total of 8 egress
queues. Use the mls qos srr-queue output queues 8 global configuration command to enable all 8 egress
queues. Once 8 egress queues are enabled, you are able to configure thresholds and buffers for all 8 queues.
The 8 egress queue configuration is only supported on a standalone switch.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 33
Configuring QoS
QoS Basic Model
Note The egress queue default settings are suitable for most situations. You should change them only when you
have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.
Note The switch supports 4 egress queues by default, although there is an option to enable a total of 8 egress
queues. Use the mls qos srr-queue output queues 8 global configuration command to enable all 8 egress
queues. Once 8 egress queues are enabled, you are able to configure thresholds, buffers, bandwidth share
weights, and bandwidth shape weights for all 8 queues. The 8 egress queue configuration is only supported
on a standalone switch.
Packet Modification
A packet is classified, policed, and queued to provide QoS. The following packet modifications can occur
during the process to provide QoS:
• For IP and non-IP packets, classification involves assigning a QoS label to a packet based on the DSCP
or CoS of the received packet. However, the packet is not modified at this stage; only an indication of
the assigned DSCP or CoS value is carried along.
• During policing, IP and non-IP packets can have another DSCP assigned to them (if they are out of
profile and the policer specifies a markdown DSCP). Once again, the DSCP in the packet is not modified,
but an indication of the marked-down value is carried along. For IP packets, the packet modification
occurs at a later stage; for non-IP packets the DSCP is converted to CoS and used for queueing and
scheduling decisions.
• Depending on the QoS label assigned to a frame and the mutation chosen, the DSCP and CoS values of
the frame are rewritten. If you do not configure a table map and if you configure the port to trust the
DSCP of the incoming frame, the DSCP value in the frame is not changed, but the CoS is rewritten
according to the DSCP-to-CoS map. If you configure the port to trust the CoS of the incoming frame
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
34 OL-32578-01
Configuring QoS
Standard QoS Default Configuration
and it is an IP packet, the CoS value in the frame is not changed, but the DSCP might be changed
according to the CoS-to-DSCP map.
The input mutation causes the DSCP to be rewritten depending on the new value of DSCP chosen. The
set action in a policy map also causes the DSCP to be rewritten.
Related Topics
Enabling QoS Globally, on page 41
Bandwidth allocation 4 4
The following table shows the default CoS input queue threshold map when QoS is enabled.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 35
Configuring QoS
Standard QoS Default Configuration
5 2–1
6, 7 1–1
The following table shows the default DSCP input queue threshold map when QoS is enabled.
40–47 2–1
48–63 1–1
Note The switch supports 4 egress queues by default, although there is an option to enable a total of 8 egress
queues. Use the mls qos srr-queue output queues 8 global configuration command to enable all 8 egress
queues. Once 8 egress queues are enabled, you are able to configure thresholds and buffers for all 8 queues.
The 8 egress queue configuration is only supported on a standalone switch.
The following table shows the default egress queue configuration for each queue-set when QoS is enabled.
All ports are mapped to queue-set 1. The port bandwidth limit is set to 100 percent and rate unlimited. Note
that for the SRR shaped weights (absolute) feature, a shaped weight of zero indicates that the queue is operating
in shared mode. Note that for the SRR shared weights feature, one quarter of the bandwidth is allocated to
each queue.
WTD drop threshold 1 100 percent 200 percent 100 percent 100 percent
WTD drop threshold 2 100 percent 200 percent 100 percent 100 percent
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
36 OL-32578-01
Configuring QoS
Standard QoS Default Configuration
Maximum threshold 400 percent 400 percent 400 percent 400 percent
The following table shows the default CoS output queue threshold map when QoS is enabled.
2, 3 3–1
4 4–1
5 1–1
6, 7 4–1
The following table shows the default DSCP output queue threshold map when QoS is enabled.
16–31 3–1
32–39 4–1
40–47 1–1
48–63 4–1
The following table displays the default egress queue configuration when the 8 egress queue configuration is
enabled using the mls qos srr-queue output queues 8 command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 37
Configuring QoS
Standard QoS Default Configuration
SRR 25 0 0 0 0 0 0 0
shaped
weights
SRR 25 25 25 25 25 25 25 25
shared
weights
The following table displays the default CoS output queue threshold map when QoS is enabled and the 8
egress queue configuration is enabled using the mls qos srr-queue output queues 8 command.
1 3 1 2
2 4 1 3
3 5 1 3
4 6 1 4
5 1 1 1
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
38 OL-32578-01
Configuring QoS
DSCP Maps
7 8 1 4
The following table displays the default DSCP output queue threshold map when QoS is enabled and the 8
egress queue configuration is enabled using the mls qos srr-queue output queues 8 command.
8-15 3 1 2
16-23 4 1 3
24-31 5 1 3
32-39 6 1 4
40-47 1 1 1
48-55 7 1 4
56-63 8 1 4
DSCP Maps
Related Topics
Configuring the CoS-to-DSCP Map, on page 83
Configuring the IP-Precedence-to-DSCP Map, on page 85
Configuring the Policed-DSCP Map, on page 86
Configuring the DSCP-to-CoS Map, on page 87
Configuring the DSCP-to-DSCP-Mutation Map, on page 89
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 39
Configuring QoS
DSCP Maps
1 8
2 16
3 24
4 32
5 40
6 48
7 56
1 8
2 16
3 24
4 32
5 40
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
40 OL-32578-01
Configuring QoS
How to Configure QoS
7 56
8–15 1
16–23 2
24–31 3
32–39 4
40–47 5
48–55 6
56–63 7
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 41
Configuring QoS
Enabling QoS Globally
SUMMARY STEPS
1. configure terminal
2. mls qos
3. end
4. show mls qos
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Example:
Switch(config)# end
Example:
Switch# show mls qos
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Related Topics
Standard QoS Default Configuration, on page 35
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
42 OL-32578-01
Configuring QoS
Enabling VLAN-Based QoS on Physical Ports
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. mls qos vlan-based
4. end
5. show mls qos interface interface-id
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the physical port, and enter interface
configuration mode.
Example:
Switch(config)# interface
gigabitethernet 1/0/1
Example:
Switch(config-if)# end
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 43
Configuring QoS
Configuring Classification Using Port Trust States
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Note Depending on your network configuration, you must perform one or more of these tasks in this module
or one or more of the tasks in the Configuring a QoS Policy.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
44 OL-32578-01
Configuring QoS
Configuring Classification Using Port Trust States
Figure 10: Port Trusted States on Ports Within the QoS Domain
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. mls qos trust [cos | dscp | ip-precedence]
4. end
5. show mls qos interface
6. copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 45
Configuring QoS
Configuring Classification Using Port Trust States
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the port to be trusted, and enters interface configuration mode.
Valid interfaces are physical ports.
Example:
Switch(config)# interface
gigabitethernet 1/0/2
Step 3 mls qos trust [cos | dscp | ip-precedence] Configures the port trust state.
By default, the port is not trusted. If no keyword is specified, the default is
Example: dscp.
Switch(config-if)# mls qos trust The keywords have these meanings:
cos
• cos—Classifies an ingress packet by using the packet CoS value. For
an untagged packet, the port default CoS value is used. The default
port CoS value is 0.
• dscp—Classifies an ingress packet by using the packet DSCP value.
For a non-IP packet, the packet CoS value is used if the packet is
tagged; for an untagged packet, the default port CoS is used. Internally,
the switch maps the CoS value to a DSCP value by using the
CoS-to-DSCP map.
• ip-precedence—Classifies an ingress packet by using the packet
IP-precedence value. For a non-IP packet, the packet CoS value is used
if the packet is tagged; for an untagged packet, the default port CoS is
used. Internally, the switch maps the CoS value to a DSCP value by
using the CoS-to-DSCP map.
To return a port to its untrusted state, use the no mls qos trust interface
configuration command.
Example:
Switch(config-if)# end
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
46 OL-32578-01
Configuring QoS
Configuring Classification Using Port Trust States
Example:
Switch# show mls qos interface
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Related Topics
Example: Configuring Port to the DSCP-Trusted State and Modifying the DSCP-to-DSCP-Mutation Map,
on page 104
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. mls qos cos {default-cos | override}
4. end
5. show mls qos interface
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 47
Configuring QoS
Configuring Classification Using Port Trust States
Step 3 mls qos cos {default-cos | override} Configures the default CoS value for the port.
• For default-cos, specify a default CoS value to be assigned to a port. If
Example: the packet is untagged, the default CoS value becomes the packet CoS
Switch(config-if)# mls qos value. The CoS range is 0 to 7. The default is 0.
override
• Use the override keyword to override the previously configured trust
state of the incoming packet and to apply the default port CoS value to
the port on all incoming packets. By default, CoS override is disabled.
Use the override keyword when all incoming packets on specified ports
deserve higher or lower priority than packets entering from other ports.
Even if a port was previously set to trust DSCP, CoS, or IP precedence,
this command overrides the previously configured trust state, and all
the incoming CoS values are assigned the default CoS value configured
with this command. If an incoming packet is tagged, the CoS value of
the packet is modified with the default CoS of the port at the ingress
port.
Note To return to the default setting, use the no mls qos cos {default-cos
| override} interface configuration command.
Step 4 end Returns to privileged EXEC mode.
Example:
Switch(config-if)# end
Example:
Switch# show mls qos interface
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
48 OL-32578-01
Configuring QoS
Configuring Classification Using Port Trust States
Related Topics
Example: Configuring Port to the DSCP-Trusted State and Modifying the DSCP-to-DSCP-Mutation Map,
on page 104
SUMMARY STEPS
1. configure terminal
2. cdp run
3. interface interface-id
4. cdp enable
5. Use one of the following:
• mls qos trust cos
• mls qos trust dscp
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 49
Configuring QoS
Configuring Classification Using Port Trust States
DETAILED STEPS
Example:
Switch# configure terminal
Example:
Switch(config)# cdp run
Step 3 interface interface-id Specifies the port connected to the Cisco IP Phone, and enters
interface configuration mode.
Example: Valid interfaces include physical ports.
Switch(config)# interface
gigabitethernet 2/1/1
Step 4 cdp enable Enables CDP on the port. By default, CDP is enabled.
Example:
Switch(config-if)# cdp enable
Step 5 Use one of the following: Configures the switch port to trust the CoS value in traffic
received from the Cisco IP Phone.
• mls qos trust cos
or
• mls qos trust dscp
Configures the routed port to trust the DSCP value in traffic
received from the Cisco IP Phone.
Example: By default, the port is not trusted.
Switch(config-if)# mls qos trust cos
Step 6 mls qos trust device cisco-phone Specifies that the Cisco IP Phone is a trusted device.
You cannot enable both trusted boundary and auto-QoS (auto
Example: qos voip interface configuration command) at the same time;
Switch(config-if)# mls qos trust they are mutually exclusive.
device cisco-phone
Note To disable the trusted boundary feature, use the no mls
qos trust device interface configuration command.
Step 7 end Returns to privileged EXEC mode.
Example:
Switch(config-if)# end
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
50 OL-32578-01
Configuring QoS
Configuring Classification Using Port Trust States
Example:
Switch# show mls qos interface
Step 9 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy running-config
startup-config
Related Topics
Example: Configuring Port to the DSCP-Trusted State and Modifying the DSCP-to-DSCP-Mutation Map,
on page 104
SUMMARY STEPS
1. configure terminal
2. mls qos
3. no mls qos rewrite ip dscp
4. end
5. show mls qos interface [interface-id]
6. copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 51
Configuring QoS
Configuring Classification Using Port Trust States
DETAILED STEPS
Example:
Switch# configure terminal
Example:
Switch(config)# mls qos
Step 3 no mls qos rewrite ip dscp Enables DSCP transparency. The switch is
configured to not modify the DSCP field of the IP
Example: packet.
Example:
Switch(config)# end
Example:
Switch# show mls qos interface gigabitethernet
2/1/1
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration
file.
Example:
Switch# copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
52 OL-32578-01
Configuring QoS
Configuring Classification Using Port Trust States
If you enter the no mls qos rewrite ip dscp global configuration command to enable DSCP transparency and
then enter the mls qos trust [cos | dscp] interface configuration command, DSCP transparency is still enabled.
Configuring the DSCP Trust State on a Port Bordering Another QoS Domain
If you are administering two separate QoS domains between which you want to implement QoS features for
IP traffic, you can configure the switch ports bordering the domains to a DSCP-trusted state. The receiving
port accepts the DSCP-trusted value and avoids the classification stage of QoS. If the two domains use different
DSCP values, you can configure the DSCP-to-DSCP-mutation map to translate a set of DSCP values to match
the definition in the other domain.
Beginning in privileged EXEC mode, follow these steps to configure the DSCP-trusted state on a port and
modify the DSCP-to-DSCP-mutation map. To ensure a consistent mapping strategy across both QoS domains,
you must perform this procedure on the ports in both domains.
SUMMARY STEPS
1. configure terminal
2. mls qos map dscp-mutation dscp-mutation-name in-dscp to out-dscp
3. interface interface-id
4. mls qos trust dscp
5. mls qos dscp-mutation dscp-mutation-name
6. end
7. show mls qos maps dscp-mutation
8. copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 53
Configuring QoS
Configuring Classification Using Port Trust States
DETAILED STEPS
Example:
Switch# configure terminal
Step 3 interface interface-id Specifies the port to be trusted, and enter interface configuration mode.
Valid interfaces include physical ports.
Example:
Switch(config)# interface
gigabitethernet1/0/2
Step 4 mls qos trust dscp Configures the ingress port as a DSCP-trusted port. By default, the port
is not trusted.
Example: Note To return a port to its non-trusted state, use the no mls qos
Switch(config-if)# mls qos trust dscp trust interface configuration command.
Step 5 mls qos dscp-mutation dscp-mutation-name Applies the map to the specified ingress DSCP-trusted port.
For dscp-mutation-name, specify the mutation map name created in
Example: Step 2.
Switch(config-if)# mls qos dscp-mutation You can configure multiple DSCP-to-DSCP-mutation maps on an ingress
gigabitethernet1/0/2-mutation
port.
Note To return to the default DSCP-to-DSCP-mutation map values,
use the no mls qos map dscp-mutation dscp-mutation-name
global configuration command.
Step 6 end Returns to privileged EXEC mode.
Example:
Switch(config-if)# end
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
54 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Example:
Switch# show mls qos maps
dscp-mutation
Step 8 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Note To return a port to its non-trusted state, use the no mls qos
Example: trust interface configuration command. To return to the default
Switch# copy-running-config DSCP-to-DSCP-mutation map values, use the no mls qos map
startup-config dscp-mutation dscp-mutation-name global configuration
command.
These sections describe how to classify, police, and mark traffic. Depending on your network configuration,
you must perform one or more of the modules in this section.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 55
Configuring QoS
Configuring a QoS Policy
SUMMARY STEPS
1. configure terminal
2. access-list access-list-number {deny | permit} source [source-wildcard]
3. end
4. show access-lists
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 access-list access-list-number {deny | Creates an IP standard ACL, repeating the command as many times as
permit} source [source-wildcard] necessary.
• For access-list-number, enter the access list number. The range is 1
Example: to 99 and 1300 to 1999.
Switch(config)# access-list 1
permit 192.2.255.0 1.1.1.255 • Use the permit keyword to permit a certain type of traffic if the
conditions are matched. Use the deny keyword to deny a certain type
of traffic if conditions are matched.
• For source, enter the network or host from which the packet is being
sent. You can use the any keyword as an abbreviation for 0.0.0.0
255.255.255.255.
• (Optional) For source-wildcard, enter the wildcard bits in dotted
decimal notation to be applied to the source. Place ones in the bit
positions that you want to ignore.
When you create an access list, remember that by default the end of the
access list contains an implicit deny statement for everything if it did not
find a match before reaching the end.
Note To delete an access list, use the no access-list access-list-number
global configuration command.
Step 3 end Returns to privileged EXEC mode.
Example:
Switch(config)# end
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
56 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Example:
Switch# show access-lists
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
Access Control Lists, on page 22
Examples: Classifying Traffic by Using ACLs, on page 105
SUMMARY STEPS
1. configure terminal
2. access-list access-list-number {deny | permit} protocol source source-wildcard destination
destination-wildcard
3. end
4. show access-lists
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 access-list access-list-number {deny | Creates an IP extended ACL, repeating the command as many times as necessary.
permit} protocol source
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 57
Configuring QoS
Configuring a QoS Policy
When creating an access list, remember that, by default, the end of the access list
contains an implicit deny statement for everything if it did not find a match before
reaching the end.
Note To delete an access list, use the no access-list access-list-number global
configuration command.
Step 3 end Returns to privileged EXEC mode.
Example:
Switch(config)# end
Example:
Switch# show access-lists
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
58 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Related Topics
Access Control Lists, on page 22
Examples: Classifying Traffic by Using ACLs, on page 105
SUMMARY STEPS
1. configure terminal
2. ipv6 access-list access-list-name
3. {deny | permit} protocol {source-ipv6-prefix/prefix-length | any | host source-ipv6-address} [operator
[port-number]] {destination-ipv6-prefix/ prefix-length | any | host destination-ipv6-address} [operator
[port-number]] [dscp value] [fragments] [log] [log-input] [routing] [sequence value] [time-range name]
4. end
5. show ipv6 access-list
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 ipv6 access-list access-list-name Creates an IPv6 ACL and enters IPv6 access-list configuration mode.
Accesses list names cannot contain a space or quotation mark or begin with a
Example: numeric.
Switch(config)# ipv6 Note To delete an access list, use the no ipv6 access-list access-list-number
access-list ipv6_Name_ACL
global configuration command.
Step 3 {deny | permit} protocol Enters deny or permit to specify whether to deny or permit the packet if conditions
{source-ipv6-prefix/prefix-length | any are matched. These are the conditions:
| host source-ipv6-address} [operator For protocol, enter the name or number of an Internet protocol: ahp, esp, icmp,
[port-number]] {destination-ipv6-prefix/ ipv6, pcp, stcp, tcp, or udp, or an integer in the range 0 to 255 representing an
prefix-length | any | host IPv6 protocol number.
destination-ipv6-address} [operator
[port-number]] [dscp value] [fragments] • The source-ipv6-prefix/prefix-length or destination-ipv6-prefix/ prefix-length
[log] [log-input] [routing] [sequence is the source or destination IPv6 network or class of networks for which to
value] [time-range name] set deny or permit conditions, specified in hexadecimal and using 16-bit
values between colons (see RFC 2373).
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 59
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-ipv6-acl)# end
Example:
Switch# show ipv6
access-list
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
60 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Example:
Switch# copy-running-config
startup-config
Related Topics
Access Control Lists, on page 22
Examples: Classifying Traffic by Using ACLs, on page 105
SUMMARY STEPS
1. configure terminal
2. mac access-list extended name
3. {permit | deny} {host src-MAC-addr mask | any | host dst-MAC-addr | dst-MAC-addr mask} [type mask]
4. end
5. show access-lists [access-list-number | access-list-name]
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mac access-list extended name Creates a Layer 2 MAC ACL by specifying the name of the list.
After entering this command, the mode changes to extended MAC ACL
Example: configuration.
Switch(config)# mac access-list Note To delete an access list, use the no mac access-list extended
extended maclist1
access-list-name global configuration command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 61
Configuring QoS
Configuring a QoS Policy
When creating an access list, remember that, by default, the end of the access
list contains an implicit deny statement for everything if it did not find a
match before reaching the end.
Example:
Switch(config-ext-mac1)# end
Example:
Switch# show access-lists
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
62 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Related Topics
Access Control Lists, on page 22
Examples: Classifying Traffic by Using ACLs, on page 105
Note You can also create class maps during policy map creation by using the class policy-map configuration
command.
SUMMARY STEPS
1. configure terminal
2. Use one of the following:
• access-list access-list-number {deny | permit} source [source-wildcard]
• access-list access-list-number {deny | permit} protocol source [source-wildcard] destination
[destination-wildcard]
• ipv6 access-list access-list-name {deny | permit} protocol {source-ipv6-prefix/prefix-length | any
| host source-ipv6-address} [operator [port-number]] {destination-ipv6-prefix/ prefix-length | any
| host destination-ipv6-address} [operator [port-number]] [dscp value] [fragments] [log] [log-input]
[routing] [sequence value] [time-range name]
• mac access-list extended name {permit | deny} {host src-MAC-addr mask | any | host dst-MAC-addr
| dst-MAC-addr mask} [type mask]
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 63
Configuring QoS
Configuring a QoS Policy
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 Use one of the following: Creates an IP standard or extended ACL, an IPv6 ACL for IP traffic,
or a Layer 2 MAC ACL for non-IP traffic, repeating the command
• access-list access-list-number {deny | permit} as many times as necessary.
source [source-wildcard]
When creating an access list, remember that, by default, the end of
• access-list access-list-number {deny | permit} the access list contains an implicit deny statement for everything if
protocol source [source-wildcard] destination it did not find a match before reaching the end.
[destination-wildcard]
• ipv6 access-list access-list-name {deny |
permit} protocol
{source-ipv6-prefix/prefix-length | any | host
source-ipv6-address} [operator
[port-number]] {destination-ipv6-prefix/
prefix-length | any | host
destination-ipv6-address} [operator
[port-number]] [dscp value] [fragments] [log]
[log-input] [routing] [sequence value]
[time-range name]
• mac access-list extended name {permit |
deny} {host src-MAC-addr mask | any | host
dst-MAC-addr | dst-MAC-addr mask} [type
mask]
Example:
Switch(config)# access-list 103 permit ip
any
any dscp 10
Step 3 class-map [match-all | match-any] class-map-name Creates a class map, and enters class-map configuration mode.
By default, no class maps are defined.
Example:
• (Optional) Use the match-all keyword to perform a logical-AND
Switch(config)# class-map class1 of all matching statements under this class map. All match
criteria in the class map must be matched.
• (Optional) Use the match-any keyword to perform a logical-OR
of all matching statements under this class map. One or more
match criteria must be matched.
• For class-map-name, specify the name of the class map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
64 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Example:
Only one match criterion per class map is supported, and only one
ACL per class map is supported.
Switch(config-cmap)# match ip dscp 10 11 12
• For access-group acl-index-or-name, specify the number or
name of the ACL created in Step 2.
• To filter IPv6 traffic with the match access-group command,
create an IPv6 ACL, as described in Step 2.
• For ip dscp dscp-list, enter a list of up to eight IP DSCP values
to match against incoming packets. Separate each value with a
space. The range is 0 to 63.
• For ip precedence ip-precedence-list, enter a list of up to eight
IP-precedence values to match against incoming packets.
Separate each value with a space. The range is 0 to 7.
Example:
Switch(config-cmap)# end
Example:
Switch# show class-map
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 65
Configuring QoS
Configuring a QoS Policy
Related Topics
Classification Based on Class Maps and Policy Maps, on page 23
Examples: Classifying Traffic by Using Class Maps, on page 106
Note IPv6 QoS is not supported on switches running the LAN base feature set.
To apply the primary match criteria to only IPv4 traffic, use the match protocol command with the ip keyword.
To apply the primary match criteria to only IPv6 traffic, use the match protocol command with the ipv6
keyword.
SUMMARY STEPS
1. configure terminal
2. class-map {match-all} class-map-name
3. match protocol [ip | ipv6]
4. match {ip dscp dscp-list | ip precedence ip-precedence-list}
5. end
6. show class-map
7. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 class-map {match-all} class-map-name Creates a class map, and enters class-map configuration mode.
By default, no class maps are defined.
Example:
When you use the match protocol command, only the match-all keyword
Switch(config)# class-map cm-1 is supported.
• For class-map-name, specify the name of the class map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
66 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Switch(config-cmap)# match protocol • When you use the match protocol command, only the match-all
ip keyword is supported for the class-map command.
Note You can also match the following protocols: ARP, CDP, and HTTP.
Step 4 match {ip dscp dscp-list | ip precedence Defines the match criterion to classify traffic.
ip-precedence-list} By default, no match criterion is defined.
Example:
Switch(config-cmap)# end
Example:
Switch# show class-map
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
Classification Based on Class Maps and Policy Maps, on page 23
Examples: Classifying Traffic by Using Class Maps, on page 106
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 67
Configuring QoS
Configuring a QoS Policy
Classifying, Policing, and Marking Traffic on Physical Ports by Using Policy Maps
You can configure a policy map on a physical port that specifies which traffic class to act on. Actions can
include trusting the CoS, DSCP, or IP precedence values in the traffic class; setting a specific DSCP or IP
precedence value in the traffic class; and specifying the traffic bandwidth limitations for each matched traffic
class (policer) and the action to take when the traffic is out of profile (marking).
A policy map also has these characteristics:
• A policy map can contain multiple class statements, each with different match criteria and policers.
• A policy map can contain a predefined default traffic class explicitly placed at the end of the map.
• A separate policy-map class can exist for each type of traffic received through a port.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
68 OL-32578-01
Configuring QoS
Configuring a QoS Policy
SUMMARY STEPS
1. configure terminal
2. class-map [match-all | match-any] class-map-name
3. policy-map policy-map-name
4. class [class-map-name | class-default]
5. trust [cos | dscp | ip-precedence]
6. set {dscp new-dscp | ip precedence new-precedence}
7. police rate-bps burst-byte [exceed-action {drop | policed-dscp-transmit}]
8. exit
9. exit
10. interface interface-id
11. service-policy input policy-map-name
12. end
13. show policy-map [policy-map-name [class class-map-name]]
14. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 class-map [match-all | match-any] Creates a class map, and enters class-map configuration mode.
class-map-name By default, no class maps are defined.
Step 3 policy-map policy-map-name Creates a policy map by entering the policy map name, and enters policy-map
configuration mode.
Example: By default, no policy maps are defined.
Switch(config-cmap)# policy-map
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 69
Configuring QoS
Configuring a QoS Policy
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
70 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Switch(config-pmap-c)# set dscp Note To remove an assigned DSCP or IP precedence value, use the no set
45
{dscp new-dscp | ip precedence new-precedence} policy-map
configuration command.
Step 7 police rate-bps burst-byte Defines a policer for the classified traffic.
[exceed-action {drop | By default, no policer is defined.
policed-dscp-transmit}]
• For rate-bps, specify average traffic rate in bits per second (b/s). The range
Example: is 8000 to 10000000000.
Switch(config-pmap-c)# police • For burst-byte, specify the normal burst size in bytes. The range is 8000 to
100000 1000000.
80000 drop
• (Optional) Specifies the action to take when the rates are exceeded. Use the
exceed-action drop keywords to drop the packet. Use the exceed-action
policed-dscp-transmit keywords to mark down the DSCP value (by using
the policed-DSCP map) and to send the packet.
Example:
Switch(config-pmap-c)# exit
Example:
Switch(config-pmap)# exit
Step 10 interface interface-id Specifies the port to attach to the policy map, and enters interface configuration
mode.
Example: Valid interfaces include physical ports.
Switch(config)# interface
gigabitethernet 2/0/1
Step 11 service-policy input Specifies the policy-map name, and applies it to an ingress port.
policy-map-name Only one policy map per ingress port is supported.
Example:
Note To remove the policy map and port association, use the no service-policy
input policy-map-name interface configuration command.
Switch(config-if)#
service-policy
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 71
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-if)# end
Example:
Switch# show policy-map
Step 14 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
Physical Port Policing, on page 25
Examples: Classifying, Policing, and Marking Traffic on Physical Ports Using Policy Maps, on page 107
Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps
You can configure hierarchical policy maps on SVIs, but not on other types of interfaces. Hierarchical policing
combines the VLAN- and interface-level policy maps to create a single policy map.
You can configure hierarchical policy maps on SVIs, but not on other types of interfaces. Hierarchical policing
combines the VLAN- and interface-level policy maps to create a single policy map.
On an SVI, the VLAN-level policy map specifies which traffic class to act on. Actions can include trusting
the CoS, DSCP, or IP precedence values or setting a specific DSCP or IP precedence value in the traffic class.
Use the interface-level policy map to specify the physical ports that are affected by individual policers.
You can configure hierarchical policy maps that filter IPv4 and IPv6 traffic.
Follow these guidelines when configuring hierarchical policy maps:
• Before configuring a hierarchical policy map, you must enable VLAN-based QoS on the physical ports
that are to be specified at the interface level of the policy map.
• You can attach only one policy map per ingress port or SVI.
• A policy map can contain multiple class statements, each with different match criteria and actions.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
72 OL-32578-01
Configuring QoS
Configuring a QoS Policy
• A separate policy-map class can exist for each type of traffic received on the SVI.
• In a switch stack, you cannot use the match input-interface class-map configuration command to
specify interfaces across stack members in a policy-map class.
• A policy-map and a port trust state can both run on a physical interface. The policy-map is applied before
the port trust state.
• If you configure the IP-precedence-to-DSCP map by using the mls qos map ip-prec-dscp dscp1...dscp8
global configuration command, the settings only affect packets on ingress interfaces that are configured
to trust the IP precedence value. In a policy map, if you set the packet IP precedence value to a new
value by using the set ip precedence new-precedence policy-map class configuration command, the
egress DSCP value is not affected by the IP-precedence-to-DSCP map. If you want the egress DSCP
value to be different than the ingress value, use the set dscp new-dscp policy-map class configuration
command.
• If you enter or have used the set ip dscp command, the switch changes this command to set dscp in its
configuration. If you enter the set ip dscp command, this setting appears as set dscp in the switch
configuration.
• You can use the set ip precedence or the set precedence policy-map class configuration command to
change the packet IP precedence value. This setting appears as set ip precedence in the switch
configuration.
• If VLAN-based QoS is enabled, the hierarchical policy map supersedes the previously configured
port-based policy map.
• The hierarchical policy map is attached to the SVI and affects all traffic in the VLAN. The actions
specified in the VLAN-level policy map affect the traffic belonging to the SVI. The police action on the
port-level policy map affects the ingress traffic on the affected physical interfaces.
• When configuring a hierarchical policy map on trunk ports, the VLAN ranges must not overlap. If the
ranges overlap, the actions specified in the policy map affect the incoming and outgoing traffic on the
overlapped VLANs.
• Aggregate policers are not supported in hierarchical policy maps.
• When VLAN-based QoS is enabled, the switch supports VLAN-based features, such as the VLAN map.
• You can configure a hierarchical policy map only on the primary VLAN of a private VLAN.
• When you enable VLAN-based QoS and configure a hierarchical policy map in a switch stack, these
automatic actions occur when the stack configuration changes:
◦When a new stack master is selected, the stack master reenables and reconfigures these features
on all applicable interfaces on the stack master.
◦When a stack member is added, the stack master reenables and reconfigures these features on all
applicable ports on the stack member.
◦When you merge switch stacks, the new stack master reenables and reconfigures these features on
the switches in the new stack.
◦When the switch stack divides into two or more switch stacks, the stack master in each switch
stack re-enables and reconfigures these features on all applicable interfaces on the stack members,
including the stack master.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 73
Configuring QoS
Configuring a QoS Policy
◦When you configure a default traffic class by using the class class-default policy-map configuration
command, unclassified traffic (traffic that does not meet the match criteria specified in the traffic
classes) is treated as default traffic class (class-default).
SUMMARY STEPS
1. configure terminal
2. class-map [match-all | match-any] class-map-name
3. match {access-group acl-index-or-name | ip dscp dscp-list | ip precedence ip-precedence-list}
4. match protocol [ip | ipv6]
5. exit
6. exit
7. class-map [match-all | match-any] class-map-name
8. match input-interface interface-id-list
9. exit
10. exit
11. policy-map policy-map-name
12. class-map class-map-name
13. police rate-bps burst-byte [exceed-action {drop | policed-dscp-transmit}]
14. exit
15. exit
16. policy-map policy-map-name
17. class [class-map-name | class-default]
18. trust [cos | dscp | ip-precedence]
19. set {dscp new-dscp | ip precedence new-precedence}
20. service-policy policy-map-name
21. exit
22. exit
23. interface interface-id
24. service-policy input policy-map-name
25. end
26. show policy-map [policy-map-name [class class-map-name]] or show mls qos vlan-based
27. copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
74 OL-32578-01
Configuring QoS
Configuring a QoS Policy
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 class-map [match-all | match-any] Creates a VLAN-level class map, and enters class-map configuration mode.
class-map-name By default, no class maps are defined.
Switch(config-cmap)# match ip • For access-group acl-index-or-name, specify the number or name of the
dscp 10 ACL.
• For ip dscp dscp-list, enter a list of up to eight IP DSCP values to match
against incoming packets. Separate each value with a space. The range is 0
to 63.
• For ip precedence ip-precedence-list, enter a list of up to eight IP-precedence
values to match against incoming packets. Separate each value with a space.
The range is 0 to 7.
Step 4 match protocol [ip | ipv6] (Optional) Specifies the IP protocol to which the class map applies.
• Use the argument ip to specify IPv4 traffic, and ipv6 to specify IPv6 traffic.
Example:
• When you use the match protocol command, only the match-all keyword
Switch(config-cmap)# match
protocol ipv6 is supported for the first level class map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 75
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-cmap)# exit
Example:
Switch(config)# exit
Step 7 class-map [match-all | match-any] Creates an interface-level class map, and enters class-map configuration mode.
class-map-name By default, no class maps are defined.
Step 8 match input-interface Specifies the physical ports on which the interface-level class map acts. You can
interface-id-list specify up to six ports as follows:
• A single port (counts as one entry)
Example:
• A list of ports separated by a space (each port counts as an entry)
Switch(config-cmap)# match
input-interface gigabitethernet • A range of ports separated by a hyphen (counts as two entries)
3/0/1-3/0/2
This command can only be used in the child-level policy map and must be the
only match condition in the child-level policy map.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
76 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-cmap)# exit
Example:
Switch(config)# exit
Step 11 policy-map policy-map-name Creates an interface-level policy map by entering the policy-map name, and enters
policy-map configuration mode.
Example: By default, no policy maps are defined, and no policing is performed.
Switch# policy-map port-plcmap To delete an existing policy map, use the no policy-map policy-map-name global
configuration command. To delete an existing class map, use the no class
class-map-name policy-map configuration command.
To return to the untrusted state in a policy map, use the no trust policy-map
configuration command. To remove an assigned DSCP or IP precedence value,
use the no set {dscp new-dscp | ip precedence new-precedence} policy-map
configuration command.
Step 12 class-map class-map-name Defines an interface-level traffic classification, and enters policy-map configuration
mode.
Example: By default, no policy-map class-maps are defined.
Switch(config-pmap)# class If a traffic class has already been defined by using the class-map global
cm-interface-1
configuration command, specify its name for class-map-name in this command.
Step 13 police rate-bps burst-byte Defines an individual policer for the classified traffic.
[exceed-action {drop | By default, no policer is defined.
policed-dscp-transmit}]
• For rate-bps, specify average traffic rate in bits per second (b/s). The range
Example: is 8000 to 10000000000.
Switch(config-pmap-c)# police • For burst-byte, specify the normal burst size in bytes. The range is 8000 to
900000 1000000.
9000 exceed-action
policed-dscp-transmit • (Optional) Specifies the action to take when the rates are exceeded. Use the
exceed-action drop keywords to drop the packet. Use the exceed-action
policed-dscp-transmit keywords to mark down the DSCP value (by using
the policed-DSCP map) and to send the packet.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 77
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-pmap-c)# exit
Example:
Switch(config-pmap)# exit
Step 16 policy-map policy-map-name Creates a VLAN-level policy map by entering the policy-map name, and enters
policy-map configuration mode.
Example: By default, no policy maps are defined.
Switch(config)# policy-map The default behavior of a policy map is to set the DSCP to 0 if the packet is an
vlan-plcmap
IP packet and to set the CoS to 0 if the packet is tagged. No policing is performed.
Step 17 class [class-map-name | class-default] Defines a VLAN-level traffic classification, and enters policy-map class
configuration mode.
Example: By default, no policy-map class-maps are defined.
Switch(config-pmap)# class cm-1 If a traffic class has already been defined by using the class-map global
configuration command, specify its name for class-map-name in this command.
A class-default traffic class is pre-defined and can be added to any policy. It is
always placed at the end of a policy map. With an implied match any included
in the class-default class, all packets that have not already matched the other
traffic classes will match class-default.
Step 18 trust [cos | dscp | ip-precedence] Configures the trust state, which QoS uses to generate a CoS-based or DSCP-based
QoS label.
Example: This command is mutually exclusive with the set command within the same policy
Switch(config-pmap-c)# trust map. If you enter the trust command, omit Step 18.
dscp
By default, the port is not trusted. If no keyword is specified when the command
is entered, the default is dscp.
The keywords have these meanings:
• cos—QoS derives the DSCP value by using the received or default port CoS
value and the CoS-to-DSCP map.
• dscp—QoS derives the DSCP value by using the DSCP value from the
ingress packet. For non-IP packets that are tagged, QoS derives the DSCP
value by using the received CoS value; for non-IP packets that are untagged,
QoS derives the DSCP value by using the default port CoS value. In either
case, the DSCP value is derived from the CoS-to-DSCP map.
• ip-precedence—QoS derives the DSCP value by using the IP precedence
value from the ingress packet and the IP-precedence-to-DSCP map. For
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
78 OL-32578-01
Configuring QoS
Configuring a QoS Policy
Step 19 set {dscp new-dscp | ip precedence Classifies IP traffic by setting a new value in the packet.
new-precedence}
• For dscp new-dscp, enter a new DSCP value to be assigned to the classified
traffic. The range is 0 to 63.
Example:
• For ip precedence new-precedence, enter a new IP-precedence value to be
Switch(config-pmap-c)# set dscp
10 assigned to the classified traffic. The range is 0 to 7.
Step 20 service-policy policy-map-name Specifies the interface-level policy-map name (from Step 10) and associate it
with the VLAN-level policy map.
Example: If the VLAN-level policy map specifies more than one class, each class can have
Switch(config-pmap-c)# a different service-policy policy-map-name command.
service-policy
port-plcmap-1
Example:
Switch(config-pmap-c)# exit
Example:
Switch(config-pmap)# exit
Step 23 interface interface-id Specifies the SVI to which to attach the hierarchical policy map, and enters
interface configuration mode.
Example:
Switch(config)# interface vlan
10
Step 24 service-policy input Specifies the VLAN-level policy-map name, and applies it to the SVI. Repeat the
policy-map-name previous step and this command to apply the policy map to other SVIs.
If the hierarchical VLAN-level policy map has more than one interface-level
Example: policy map, all class maps must be configured to the same VLAN-level policy
Switch(config-if)# map specified in the service-policy policy-map-name command.
service-policy
input vlan-plcmap Note To remove the hierarchical policy map and port associations, use the no
service-policy input policy-map-name interface configuration command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 79
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config-if)# end
Example:
Switch# show mls qos vlan-based
Step 27 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
SVI Policing, on page 26
Examples: Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps, on
page 108
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
80 OL-32578-01
Configuring QoS
Configuring a QoS Policy
SUMMARY STEPS
1. configure terminal
2. mls qos aggregate-policer aggregate-policer-name rate-bps burst-byte exceed-action {drop |
policed-dscp-transmit}
3. class-map [match-all | match-any] class-map-name
4. policy-map policy-map-name
5. class [class-map-name | class-default]
6. police aggregate aggregate-policer-name
7. exit
8. interface interface-id
9. service-policy input policy-map-name
10. end
11. show mls qos aggregate-policer [aggregate-policer-name]
12. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos aggregate-policer aggregate-policer-name Defines the policer parameters that can be applied to multiple traffic
rate-bps burst-byte exceed-action {drop | classes within the same policy map.
policed-dscp-transmit} By default, no aggregate policer is defined.
Step 3 class-map [match-all | match-any] Creates a class map to classify traffic as necessary.
class-map-name
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 81
Configuring QoS
Configuring a QoS Policy
Example:
Switch(config)# class-map ipclass1
Step 4 policy-map policy-map-name Creates a policy map by entering the policy map name, and enters
policy-map configuration mode.
Example:
Switch(config-cmap)# policy-map aggflow1
Step 5 class [class-map-name | class-default] Defines a traffic classification, and enters policy-map class
configuration mode.
Example:
Switch(config-cmap-p)# class ipclass1
Step 6 police aggregate aggregate-policer-name Applies an aggregate policer to multiple classes in the same policy
map.
Example: For aggregate-policer-name, enter the name specified in Step 2.
Switch(configure-cmap-p)# police aggregate To remove the specified aggregate policer from a policy map, use
transmit1
the no police aggregate aggregate-policer-name policy map
configuration command. To delete an aggregate policer and its
parameters, use the no mls qos aggregate-policer
aggregate-policer-name global configuration command.
Example:
Switch(configure-cmap-p)# exit
Step 8 interface interface-id Specifies the port to attach to the policy map, and enters interface
configuration mode.
Example: Valid interfaces include physical ports.
Switch(config)# interface gigabitethernet
2/0/1
Step 9 service-policy input policy-map-name Specifies the policy-map name, and applies it to an ingress port.
Only one policy map per ingress port is supported.
Example:
Switch(config-if)# service-policy input
aggflow1
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
82 OL-32578-01
Configuring QoS
Configuring DSCP Maps
Example:
Switch(configure-if)# end
Example:
Switch# show mls qos aggregate-policer
transmit1
Step 12 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config startup-config
Related Topics
Policing and Marking Overview, on page 24
Examples: Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 110
Physical Port Policing, on page 25
Examples: Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 110
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 83
Configuring QoS
Configuring DSCP Maps
SUMMARY STEPS
1. configure terminal
2. mls qos map cos-dscp dscp1...dscp8
3. end
4. show mls qos maps cos-dscp
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos map cos-dscp dscp1...dscp8 Modifies the CoS-to-DSCP map.
For dscp1...dscp8, enter eight DSCP values that correspond
Example: to CoS values 0 to 7. Separate each DSCP value with a space.
Switch(config)# mls qos map The DSCP range is 0 to 63.
cos-dscp 10 15 20 25 30 35 40 45
Note To return to the default map, use the no mls qos
cos-dscp global configuration command.
Step 3 end Returns to privileged EXEC mode.
Example:
Switch(config)# end
Example:
Switch# show mls qos maps cos-dscp
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
DSCP Maps, on page 39
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
84 OL-32578-01
Configuring QoS
Configuring DSCP Maps
SUMMARY STEPS
1. configure terminal
2. mls qos map ip-prec-dscp dscp1...dscp8
3. end
4. show mls qos maps ip-prec-dscp
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos map ip-prec-dscp dscp1...dscp8 Modifies the IP-precedence-to-DSCP map.
For dscp1...dscp8, enter eight DSCP values that correspond
Example: to the IP precedence values 0 to 7. Separate each DSCP value
Switch(config)# mls qos map with a space.
ip-prec-dscp 10 15 20 25 30 35 40
45
The DSCP range is 0 to 63.
Note To return to the default map, use the no mls qos
ip-prec-dscp global configuration command.
Step 3 end Returns to privileged EXEC mode.
Example:
Switch(config)# end
Example:
Switch# show mls qos maps ip-prec-dscp
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 85
Configuring QoS
Configuring DSCP Maps
Example:
Switch# copy-running-config
startup-config
Related Topics
DSCP Maps, on page 39
Examples: Configuring DSCP Maps, on page 111
SUMMARY STEPS
1. configure terminal
2. mls qos map policed-dscp dscp-list to mark-down-dscp
3. end
4. show mls qos maps policed-dscp
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos map policed-dscp dscp-list to mark-down-dscp Modifies the policed-DSCP map.
• For dscp-list, enter up to eight DSCP values separated
Example: by spaces. Then enter the to keyword.
Switch(config)# mls qos map
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
86 OL-32578-01
Configuring QoS
Configuring DSCP Maps
Example:
Switch(config)# end
Example:
Switch(config)# show mls qos maps
policed-dscp
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
DSCP Maps, on page 39
Examples: Configuring DSCP Maps, on page 111
SUMMARY STEPS
1. configure terminal
2. mls qos map dscp-cos dscp-list to cos
3. end
4. show mls qos maps dscp-to-cos
5. copy running-config startup-config
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 87
Configuring QoS
Configuring DSCP Maps
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos map dscp-cos dscp-list to cos Modifies the DSCP-to-CoS map.
• For dscp-list, enter up to eight DSCP values separated by
Example: spaces. Then enter the to keyword.
Switch# mls qos map dscp-cos 0 8
16 24 32 40 48 50 to 0 • For cos, enter the CoS value to which the DSCP values
correspond.
Example:
Switch(config)# end
Example:
Switch# show mls qos maps
dscp-to-cos
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config
startup-config
Related Topics
DSCP Maps, on page 39
Examples: Configuring DSCP Maps, on page 111
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
88 OL-32578-01
Configuring QoS
Configuring DSCP Maps
SUMMARY STEPS
1. configure terminal
2. mls qos map dscp-mutation dscp-mutation-name in-dscp to out-dscp
3. interface interface-id
4. mls qos trust dscp
5. mls qos dscp-mutation dscp-mutation-name
6. end
7. show mls qos maps dscp-mutation
8. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos map dscp-mutation dscp-mutation-name Modifies the DSCP-to-DSCP-mutation map.
in-dscp to out-dscp
• For dscp-mutation-name, enter the mutation map name.
You can create more than one map by specifying a new
Example: name.
Switch(config)# mls qos map dscp-mutation
mutation1 1 2 3 4 5 6 7 to 0 • For in-dscp, enter up to eight DSCP values separated by
spaces. Then enter the to keyword.
• For out-dscp, enter a single DSCP value.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 89
Configuring QoS
Configuring DSCP Maps
Step 4 mls qos trust dscp Configures the ingress port as a DSCP-trusted port. By default,
the port is not trusted.
Example:
Switch(config-if)# mls qos trust dscp
Step 5 mls qos dscp-mutation dscp-mutation-name Applies the map to the specified ingress DSCP-trusted port.
For dscp-mutation-name, enter the mutation map name specified
Example: in Step 2.
Switch(config-if)# mls qos dscp-mutation
mutation1
Example:
Switch(config-if)# end
Example:
Switch# show mls qos maps dscp-mutation
Step 8 copy running-config startup-config (Optional) Saves your entries in the configuration file.
Example:
Switch# copy-running-config startup-config
Related Topics
DSCP Maps, on page 39
Examples: Configuring DSCP Maps, on page 111
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
90 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
Configuration Guidelines
Follow these guidelines when the expedite queue is enabled or the egress queues are serviced based on their
SRR weights:
• If the egress expedite queue is enabled, it overrides the SRR shaped and shared weights for queue 1.
• If the egress expedite queue is disabled and the SRR shaped and shared weights are configured, the
shaped mode overrides the shared mode for queue 1, and SRR services this queue in shaped mode.
• If the egress expedite queue is disabled and the SRR shaped weights are not configured, SRR services
this queue in shared mode.
Allocating Buffer Space to and Setting WTD Thresholds for an Egress Queue Set
You can guarantee the availability of buffers, set WTD thresholds, and configure the maximum allocation for
a queue set by using the mls qos queue-set output qset-id threshold queue-id drop-threshold1 drop-threshold2
reserved-threshold maximum-threshold global configuration command.
Each threshold value is a percentage of the queue’s allocated buffers, which you specify by using the mls qos
queue-set output qset-id buffers allocation1 ... allocation4 global configuration command. The queues use
WTD to support distinct drop percentages for different traffic classes.
Note The switch supports 4 egress queues by default, although there is an option to enable a total of 8 egress
queues. Use the mls qos srr-queue output queues 8 global configuration command to enable all 8 egress
queues. Once 8 egress queues are enabled, you are able to configure thresholds, buffers, bandwidth share
weights, and bandwidth shape weights for all 8 queues. The 8 egress queue configuration is only supported
on a standalone switch.
Note The egress queue default settings are suitable for most situations. You should change them only when you
have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 91
Configuring QoS
Configuring Egress Queue Characteristics
Beginning in privileged EXEC mode, follow these steps to configure the memory allocation and to drop
thresholds for a queue set. This procedure is optional.
SUMMARY STEPS
1. configure terminal
2. mls qos srr-queue output queues 8
3. mls qos queue-set output qset-id buffers allocation1 ... allocation8
4. mls qos queue-set output qset-id threshold queue-id drop-threshold1 drop-threshold2 reserved-threshold
maximum-threshold
5. interface interface-id
6. queue-set qset-id
7. end
8. show mls qos interface [interface-id] buffers
9. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 mls qos srr-queue output queues 8 (Optional) The switch supports 4 egress queues by default, although you can enable
a total of 8 egress queues. Use the optional mls qos srr-queue output queues 8
Example: command to enable the additional 4 egress queues.
Switch(config)# mls qos Once 8 queue support is enabled, you can then proceed to configure the additional
srr-queue output queues 8 4 queues. Any existing egress queue configuration commands are then modified to
support the additional queue parameters.
Note The option to enable 8 queues is only available on a standalone switch. If
the switch is within a stack, then only an additional 2 queues can be enabled
for a total of 6 egress queues.
Step 3 mls qos queue-set output qset-id Allocates buffers to a queue set.
buffers allocation1 ... allocation8 By default, all allocation values are equally mapped among the four queues (25,
25, 25, 25). Each queue has 1/4 of the buffer space. When eight egress queues are
Example: configured, then by default 30 percent of the total buffer space is allocated to queue
Switch(config)# mls qos 2 and 10 percent (each) to queues 1,3,4,5,6,7, and 8.
queue-set output 2 buffers 40
20 20 20 10 10 10 10
If you enabled 8 egress queues as described in Step 2 above, then the following
applies:
• For qset-id, enter the ID of the queue set. The range is 1 to 2. Each port belongs
to a queue set, which defines all the characteristics of the four egress queues
per port.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
92 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
Allocate buffers according to the importance of the traffic; for example, give a large
percentage of the buffer to the queue with the highest-priority traffic.
Note To return to the default setting, use the no mls qos queue-set output qset-id
buffers global configuration command.
Step 4 mls qos queue-set output qset-id Configures the WTD thresholds, guarantee the availability of buffers, and configures
threshold queue-id drop-threshold1 the maximum memory allocation for the queue set (four egress queues per port).
drop-threshold2 reserved-threshold By default, the WTD thresholds for queues 1, 3, and 4 are set to 100 percent. The
maximum-threshold thresholds for queue 2 are set to 200 percent. The reserved thresholds for queues 1,
2, 3, and 4 are set to 50 percent. The maximum thresholds for all queues are set to
Example: 400 percent by default.
Switch(config)# mls qos If you enabled 8 egress queues as described in Step 2 above, then the following
queue-set output 2 threshold 2
40 60 80 200
applies:
• For qset-id, enter the ID of the queue set specified in Step 3. The range is 1
to 2.
• For queue-id, enter the specific queue in the queue set on which the command
is performed. The queue-id range is 1-4 by default and 1-8 when 8 queues are
enabled.
• For drop-threshold1 drop-threshold2, specify the two WTD thresholds
expressed as a percentage of the queue’s allocated memory. The range is 1 to
3200 percent.
• For reserved-threshold, enter the amount of memory to be guaranteed
(reserved) for the queue expressed as a percentage of the allocated memory.
The range is 1 to 100 percent.
• For maximum-threshold, enable a queue in the full condition to obtain more
buffers than are reserved for it. This is the maximum memory the queue can
have before the packets are dropped if the common pool is not empty. The
range is 1 to 3200 percent.
Note To return to the default WTD threshold percentages, use the no mls qos
queue-set output qset-id threshold [queue-id] global configuration
command.
Step 5 interface interface-id Specifies the port of the outbound traffic, and enters interface configuration mode.
Example:
Switch(config)# interface
gigabitethernet1/0/1
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 93
Configuring QoS
Configuring Egress Queue Characteristics
Switch(config-id)# queue-set 2
Example:
Switch(config-id)# end
Example:
Switch# show mls qos interface
buffers
Step 9 copy running-config startup-config (Optional) Saves your entries in the configuration file.
To return to the default setting, use the no mls qos queue-set output qset-id buffers
Example: global configuration command. To return to the default WTD threshold percentages,
Switch# copy-running-config use the no mls qos queue-set output qset-id threshold [queue-id] global
startup-config configuration command.
Note The egress queue default settings are suitable for most situations. You should change them only when you
have a thorough understanding of egress queues and if these settings do not meet your QoS solution.
Beginning in privileged EXEC mode, follow these steps to map DSCP or CoS values to an egress queue and
to a threshold ID. This procedure is optional.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
94 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
SUMMARY STEPS
1. configure terminal
2. Use one of the following:
• mls qos srr-queue output dscp-map queue queue-id threshold threshold-id dscp1...dscp8
• mls qos srr-queue output cos-map queue queue-id threshold threshold-id cos1...cos8
3. end
4. show mls qos maps
5. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 Use one of the following: Maps DSCP or CoS values to an egress queue and to a threshold ID.
• mls qos srr-queue output By default, DSCP values 0–15 are mapped to queue 2 and threshold 1. DSCP values
dscp-map queue queue-id 16–31 are mapped to queue 3 and threshold 1. DSCP values 32–39 and 48–63 are
threshold threshold-id mapped to queue 4 and threshold 1. DSCP values 40–47 are mapped to queue 1
dscp1...dscp8 and threshold 1.
• mls qos srr-queue output By default, CoS values 0 and 1 are mapped to queue 2 and threshold 1. CoS values
cos-map queue queue-id 2 and 3 are mapped to queue 3 and threshold 1. CoS values 4, 6, and 7 are mapped
threshold threshold-id to queue 4 and threshold 1. CoS value 5 is mapped to queue 1 and threshold 1.
cos1...cos8 • For queue-id, the range is 1 to 4.
Note If you enabled 8 egress queues using the mls qos srr-queue output
queues 8 global configuration command, then the queue-id range
Example:
would be from 1 to 8.
Switch(config)# mls qos srr-queue
output • For threshold-id, the range is 1 to 3. The drop-threshold percentage for
dscp-map queue 1 threshold 2 10 threshold 3 is predefined. It is set to the queue-full state.
11
• For dscp1...dscp8, enter up to eight values, and separate each value with a
space. The range is 0 to 63.
• For cos1...cos8, enter up to eight values, and separate each value with a space.
The range is 0 to 7.
Note To return to the default DSCP output queue threshold map or the default
CoS output queue threshold map, use the no mls qos srr-queue output
dscp-map or the no mls qos srr-queue output cos-map global
configuration command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 95
Configuring QoS
Configuring Egress Queue Characteristics
Example:
Switch(config)# end
Step 5 copy running-config startup-config (Optional) Saves your entries in the configuration file.
To return to the default DSCP output queue threshold map or the default CoS output
Example: queue threshold map, use the no mls qos srr-queue output dscp-map or the no
Switch# copy-running-config mls qos srr-queue output cos-map global configuration command.
startup-config
Related Topics
Mapping Tables Overview, on page 28
Examples: Configuring Egress Queue Characteristics, on page 113
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
96 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. srr-queue bandwidth shape weight1 weight2 weight3 weight4
4. end
5. show mls qos interface interface-id queueing
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the port of the outbound traffic, and enters interface configuration
mode.
Example:
Switch(config)# interface
gigabitethernet2/0/1
Step 3 srr-queue bandwidth shape weight1 Assigns SRR weights to the egress queues. By default, weight1 is set to 25;
weight2 weight3 weight4 weight2, weight3, and weight4 are set to 0, and these queues are in shared
mode.
Example: For weight1 weight2 weight3 weight4, enter the weights to control the
Switch(config-if)# srr-queue percentage of the port that is shaped. The inverse ratio (1/weight) controls
bandwidth shape 8 0 0 0 the shaping bandwidth for this queue. Separate each value with a space. The
range is 0 to 65535.
If you configure a weight of 0, the corresponding queue operates in shared
mode. The weight specified with the srr-queue bandwidth shape command
is ignored, and the weights specified with the srr-queue bandwidth share
interface configuration command for a queue come into effect. When
configuring queues in the same queue-set for both shaping and sharing, make
sure that you configure the lowest number queue for shaping.
The shaped mode overrides the shared mode.
To return to the default setting, use the no srr-queue bandwidth shape
interface configuration command.
Note If you enabled 8 egress queues using the mls qos srr-queue output
queues 8 global configuration command, then you would be able
to assign SRR weights to a total of 8 queues.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 97
Configuring QoS
Configuring Egress Queue Characteristics
Example:
Switch(config-if)# end
Example:
Switch# show mls qos interface
interface-id queuing
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
To return to the default setting, use the no srr-queue bandwidth shape
Example: interface configuration command.
Switch# copy running-config
startup-config
Related Topics
Queueing and Scheduling on Egress Queues, on page 31
Examples: Configuring Egress Queue Characteristics, on page 113
Note The egress queue default settings are suitable for most situations. You should change them only when you
have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.
Beginning in privileged EXEC mode, follow these steps to assign the shared weights and to enable bandwidth
sharing on the four egress queues mapped to a port. This procedure is optional.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
98 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. srr-queue bandwidth share weight1 weight2 weight3 weight4
4. end
5. show mls qos interface interface-id queueing
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the port of the outbound traffic, and enters interface
configuration mode.
Example:
Switch(config)# interface
gigabitethernet2/0/1
Step 3 srr-queue bandwidth share weight1 weight2 Assigns SRR weights to the egress queues. By default, all four weights
weight3 weight4 are 25 (1/4 of the bandwidth is allocated to each queue).
For weight1 weight2 weight3 weight4, enter the weights to control
Example: the ratio of the frequency in which the SRR scheduler sends packets.
Switch(config-id)# srr-queue Separate each value with a space. The range is 1 to 255.
bandwidth share 1 2 3 4
To return to the default setting, use the no srr-queue bandwidth
share interface configuration command.
Note If you enabled 8 egress queues using the mls qos srr-queue
output queues 8 global configuration command, then you
would be able to assign SRR weights to a total of 8 queues.
Step 4 end Returns to privileged EXEC mode.
Example:
Switch(config-id)# end
Step 5 show mls qos interface interface-id queueing Verifies your entries.
Example:
Switch# show mls qos interface
interface_id queuing
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 99
Configuring QoS
Configuring Egress Queue Characteristics
Related Topics
Queueing and Scheduling on Egress Queues, on page 31
Examples: Configuring Egress Queue Characteristics, on page 113
SUMMARY STEPS
1. configure terminal
2. mls qos
3. interface interface-id
4. priority-queue out
5. end
6. show running-config
7. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
100 OL-32578-01
Configuring QoS
Configuring Egress Queue Characteristics
Example:
Switch(config)# mls qos
Step 3 interface interface-id Specifies the egress port, and enters interface configuration mode.
Example:
Switch(config)# interface
gigabitethernet1/0/1
Step 4 priority-queue out Enables the egress expedite queue, which is disabled by default.
When you configure this command, the SRR weight and queue size
Example: ratios are affected because there is one fewer queue participating in
Switch(config-if)# priority-queue out SRR. This means that weight1 in the srr-queue bandwidth shape
or the srr-queue bandwidth share command is ignored (not used
in the ratio calculation).
Note To disable the egress expedite queue, use the no
priority-queue out interface configuration command.
Step 5 end Returns to privileged EXEC mode.
Example:
Switch(config-if)# end
Example:
Switch# show running-config
Step 7 copy running-config startup-config (Optional) Saves your entries in the configuration file.
To disable the egress expedite queue, use the no priority-queue
Example: out interface configuration command.
Switch# copy running-config
startup-config
Related Topics
Queueing and Scheduling on Egress Queues, on page 31
Examples: Configuring Egress Queue Characteristics, on page 113
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 101
Configuring QoS
Configuring Egress Queue Characteristics
Note The egress queue default settings are suitable for most situations. You should change them only when you
have a thorough understanding of the egress queues and if these settings do not meet your QoS solution.
Beginning in privileged EXEC mode, follow these steps to limit the bandwidth on an egress port. This procedure
is optional.
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. srr-queue bandwidth limit weight1
4. end
5. show mls qos interface [interface-id] queueing
6. copy running-config startup-config
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the port to be rate-limited, and enters interface
configuration mode.
Example:
Switch(config)# interface
gigabitethernet2/0/1
Step 3 srr-queue bandwidth limit weight1 Specifies the percentage of the port speed to which the port
should be limited. The range is 10 to 90.
Example: By default, the port is not rate-limited and is set to 100 percent.
Switch(config-if)# srr-queue Note To return to the default setting, use the no srr-queue
bandwidth limit 80
bandwidth limit interface configuration command.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
102 OL-32578-01
Configuring QoS
Monitoring Standard QoS
Example:
Switch(config-if)# end
Step 5 show mls qos interface [interface-id] queueing Verifies your entries.
Example:
Switch# show mls qos interface
interface_id queueing
Step 6 copy running-config startup-config (Optional) Saves your entries in the configuration file.
To return to the default setting, use the no srr-queue
Example: bandwidth limit interface configuration command.
Switch# copy-running-config
startup-config
Related Topics
Queueing and Scheduling on Egress Queues, on page 31
Examples: Configuring Egress Queue Characteristics, on page 113
Command Description
show class-map [class-map-name] Displays QoS class maps, which define the match
criteria to classify traffic.
show mls qos input-queue Displays QoS settings for the ingress queues.
show mls qos interface [interface-id] [buffers | Displays QoS information at the port level, including
policers | queueing | statistics] the buffer allocation, which ports have configured
policers, the queueing strategy, and the ingress and
egress statistics.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 103
Configuring QoS
Configuration Examples for QoS
Command Description
show mls qos maps [cos-dscp | cos-input-q Displays QoS mapping information.
|cos-output-q | dscp-cos | dscp-input-q
|dscp-mutation dscp-mutation-name |
dscp-output-q | ip-prec-dscp | policed-dscp]
show mls qos queue-set [qset-id] Displays QoS settings for the egress queues.
show mls qos vlan vlan-id Displays the policy maps attached to the specified SVI.
show policy-map [policy-map-name [class Displays QoS policy maps, which define classification
class-map-name]] criteria for incoming traffic.
Do not use the show policy-map interface privileged
EXEC command to display classification information
for incoming traffic. The control-plane and interface
keywords are not supported, and the statistics shown in
the display should be ignored.
Related Topics
Configuring the Trust State on Ports Within the QoS Domain, on page 45
Configuring the CoS Value for an Interface, on page 47
Configuring a Trusted Boundary to Ensure Port Security, on page 49
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
104 OL-32578-01
Configuring QoS
Examples: Classifying Traffic by Using ACLs
This example shows how to create an ACL that permits IP traffic from any source to any destination that has
the DSCP value set to 32:
This example shows how to create an ACL that permits IP traffic from a source host at 10.1.1.1 to a destination
host at 10.1.1.2 with a precedence value of 5:
This example shows how to create an ACL that permits PIM traffic from any source to a destination group
address of 224.0.0.2 with a DSCP set to 32:
This example shows how to create an ACL that permits IPv6 traffic from any source to any destination that
has the DSCP value set to 32:
This example shows how to create an ACL that permits IPv6 traffic from a source host at 10.1.1.1 to a
destination host at 10.1.1.2 with a precedence value of 5:
This example shows how to create a Layer 2 MAC ACL with two permit statements. The first statement
allows traffic from the host with MAC address 0001.0000.0001 to the host with MAC address 0002.0000.0001.
The second statement allows only Ethertype XNS-IDP traffic from the host with MAC address 0001.0000.0002
to the host with MAC address 0002.0000.0002.
Related Topics
Creating an IP Standard ACL for IPv4 Traffic, on page 55
Creating an IP Extended ACL for IPv4 Traffic, on page 57
Creating an IPv6 ACL for IPv6 Traffic, on page 59
Creating a Layer 2 MAC ACL for Non-IP Traffic, on page 61
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 105
Configuring QoS
Examples: Classifying Traffic by Using Class Maps
This example shows how to create a class map called class2, which matches incoming traffic with DSCP
values of 10, 11, and 12.
This example shows how to create a class map called class3, which matches incoming traffic with IP-precedence
values of 5, 6, and 7:
This example shows how to configure a class map to match IP DSCP and IPv6:
This example shows how to configure a class map that applies to both IPv4 and IPv6 traffic:
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
106 OL-32578-01
Configuring QoS
Examples: Classifying, Policing, and Marking Traffic on Physical Ports Using Policy Maps
Related Topics
Classifying Traffic by Using Class Maps, on page 63
Classifying Traffic by Using Class Maps and Filtering IPv6 Traffic, on page 66
Classification Based on Class Maps and Policy Maps, on page 23
This example shows how to create a Layer 2 MAC ACL with two permit statements and attach it to an ingress
port. The first permit statement allows traffic from the host with MAC address 0001.0000.0001 destined for
the host with MAC address 0002.0000.0001. The second permit statement allows only Ethertype XNS-IDP
traffic from the host with MAC address 0001.0000.0002 destined for the host with MAC address
0002.0000.0002.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 107
Configuring QoS
Examples: Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps
This example shows how to create a class map that applies to both IPv4 and IPv6 traffic with the default class
applied to unclassified traffic:
Related Topics
Classifying, Policing, and Marking Traffic on Physical Ports by Using Policy Maps, on page 68
Physical Port Policing, on page 25
Switch> enable
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# access-list 101 permit ip any any
Switch(config)# class-map cm-1
Switch(config-cmap)# match access 101
Switch(config-cmap)# exit
Switch(config)# exit
Switch#
Switch#
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
108 OL-32578-01
Configuring QoS
Examples: Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps
This example shows that when a child-level policy map is attached below a class, an action must be specified
for the class:
This example shows how to configure a class map to match IP DSCP and IPv6:
This example shows how to configure default traffic class to a policy map:
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 109
Configuring QoS
Examples: Classifying, Policing, and Marking Traffic by Using Aggregate Policers
This example shows how the default traffic class is automatically placed at the end of policy-map pm3 even
though class-default was configured first:
Related Topics
Classifying, Policing, and Marking Traffic on SVIs by Using Hierarchical Policy Maps, on page 72
SVI Policing, on page 26
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
110 OL-32578-01
Configuring QoS
Examples: Configuring DSCP Maps
Related Topics
Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 80
Policing and Marking Overview, on page 24
Classifying, Policing, and Marking Traffic by Using Aggregate Policers, on page 80
Physical Port Policing, on page 25
Cos-dscp map:
cos: 0 1 2 3 4 5 6 7
--------------------------------
dscp: 10 15 20 25 30 35 40 45
This example shows how to modify and display the IP-precedence-to-DSCP map:
IpPrecedence-dscp map:
ipprec: 0 1 2 3 4 5 6 7
--------------------------------
dscp: 10 15 20 25 30 35 40 45
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 111
Configuring QoS
Examples: Configuring DSCP Maps
Note In this policed-DSCP map, the marked-down DSCP values are shown in the body of the matrix. The d1
column specifies the most-significant digit of the original DSCP; the d2 row specifies the least-significant
digit of the original DSCP. The intersection of the d1 and d2 values provides the marked-down value. For
example, an original DSCP value of 53 corresponds to a marked-down DSCP value of 0.
This example shows how to map DSCP values 0, 8, 16, 24, 32, 40, 48, and 50 to CoS value 0 and to display
the map:
Note In the above DSCP-to-CoS map, the CoS values are shown in the body of the matrix. The d1 column
specifies the most-significant digit of the DSCP; the d2 row specifies the least-significant digit of the
DSCP. The intersection of the d1 and d2 values provides the CoS value. For example, in the DSCP-to-CoS
map, a DSCP value of 08 corresponds to a CoS value of 0.
This example shows how to define the DSCP-to-DSCP-mutation map. All the entries that are not explicitly
configured are not modified (remains as specified in the null map):
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
112 OL-32578-01
Configuring QoS
Examples: Configuring Egress Queue Characteristics
Note In the above DSCP-to-DSCP-mutation map, the mutated values are shown in the body of the matrix. The
d1 column specifies the most-significant digit of the original DSCP; the d2 row specifies the least-significant
digit of the original DSCP. The intersection of the d1 and d2 values provides the mutated value. For
example, a DSCP value of 12 corresponds to a mutated value of 10.
Related Topics
Configuring the CoS-to-DSCP Map, on page 83
Configuring the IP-Precedence-to-DSCP Map, on page 85
Configuring the Policed-DSCP Map, on page 86
Configuring the DSCP-to-CoS Map, on page 87
Configuring the DSCP-to-DSCP-Mutation Map, on page 89
DSCP Maps, on page 39
This example shows how to map DSCP values 10 and 11 to egress queue 1 and to threshold 2:
This example shows how to configure bandwidth shaping on queue 1. Because the weight ratios for queues
2, 3, and 4 are set to 0, these queues operate in shared mode. The bandwidth weight for queue 1 is 1/8, which
is 12.5 percent:
This example shows how to configure the weight ratio of the SRR scheduler running on an egress port. Four
queues are used, and the bandwidth ratio allocated for each queue in shared mode is 1/(1+2+3+4), 2/(1+2+3+4),
3/(1+2+3+4), and 4/(1+2+3+4), which is 10 percent, 20 percent, 30 percent, and 40 percent for queues 1, 2,
3, and 4. This means that queue 4 has four times the bandwidth of queue 1, twice the bandwidth of queue 2,
and one-and-a-third times the bandwidth of queue 3.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 113
Configuring QoS
Where to Go Next
This example shows how to enable the egress expedite queue when the SRR weights are configured. The
egress expedite queue overrides the configured SRR weights.
When you configure this command to 80 percent, the port is idle 20 percent of the time. The line rate drops
to 80 percent of the connected speed, which is 800 Mb/s. These values are not exact because the hardware
adjusts the line rate in increments of six.
Related Topics
Allocating Buffer Space to and Setting WTD Thresholds for an Egress Queue-Set
Configuring SRR Shaped Weights on Egress Queues, on page 96
Configuring SRR Shared Weights on Egress Queues, on page 98
Configuring the Egress Expedite Queue, on page 100
Limiting the Bandwidth on an Egress Interface, on page 102
Queueing and Scheduling on Egress Queues, on page 31
Mapping DSCP or CoS Values to an Egress Queue and to a Threshold ID, on page 94
Mapping Tables Overview, on page 28
Where to Go Next
Review the auto-QoS documentation to see if you can use these automated capabilities for your QoS
configuration.
Additional References
Related Documents
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
114 OL-32578-01
Configuring QoS
Feature History and Information for QoS
Standard/RFC Title
— —
MIBs
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/support
resources, including documentation and tools for
troubleshooting and resolving technical issues with
Cisco products and technologies.
To receive security and technical information about
your products, you can subscribe to various services,
such as the Product Alert Tool (accessed from Field
Notices), the Cisco Technical Services Newsletter,
and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website
requires a Cisco.com user ID and password.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 115
Configuring QoS
Feature History and Information for QoS
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
116 OL-32578-01
CHAPTER 3
Configuring Auto-QoS
• Finding Feature Information, page 117
• Prerequisites for Auto-QoS, page 117
• Restrictions for Auto-QoS, page 118
• Information About Configuring Auto-QoS, page 119
• How to Configure Auto-QoS, page 122
• Monitoring Auto-QoS, page 125
• Configuration Examples for Auto-Qos, page 126
• Where to Go Next for Auto-QoS, page 133
• Additional References, page 134
• Feature History and Information for Auto-QoS, page 135
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 117
Configuring Auto-QoS
Auto-QoS VoIP Considerations
Note When a device running Cisco SoftPhone is connected to a nonrouted or routed port, the
switch supports only one Cisco SoftPhone application per port.
• When enabling auto-QoS with a Cisco IP Phone on a routed port, you must assign a static IP address to
the IP phone.
• This release supports only Cisco IP SoftPhone Version 1.3(3) or later.
• Connected devices must use Cisco Call Manager Version 4 or later.
• Auto-Qos VoIP uses the priority-queue interface configuration command for an egress interface. You
can also configure a policy-map and trust device on the same interface for Cisco IP phones.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
118 OL-32578-01
Configuring Auto-QoS
Information About Configuring Auto-QoS
• We recommend that you do not enable 8 egress queues by using the mls qos srr-queue output queues
8 command, when running the following features in your configuration:
◦Auto-QoS
◦Auto SmartPort
◦EnergyWise
Running these features with 8 egress queue enabled in a single configuration is not supported on the
switch.
Note You can enable auto-QoS on static, dynamic-access, voice VLAN access, and trunk ports.
You also use the auto-QoS commands to identify ports that receive trusted traffic through an uplink. Auto-QoS
then performs these functions:
• Detects the presence or absence of auto-QoS devices through conditional trusted interfaces.
• Configures QoS classification
• Configures egress queues
Related Topics
Enabling Auto-QoS, on page 122
Examples: Global Auto-QoS Configuration, on page 126
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 119
Configuring Auto-QoS
Generated Auto-QoS Configuration
The switch configures egress queues on the port according to the settings in the following tables.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
120 OL-32578-01
Configuring Auto-QoS
Generated Auto-QoS Configuration
CoS value 5 3 6 7 3 –
The following table describes the auto-QoS configuration for ingress queues.
The switch configures ingress queues on the port according to the settings in the following table. This table
shows the generated auto-QoS configuration for the ingress queues.
Ingress Queue Queue CoS-to-Queue Map Queue Weight Queue (Buffer) Size
Number (Bandwidth)
SRR shared 1 0, 1, 2, 3, 6, 7 70 percent 90 percent
The following table shows the generated auto-QoS configuration for the egress queues.
Egress Queue Queue Number CoS-to-Queue Queue Weight Queue (Buffer) Queue (Buffer)
Map (Bandwidth) Size for Size for 10/100
Gigabit-Capable Ethernet Ports
Ports
Priority 1 4, 5 Up to 100 25 percent 15 percent
percent
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 121
Configuring Auto-QoS
Effects of Auto-QoS on Running Configuration
• When you enable auto-QoS by using the auto qos voip cisco-phone, the auto qos voip cisco-softphone,
or the auto qos voip trust interface configuration command, the switch automatically generates a QoS
configuration based on the traffic type and ingress packet label and applies the commands listed in
Examples: Global Auto-QoS Configuration, on page 126 to the port.
Enabling Auto-QoS
For optimum QoS performance, enable auto-QoS on all the devices in your network.
SUMMARY STEPS
1. configure terminal
2. interface interface-id
3. Use one of the following:
• auto qos voip {cisco-phone | cisco-softphone | trust}
• auto qos video {cts | ip-camera | media-player}
• auto qos classify [police]
• auto qos trust {cos | dscp}
4. exit
5. interface interface-id
6. auto qos trust
7. end
8. show auto qos interface interface-id
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
122 OL-32578-01
Configuring Auto-QoS
Configuring Auto-QoS
DETAILED STEPS
Example:
Switch# configure terminal
Step 2 interface interface-id Specifies the port that is connected to a video device or the uplink port that
is connected to another trusted switch or router in the network interior, and
Example: enters interface configuration mode.
Switch(config)# interface
gigabitethernet 3/0/1
QoS labels of incoming packets are trusted only when the system is detected.
Enables auto-QoS for classification.
• police—Policing is set up by defining the QoS policy maps and applying
them to ports (port-based QoS).
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 123
Configuring Auto-QoS
Configuring Auto-QoS
Example:
Switch(config-if)# exit
Step 5 interface interface-id Specifies the switch port identified as connected to a trusted switch or router,
and enters interface configuration mode.
Example:
Switch(config)# interface
gigabitethernet 2/0/1
Step 6 auto qos trust Enables auto-QoS on the port, and specifies that the port is connected to a
trusted router or switch.
Example:
Switch(config-if)# auto qos trust
Example:
Switch(config-if)# end
Related Topics
Auto-QoS Overview, on page 119
Examples: Global Auto-QoS Configuration, on page 126
Examples: Auto-QoS Generated Configuration for VoIP Devices, on page 130
Examples: Auto-QoS Generated Configuration For Enhanced Video, Trust, and Classify Devices, on
page 131
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
124 OL-32578-01
Configuring Auto-QoS
Monitoring Auto-QoS
Troubleshooting Auto-QoS
To display the QoS commands that are automatically generated when auto-QoS is enabled or disabled, enter
the debug auto qos privileged EXEC command before you enable auto-QoS. For more information, see the
debug auto qos command in the command reference for this release.
To disable auto-QoS on a port, use the no form of the auto qos command interface configuration command,
such as no auto qos voip.
Note Auto-QoS generated global commands can also be removed manually if desired.
Only the auto-QoS-generated interface configuration commands for this port are removed. If this is the last
port on which auto-QoS is enabled and you enter the no auto qos voip command, auto-QoS is considered
disabled even though the auto-QoS-generated global configuration commands remain (to avoid disrupting
traffic on other ports affected by the global configuration).
You can use the no mls qos global configuration command to disable the auto-QoS-generated global
configuration commands. With QoS disabled, there is no concept of trusted or untrusted ports because the
packets are not modified (the CoS, DSCP, and IP precedence values in the packet are not changed). Traffic
is switched in pass-through mode (packets are switched without any rewrites and classified as best effort
without any policing).
Monitoring Auto-QoS
Table 23: Commands for Monitoring Auto-QoS
Command Description
show auto qos [interface [interface-type]] Displays the initial auto-QoS configuration.
You can compare the show auto qos and the show
running-config command output to identify the
user-defined QoS settings.
show mls qos [ aggregate policer | interface | Displays information about the QoS configuration that
maps | queue-set | stack-port | stack-qset | vlan might be affected by auto-QoS.
]
show mls qos aggregate policer policer_name Displays information about the QoS aggregate policer
configuration that might be affected by auto-QoS.
show mls qos interface [interface-type | buffers Displays information about the QoS interface
| policers | queueing | statistics ] configuration that might be affected by auto-QoS.
show mls qos maps [cos-dscp | cos-output-q | Displays information about the QoS maps configuration
dscp-cos | dscp-mutation | dscp-output-q | that might be affected by auto-QoS.
ip-prec-dscp | policed-dscp ]
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 125
Configuring Auto-QoS
Configuration Examples for Auto-Qos
Command Description
show mls qos queue-set queue-set ID Displays information about the QoS queue-set
configuration that might be affected by auto-QoS.
show mls qos stack-port buffers Displays information about the QoS stack port buffer
configuration that might be affected by auto-QoS.
show mls qos stack-qset Displays information about the QoS stack queue set
configuration that might be affected by auto-QoS.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
126 OL-32578-01
Configuring Auto-QoS
Examples: Global Auto-QoS Configuration
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 127
Configuring Auto-QoS
Examples: Global Auto-QoS Configuration
17 18 19 20 21 22 23
Switch(config)# mls qos srr-queue
output dscp-map queue 2 threshold 1 26
27 28 29 30 31 34 35 36 37 38 39
Switch(config)# mls qos srr-queue
output dscp-map queue 2 threshold 2 24
Switch(config)# mls qos Switch(config)# mls qos srr-queue
srr-queue output dscp-map queue 2 threshold 3 48
output dscp-map queue 2
threshold 3 49 50 51 52 53 54 55 56
24 25 26 27 28 29 30 31 Switch(config)# mls qos srr-queue
Switch(config)# mls qos output dscp-map queue 2 threshold 3 57
srr-queue
output dscp-map queue 2 58 59 60 61 62 63
threshold 3
48 49 50 51 52 53 54 55
Switch(config)# mls qos
srr-queue Switch(config)# mls qos srr-queue
output dscp-map queue 2 output dscp-map queue 3 threshold 3 0
threshold 3 1 2 3 4 5 6 7
56 57 58 59 60 61 62 63
Switch(config)# mls qos
srr-queue
output dscp-map queue 3 Switch(config)# mls qos srr-queue
threshold 3 output dscp-map queue 4 threshold 1 8
16 17 18 19 20 21 22 23 9 11 13 15
Switch(config)# mls qos Switch(config)# mls qos srr-queue
srr-queue output dscp-map queue 4 threshold 2 10
output dscp-map queue 3
threshold 3 12 14
32 33 34 35 36 37 38 39
Switch(config)# mls qos
srr-queue
output dscp-map queue 4
threshold 1 8
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
128 OL-32578-01
Configuring Auto-QoS
Examples: Global Auto-QoS Configuration
bandwidth share 10 10 60 20
Related Topics
Enabling Auto-QoS, on page 122
Auto-QoS Overview, on page 119
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 129
Configuring Auto-QoS
Examples: Auto-QoS Generated Configuration for VoIP Devices
If you entered the auto qos voip cisco-softphone command, the switch automatically creates class maps and
policy maps.
After creating the class maps and policy maps, the switch automatically applies the policy map called
AutoQoS-Police-SoftPhone to an ingress interface on which auto-QoS with the Cisco SoftPhone feature is
enabled.
If you entered the auto qos voip cisco-phone command, the switch automatically creates class maps and
policy maps.
If you entered the auto qos voip cisco-softphone command, the switch automatically creates class maps and
policy maps.
After creating the class maps and policy maps, the switch automatically applies the policy map called
AutoQoS-Police-SoftPhone to an ingress interface on which auto-QoS with the Cisco SoftPhone feature is
enabled.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
130 OL-32578-01
Configuring Auto-QoS
Examples: Auto-QoS Generated Configuration For Enhanced Video, Trust, and Classify Devices
Related Topics
Enabling Auto-QoS, on page 122
Auto-QoS Overview, on page 119
If you entered the auto qos classify command, the switch automatically creates class maps and policy maps
(as shown below).
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 131
Configuring Auto-QoS
Examples: Auto-QoS Generated Configuration For Enhanced Video, Trust, and Classify Devices
If you entered the auto qos classify police command, the switch automatically creates class maps and policy
maps (as shown below).
This is the enhanced configuration for the auto qos voip cisco-phone command:
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
132 OL-32578-01
Configuring Auto-QoS
Where to Go Next for Auto-QoS
This is the enhanced configuration for the auto qos voip cisco-softphone command:
Related Topics
Enabling Auto-QoS, on page 122
Auto-QoS Overview, on page 119
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 133
Configuring Auto-QoS
Additional References
Additional References
Related Documents
Standard/RFC Title
— —
MIBs
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/support
resources, including documentation and tools for
troubleshooting and resolving technical issues with
Cisco products and technologies.
To receive security and technical information about
your products, you can subscribe to various services,
such as the Product Alert Tool (accessed from Field
Notices), the Cisco Technical Services Newsletter,
and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website
requires a Cisco.com user ID and password.
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
134 OL-32578-01
Configuring Auto-QoS
Feature History and Information for Auto-QoS
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 135
Configuring Auto-QoS
Feature History and Information for Auto-QoS
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
136 OL-32578-01
INDEX
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 IN-1
Index
H policers 25, 80
configuring 80
hierarchical policy maps 72 for more than one traffic class 80
configuring 72 types of 25
policing 25, 26
hierarchical 26
I See hierarchical policy maps 26
token-bucket algorithm 25
ingress queue 35 policy maps for QoS 68, 72
default configuration 35 hierarchical on SVIs 72
IP ACLs 22 configuring 72
for QoS classification 22 nonhierarchical on physical ports 68
IP phones 49 configuring 68
trusted boundary for QoS 49 prerequisites 13, 117
IP precedence 17 auto-QoS 117
IP-precedence-to-DSCP map for QoS 40, 85 QoS 13
prioritization 16
L
Q
Layer 3 packets, classification methods 17
QoS 18, 20, 22, 23, 25, 28, 29, 33, 34, 35, 40, 41, 43, 45, 47, 51, 53, 55, 63,
66, 68, 71, 72, 80, 83, 85, 86, 87, 89, 91, 94, 96, 98, 100, 102, 110,
111, 119, 120, 122, 125
M auto-QoS 120, 122, 125
mapping table 39 categorizing traffic 120
default configuration 39 disabling 125
mapping tables for QoS 28, 40, 41, 83, 85, 86, 89 effects on running configuration 122
configuring 40, 41, 83, 85, 86, 89 basic model 18
CoS-to-DSCP 40, 83 class maps 63, 66
DSCP 83 configuring 63, 66
DSCP-to-CoS 41 classification 18, 20, 22, 23, 51
DSCP-to-DSCP-mutation 89 DSCP transparency, described 51
IP-precedence-to-DSCP 40, 85 forwarding treatment 18
policed-DSCP 86 IP ACLs, described 22, 23
described 28 MAC ACLs, described 20, 23
marking 68, 80, 110, 111 options for IP traffic 20
action in policy map 68 trusted CoS, described 20
action with aggregate policers 80, 110, 111 configuring 45, 47, 53, 55, 68, 72, 80, 83, 91, 110, 111, 122
memory allocation 33 aggregate policers 80, 110, 111
monitoring 103 auto-QoS 122
default port CoS value 47
DSCP maps 83
DSCP trust states bordering another domain 53
N egress queue characteristics 91
nonhierarchical policy maps 68 IP standard ACLs 55
configuring 68 policy maps on physical ports 68
policy maps, hierarchical 72
port trust states within the domain 45
default auto configuration 120
P default configuration 35
egress queues 33, 94, 96, 98
packet modification, with QoS 34 configuring shaped weights for SRR 96
policed-DSCP map for QoS 86
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
IN-2 OL-32578-01
Index
QoS (continued) R
egress queues (continued)
configuring shared weights for SRR 98 references 133
displaying the threshold map 96 auto-QoS 133
mapping DSCP or CoS values 94
WTD, described 33
enabling globally 41 S
enabling VLAN-based on physical ports 43
implicit deny 23 scheduling 31
IP phones 119 shaped mode 34
automatic classification and queueing 119 shared mode 34
limiting bandwidth on egress interface 102 SRR 30
mapping tables 28, 40, 41, 83, 85, 86, 87, 89 described 30
CoS-to-DSCP 40, 83 shaped mode 30
DSCP-CoS 87 shared mode 30
DSCP-to-CoS 41
DSCP-to-DSCP-mutation 89
IP-precedence-to-DSCP 40, 85
policed-DSCP 86
T
types of 28 troubleshooting 125
marked-down actions 71 auto-QoS 125
packet modification 34 trust states 44
policers 25, 71 trusted boundary for QoS 49
configuring 71 trusted port states 19
types of 25 classification options 19
QoS 20
classification 20
trust DSCP, described 20
trust IP precedence, described 20 W
queues 29, 34, 100 WTD 91
high priority (expedite) 34, 100 setting thresholds 91
location of 29 egress queue sets 91
WTD, described 29
rewrites 34
QoS policy 55
queueing 31
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
OL-32578-01 IN-3
Index
QoS Configuration Guide, Cisco IOS Release 15.2(2)E (Catalyst 2960-XR Switch)
IN-4 OL-32578-01