Content

| 8.6 |  | Congestion Avoidance |
| 8.6.2 |  | Weighted random early detection (WRED) |

Weighted random early detection (WRED) is a queuing technique for congestion avoidance. WRED manages how packets are handled when an interface starts becoming congested. When traffic begins to exceed the interface traffic thresholds prior to any congestion, the interface starts dropping packets from selected flows. If the dropped packets are TCP, the TCP source recognizes that packets are getting dropped, and lowers its transmission rate. The lowered transmission rate then reduces the traffic to the interface, avoiding congestion. Because TCP retransmits dropped packets, no actual data loss occurs.

WRED drops packets according to the following criteria:

- RSVP flows are given precedence over non-RSVP flows, to ensure that time-critical packets are transmitted as required.
- Using IP precedence or DSCP value of the packets, packets with higher precedence are less likely to be dropped. If the default settings are preventing QoS, the precedence value can be used to control how WRED determines when and how often to drop packets.
- The amount of bandwidth used by the traffic flow. Flows that use the most bandwidth are more likely to have packets dropped.
- The weight factor defined for the interface determines how frequently packets are dropped.

WRED chooses the packets to drop after considering these factors in combination. The net result being that the highest priority and lowest bandwidth traffic is preserved. WRED differs from standard random early detection (RED) in that RED ignores IP precedence, and instead drops packets from all traffic flows, not selecting low precedence or high bandwidth flows. By selectively dropping packets before congestion occurs, WRED prevents an interface from getting flooded, necessitating a large number of dropped packets. This increases the overall bandwidth usage for the interface.

An effective use of weighted random early detection is to avoid congestion on a predominantly TCP/IP network, one that has minimal UDP traffic and no significant traffic from other networking protocols. It is especially effective on core devices rather than edge devices, because the traffic marking performed on edge devices can then affect the WRED interfaces throughout the network. The disadvantage of WRED is that only predominantly TCP/IP networks can benefit. Other protocols, such as NetWare IPX/SPX, do not respond to dropped packets by lowering their transmission rates and just retransmit the packets at the same rate. WRED treats all non-TCP/IP packets as having precedence zero. In a mixed protocol environment, WRED might not be the best choice for queuing traffic.

Weighted random early detection interfaces automatically favor high priority, low bandwidth traffic flows. No specific policies are needed. However, because WRED automatically uses the IP precedence settings in packets, consider marking all traffic that enters the device or mark the traffic at the point where it enters the network. Marking all traffic will ensure that packets receive the service level intended.