Information About Queuing and Scheduling
Traffic queuing is the ordering of packets and applies to both input and output of data. Device modules can support multiple queues, which you can use to control the sequencing of packets in different traffic classes. You can also set weighted random early detection (WRED) and taildrop thresholds. The device drops packets only when the configured thresholds are exceeded.
Traffic scheduling is the methodical output of packets at a desired frequency to accomplish a consistent flow of traffic. You can apply traffic scheduling to different traffic classes to weight the traffic by priority.
The queuing and scheduling processes allow you to control the bandwidth that is allocated to the traffic classes, so that you achieve the desired trade-off between throughput and latency for your network.
Table 7-1 describes the system-defined queues that you can use to perform queuing and scheduling.
Table 7-1 System-Defined Queue Types
|
|
|
2q4t |
Input |
2 queues with 4 WRED or tail drop thresholds per queue |
1p3q4t |
Output |
1 strict priority plus 3 normal queues or 4 normal queues with 4 WRED or tail-drop thresholds per queue |
8q2t |
Input |
8 queues with 2 tail drop thresholds per queue |
1p7q4t |
Output |
1 strict priority queue plus 7 normal queues or 8 normal queues with 4 WRED or tail drop thresholds per queue |
The queues match on the class of service (CoS) field. The device ensures that every CoS value from 0 to 7 maps to a queue for each queue type. Only one queue for a queue type can be assigned with a specific CoS value. For more information about the system-defined queues, see Table 3-3 .
This section includes the following topics:
Setting Ingress Port CoS
You can set the CoS field in all ingress packets for untrusted ports. By default, ports are trusted and the CoS field is not modified. You can use this method to configure the port state to trusted or untrusted.
For information about configuring ingress port CoS, see the “Configuring Ingress Port CoS” section.
Modifying Class Maps
You can modify the CoS values that are matched by system-defined queuing class maps, which modify the CoS-to-queue mapping. Table 3-3 lists the default system-defined CoS values. Each CoS value appears only once in the queues of the same type.
If you want to change the system-default queuing class maps, you must also change the queuing policies applied on the interfaces because any changes in the queuing class maps causes traffic disruptions and might also cause packet drops.
Caution
When you modify a system-defined
queuing class map, the changes occur immediately and it may disrupt traffic on all virtual device contexts (VDCs).
Note For traffic crossing Layer 3, the queue mapping CoS-to-queue occurs automatically.
For information about configuring class maps, see the “Modifying Queuing Class Maps” section.
Congestion Avoidance
You can use the following methods to proactively avoid traffic congestion on the device:
- Apply WRED to a class of traffic, which allows the device to drop packets based on the CoS field. WRED is designed to work with TCP traffic.
- Apply tail drop to a class of traffic, which allows the device to drop packets based on the CoS field.
For information about configuring congestion avoidance, see the “Configuring Congestion Avoidance” section.
Congestion Management
For ingress packets, you can configure congestion management by specifying a bandwidth that allocates a minimum data rate to a queue.
For egress packets, you can choose one of the following congestion management methods:
- Specify a bandwidth that allocates a minimum data rate to a queue.
- Impose a maximum data rate on a class of traffic so that excess packets are retained in a queue to shape the output rate.
- Allocate all data for a class of traffic to a priority queue. The device distributes the remaining bandwidth among the other queues.
For information about configuring congestion management, see the “Configuring Congestion Management” section.
Virtualization Support
A VDC is a logical representation of a set of system resources. Other than configuring class maps, queuing and scheduling apply only to the VDC where the commands are entered. For information about configuring class maps, see the “Modifying Queuing Class Maps” section.
For information about configuring VDCs, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.0.
Configuring Queuing and Scheduling
You configure queuing and scheduling by creating policy maps of type queuing that you apply to either traffic direction of an interface. You can modify system-defined class maps, which are used in policy maps to define classes of traffic to which you want to apply policies.
Additional considerations are:
- Changes to system class-maps take effect immediately across all VDCs.
The specified COS values immediately map to the new queues.
- Changes are disruptive.
The traffic passing through ports of the specified port type experience a brief period of traffic loss.
All ports of the specified type are affected. For example, if you change COS-to-queue mapping for the M1 10G egress interface type, then all M1 10G ports in all VDCs experience a brief disruption.
- Performance can be impacted.
If one or more ports of the specified type do not have a queuing policy applied that defines the behavior for the new queue, then the traffic mapping to that queue may experience performance degradation.
- If you change the COS-to-queue mapping by modifying the queuing class-maps, then ensure that a new queuing policy was applied to all ports of that type that use the new queues.
- By default, non-used queues do not have an allocated buffer. Allocate buffers to these queues to avoid tail drop.
- Changes to system class-maps are only made on the default VDC.
For information about configuring policy maps and class maps, see Chapter3, “Using Modular QoS CLI”
You can configure the congestion-avoidance features, which include tail drop and WRED, in any queue. You can configure one of the egress congestion management features, which include priority, shaping, and bandwidth in output queues, and bandwidth in input queues.
We recommend that you modify the CoS value before you create a policy map. You can modify the CoS values that are matched by device-defined class map queues. You must assign each CoS value from 0 to 7 to one or more of the queues for each queue type. Each CoS value can be used only once in each queue type.
The system-defined policy maps default-in-policy and default-out-policy are attached to all ports to which you do not apply a queuing policy map. The default policy maps cannot be configured. For more information about the default policy maps, see Table 3-5 .
This example shows that if you downgrade from Release 4.0(3) to Release 4.0(2) and enter the show running-configuration command, the input default queuing policy has an unknown enum in the display:
switch#
show running-config
version 4.0(2)
…
policy-map type queuing default-in-policy
class type queuing
unknown enum 0
queue-limit percent 50
bandwidth percent 80
class type queuing
unknown enum 0
queue-limit percent 50
bandwidth percent 20
If you copy and paste this configuration into any Cisco NX-OS release, the device sends errors while executing all the commands starting from the policy-map type queuing default-in-policy command. You may ignore these errors because they do not affect the performance of the device.
This section includes the following topics:
Configuring Ingress Port CoS
To make a port untrusted, set the CoS value to a static value.
Note ● By default, ports are trusted (trust CoS) and the CoS field is not modified. When you configure the ingress port CoS value, the port becomes untrusted
- For the untagged bridged traffic, a Cisco Nexus 7000 Series NX-OS device ignores the Differentiated Services Code Point (DSCP) and queues on ingress and egress direction, if the CoS value is 0.
- By default, Layer 3 ports trust DSCP and also copy the DSCP value to CoS.
You use the ingress default queues from the system-defined queue classes for the type of module to which you want to apply the policy map. For the list of system-defined class maps for each type of module, see Table 3-3.
The CoS values set using this procedure apply to all packet that ingress the specified interfaces, not just to the class-default packets. If you set the CoS value, the device modifies the value before ingress queuing and scheduling so the CoS-modified packets are classified differently.
Note If you want to change the system-defined queuing class-maps, you must either modify the configured queuing policies or create new queuing policies and attach these policies to the affected interfaces. If you fail to do so, you can render the default queuing or the configured queuing policies invalid, which may affect the interfaces in multiple VDCs.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. set cos value
5. exit
6. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
7. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing untrusted_port_cos switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name that you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 2q4t-in-q-default switch(config-pmap-c-que)# |
Configures the class map of type queuing, and then enters policy-map class queuing mode. Class queuing names are listed in Table 3-3 . Note To configure port CoS, you can use only an ingress default system-defined queue type. |
Step 4 |
set cos value Example: switch(config-pmap-c-que)# set cos 5 |
Sets the CoS field in all ingress packet to the value specified. The range is from 0 to 7. |
Step 5 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits policy-map queue mode, and enters configuration mode. |
Step 6 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type untrusted_port_cos |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 7 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Modifying Queuing Class Maps
You can modify the CoS values that are matched by system-defined class maps. Table 3-3 lists the default system-defined CoS values.
The system-defined class maps can only be changed from the default VDC. Changes occur immediately and are applied to all ports on all VDCs that use the modified class map.
Note When you modify a system-defined class map, the changes occur immediately and may disrupt traffic on all VDCs that use the modified class map.
The device automatically modifies the CoS values that you configured in other queues so that each CoS value appears only once in the queues of the same type.
BEFORE YOU BEGIN
Ensure that you are in the default VDC for the device.
SUMMARY STEPS
1. configure terminal
2. class-map type queuing match-any { class-queuing-name | WORD}
3. match cos value-range
4. (Optional) Repeat Steps 2 and 3 to modify CoS values for additional queues
5. exit
6. (Optional) show class-map type queuing [ class-queuing-name ]
7. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
class-map type queuing match-any class-queuing-name Example: switch(config)# class-map type queuing match-any 1p3q4t-out-pq1 switch(config-cmap-que)# |
Configures the class map of type queuing, and then enters class-map queuing mode. Class queuing names are listed in Table 3-3 . Note The match on WORD is used for defining hierarchical class-maps in a queuing policy. The argument, WORD, is supported only on the F-Series Modules. |
Step 3 |
match cos value-range Example: switch(config-cmap-que)# match 0-3,7 |
Sets the CoS value range matched by this queue. You can specify a range of values by using a hyphen between the beginning and ending values and a comma between values. The range is from 0 to 7. |
Step 4 |
Repeat Steps 2 and 3 to modify CoS values for additional queues. |
— |
Step 5 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits class-map queue mode and enters configuration mode. |
Step 6 |
show class-map type queuing [class-queuing-name] Example: switch(config)# show class-map type queuing |
(Optional) Displays information about all configured class maps or a selected class map of type queuing. Class queuing names are listed in Table 3-3 . |
Step 7 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring Congestion Avoidance
You can configure congestion avoidance with tail drop or WRED features. Both features can be used in ingress and egress policy maps.
Note WRED and tail drop cannot be configured in the same class.
This section includes the following topics:
Configuring Tail Drop
You can configure tail drop on both ingress and egress queues by setting thresholds by CoS values. The device will drop packets that exceed the thresholds. You can specify a threshold based on the queue size or buffer memory that is used by the queue.
Note You cannot configure the queue size on ingress 10-Gigabit Ethernet ports except for the 8 port 10-Gigabit Ethernet I/O module.
You use the system-defined queue classes for the type of module to which you want to apply the policy map. See Table 3-3.
Note WRED and tail drop cannot be configured in the same class.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. queue-limit cos value { threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent percent_of_queuelimit }
5. (Optional) Repeat Step 4 to assign tail drop thresholds for other CoS values.
6. (Optional) Repeat Steps 3 through 5 to assign tail drop thresholds for other queue classes.
7. exit
8. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
9. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ queuing-policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing shape_queues switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing, and then enters policy-map class queuing mode. Class queuing names are listed in Table 3-3 . |
Step 4 |
queue-limit cos value { threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent percent_of_queuelimit } Example: switch(config-pmap-c-que)# queue-limit cos 5 10 mbytes |
Assigns a tail drop threshold based on the queue size or percentage of the buffer memory that is used by the queue. The device will drop packets that exceed the specified threshold. You can configure the threshold by the number of packets, number of bytes, or the duration of time at the underlying interface minimum guaranteed link rate. The default threshold is in packets. The size is from 1 to 83886080. The duration is from 1 to 83886080. The percentage is from 1 to 100. The example shows how to set a tail drop threshold for packets with a CoS of 5 to a maximum size of 10 MB. |
Step 5 |
(Optional) Repeat Step 4 to assign tail drop thresholds for other CoS values. |
— |
Step 6 |
(Optional) Repeat Steps 3 through 5 to assign tail drop thresholds for other queue classes. |
— |
Step 7 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits policy-map queue mode and enters configuration mode. |
Step 8 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing shape_queues |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 9 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring WRED
Before configuring WRED, ensure that the CoS values are there (see the “Modifying Queuing Class Maps” section).
You can configure WRED on both ingress and egress queues to set minimum and maximum packet drop thresholds. The frequency of dropped packets increases as the queue size exceeds the minimum threshold. When the maximum threshold is exceeded, all packets for the CoS value are dropped.
Note You cannot configure WRED on ingress 10-Gigabit Ethernet ports except for the 8 port 10-Gigabit Ethernet I/O module.
You can configure WRED thresholds by CoS value, and configure a single WRED threshold to use on all CoS values that you do not specifically configure.
Note WRED and tail drop cannot be configured in the same class.
You use the system-defined queue classes for the type of module to which you want to apply the policy map. See Table 3-3.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. random-detect cos-based [ aggregate [ minimum-threshold ] { min-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent min-percent-of-qsize } [ maximum-threshold ] { max-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent max-percent-of-qsize }]
5. random-detect { cos cos-list [ minimum-threshold ] { min-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent min-percent-of-qsize } [ maximum-threshold ] { max-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent max-percent-of-qsize }}
6. (Optional) Repeat Step 5 to configure WRED for other CoS values.
7. (Optional) Repeat Steps 3 through 6 to configure WRED for other queuing classes.
8. exit
9. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
10. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ queuing-policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing shape_queues switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing, and then enters policy-map class queuing mode. Class queuing names are listed in Table 3-3 . |
Step 4 |
random-detect cos-based [ aggregate [ minimum-threshold ] { min-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent min-percent-of-qsize } [ maximum-threshold ] { max-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent max-percent-of-qsize }] Example 1: switch(config-pmap-c-que)# random-detect cos-based aggregate 10 mbytes 20 mbytes Example 2: switch(config-pmap-c-que)# random-detect cos-based aggregate percent 10 percent 20 |
Configures WRED for all CoS values not configured by a CoS-specific random-detect command. You can specify minimum and maximum thresholds used to drop packets from the queue. You can configure thresholds by the number of packets, number of bytes, the duration of time at the underlying interface minimum guaranteed link rate, or as the percentage of queue size. The minimum and maximum thresholds must be of the same type. If no aggregate arguments are supplied, no aggregate WRED is configured. The default threshold is in packets. The thresholds are from 1 to 83886080. The percentage range is from 1 to 100. Note You must enter this command, even if you enter the command with no values. Example 1 shows how to set the aggregate WRED thresholds for nonconfigured classes of traffic to a minimum of 10 MB and a maximum of 20 MB. Example 2 shows how to set the aggregate WRED thresholds for nonconfigured classes of traffic to a minimum of 10 percent and a maximum of 20 percent of the queue size. Note You can specify only one random-detect cos-based command in a class. |
Step 5 |
random-detect { cos cos-list [[ minimum-threshold ] { min-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent min-percent-of-qsize }] [ maximum-threshold ] { max-threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent max-percent-of-qsize }} Example 1: switch(config-pmap-c-que)# random-detect cos 5,7 15 mbytes 20 mbytes Example 2: switch(config-pmap-c-que)# random-detect cos 5 percent 5 percent 15 |
(Optional) Configures WRED for specific CoS values. You can specify minimum and maximum thresholds used to drop packets from the queue. You can configure thresholds by the number of packets, number of bytes, the duration of time at the underlying interface minimum guaranteed link rate, or as the percentage of the queue size. The minimum and maximum thresholds must be of the same type. The default threshold is in packets. Thresholds are from 1 to 83886080. The percentage range is from 1 to 100. Example 1 shows how to set the aggregate WRED thresholds for CoS values 5 and 7 to a minimum of 15 MB and a maximum of 20 MB. Example 2 shows how to set the aggregate WRED thresholds for CoS value 5 to a minimum of 5 percent and a maximum of 15 percent of the queue size. |
Step 6 |
(Optional) Repeat Step 5 to configure WRED for other CoS values. |
— |
Step 7 |
(Optional) Repeat Steps 3 through 6 to configure WRED for other queuing classes. |
— |
Step 8 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits policy-map queue mode and enters configuration mode. |
Step 9 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing shape_queues |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 10 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring Congestion Management
You can configure only one of the following congestion management methods in a policy map:
- Allocate a minimum data rate to a queue by using the bandwidth and bandwidth remaining commands.
- Allocate all data for a class of traffic to a priority queue by using the priority command. You can use the bandwidth remaining command to distribute remaining traffic among the nonpriority queues. By default, the system evenly distributes the remaining bandwidth among the nonpriority queues.
- Allocate a maximum data rate to a queue by using the shape command.
In addition to the congestion management feature that you choose, you can configure one of the following queue features in each class of a policy map:
This section includes the following topics:
Configuring Bandwidth and Bandwidth Remaining
You can configure the bandwidth and bandwidth remaining on both ingress and egress queues to allocate a minimum percentage of the interface bandwidth to a queue. You use the system-defined ingress or egress queue class for the type of module to which you want to apply the policy map. For the list of system-defined ingress or egress queue classes for each module, see Table 3-3.
Note If you configure bandwidth, you cannot configure the priority or shaping in the same policy map.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. bandwidth { rate [ bps | kbps | mbps | gbps ] | percent }
or
bandwidth remaining percent percent
5. (Optional) Repeat Steps 3 to 4 to assign bandwidth or bandwidth remaining for other queuing classes.
6. exit
7. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
8. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ queuing-policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing shape_queues switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing, and then enters policy-map class queuing mode. You must select one of the system-defined output queues. Class queuing names are listed in Table 3-3 . |
Step 4 |
bandwidth { rate [ bps | kbps | mbps | gbps ] | percent percent } Example 1: switch(config-pmap-c-que)# bandwidth 10 mbps Example 2: switch(config-pmap-c-que)# bandwidth percent 25 |
Assigns a minimum rate of the interface bandwidth to an output queue. You can configure a data rate by the bit rate or as the percentage of the underlying interface link rate. The default units are kbps. The data rate is from 1 to 10,000,000,000. The percentage range is from 1 to 100. Note You can use only the percent keyword for interfaces set to autonegotiate. Example 1 shows how to set the bandwidth to a minimum rate of 100 megabits per second (mbps). Example 2 shows how to set the bandwidth to a minimum of 25 percent of the underlying link rate. |
bandwidth remaining percent percent Example: switch(config-pmap-c-que)# bandwidth remaining percent 25 |
(Optional) Assigns the percentage of the bandwidth that remains to this queue. The range is from 0 to 100. The example shows how to set the bandwidth for this queue to 25 percent of the remaining bandwidth. |
Step 5 |
(Optional) Repeat Steps 3 to 4 to assign bandwidth or bandwidth remaining for other queuing classes. |
— |
Step 6 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits policy-map queue mode and enters configuration mode. |
Step 7 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing shape_queues |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 8 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring Priority
If you do not specify the priority, the system-defined egress pq queues behave as normal queues. For information on the system-defined type queuing class maps, see Chapter3, “Using Modular QoS CLI”.
You can configure only one level of priority on an egress priority queue. You use the system-defined priority queue class for the type of module to which you want to apply the policy map. For the list of available system-defined class maps for each module, see Table 3-3.
For the nonpriority queues, you can configure how much of the remaining bandwidth to assign to each queue. By default, the device evenly distributes the remaining bandwidth among the nonpriority queues.
Note If you configure priority, you cannot configure the bandwidth or shaping in the same policy map.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. priority [ level value ]
5. class type queuing class-queuing-name
6. bandwidth remaining percent percent
7. (Optional) Repeat Steps 5 to 6 to assign bandwidth remaining for the other nonpriority queues.
8. exit
9. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
10. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [queuing- policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing priority_queue1 switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name that you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config-pmap-que)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing, and then enters policy-map class queuing mode. You must select one of the system-defined priority queues. Class queuing names are listed in Table 3-3 . |
Step 4 |
priority [level value ] Example: switch(config-pmap-c-que)# priority |
Selects this queue as a priority queue. Only one priority level is supported. |
Step 5 |
class type queuing class-queuing-name Example: switch(config-pmap-c-que)# class type queuing 1p3q4t-out-q2 |
(Optional) Configures the class map of type queuing, and then enters policy-map class queuing mode. Class queuing names are listed in Table 3-3 . Choose a nonpriority queue where you want to configure the remaining bandwidth. By default, the system evenly distributes the remaining bandwidth among the nonpriority queues. |
Step 6 |
bandwidth remaining percent percent Example: switch(config-pmap-c-que)# bandwidth remaining percent 25 |
(Optional) Assigns the percent of the bandwidth that remains to this queue. The range is from 1 to 100. |
Step 7 |
(Optional) Repeat Steps 5 to 6 to assign the remaining bandwidth for the other nonpriority queues. |
— |
Step 8 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits the policy-map queue mode and enters configuration mode. |
Step 9 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing priority_queue1 |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 10 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring Shaping
Note The device forces the shape rate to the closest value in the following percentage intervals: 100, 50, 33, 25, 12.5, 6.25, 3.13, or 1.07.
You can configure shaping on an egress queue to impose a maximum rate on it. You use the system-defined egress queue class for the type of module to which you want to apply the policy map. For the list of available system-defined class maps for each module, see Table 3-3.
Note If you configure shaping, you cannot configure the bandwidth or priority in the same policy map.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. shape [ average ] { rate [ bps | kbps | mbps | gbps ] | percent percent }
5. (Optional) Repeat Steps 3 to 4 to configure shaping for other queuing classes.
6. exit
7. (Optional) policy-map type queuing [ policy-map-name | que-dynamic ]
8. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ queuing - policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing shape_queues switch(config-pmap-que)# |
Configures the policy map of type queuing, and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing and then enters policy-map class queuing mode. You must select one of the system-defined output queues. Class queuing names are listed in Table 3-3 . |
Step 4 |
shape [ average ] { rate [ bps | kbps | mbps | gbps ] | percent percent } Example 1: switch(config-pmap-c-que)# shape 10 mbps Example 2: switch(config-pmap-c-que)# shape percent 25 |
Assigns a maximum rate on an output queue. You can configure a data rate by the bit rate or as a percentage of the underlying interface link rate. The default bit rate is in bits per second (bps). The data rate is from 8000 bps to 10 gbps. The percentage range is from 1 to 100. Note You can use only the percent keyword for interfaces set to autonegotiate. Example 1 shows how to shape traffic to a maximum rate of 100 megabits per second (mbps). Example 2 shows how to shape traffic to a maximum of 25 percent of the underlying link rate. |
Step 5 |
(Optional) Repeat Steps 3 to 4 to configure shaping for other queuing classes. |
— |
Step 6 |
exit Example: switch(config-cmap-que)# exit switch(config)# |
Exits policy-map queue mode and enters configuration mode. |
Step 7 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing shape_queues |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 8 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |
Configuring Queue Limits
You can configure the queue limit on both ingress and egress queues. The device drops any packets that exceed the queue limit. You use the system-defined queue classes for the type of module to which you want to apply the policy map. See Table 3-3.
SUMMARY STEPS
1. configure terminal
2. policy-map type queuing [ match-first ] { queuing-policy-map-name | que-dynamic }
3. class type queuing class-queuing-name
4. queue-limit { threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent percent_of_queuelimit }
5. exit
6. exit
7. (Optional) show policy-map type queuing [ policy-map-name | que-dynamic ]
8. (Optional) copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
configure terminal Example: switch# configure terminal switch(config)# |
Enters configuration mode. |
Step 2 |
policy-map type queuing [ match-first ] [ queuing-policy-map-name | que-dynamic ] Example: switch(config)# policy-map type queuing shape_queues switch(config-pmap-que)# |
Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters. |
Step 3 |
class type queuing class-queuing-name Example: switch(config)# class type queuing 1p3q4t-out-pq1 switch(config-pmap-c-que)# |
Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in Table 3-3 . |
Step 4 |
queue-limit { threshold [ packets | bytes | kbytes | mbytes | ms | us ] | percent percent_of_queuelimit } Example: switch(config-pmap-c-que)# queue-limit 10 mbytes |
Assigns a queue limit based on the queue size or percentage of the buffer memory used by the queue. The device will drop packets that exceed the specified threshold. You can configure the threshold by the number of packets, number of bytes, or the duration of time at the underlying interface minimum guaranteed link rate. The default threshold is in packets. The size is from 1 to 83886080. The duration is from 1 to 83886080. The percentage range is from 1 to 100. The example shows how to set a queue limit to a maximum size of 10 MB. |
Step 5 |
exit Example: switch(config-pmap-c-que)# exit switch(config-pmap-que)# |
Exits class-map queue mode and enters policy-map queue mode. |
Step 6 |
exit Example: switch(config-pmap-que)# exit switch(config)# |
Exits policy-map queue mode and enters configuration mode. |
Step 7 |
show policy-map type queuing [ policy-map-name | que-dynamic ] Example: switch(config)# show policy-map type queuing shape_queues |
(Optional) Displays information about all configured policy maps or a selected policy map of type queuing. |
Step 8 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the running configuration to the startup configuration. |