WRED Configuration Tasks

When a packet arrives at a WRED-enabled output interface, the following chain of events takes place:

  1. The length of the queue is calculated.
  2. If the queue length is less than the minimum threshold, the packet is placed in the queue.
  3. If the queue length is more than the maximum threshold, the packet is dropped.
  4. If the queue length is more than the minimum threshold but less than the maximum threshold, the packet is either dropped or queued, based on the packet drop probability.

The following command can be used to enable or disable WRED:

set interface gigabit-ethernet <port> wred queue <value> enable <bool>

The following example demonstrates how to enable WRED on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 enable true
admin@XorPlus# commit
Commit OK.
Save done.

The following example demonstrates how to disable WRED on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 enable false
admin@XorPlus# commit
Commit OK.
Save done.

The following command can be used to set the maximum threshold:

set interface gigabit-ethernet <port> wred queue <value> max_thresh <int>

The following example demonstrates how to set the maximum threshold to 400 on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 max_thresh 400
admin@XorPlus# commit                                                
Commit OK.                                                                  
Save done.

The following command can be used to set the minimum threshold:

set interface gigabit-ethernet <port> wred queue <value> min_thresh <int> 

The following example demonstrates how to set the minimum threshold to 200 on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 min_thresh 200
admin@XorPlus# commit
Commit OK.
Save done.

The following command can be used to to configure drop probability:

set interface gigabit-ethernet <port> wred queue <value> drop_probability <int>

The following example demonstrates how to set the drop probability to 50% on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 drop_probability 50
admin@XorPlus# commit
Commit OK.
Save done.

When congestion occurs, WRED drops packets based on the queue length exceeding certain threshold value. ECN (Explicit Congestion Notification) can enhance basic WRED operation by marking packets instead of dropping them when the queue length exceeds certain threshold value. Downstream routers and hosts would see this marking as an indication of network congestion and slow down their packet transmission rates.

ECN is a value in the DS (Differentiated Services) field of the IPv4 protocol header. ECN uses the two least significant (right-most) bits of the 8-bit DF field to encode four different codepoints:

  1. 00 - Not ECN-Capable Transport
  2. 01 - ECN-Capable Transport(1)
  3. 10 - ECN-Capable Transport(0)
  4. 11 - Congestion Experienced

When both end hosts support ECN, they mark their packets with either 10 or 01. When ECN is enabled, PicOS changes the ECN field of all such packets to 11. When ECN is not enabled, the ECN bits are not changed.

The following command can be used to enable or disable ECN:

set interface gigabit-ethernet <port> wred queue <value> ecn_thresh <int>

The following example demonstrates how to enable ECN on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 ecn_thresh 1
admin@XorPlus# commit
Commit OK.
Save done.

The following example demonstrates how to disable ECN on queue 0 of interface ge-1/1/1:

admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 wred queue 0 ecn_thresh 0
admin@XorPlus# commit                                                
Commit OK.                                                                  
Save done.                                                                   

Copyright © 2024 Pica8 Inc. All Rights Reserved.