Regardless of the WRED mode, you can tune any individual drop curve. Using the same command you may change the Minimum Threshold,
the Maximum Threshold or the Drop Probability at Maximum Threshold for that drop curve. With the minimum and maximum thresholds
and the drop probability, a router can construct the exponential curve it needs to determine drop probability for any average
queue depth. Tuning WRED parameters is not typical; do not attempt unless you have a thorough understanding of how tuning
will impact applications in that class. The default values should suffice for the vast majority of use cases.
If you decide to tune WRED drop curves, you have the option to specify thresholds in packets (default), bytes or time. The
queue-limit must be configured in the chosen unit before you add WRED configuration
to the class and only when the queue is already running in the desired mode can you change thresholds in that unit. Moreover,
you can only change the curve for a particular DSCP, precedence or discard-class value provided WRED is operating in that
mode.
Recall that the drop probability is an integer number. If the average queue limit is at the maximum threshold, a packet has
a 1 in that integer value chance of being dropped. For example, if the drop probability is 20, a 1 in 20 (5%) chance exists for a packet to dropped by WRED.
The command to change a drop curve is random-detect [dscp|precedence|discard-class] value min-threshold max-threshold drop-probability , as illustrated here:
policy-map tuneprecedence
class bulk-data
bandwidth remaining percent 30
random-detect
random-detect precedence 1 1301 2083 10
Running the queue in packet mode (the default) and WRED in precedence mode (also the default), I decide against differentiation
in the minimum threshold for precedence 1 and 2. I change the curve for precedence 1, setting the minimum threshold to 1301,
the maximum threshold to 2083 and the drop probability at max threshold to 1 in 10 packets:
random-detect precedence 1 1301 2083 10
As always, we can verify the configuration with the show policy-map interface command:
show policy-map interface g1/0/0
GigabitEthernet1/0/0
Service-policy output: tuneprecedence
Class-map: bulk-data (match-all)
0 packets, 0 bytes
5 minute offered rate 0000 bps, drop rate 0000 bps
Match: access-group name bulkdata
Queueing
queue limit 4166 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 0/0
bandwidth remaining 30%
Exp-weight-constant: 4 (1/16)
Mean queue depth: 1086 packets
class Transmitted Random drop Tail drop Minimum Maximum Mark
pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
0 0/0 0/0 0/0 1041 2083 1/10
1 0/0 0/0 0/0 1301 2083 1/10
2 0/0 0/0 0/0 1301 2083 1/10
3 0/0 0/0 0/0 1431 2083 1/10
4 0/0 0/0 0/0 1561 2083 1/10
5 0/0 0/0 0/0 1691 2083 1/10
6 0/0 0/0 0/0 1821 2083 1/10
7 0/0 0/0 0/0 1951 2083 1/10
Notice the new values we set for precedence 1.
What if we change the thresholds for a queue that is running in time-based mode where WRED is running in DSCP mode? In particular,
we want the minimum threshold of af21 to exceed that of af11. The configuration would appear as follows:
policy-map tunedscp
class bulk-data
bandwidth remaining percent 30
queue-limit 50 ms
random-detect dscp-based
random-detect dscp af21 22 ms 25 ms 10
Looking at the output of show policy-map interface we verify the configuration:
show policy-map interface g1/0/0
GigabitEthernet1/0/0
Service-policy output: tunedscp
Class-map: bulk-data (match-all)
148826 packets, 223239000 bytes
5 minute offered rate 2358000 bps, drop rate 0000 bps
Match: access-group name bulkdata
Queueing
queue limit 50 ms/ 6250000 bytes
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 148826/223239000
bandwidth remaining 30%
Exp-weight-constant: 9 (1/512)
Mean queue depth: 0 ms/ 992 bytes
dscp Transmitted Random drop Tail drop Minimum Maximum Mark
pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
ms/bytes ms/bytes
af11 96498/144747000 0/0 0/0 21/2734375 25/3125000 1/10
af21 52328/78492000 0/0 0/0 22/2750000 25/3125000 1/10
With DSCP-based WRED we will only show curve statistics for DSCP values that have been observed within that class (refer to
Mode: Precedence, DSCP, and Discard-Class).