Weighted Random Early Detection (WRED) in QoS

1. Introduction

Weighted Random Early Detection (WRED) is a congestion avoidance QoS mechanism that randomly drops packets before the queue is full, helping to prevent global TCP synchronization and optimize network performance.

πŸ“Œ Key Benefits of WRED:
βœ… Prevents queue tail drops, reducing congestion
βœ… Improves TCP traffic performance
βœ… Differentiates traffic by priority levels
βœ… Works best in TCP-based networks


2. How WRED Works

WRED monitors queue depth and randomly drops packets based on:

  • Queue occupancy (how full the queue is)
  • Packet marking (DSCP/IP Precedence)
  • Minimum and maximum drop thresholds

πŸ”Ή WRED Drop Logic:

Queue StatusBehavior
Queue < Min ThresholdNo drops βœ…
Queue between Min & MaxRandom drops based on priority 🎲
Queue > Max ThresholdAll new packets dropped (Tail Drop) 🚫

πŸ“Œ Higher-priority traffic has higher thresholds, reducing drop probability.


3. WRED vs. Tail Drop

FeatureWREDTail Drop
Packet Drop BehaviorGradual, based on queue depthDrops all packets when full
Effect on TCPPrevents global TCP synchronizationCauses synchronization issues
QoS DifferentiationPrioritizes important trafficNo differentiation

4. Configuring WRED on a Cisco Router

A. Basic WRED Configuration

To enable WRED on an interface:

interface GigabitEthernet1/0/1
random-detect

πŸ“Œ This applies default WRED settings, treating all traffic equally.


B. WRED with IP Precedence-Based Drop Probabilities

To prioritize higher-priority traffic:

interface GigabitEthernet1/0/1
random-detect precedence 3 20 40
random-detect precedence 5 30 60

πŸ“Œ Explanation:

  • Precedence 3 packets β†’ Start dropping at 20% queue, full drop at 40%.
  • Precedence 5 packets β†’ Start dropping at 30%, full drop at 60%.
  • Higher precedence = Less chance of being dropped.

C. WRED with DSCP-Based Drop Probabilities

To configure WRED based on DSCP values:

interface GigabitEthernet1/0/1
random-detect dscp-based

Then, define DSCP drop thresholds:

  • DSCP 10 (low priority) β†’ Drops start at 20%, full drop at 50% queue depth.
  • DSCP 46 (VoIP, high priority) β†’ Drops start at 40%, full drop at 70%.

D. WRED with Class-Based QoS

1️⃣ Define a Traffic Class:

class-map MATCH-VIDEO
match ip dscp af41

2️⃣ Create a Policy with WRED:

policy-map WRED-POLICY
class MATCH-VIDEO
random-detect dscp-based

3️⃣ Apply Policy to an Interface:

interface GigabitEthernet1/0/1
service-policy output WRED-POLICY

πŸ“Œ Now, WRED is applied only to DSCP AF41 traffic!


5. Verifying WRED

βœ… Check WRED settings on an interface:

show interfaces GigabitEthernet1/0/1 random-detect

βœ… Monitor packet drops with WRED:

show policy-map interface GigabitEthernet1/0/1

6. Summary

ScenarioConfiguration
Enable WRED on an interfacerandom-detect
Prioritize traffic based on IP Precedencerandom-detect precedence X min max
Prioritize traffic based on DSCPrandom-detect dscp-based
Class-Based WREDpolicy-map WRED-POLICY + random-detect dscp-based
Verify WRED settingsshow interfaces random-detect

πŸš€ WRED improves congestion management by preventing queue overflows and TCP synchronization issues!

Comments

Leave a comment