Table Of Contents
Configuring Weighted Random Early Detection
Weighted Random Early Detection Configuration Task List
Configuring DWRED in a Traffic Policy
Configuring DWRED to Use IP Precedence Values in a Traffic Policy
Monitoring and Maintaining DWRED
Flow-Based WRED Configuration Task List
DiffServ Compliant WRED Configuration Task List
Configuring WRED to Use the Differentiated Services Code Point Value
Verifying the DSCP Value Configuration
Parameter-Setting DWRED Example
Parameter-Setting WRED Example
DWRED on an Interface: Example
Configuring DWRED in Traffic Policy: Example
Flow-Based WRED Configuration Example
DiffServ Compliant WRED Configuration Examples
WRED Configured to Use the DSCP Value: Example
DSCP Value Configuration Verification: Example
Configuring Weighted Random Early Detection
Feature History
Release ModificationCisco IOS
For information about feature support in Cisco IOS software, use Cisco Feature Navigator.
This chapter describes the tasks for configuring Weighted Random Early Detection (WRED), distributed WRED (DWRED), flow-based WRED, and DiffServ Compliant WRED on a router.
For complete conceptual information, see the "Congestion Avoidance Overview" module in this book.
For a complete description of the WRED and DWRED commands in this chapter, see the Cisco IOS Quality of Service Solutions Command Reference. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online.
The RSVP-ATM QoS Interworking and IP to ATM Class of Service features also use WRED. For information on how to configure these features with WRED, see the chapters "Configuring RSVP-ATM QoS Interworking" and "Configuring IP to ATM Class of Service" in this book.
Use Cisco Feature Navigator to find information about platform support and Cisco IOS and Catalyst OS software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Note
WRED is useful with adaptive traffic such as TCP/IP. With TCP, dropped packets indicate congestion, so the packet source will reduce its transmission rate. With other protocols, packet sources may not respond or may resend dropped packets at the same rate. Thus, dropping packets does not decrease congestion.
WRED treats non-IP traffic as precedence 0, the lowest precedence. Therefore, non-IP traffic is more likely to be dropped than IP traffic.
You cannot configure WRED on the same interface as Route Switch Processor (RSP)-based custom queueing (CQ), priority queueing (PQ), or weighted fair queueing (WFQ). However, you can configure both DWRED and DWFQ on the same interface.
Weighted Random Early Detection Configuration Task List
Random Early Detection (RED) is a congestion avoidance mechanism that takes advantage of the congestion control mechanism of TCP. By randomly dropping packets prior to periods of high congestion, RED tells the packet source to decrease its transmission rate. WRED drops packets selectively based on IP precedence. Edge routers assign IP precedences to packets as they enter the network. (WRED is useful on any output interface where you expect to have congestion. However, WRED is usually used in the core routers of a network, rather than at the edge.) WRED uses these precedences to determine how it treats different types of traffic.
When a packet arrives, the following events occur:
1.
The average queue size is calculated.
2.
If the average is less than the minimum queue threshold, the arriving packet is queued.
3.
If the average is between the minimum queue threshold for that type of traffic and the maximum threshold for the interface, the packet is either dropped or queued, depending on the packet drop probability for that type of traffic.
4.
If the average queue size is greater than the maximum threshold, the packet is dropped.
See the "Congestion Avoidance Overview"module in this book for more details on the queue calculations and how WRED works.
To configure WRED on an interface, perform the tasks described in the following sections. The task in the first section is required; the tasks in the remaining sections are optional.
•
Enabling WRED (Required)
•
Changing WRED Parameters (Optional)
•
Monitoring WRED (Optional)
See the end of this chapter for the section "WRED Configuration Examples."
Enabling WRED
To enable WRED, use the following command in interface configuration mode:
Command PurposeRouter(config-if)# random-detect
Enables WRED. If you configure this command on a Versatile Interface Processor (VIP) interface, DWRED is enabled.
You need not specify any other commands or parameters in order to configure WRED on the interface. WRED will use the default parameter values.
Changing WRED Parameters
To change WRED parameters, use the following commands in interface configuration mode, as needed:
When you enable WRED with the random-detect interface configuration command, the parameters are set to their default values. The weight factor is 9. For all precedences, the mark probability denominator is 10, and maximum threshold is based on the output buffering capacity and the transmission speed for the interface.
The default minimum threshold depends on the precedence. The minimum threshold for IP Precedence 0 corresponds to half of the maximum threshold. The values for the remaining precedences fall between half the maximum threshold and the maximum threshold at evenly spaced intervals.
Note
The default WRED parameter values are based on the best available data. We recommend that you do not change the parameters from their default values unless you have determined that your applications will benefit from the changed values.
Monitoring WRED
To monitor WRED services in your network, use the following commands in EXEC mode, as needed:
DWRED Configuration Task List
To configure DWRED, perform the tasks described in the following sections. The tasks in the first two sections are required; the task in the remaining section is optional.
•
Configuring DWRED in a Traffic Policy (Required)
•
Configuring DWRED to Use IP Precedence Values in a Traffic Policy (Required)
•
Monitoring and Maintaining DWRED (Optional)
See the end of this chapter for the section "DWRED Configuration Examples."
Configuring DWRED in a Traffic Policy
To configure DWRED in a traffic policy, use the policy-map command in global configuration mode to specify the traffic policy name. Then to configure the traffic policy, use the following commands in policy-map configuration mode:
The default traffic class for the traffic policy is the traffic class to which traffic is directed if that traffic does not satisfy the match criteria of other traffic classes whose policy is defined in the traffic policy. To configure a policy for more than one traffic class in the same policy map, repeat Step 2 through Step 4.
To attach a traffic policy to an interface and enable CBWFQ on the interface, you must create a traffic policy. You can configure traffic class policies for as many traffic classes as are defined on the router, up to the maximum of 64.
After configuring the traffic policy with the policy-map command, you must still attach the traffic policy to an interface before it is successfully enabled. For information on attaching a traffic policy to an interface, see the "Applying QoS Features Using the MQC" module.
Configuring DWRED to Use IP Precedence Values in a Traffic Policy
To configure DWRED to drop packets based on IP Precedence values, use the following commands beginning in global configuration mode:
After configuring the traffic policy with the policy-map command, you must still attach the traffic policy to an interface before it is successfully enabled. For information on attaching a traffic policy to an interface, see the "Applying QoS Features Using the MQC" module.
Monitoring and Maintaining DWRED
To display the configuration of a traffic policy and its associated traffic classes, use the following commands in EXEC mode, as needed:
Flow-Based WRED Configuration Task List
To configure flow-based WRED on an interface, perform the required task described in the "Configuring Flow-Based WRED" section.
See the end of this chapter for the section "Flow-Based WRED Configuration Example."
Configuring Flow-Based WRED
Before you can configure flow-based WRED, you must enable WRED and configure it. For information on how to configure WRED, see the section "Weighted Random Early Detection Configuration Task List" earlier in this chapter.
To configure an interface for flow-based WRED, use the following commands in interface configuration mode:
DiffServ Compliant WRED Configuration Task List
To configure the DiffServ Compliant Weighted Random Early Detection feature, perform the tasks described in the following sections. The task in the first section is required; the task in the remaining section is optional.
•
Configuring WRED to Use the Differentiated Services Code Point Value (Required)
•
Verifying the DSCP Value Configuration (Optional)
See the end of this chapter for the section "DiffServ Compliant WRED Configuration Examples."
Configuring WRED to Use the Differentiated Services Code Point Value
The commands used to configure WRED to use the differentiated services code point (DSCP) value vary according to whether WRED is used at the interface level, the per-VC level, or the class level.
WRED at the Interface Level
To configure WRED to use the DSCP value when it calculates the drop probability, use the following commands in interface configuration mode:
WRED at the per-VC Level
To configure WRED to use the DSCP value when it calculates the drop probability, use the following commands beginning in global configuration mode:
WRED at the Class Level
To configure WRED 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.
Command PurposeStep 1
Router(config-if)# class-map class-map-name
Creates a class map to be used for matching packets to a specified class.
Step 2
Router(config-cmap)# match match criterion
Configures the match criteria for a class map. For more information about match criteria, see the "Applying QoS Features Using the MQC" module.
Step 3
Router(config-if)# policy-map policy-map
Creates or modifies a policy map that can be attached to one or more interfaces to specify a traffic policy.
Step 4
Router(config-pmap)# class class-map-name
Specifies the QoS actions for the default class.
Step 5
Router(config-pmap-c)# bandwidth {bandwidth-kbps | percent percent}
Specifies or modifies the bandwidth allocated for a class belonging to a policy map.
Step 6
Router(config-pmap-c)# random-detect dscp-based
Indicates that WRED is to use the DSCP value when it calculates the drop probability for the packet.
Step 7
Router(config-pmap-c)# random-detect dscp dscpvalue min-threshold max-threshold [mark-probability-denominator]
Specifies the minimum and maximum packet thresholds and, optionally, the mark-probability denominator for the DSCP value.
Step 8
Router(config-if)# service-policy output policy-map
Attaches a policy map to an output interface or VC to be used as the traffic policy for that interface or VC.
Verifying the DSCP Value Configuration
To verify the DSCP value configuration, use the following commands in global configuration mode, as needed:
WRED Configuration Examples
The following sections provide WRED and DWRED configuration examples:
•
Parameter-Setting DWRED Example
•
Parameter-Setting WRED Example
For information on how to configure WRED, see the section "Weighted Random Early Detection Configuration Task List" in this chapter.
WRED Configuration Example
The following example enables WRED with default parameter values:
interface Serial5/0description to qos1-75aip address 200.200.14.250 255.255.255.252random-detectUse the show interfaces command output to verify the configuration. Notice that the "Queueing strategy" report lists "random early detection (RED)."
Router# show interfaces serial 5/0Serial5/0 is up, line protocol is upHardware is M4TDescription: to qos1-75aInternet address is 200.200.14.250/30MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 237/255Encapsulation HDLC, crc 16, loopback not setKeepalive not setLast input 00:00:15, output 00:00:00, output hang neverLast clearing of "show interface" counters 00:05:08Input queue: 0/75/0 (size/max/drops); Total output drops: 1036Queueing strategy: random early detection(RED)5 minutes input rate 0 bits/sec, 2 packets/sec5 minutes output rate 119000 bits/sec, 126 packets/sec594 packets input, 37115 bytes, 0 no bufferReceived 5 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort37525 packets output, 4428684 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 output buffer failures, 0 output buffers swapped out0 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=upUse the show queue command output to view the current contents of the interface queue. Notice that there is only a single queue into which packets from all IP precedences are placed after dropping has taken place. The output has been truncated to show only three of the five packets.
Router# show queue serial 5/0Output queue for Serial5/0 is 5/0Packet 1, linktype: ip, length: 118, flags: 0x288source: 190.1.3.4, destination: 190.1.2.2, id: 0x0001, ttl: 254,TOS: 128 prot: 17, source port 11111, destination port 22222data: 0x2B67 0x56CE 0x005E 0xE89A 0xCBA9 0x8765 0x43210x0FED 0xCBA9 0x8765 0x4321 0x0FED 0xCBA9 0x8765Packet 2, linktype: ip, length: 118, flags: 0x288source: 190.1.3.5, destination: 190.1.2.2, id: 0x0001, ttl: 254,TOS: 160 prot: 17, source port 11111, destination port 22222data: 0x2B67 0x56CE 0x005E 0xE89A 0xCBA9 0x8765 0x43210x0FED 0xCBA9 0x8765 0x4321 0x0FED 0xCBA9 0x8765Packet 3, linktype: ip, length: 118, flags: 0x280source: 190.1.3.6, destination: 190.1.2.2, id: 0x0001, ttl: 254,TOS: 192 prot: 17, source port 11111, destination port 22222data: 0x2B67 0x56CE 0x005E 0xE89A 0xCBA9 0x8765 0x43210x0FED 0xCBA9 0x8765 0x4321 0x0FED 0xCBA9 0x8765Use the show queueing command output to view the current settings for each of the precedences. Also notice that the default minimum thresholds are spaced evenly between half and the entire maximum threshold. Thresholds are specified in terms of packet count.
Router# show queueingCurrent random-detect configuration:Serial5/0Queueing strategy:random early detection (WRED)Exp-weight-constant:9 (1/512)Mean queue depth:28Class Random Tail Minimum Maximum Markdrop drop threshold threshold probability0 330 0 20 40 1/101 267 0 22 40 1/102 217 0 24 40 1/103 156 0 26 40 1/104 61 0 28 40 1/105 6 0 31 40 1/106 0 0 33 40 1/107 0 0 35 40 1/10rsvp 0 0 37 40 1/10Parameter-Setting DWRED Example
The following example specifies the same parameters for each IP precedence. Thus, all IP precedences receive the same treatment. Start by enabling DWRED.
interface FastEthernet1/0/0ip address 200.200.14.250 255.255.255.252random-detectNext, enter the show queueing random-detect command to determine reasonable values to use for the precedence-specific parameters.
Router# show queueing random-detectCurrent random-detect configuration:FastEthernet2/0/0Queueing strategy:fifoPacket drop strategy:VIP-based random early detection (DWRED)Exp-weight-constant:9 (1/512)Mean queue depth:0Queue size:0 Maximum available buffers:6308Output packets:5 WRED drops:0 No buffer:0Class Random Tail Minimum Maximum Mark Outputdrop drop threshold threshold probability Packets0 0 0 109 218 1/10 51 0 0 122 218 1/10 02 0 0 135 218 1/10 03 0 0 148 218 1/10 04 0 0 161 218 1/10 05 0 0 174 218 1/10 06 0 0 187 218 1/10 07 0 0 200 218 1/10 0Complete the configuration by assigning the same parameter values to each precedence. Use the values obtained from the show queueing random-detect command output to choose reasonable parameter values.
interface FastEthernet1/0/0random-detect precedence 0 100 218 10random-detect precedence 1 100 218 10random-detect precedence 2 100 218 10random-detect precedence 3 100 218 10random-detect precedence 4 100 218 10random-detect precedence 5 100 218 10random-detect precedence 6 100 218 10random-detect precedence 7 100 218 10Parameter-Setting WRED Example
The following example enables WRED on the interface and specifies parameters for the different IP precedences:
interface Hssi0/0/0description 45Mbps to R1ip address 10.200.14.250 255.255.255.252random-detectrandom-detect precedence 0 32 256 100random-detect precedence 1 64 256 100random-detect precedence 2 96 256 100random-detect precedence 3 120 256 100random-detect precedence 4 140 256 100random-detect precedence 5 170 256 100random-detect precedence 6 290 256 100random-detect precedence 7 210 256 100random-detect precedence rsvp 230 256 100DWRED Configuration Examples
The following sections provide DWRED configuration examples:
•
DWRED on an Interface: Example
•
Configuring DWRED in Traffic Policy: Example
For information on how to configure DWRED, see the section "DWRED Configuration Task List" in this chapter.
DWRED on an Interface: Example
The following example configures DWRED on an interface with a weight factor of 10:
Router(config)# interface hssi0/0/0Router(config-if)# description 45mbps to R1Router(config-if)# ip address 192.168.14.250 255.255.255.252Router(config-if)# random-detectRouter(config-if)# random-detect exponential-weighting-constant 10Modular QoS CLI: Example
The following example enables DWRED using the Legacy CLI (non-Modular QoS Command-Line Interface) feature on the interface and specifies parameters for the different IP precedences:
interface Hssi0/0/0description 45Mbps to R1ip address 200.200.14.250 255.255.255.252random-detectrandom-detect precedence 0 32 256 100random-detect precedence 1 64 256 100random-detect precedence 2 96 256 100random-detect precedence 3 120 256 100random-detect precedence 4 140 256 100random-detect precedence 5 170 256 100random-detect precedence 6 290 256 100random-detect precedence 7 210 256 100random-detect precedence rsvp 230 256 100The following example uses the Modular QoS CLI to configure a traffic policy called policy10. For congestion avoidance, WRED packet drop is used, not tail drop. IP Precedence is reset for levels 0 through 5.
policy-map policy10 class acl10 bandwidth 2000random-detect exponential-weighting-constant 10random-detect precedence 0 32 256 100random-detect precedence 1 64 256 100random-detect precedence 2 96 256 100random-detect precedence 3 120 256 100random-detect precedence 4 140 256 100random-detect precedence 5 170 256 100Configuring DWRED in Traffic Policy: Example
The following example configures policy for a traffic class named int10 to configure the exponential weight factor as 12. This is the weight factor used for the average queue size calculation for the queue for traffic class int10. WRED packet drop is used for congestion avoidance for traffic class int10, not tail drop.
policy-map policy12 class int10 bandwidth 2000random-detect exponential-weighting-constant 12Flow-Based WRED Configuration Example
The following example enables WRED on the serial interface 1 and configures flow-based WRED. The random-detect interface configuration command is used to enable WRED. Once WRED is enabled, the random-detect flow command is used to enable flow-based WRED.
After flow-based WRED is enabled, the random-detect flow average-depth-factor command is used to set the scaling factor to 8 and the random-detect flow count command is used to set the flow count to 16. The scaling factor is used to scale the number of buffers available per flow and to determine the number of packets allowed in the output queue for each active flow.
configure terminalinterface Serial1random-detectrandom-detect flowrandom-detect flow average-depth-factor 8random-detect flow count 16endThe following part of the example shows a sample configuration file after the previous flow-based WRED commands are issued:
Router# more system:running-configBuilding configuration...Current configuration:!version 12.0service timestamps debug datetime msec localtimeservice timestamps log uptimeno service password-encryptionservice tcp-small-servers!no logging consoleenable password lab!clock timezone PST -8clock summer-time PDT recurringip subnet-zerono ip domain-lookup!interface Ethernet0no ip addressno ip directed-broadcastno ip mroute-cacheshutdown!interface Serial0no ip addressno ip directed-broadcastno ip mroute-cacheno keepaliveshutdown!interface Serial1ip address 190.1.2.1 255.255.255.0no ip directed-broadcastload-interval 30no keepaliverandom-detectrandom-detect flowrandom-detect flow count 16random-detect flow average-depth-factor 8!router igrp 8network 190.1.0.0!ip classlessno ip http server!line con 0transport input noneline 1 16transport input allline aux 0transport input allline vty 0 4password lablogin!endDiffServ Compliant WRED Configuration Examples
This following sections provide DiffServ Compliant WRED configuration examples:
•
WRED Configured to Use the DSCP Value: Example
•
DSCP Value Configuration Verification: Example
For information on how to configure DiffServ compliant WRED, see the section "DiffServ Compliant WRED Configuration Task List" in this chapter.
WRED Configured to Use the DSCP Value: Example
The following example configures WRED to use the DSCP value 8. The minimum threshold for the DSCP value 8 is 24 and the maximum threshold is 40. This configuration was performed at the interface level.
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 9. The minimum threshold for the DSCP value 9 is 20 and the maximum threshold is 50. This configuration can be attached to other VCs, as required.
Router(config)# random-detect-group sanjose dscp-basedRouter(cfg-red-grp)# dscp 9 20 50Router(config-subif-vc)# random-detect attach sanjoseThe following example enables WRED to use the DSCP value 8 for the class c1. The minimum threshold for the DSCP value 8 is 24 and the maximum threshold is 40. The last line attaches the traffic policy to the output interface or 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 p1DSCP Value Configuration Verification: Example
When WRED has been configured to use the DSCP value when it calculates the drop probability of a packet, all entries of the DSCP table are initialized with the appropriate default values. The example in the following section are samples of the show policy interface command for WRED at the class level.
This example displays packet statistics along with the entries of the DSCP table, confirming that WRED has been enabled to use the DSCP value when it calculates the drop probability for a packet.
Router# show policy interface Serial6/3Serial6/3Service-policy output: testClass-map: c1 (match-any)0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: protocol ip0 packets, 0 bytes5 minute rate 0 bpsWeighted Fair QueueingOutput Queue: Conversation 265Bandwidth 20 (%)Bandwidth 308 (kbps)(pkts matched/bytes matched) 0/0(depth/total drops/no-buffer drops) 0/0/0exponential weight: 9mean queue depth: 0dscp Transmitted Random drop Tail drop Minimum Maximum Markpkts/bytes pkts/bytes pkts/bytes thresh thresh probaf11 0/0 0/0 0/0 32 40 1/10af12 0/0 0/0 0/0 28 40 1/10af13 0/0 0/0 0/0 24 40 1/10af21 0/0 0/0 0/0 32 40 1/10af22 0/0 0/0 0/0 28 40 1/10af23 0/0 0/0 0/0 24 40 1/10af31 0/0 0/0 0/0 32 40 1/10af32 0/0 0/0 0/0 28 40 1/10af33 0/0 0/0 0/0 24 40 1/10af41 0/0 0/0 0/0 32 40 1/10af42 0/0 0/0 0/0 28 40 1/10af43 0/0 0/0 0/0 24 40 1/10cs1 0/0 0/0 0/0 22 40 1/10cs2 0/0 0/0 0/0 24 40 1/10cs3 0/0 0/0 0/0 26 40 1/10cs4 0/0 0/0 0/0 28 40 1/10cs5 0/0 0/0 0/0 30 40 1/10cs6 0/0 0/0 0/0 32 40 1/10cs7 0/0 0/0 0/0 34 40 1/10ef 0/0 0/0 0/0 36 40 1/10rsvp 0/0 0/0 0/0 36 40 1/10default 0/0 0/0 0/0 20 40 1/10CCDE, CCENT, Cisco Eos, Cisco Lumin, Cisco Nexus, Cisco StadiumVision, Cisco TelePresence, Cisco WebEx, the Cisco logo, DCE, and Welcome to the Human Network are trademarks; Changing the Way We Work, Live, Play, and Learn and Cisco Store are service marks; and Access Registrar, Aironet, AsyncOS, Bringing the Meeting To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Collaboration Without Limitation, EtherFast, EtherSwitch, Event Center, Fast Step, Follow Me Browsing, FormShare, GigaDrive, HomeLink, Internet Quotient, IOS, iPhone, iQuick Study, IronPort, the IronPort logo, LightStream, Linksys, MediaTone, MeetingPlace, MeetingPlace Chime Sound, MGX, Networkers, Networking Academy, Network Registrar, PCNow, PIX, PowerPanels, ProConnect, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way to Increase Your Internet Quotient, TransPath, WebEx, and the WebEx logo are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website 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. (0809R)
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any examples, command display output, and figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
© 2007 Cisco Systems, Inc. All rights reserved.

