|
|
This chapter describes how to configure quality of service (QoS).
This chapter consists of these sections:
These sections describe how QoS works:
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.
QoS classifies traffic by assigning priority-indexed IEEE 802.1p class of service (CoS) values to frames at supported ingress ports. On the Catalyst 5000 family switches, for IPv4 traffic destined for a router, QoS can classify packets that match an access-control entry (ACE) by setting the IP precedence bits (in the IP header) and CoS value in the frame header.
QoS implements scheduling on supported egress ports with transmit queue drop thresholds and multiple transmit queues that use the IEEE 802.1p CoS values to give preference to higher-priority traffic. Figure 15-1 shows how QoS affects the traffic flow through a Catalyst 5000 family switch.

Figure 15-2 shows how QoS affects the traffic flow through a Catalyst 4000 family or 2948G switch.

The following QoS terminology is used in this chapter:
These sections describe the three supported methods of classification and marking:
ISL or 802.1Q frames are not classified or marked at the ingress port. The existing CoS value is honored.
On the Catalyst 5000 family switches, QoS classifies and marks all other frame types that enter the switch through a supported ingress port with the configured CoS value of the port (the default is zero). On the Catalyst 4000 family and 2948G switches, QoS classifies and marks all other frame types that enter the switch with the default CoS value configured for the entire switch. You cannot mark traffic on a per-port basis.
On the Catalyst 5000 family switches, QoS can rewrite the CoS value with a configurable value in frames destined for selected destination host Media Access Control (MAC) address and VLAN pairs (see the "Mapping a CoS Value to a Host Destination MAC Address/VLAN Pair" section). Destination-based marking overwrites any CoS value previously written, including port-based CoS values.
On the Catalyst 5000 family switches, for IPv4 traffic destined for a router, QoS can perform classification of traffic that matches the parameters in an ACE under the following conditions:
If ACE-based classification occurs, QoS sets the IP precedence bits in the IP header to match the CoS value. ACE-based marking overwrites any CoS value previously written, including port-based and destination-based CoS values.
These parameters can be specified in an ACE:
For information on configuring ACEs, see the "Creating an Access Control Entry" section.
On the Catalyst 5000 family switches, there is one non-user-configurable transmit queue and four user-configurable transmit queue drop thresholds for each port. Ports of this type are specified using the 1q4t keyword in QoS-related commands.
On the Catalyst 4000 family and 2948G switches, there are two user-configurable transmit queues and a single non-user-configurable transmit queue drop threshold for each port. Ports of this type are specified using the 2q1t keyword in QoS-related commands.
![]() | Caution On the Catalyst 4000 family and 2948G switches, when QoS is disabled, unicast traffic is assigned to queue 1 and broadcast, multicast, and unknown traffic is assigned to queue 2. If you enable QoS but do not modify the CoS-to-transmit queue mappings, switch performance could be affected because all traffic is assigned to queue 1. If you enable QoS, we recommend that you modify the CoS-to-transmit queue mappings. |
QoS requires these software and hardware versions:
On Catalyst 5000 family switches, the following hardware is required:
Use the show port capabilities command to determine the specific QoS support for a module.
Table 15-1 shows the QoS default configuration.
| Feature | Default Value |
|---|---|
QoS global enable state | Disabled |
Port CoS value (Catalyst 5000 family) | 0 |
Switch CoS value (Catalyst 4000 family and 2948G) | 0 |
Transmit queue drop threshold percentages | Catalyst 5000 family:
Catalyst 4000 family and 2948G:
|
CoS value-to-drop threshold mapping | Catalyst 5000 family:
Catalyst 4000 family and 2948G:
|
CoS value-to-transmit queue mapping | Catalyst 5000 family:
Catalyst 4000 family and 2948G:
|
| 1Non-user-configurable |
These sections describe how to configure QoS:
To enable QoS globally on the switch, perform this task in privileged mode:
| Task | Command |
|---|---|
Enable QoS on the switch. | set qos enable |
This example shows how to enable QoS:
Console> (enable) set qos enable QoS is enabled. Console> (enable)
On the Catalyst 4000 family and 2948G switches, QoS assigns unclassified frames received on any port on the switch the CoS value configured for the switch. The default CoS value is zero.
To set the default CoS value for a Catalyst 4000 family or 2948G switch, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Set the CoS value for the switch. | set qos defaultcos cos-value |
Step 2 Verify the CoS value of the switch. | show qos info [runtime | config] |
This example shows how to set CoS equal to 7 in all unclassified frames received on the switch and verify the configuration:
Console> (enable) set qos defaultcos 7 qos defaultcos set to 7 Console> (enable)
On the Catalyst 5000 family switches, QoS assigns to unclassified frames received through a supported port the CoS value configured for that port. The default CoS value is zero.
To set the CoS value for a port, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Set the CoS value for a port. | set port qos mod_num/port_num cos cos-value |
Step 2 Verify the CoS value of the port. | show port qos mod_num/port_num |
This example shows how to set CoS equal to 7 in all unclassified frames received through port 8/1 and verify the configuration:
Console> (enable) set port qos 8/1 cos 7 Port 8/1 qos cos set to 7 Console> (enable) show port qos 8/1 QoS is enabled on 8/1 Port 8/1 has 1 transmit queue with 4 drop thresholds (1q4t). QoS setting in NVRAM: Default CoS = 7 Run time setting of QoS: Default CoS = 7 Console> (enable)
On the Catalyst 4000 family and 2948G switches, to revert to the default switch CoS value, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Revert to the default CoS value for the switch. | clear qos defaultcos |
Step 2 Verify that the default CoS value was restored. | show qos info [runtime | config] |
This example shows how to revert to the default CoS value for port 8/1 and verify the configuration:
Console> (enable) clear qos defaultcos qos defaultcos setting cleared. Console> (enable)
On the Catalyst 5000 family switches, to revert to the default CoS value for a port, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Revert to the default CoS value for a port. | clear port qos mod_num/port_num cos |
Step 2 Verify that the default CoS value was restored. | show port qos mod_num/port_num |
This example shows how to revert to the default CoS value for port 8/1 and verify the configuration:
Console> (enable) clear port qos 8/1 cos Port 8/1 qos cos setting cleared. Console> (enable) show port qos 8/1 QoS is enabled on 8/1 Port 8/1 has 1 transmit queue with 4 drop thresholds (1q4t). QoS setting in NVRAM: Default CoS = 0 Run time setting of QoS: Default CoS = 0 Console> (enable)
To assign a CoS value to all frames destined for a particular host destination MAC address and VLAN number pair, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Assign a CoS value to a host destination MAC address/VLAN number pair. | set qos mac-cos dest_MAC_addr VLAN cos_value |
Step 2 Verify the assigned CoS value. | show qos mac-cos dest_MAC_addr [VLAN] show qos mac-cos all |
This example shows how to assign CoS 2 to a destination MAC address and VLAN number pair and verify the configuration:
Console> (enable) set qos mac-cos 00-40-0b-30-03-48 525 2 CoS 2 is assigned to 00-40-0b-30-03-48 vlan 525. Console> (enable) show qos mac-cos 00-40-0b-30-03-48 VLAN Dest MAC CoS ---- ------------------ --- 525 00-40-0b-30-03-48 2 Console> (enable)
The dest_addr/wildcardmask parameter is the destination IP address and netmask. The src_addr/wildcardmask parameter is the source IP address and netmask. The cos (CoS) parameter range is 0-7. The address and wildcard mask (use one bits in where you want wildcards) can specify a network, subnet, or host address.
Frames are compared to the access control entries sequentially. QoS uses the first match found. By default, ACE entries are added to the end of the access control list. Use the optional before ACE# keyword and parameter to position an entry within the list (use the show qos ip command to display the access control list).
To create an ACE, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Create an ACE. | set qos ip-filter cos dest_addr/wildcardmask src_addr/wildcardmask [before ACE#] set qos ip-filter cos dest_addr/wildcardmask src_addr/wildcardmask {tcp | udp | any} dst_port src_port [before ACE#>] |
Step 2 Verify the entry. | show qos ip |
This example shows how to create ACEs and an ACE within the list and verify the configuration:
Console> (enable) set qos ip 7 100.100.1.1/0.0.0.255 200.200.1.1/0.0.0.255
qos ip-filter is set successfully.
Console> (enable) show qos ip
There are 1 IP filter(s).
ACE# Dest IP/Mask Src IP/Mask
---- -------------------------------- --------------------------------
1 100.100.1.1/0.0.0.255 200.200.1.1/0.0.0.255
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
both 0 0 7
Console> (enable) set qos ip 4 120.100.1.1/0.0.0.255 210.210.1.1/0.0.0.255 tcp 23 47
qos ip-filter is set successfully.
Console> (enable) sh qos ip
There are 2 IP filter(s).
ACE# Dest IP/Mask Src IP/Mask
---- -------------------------------- --------------------------------
1 100.100.1.1/0.0.0.255 200.200.1.1/0.0.0.255
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
both 0 0 7
2 120.100.1.1/0.0.0.255 210.210.1.1/0.0.0.255
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
tcp 23 47 4
Console> (enable) set qos ip-filter 1 20.20.20.1/255.0.0.0 30.30.1.1/255.0.0.0 before 1
qos ip-filter is set successfully.
Console> (enable) sh qos ip
There are 3 IP filter(s).
ACE# Dest IP/Mask Src IP/Mask
---- -------------------------------- --------------------------------
1 20.20.20.1/255.0.0.0 30.30.1.1/255.0.0.0
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
both 0 0 1
2 100.100.1.1/0.0.0.255 200.200.1.1/0.0.0.255
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
both 0 0 7
3 120.100.1.1/0.0.0.255 210.210.1.1/0.0.0.255
Protocol Dst Port Src Port CoS
-------- -------- -------- ---
tcp 23 47 4
Use this command to enter router addresses used by QoS, except for the MLS-RP.
To configure a router address, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Configure a router for use with QoS. | set qos router-mac MAC_addr vlan |
Step 2 Verify the configuration. | show qos router-mac [MAC_addr | vlan] |
This example shows how to configure a router address in VLAN 2:
Console> (enable) set qos router-mac 00-40-0b-30-03-48 2
Router MAC/Vlan is set for QoS.
Console> (enable) show qos router-mac 00-40-0b-30-03-48
Number MAC address Vlan #
---------------------------------
1 00-40-0b-30-03-48 2
Console> (enable)
To remove a router or all routers from the QoS configuration, perform this task in privileged mode:
| Task | Command |
|---|---|
Step 1 Remove a router or all routers from the QoS configuration. | clear qos router-mac MAC_addr vlan clear qos router-mac all |
Step 2 Verify the configuration. | show qos router-mac |
This example shows how to clear a router address in VLAN 2:
Console> (enable) clear qos router-mac 00-40-0b-30-03-48 2 QoS Router MAC/Vlan(s) cleared. Console> (enable)
Use the set qos wred-threshold command to set the transmit queue drop thresholds.
The port_type is hardware-dependent. Use the show port capabilities command to determine the port_type for your hardware. The port type is defined by the number of transmit queues and the number of drop thresholds supported on the port. For example, the 1q4t port type supports one transmit queue and four drop thresholds.
The q# is the transmit queue number. The thresholds are specified as percentages, ranging from 1 to 100. A value of 10 indicates a threshold when the buffer is 10 percent full. The number of threshold percentages you can specify depends on the port_type.
To configure the transmit queue drop thresholds on all ports in the switch, perform this task in privileged mode:
| Task | Command |
|---|---|
Set the transmit drop queue thresholds. | set qos wred-threshold port_type tx queue q# threshold_percentage_values |
This example shows how to configure the transmit queue drop thresholds:
Console> (enable) set qos wred-threshold 1q4t tx queue 1 30 50 80 100 Transmit drop thresholds for queue 1 set at 30% 50% 80% 100% Console> (enable)
Use the set qos map command to associate CoS values to transmit queue drop thresholds.
The port_type is hardware-dependent. Use the show port capabilities command to determine the port_type for your hardware. The port type is defined by the number of transmit queues and the number of drop thresholds supported on the port. For example, the 1q4t port type supports one transmit queue and four drop thresholds.
The q# is the transmit queue number. The threshold# is the drop threshold number for the specified queue.
The cos_list is the list of CoS values to map to the specified transmit queue and drop threshold. On the Catalyst 4000 family and 2948G switches, CoS values must be specified in pairs (0-1, 2-3, 4-5, and 6-7).
To associate CoS values to a transmit queue and drop threshold, perform this task in privileged mode:
| Task | Command |
|---|---|
Associate a CoS value to a transmit queue and drop threshold. | set qos map port_type q# threshold# cos cos_list |
This example shows how to assign the CoS values 4 through 7 to the first transmit queue and the second drop threshold for that queue on a 1q4t port (Catalyst 5000 family switches):
Console> (enable) set qos map 1q4t 1 2 cos 4-7
Qos tx priority queue and threshold mapped to cos successfully.
Console> (enable)
This example shows how to map CoS values 4 through 7 to the second transmit queue and the first drop threshold for that queue on a 2q1t port (Catalyst 4000 family and 2926G switches):
Console> (enable) set qos map 2q1t 2 1 cos 4-7 Qos tx priority queue and threshold mapped to cos successfully. Console> (enable)
Use the clear qos map command to revert to the default CoS-to-transmit queue and drop threshold mappings.
The port_type is hardware-dependent. Use the show port capabilities command to determine the port_type for your hardware.
To revert to the default CoS-to-transmit queue and drop threshold mappings, perform this task in privileged mode:
| Task | Command |
|---|---|
Revert to default CoS-to-transmit queue and drop threshold mappings. | clear qos map port_type |
This example shows how to return the CoS-to-transmit queue and drop threshold mappings to the default values on 1q4t ports (Catalyst 5000 family switches):
Console> (enable) clear qos map 1q4t Qos map setting cleared. Console> (enable)
This example shows how to return the CoS-to-transmit queue and drop threshold mappings to the default values on 2q1t ports (Catalyst 4000 family and 2948G switches):
Console> (enable) clear qos map 2q1t Qos map setting cleared. Console> (enable)
To display QoS statistics, perform this task:
| Task | Command |
|---|---|
Display QoS statistics. | show qos statistics [mod_num[/port_num]] |
This example shows how to display QoS statistics for port 8/1:
Console> show qos statistics 8/1 On Transmit:Port 8/1 has 1 Queue(s) 4 Threshold(s) Q # Threshold #:Packets dropped --- ----------------------------------------------- 1 1:63551 pkts, 2:0 pkts, 3:0 pkts, 4:0 pkts Console>
To display QoS information, perform one of these tasks:
| Task | Command |
|---|---|
| Catalyst 5000 family switches: | |
| show qos info [runtime | config] mod_num/port_num |
| show qos info config port_type tx |
| Catalyst 4000 family and 2948G switches: | |
| show qos info [runtime | config] |
This example shows how to display the QoS information currently in NVRAM for port 1/1:
Console> show qos info runtime 8/1 Run time setting of QoS: QoS is enabled Port 8/1 has 1 transmit queue with 4 drop thresholds (1q4t). Default CoS = 0 Queue and Threshold Mapping: Queue Threshold CoS ----- --------- --------------- 1 1 0 1 1 2 2 3 1 3 4 5 1 4 6 7 Tx WRED thresholds: Queue # Thresholds in percentage ( in abs values ) ------- ------------------------------------------ 1 14% (16380 bytes) 28% (32764 bytes) 57% (65532 bytes) 100% (131068 bytes) Console>
This example shows how to display the QoS information for the transmit queue:
Console> (enable) show qos info config 1q4t tx QoS setting in NVRAM for 1q4t transmit: QoS is enabled Queue and Threshold Mapping: Queue Threshold CoS ----- --------- --------------- 1 1 0 1 1 2 2 3 1 3 4 5 1 4 6 7 Tx WRED thresholds: Queue # Thresholds in percentage ( in abs values ) ------- ------------------------------------------ 1 14% 28% 57% 100% Console>
This example shows how to display the current QoS configuration information for the switch (Catalyst 4000 family and 2948G switches):
Console> show qos info config QoS setting in NVRAM: QoS is enabled All ports have 2 transmit queues with 1 drop thresholds (2q1t). Default CoS = 4 Queue and Threshold Mapping: Queue Threshold CoS ----- --------- --------------- 1 1 0 1 2 3 2 1 4 5 6 7 Console>
To revert to QoS defaults, perform this task in privileged mode:
| Task | Command |
|---|---|
Revert to QoS defaults. | clear qos config |
This example shows how to revert to QoS defaults:
Console> (enable) clear qos config This command will disable QoS and take values back to factory default. Do you want to continue (y/n) [n]? y QoS config cleared. Console> (enable)
To disable QoS, perform this task in privileged mode:
| Task | Command |
|---|---|
Disable QoS on the switch. | set qos disable |
This example shows how to disable QoS:
Console> (enable) set qos disable QoS is disabled. Console> (enable)
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Thu Feb 10 09:09:18 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.