Table Of Contents
Differentiated Services Compliant Distributed Weighted Random Early Detection
Functional Description of dWRED
Supported Standards, MIBs, and RFCs
Configuring dWRED to Use the DSCP Value
Verifying the DSCP Value Configuration
dWRED Configured to Use the DSCP Value Example
DSCP Value Configuration Verification Example
random-detect (interface and policy map class)
Differentiated Services Compliant Distributed Weighted Random Early Detection
Feature History
Note
This document describes the Differentiated Services Compliant Distributed Weighted Random Early Detection (DiffServ Compliant dWRED) feature that was introduced in Cisco IOS Release 12.1(5a)E and is also available in Cisco IOS Release 12.0(15)S and Cisco IOS Release 12.2(14)S or later on Versatile Interface Processor (VIP)-enabled Cisco 7500 series routers and FlexWAN-enabled Catalyst 6000 family switches (in Release 12.1 E only); this is not the document for the DiffServ Compliant Weighted Random Early Detection feature that was originally released in Cisco IOS Release 12.1 T.
If you are running Cisco IOS Release 12.1(5)T or a later release a nd need information on the DiffServ Compliant Weighted Random Early Detection feature, refer to the DiffServ Compliant Weighted Random Early Detection document on the Cisco IOS Release 12.1(5)T documentation index.This document describes the Differentiated Services Compliant Distributed Weighted Random Early Detection (DiffServ Compliant dWRED) feature for Release 12.1(5a)E, 12.0(15)S, and 12.2(14)S and includes the following sections:
•
Supported Standards, MIBs, and RFCs
Feature Overview
This feature enables distributed Weighted Random Early Detection (dWRED) to use the differentiated services code point (DSCP) value when it calculates the drop probability for a packet. The DSCP value is the first six bits of the IP type of service (ToS) byte.
For a description of how dWRED detects and drops packets, see the "Functional Description of dWRED" section of this document.
The random-detect command is used to enable DSCP-based dWRED and is introduced on Cisco IOS Release 12.1(5a)E and Release 12.0(15)S as part of this feature (for information on DiffServ Compliant WRED on Release 12.1 T or later release, refer to the note at the beginning of this document).
This feature adds two new arguments, dscp-based and prec-based, to the existing random-detect QoS policy-map class command.
The dscp-based argument enables dWRED to use the DSCP value of a packet when it calculates the drop probability for the packet. The prec-based argument enables dWRED to use the IP Precedence value of a packet when it calculates the drop probability for the packet.
These arguments are optional (you need not use either of them to use the commands), but they are also mutually exclusive; that is, if you use the dscp-based argument, you cannot use the prec-based argument with the same command.
The random-detect dscp command is then entered to configure the dWRED parameters on a particular DSCP value or code point (the code point explanation begins in the next paragraph). The dWRED parameters include the minimum and maximum threshold values, and the mark probability denominator.
This feature also allows users to enable dWRED using the Assured Forwarding (AF) code points, the Expedited Forwarding (EF) code point, and Class Selector (CS) values within the IP DSCP header. The AF code points provide a means for a domain to offer four different levels (four different AF classes) of forwarding assurances for IP packets received from other (such as customer) domains. Each one of the four AF classes is allocated a certain amount of forwarding services (buffer space and bandwidth).
Within each AF class, IP packets are marked with one of three possible drop precedence values (binary 2{010}, 4{100}, or 6{110}), which exist as the three lowest bits in the DSCP header. In congested network environments, the drop precedence value of the packet determines the importance of the packet within the AF class. Packets with higher drop precedence values are discarded before packets with lower drop precedence values.
The upper three bits of the IP DSCP value determine the AF class; the lower three values determine the drop probability.
The EF code point is usually used to mark high priority, time-sensitive data. The EF code point marking is equal to the highest IP precedence value; therefore, the EF code point is always equal to precedence value 7.
The CS values are equal to IP precedence values (for instance, cs1 is the same as IP precedence 1).
Usage Points to Note
Remember the following points when using the new commands and the new arguments:
•
If you use the dscp-based argument, dWRED will use the DSCP value to calculate the drop probability.
•
If you use the prec-based argument, dWRED will use the IP precedence value to calculate the drop probability.
•
The dscp-based and prec-based arguments are mutually exclusive. If you do not specify either argument, dWRED will use the IP precedence value to calculate the drop probability (the default method).
•
The random-detect dscp command that is used to configure the dWRED parameters in QoS policy-map class configuration mode must be used in conjunction with the random-detect (QoS policy-map class) command.
•
The random-detect dscp command can be used only if you use the dscp-based argument with the random-detect (QoS policy-map class) command.
Functional Description of dWRED
When a packet arrives, the following events occur:
•
The average queue size is calculated. See the "Average Queue Size" section for details.
•
If the average queue size is less than the minimum queue threshold, the arriving packet is queued.
•
If the average queue size is between the minimum queue threshold and the maximum queue threshold, the packet is either dropped or queued, depending on the packet drop probability. See the "Packet-Drop Probability" section for details.
•
If the average queue size is greater than the maximum queue threshold, the packet is automatically dropped.
Average Queue Size
The average queue size is based on the previous average and the current size of the queue. The formula is:
average_queue_size = (old_average * (1-1/2^n)) + (current_queue_size * 1/2^n)
where n is the exponential weight factor, a user-configurable value.
Note
We recommend using the default value for the exponential weight factor. Change this value from the default value only if you have determined that your situation would benefit from using a different value.
For high values of n, the previous average queue size becomes more important. A large factor smooths out the peaks and lows in queue length. The average queue size is unlikely to change very quickly, avoiding drastic swings in size. The dWRED process is slow to start dropping packets, but it may continue dropping packets for a time after the actual queue size has fallen below the minimum threshold. The slow-moving average accommodates temporary bursts in traffic.
If the value of n becomes too high, dWRED does not react to congestion. Packets are sent or dropped as if dWRED were not in effect.
For low values of n, the average queue size closely tracks the current queue size. The resulting average may fluctuate with changes in the traffic levels. In this case, the dWRED process responds quickly to long queues. Once the queue falls below the minimum threshold, the process stops dropping packets.
If the value of n becomes too low, dWRED overreacts to temporary traffic bursts and drops traffic unnecessarily.
Packet-Drop Probability
The probability that a packet will be dropped is based on the minimum threshold, maximum threshold, and mark probability denominator.
When the average queue size is above the minimum threshold, RED starts dropping packets. The rate of packet drop increases linearly as the average queue size increases, until the average queue size reaches the maximum threshold.
The mark probability denominator is the fraction of packets dropped when the average queue size is at the maximum threshold. For example, if the denominator is 512, one out of every 512 packets is dropped when the average queue size is at the maximum threshold.
When the average queue size is above the maximum threshold, all packets are dropped.
Figure 1 summarizes the packet drop probability.
Figure 1 dWRED Packet Drop Probability
The minimum threshold value should be set high enough to maximize the link utilization. If the minimum threshold is too low, packets may be dropped unnecessarily, and the transmission link will not be fully used.
The difference between the maximum threshold and the minimum threshold should be large enough to avoid global synchronization of TCP hosts (global synchronization of TCP hosts can occur as multiple TCP hosts reduce their transmission rates). If the difference between the maximum and minimum thresholds is too small, many packets may be dropped at once, resulting in global synchronization.
Benefits
This feature extends the functionality of dWRED to enable support for Differentiated Services (DiffServ) and Assured Forwarding (AF) Per Hop Behavior (PHB). This feature enables dWRED to be compliant with the DiffServ standard and the AF PHB Internet Engineering Task Force (IETF) standard.
This feature enables customers to implement AF PHB by marking packets according to DSCP values and then assigning preferential drop probabilities to those packets.
Restrictions
IP Packets
This feature can be used with IP packets only. It is not intended for use with Multiprotocol Label Switching (MPLS)-encapsulated or other packets.
User-Defined Traffic Class Limitations
Either the bandwidth or the shape command must be used in conjunction with dWRED when dWRED is configured in a traffic policy (also known as a policy map) using a user-defined, nondefault traffic class (which is also known as a class map). Therefore, either the bandwidth or the shape command must be entered in the same traffic policy as the random-detect command if the traffic policy is not using the default traffic class.
If the traffic policy is using the default traffic class, the bandwidth and shape commands need not be specified in the traffic policy configuration.
Output Policy Limitation
A traffic policy configured using dWRED can be attached only at the output direction of an interface (the service-policy output command can be used to attach a traffic policy containing dWRED; the service-policy input command cannot be used).
Supported Platforms
This feature is supported on the following platforms:
•
Cisco 7500 series routers with a VIP2-40 or later VIP release
•
Catalyst 6000 family switches with a FlexWAN module
Note
The Catalyst 6000 family of switches do not run Cisco IOS Release 12.0 S or 12.2(14)S.
Determining Platform Support Through Cisco Feature Navigator
Cisco IOS software is packaged in feature sets that are supported on specific platforms. To get updated information regarding platform support for this feature, access Cisco Feature Navigator. Cisco Feature Navigator dynamically updates the list of supported platforms as new platform support is added for the feature.
Cisco Feature Navigator is a web-based tool that enables you to determine which Cisco IOS software images support a specific set of features and which features are supported in a specific Cisco IOS image. You can search by feature or release. Under the release section, you can compare releases side by side to display both the features unique to each software release and the features in common.
To access Cisco Feature Navigator, you must have an account on Cisco.com. If you have forgotten or lost your account information, send a blank e-mail to cco-locksmith@cisco.com. An automatic check will verify that your e-mail address is registered with Cisco.com. If the check is successful, account details with a new random password will be e-mailed to you. Qualified users can establish an account on Cisco.com by following the directions found at this URL:
Cisco Feature Navigator is updated regularly when major Cisco IOS software releases and technology releases occur. For the most current information, go to the Cisco Feature Navigator home page at the following URL:
Availability of Cisco IOS Software Images
Platform support for particular Cisco IOS software releases is dependent on the availability of the software images for those platforms. Software images for some platforms may be deferred, delayed, or changed without prior notice. For updated information about platform support and availability of software images for each Cisco IOS software release, refer to the online release notes or, if supported, Cisco Feature Navigator.
Supported Standards, MIBs, and RFCs
Standards
The Differentiated Services and the Assured Forwarding Per-Hop Behavior standards are supported by this feature.
MIBs
The Class-Based Quality of Service MIB supports this feature. This MIB is actually the following two MIBs:
•
CISCO-CLASS-BASED-QOS-MIB
•
CISCO-CLASS-BASED-QOS-CAPABILITY-MIB
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:
http://tools.cisco.com/ITDIT/MIBS/servlet/index
If Cisco MIB Locator does not support the MIB information that you need, you can also obtain a list of supported MIBs and download MIBs from the Cisco MIBs page at the following URL:
http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
To access Cisco MIB Locator, you must have an account on Cisco.com. If you have forgotten or lost your account information, send a blank e-mail to cco-locksmith@cisco.com. An automatic check will verify that your e-mail address is registered with Cisco.com. If the check is successful, account details with a new random password will be e-mailed to you. Qualified users can establish an account on Cisco.com by following the directions found at this URL:
RFCs
•
RFC 2474, Definition of the Differentiated Services Field in IPv4 and IPv6 Headers
•
RFC 2475, An Architecture for Differentiated Services Framework
•
RFC 2597, Assured Forwarding PHB
•
RFC 2598, An Expedited Forwarding PHB
Configuration Tasks
See the following sections for configuration tasks for the DiffServ Compliant Distributed Weighted Random Early Detection feature. Each task in the list is identified as optional or required.
•
Configuring dWRED to Use the DSCP Value (required)
•
Verifying the DSCP Value Configuration (optional)
Configuring dWRED to Use the DSCP Value
To configure dWRED to use the DSCP value when it calculates the drop probability, use the following commands beginning in interface configuration mode. These are the commands to use at the class level, within policy maps.
Note
dWRED using DSCP values is enabled using the Modular QoS Command Line Interface (CLI.) For additional information on the Modular QoS CLI, including information on match criteria and QoS feature options, see the Modular QoS CLI document on Cisco.com.
Verifying the DSCP Value Configuration
To verify the DSCP value configuration, use either of the following commands in global configuration mode:
Configuration Examples
This section provides the following configuration examples:
•
dWRED Configured to Use the DSCP Value Example
•
DSCP Value Configuration Verification Example
dWRED Configured to Use the DSCP Value Example
The following example enables dWRED to use the DSCP value 8 for class c1. The minimum threshold for DSCP value 8 is 24 and the maximum threshold is 40. The last line attaches the traffic policy so the traffic policy applies to all traffic leaving interface pos10/0/0.
Router(config-if)# class-map c1Router(config-cmap)# match access-group 101Router(config-if)# policy-map p1Router(config-pmap)# class c1Router(config-pmap-c)# bandwidth 48Router(config-pmap-c)# random-detect dscp-basedRouter(config-pmap-c)# random-detect dscp 8 24 40Router# interface pos10/0/0Router(config-if)# service-policy output p1DSCP Value Configuration Verification Example
In the following example, all traffic marked with the IP DSCP values of 17 and 53 in the default traffic class of the policy map named random-dscp is dWRED-enabled:
Router# show policy-map random-dscpPolicy Map random-dscpClass class-defaultrandom-detect dscp-basedrandom-detect dscp 17 100 200 10random-detect dscp 53 200 400 10Assuming policy map random-dscp is attached to interface pos10/0/0, the following output would appear after entering the show policy-map interface command. The show policy-map interface command displays only output for DSCP values that were user-configured or for active DSCP values. Note that both user-configured DSCP values (17 and 53) appear in the command output, and that DSCP value 0 appears because it is active.
Router# show policy-map interface pos10/0/0POS10/0/0Service-policy output:random-dscp (1080)Class-map:class-default (match-any) (1081/0)0 packets, 0 bytes30 second offered rate 0 bps, drop rate 0 bpsMatch:any (1083)0 packets, 0 bytes30 second rate 0 bpsqueue size 0, queue limit 23264packets output 5, packet drops 0tail/random drops 0, no buffer drops 0, other drops 0Random-detect:Exp-weight-constant:9 (1/512)Mean queue depth:0Class Random Tail Minimum Maximum Mark Outputdrop drop threshold threshold probability packets0 0 0 5816 11632 1/10 517 0 0 100 200 1/10 053 0 0 200 400 1/10 0Command Reference
This section documents the following new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.2 command reference publications.
Note
The command pages in this section document the entire history of each command, including the introduction of the command on platforms not supported by the DiffServ Compliant dWRED feature. Therefore, the command references might contain information that does not pertain to DiffServ Compliant dWRED but does pertain to the command.
If information in the command reference does not pertain to the DiffServ Compliant dWRED feature, the difference is noted in the command reference for that particular command.
•
random-detect (interface and policy map class)
random-detect dscp
To change the minimum and maximum packet thresholds for the differentiated services code point (DSCP) value, use the random-detect dscp command in interface or QoS policy-map class configuration mode. To return the minimum and maximum packet thresholds to the default for the DSCP value, use the no form of this command.
random-detect dscp dscp-value min-threshold max-threshold [mark-probability-denominator]
no random-detect dscp dscp-value min-threshold max-threshold [mark-probability-denominator]
Syntax Description
Defaults
The default values for this command are different on Versatile Interface Processor (VIP)-enabled Cisco 7500 series routers and Catalyst 6000 family switches with a FlexWAN module (dWRED). All other platforms running WRED have another set of default values.
Both sets of default values are described in the "Usage Guidelines" section.
Command Modes
Interface configuration
Policy map class configuration
Command History
Usage Guidelines
VIP-Enabled Cisco 7500 Series Routers and Catalyst 6000 Family Switches with a FlexWAN Module Defaults
For all IP precedence values, the default mark-probability-denominator is 10, and the max-threshold value is based on the output buffering capacity and the transmission speed of the interface.
The default min-threshold value depends on the IP precedence value. The min-threshold value for IP precedence 0 corresponds to half of the max-threshold value. The values for the remaining IP precedence values fall between half the max-threshold and the max-threshold at even interval.
Unless the maximum and minimum threshold values for the IP DSCP values are configured by the user, all DSCP values have the same minimum threshold and maximum threshold values as the value specified for precedence 0.
Table 1 lists the default minimum threshold value for each IP precedence value.
Non-VIP-Enabled Cisco 7500 Series Routers and Catalyst 6000 Family Switches with a FlexWAN Module Defaults
All platforms except the VIP-enabled Cisco 7500 series router and the Catalyst 6000 have the following default values.
If WRED is using the DSCP value to calculate the drop probability of a packet, all 64 entries of the DSCP table are initialized with the default settings shown in Table 2.
This command is not available at the interface level for Cisco IOS Release 12.1 E or Release 12.0 S. This command is only available in policy-map class configuration mode in Cisco IOS Release 12.1 E.
The random-detect dscp command allows you to specify the DSCP value. The DSCP value can be a number from 0 to 63, or it can be one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, or ef.
The Assured Forwarding (AF) code points provide a means for a domain to offer four different levels (four different AF classes) of forwarding assurances for IP packets received from other (such as customer) domains. Each one of the four AF classes is allocated a certain amount of forwarding services (buffer space and bandwidth).
Within each AF class, IP packets are marked with one of three possible drop precedence values (binary 2{010}, 4{100}, or 6{110}), which exist as the three lowest bits in the DSCP header. In congested network environments, the drop precedence value of the packet determines the importance of the packet within the AF class. Packets with higher drop precedence values are discarded before packets with lower drop precedence values.
The upper three bits of the IP DSCP value determine the AF class; the lower three values determine the drop probability.
The Expedited Forwarding (EF) code point is usually used to mark high-priority, time-sensitive data. The EF code point marking is equal to the highest precedence value; therefore, the EF code point is always equal to precedence value 7.
The Class Selector (CS) values are equal to IP precedence values (for instance, cs1 is the same as IP precedence 1).
On a particular traffic class, eight DSCP values can be configured per traffic class. Overall, 29 values can be configured on a traffic class: 8 precedence values, 12 AF code points, 1 EF code point, and 8 user-defined DSCP values.
This command must be used in conjunction with the random-detect (interface and policy map class) command.
Additionally, the random-detect dscp command is available only if you specified the dscp-based argument when using the random-detect (interface and policy map class) command.
Examples
The following example enables WRED to use the DSCP value 8. The minimum threshold for the DSCP value 8 is 20, the maximum threshold is 40, and the mark probability is 1/10.
random-detect dscp 8 20 40 10Related Commands
random-detect (interface and policy map class)
To enable Weighted Random Early Detection (WRED) or distributed WRED (dWRED), use the random-detect command in interface configuration mode. To configure WRED in a traffic policy, use the random-detect command in QoS policy-map class configuration mode. To disable WRED or dWRED, use the no form of this command.
random-detect [dscp-based | prec-based]
no random-detect [dscp-based | prec-based]
Syntax Description
Defaults
WRED and dWRED are disabled by default.
If you choose not to use either the dscp-based or the prec-based argument, WRED uses the IP Precedence value (the default method) to calculate drop probability for the packet.
Command Modes
Interface configuration (when used on an interface)
QoS policy-map class (configuration when used to specify class policy in a policy map)
Command History
Usage Guidelines
This command is not available at the interface level for Cisco IOS Release 12.1 E or Release 12.0 S. This command is available only in QoS policy-map class configuration mode in Cisco IOS Release 12.1 E.
This command includes two optional arguments, dscp-based and prec-based, that determine the method WRED uses to calculate the drop probability of a packet.
Note the following points when deciding which method to instruct WRED to use:
•
With the dscp-based argument, WRED uses the DSCP value (that is, the first six bits of the IP type of service [ToS] byte) to calculate the drop probability.
•
With the prec-based argument, WRED uses the IP precedence value to calculate the drop probability.
•
The dscp-based and prec-based arguments are mutually exclusive.
•
If neither argument is specified, WRED uses the IP precedence value to calculate the drop probability (the default method).
Examples
The following example enables WRED to use the DSCP value 8. The minimum threshold for DSCP value 8 is 24 and the maximum threshold is 40. This configuration was performed at the interface level and is therefore unavailable in Cisco IOS Release 12.1 E.
Router(config-if)# interface seo/0Router(config-if)# random-detect dscp-basedRouter(config-if)# random-detect dscp 8 24 40The following example enables WRED to use the DSCP value 8 for class c1. The minimum threshold for DSCP value 8 is 24 and the maximum threshold is 40. The last line attaches the service policy to the output interface or virtual circuit (VC) p1.
Router(config-if)# class-map c1Router(config-cmap)# match access-group 101Router(config-if)# policy-map p1Router(config-pmap)# class c1Router(config-pmap-c)# bandwidth 48Router(config-pmap-c)# random-detect dscp-basedRouter(config-pmap-c)# random-detect dscp 8 24 40Router(config-if)# service-policy output p1Related Commands
Glossary
AF code points—Assured Forwarding code points. The AF code points provide a means for a domain to offer four different levels (four different AF classes) of forwarding assurances for IP packets received from other (such as customer) domains. Each one of the four AF classes is allocated a certain amount of forwarding services (buffer space and bandwidth).
Within each AF class, IP packets are marked with one of three possible drop precedence values (binary 2{010}, 4{100}, or 6{110}), which exist as the three lowest bits in the DSCP header. In congested network environments, the drop precedence value of the packet determines the importance of the packet within the AF class. Packets with higher drop precedence values are discarded before packets with lower drop precedence values.
The upper three bits of the IP DSCP value determine the AF class; the lower three values determine the drop probability.
Assured Forwarding code points—see AF code points.
average queue size—The average queue depth is used in WRED congestion management and is determined by using the following formula:
average = (old_average * (1-1/2^n)) + (current_queue_size * 1/2^n)
where n is the user-defined exponential weighted constant number (although we suggest using the default value in most scenarios; the default value is 9). The average queue depth is used to determine if congestion is present on the interface. If the incoming traffic rate is larger than the queue depth, WRED begins systematically dropping packets to smooth the link.
current queue size—The current queue depth is the current size of the queue. The current queue depth is used as part of the average queue depth calculation when using WRED for congestion avoidance purposes.
EF code point—Expedited Forwarding code point. The EF code point is usually used to mark high-priority, time-sensitive data. The EF code point marking is equal to the highest precedence value; therefore, the EF code point is always equal to precedence value 7.
Expedited Forwarding code point—see EF code point.
exponential weighting constant number—The exponential weighting constant number is used to calculate the average queue depth in WRED congestion management. The average queue depth is used in WRED congestion management and is determined by using the following formula:
average = (old_average * (1-1/2^n)) + (current_queue_size * 1/2^n)
where n is the exponential weighting constant number (although we suggest using the default value in most scenarios; the default value is 9).
mark probability denominator—The mark probability denominator is the fraction of packets dropped when the average queue size is at the maximum threshold. For example, if the denominator is 512, one out of every 512 packets is dropped when the average queue is at the maximum threshold.
maximum threshold parameter—The maximum threshold parameter is specified as part of the WRED and dWRED congestion management features. When the average queue depth exceeds the minimum threshold, WRED or dWRED senses congestion and begins dropping packets. The rate of packet drops until the maximum threshold parameter is met.
minimum threshold parameter—The minimum threshold parameter is specified as part of the WRED and dWRED congestion management features. When the average queue depth exceeds the minimum threshold, WRED or dWRED senses congestion and begins dropping packets. The rate of packet drops until the maximum threshold parameter is met.


