Necessity for configuring WRED on Cisco routers
Although queues provide congestion management for VoIP QoS, some mechanisms that provide congestion avoidance are still needed, such as WRED. In particular, WRED prevents the output queue from reaching the limit, which will result in the loss of all input packets. This article comes from Informit and discusses the need to configure WRED on Cisco routers.
Please recall what you learned in your early network technology - how the windowing of the Transmission Control Protocol (TCP) works. The sender sends a message segment, and if the sender receives a successful reply from the receiver, it sends two more message segments (i.e., two "window sizes"). If the reply reply is successfully sent, the sender sends four information segments and continues to do so, the window size increases exponentially.
However, if a message segment is lost, the TCP stream will enter TCP slow start, and the window size is reduced to 1. The TCP stream then exponentially increases its window size until half of the window size when congestion occurs. The window size of the TCP stream then grows linearly. TCP slow startup is related to QoS, because when the output queue of an interface is full, all newly arrived packets are discarded (i.e. "tail dropped"), and all TCP streams enter TCP slow startup at the same time.
Note that the process of multiple TCP streams entering TCP slow startup at the same time is called global synchronization or TCP synchronization. When TCP synchronization occurs, the bandwidth of the connection cannot be fully utilized, resulting in waste of bandwidth.
RED Basic Random Early Detection (RED) is designed to prevent TCP synchronization by randomly discarding packets when the output queue of an interface is about to be saturated. The speed at which RED drops packets depends on the queue depth at that time. The following three parameters affect when a newly arrived packet is discarded:
·Minimum threshold
·Maximum threshold
· Label probability denominator (MPD)
The minimum threshold specifies the number of packets in the queue before the queue is ready to drop packets. The possibility of packets being discarded continues to rise as the queue depth reaches its maximum threshold. When the queue depth exceeds the maximum threshold, all other packets attempting to enter the queue are discarded.
The possibility of packet dropping is 1/(MPD) when the queue depth is equal to the maximum threshold. For example, if the label probability denominator is set to 10, the probability of being discarded is 1/10 (ie, the probability of being discarded is ten percent). The minimum threshold, maximum threshold and MPD constitute RED. RED is very useful in ports where the router may be congested. For example, a WAN port may need to adopt RED.
CB-WRED
Cisco does not support RED, but supports better weighted random premature detection (WRED). Unlike RED, WRED can parse each priority tag. For example, the minimum threshold for a packet with IP priority 0 may be 20, but the minimum threshold for a packet with IP priority 1 may be 25. In this example, packets with IP priority 0 will be discarded first than packets with IP priority 1.
Although WRED can be set from port configuration mode or virtual circuit structure, here is a description of the settings of MQC-based WRED. In order to enable WRED and set the tags that WRED needs to pay attention to (i.e. IP priority or DSCP), the following policy map configuration mode commands need to be entered.
Router(config-pmap-c)#random-detect [dscp-based | prec-based]
If it is not specified as dscp-based or prec-based, WRED is defaulted to prec-based. After WRED is configured, the IOS allocates the default minimum threshold, maximum threshold, and MPD. You can change the default parameters using the following command:
Router(config-pmap-c)#random-detect precedence precedence_value
minimum-threshold maximum-threshold mark-probability-denominator
(For prec-based WRED)
Router(config-pmap-c)#random-detect dscp dscp_value
minimum-thresholdmaximum-threshold mark-probability-denominator
(For dscp-based WRED)