Open In App

Types of RED Queue Disciplines

Random early detection (RED), also known as random early discard or random early drop is a queuing discipline for a network scheduler suited for congestion avoidance. There are different types of RED Queue Disciplines:

Gentle RED:

Random Early Detection algorithm increases the drop probability from 0.05 to 0.50 when the average queue length increases from minimum threshold value to maximum threshold value linearly. But when the average queue length increases slightly beyond the maximum threshold the packet drop probability increases directly from 0.50 to 1. This sudden jump is non-gentle. This sudden jump is normalized by the gentle RED algorithm. 



 

This behavior leads to aggressive packet drops i.e., when average queue length increases beyond the maxth, the drop probability sharply rises to 1.

Working of Gentle RED:

 

Gentle RED tries to flatten this curve with a slope similar to the original RED when the average queue length is between maxth and twice of maxth. We can calculate the slope of the RED curve and Gentle RED curve easily. The slope of RED is around 79 degrees and the Gentle RED slope is around 73 degrees. The working of Gentle RED is the same as of RED, it just increases the drop probability from 0.5 to 1 linearly.



Calculation of Average Queue Length:

On arrival of every packet, RED calculates the average queue length using Eq. (1). This mathematical model is known as ‘Exponential Weighted Moving Average’ or EWMA.

=> newavg = (1 – wq) x oldavg + wq x current_queue_len Eq. (1)

=> where, newavg = new average queue length being calculated in this sample.

=> oldavg = old average queue length obtained during the previous sample

=> current_queue_len = ‘instantaneous’ queue length at the router

=> wq = weight associated with the ‘current_queue_len’. 

=> Default value: 0.002

Calculation of Drop Probability:

Once the ‘newavg’ is calculated, RED uses the following logic to calculate the drop probability (Pd), where minth represents the minimum threshold for ‘average queue length’ and maxth represents the maximum threshold for ‘average queue length’. minth and maxth are in the context of average queue length, not the instantaneous queue length. This is an important takeaway before we go into further depth.

=>  default value of minth in the paper is 5 packets

=> if (newavg ≤ minth)   enqueue the incoming packet  

=>  default value of maxth in the paper is 15 packets

=> else if (newavg > 2*maxth)  it means Pd= 1 

=> drop the incoming packet   

=> else if(minth < newavg < maxth)

=> Pd= maxp x [(newavg – minth) ÷ (maxth – minth)] 

=> else if(maxth < newavg < 2*maxth)

=> Pd= maxp + (1-maxp) x [(newavg – maxth) ÷ maxth]  where, maxp = maximum drop probability. 

=> Default: 0.5 (previously, it was 0.02)

 Nonlinear RED and Self Configuring RED:

Instead of increasing the Pd linearly, it might be better if Pd is increased slowly when it is near to minth and increased sharply when it is near to max. If drop probability increases linearly between minimum threshold and maximum threshold then there is a high chance that incoming packet might get dropped even if the average queue length is not large. So, to get the high probability of dropping the packet when the average queue size is nearer to the maximum threshold researcher went on to do the experiments and came up with the quadratic equation for calculating the drop probability when the average queue length is more than the minimum and less than maximum threshold value.

Working of Nonlinear RED:

=> Pd= 0, when newavg <= minth

=> Pd= 1, when newavg < maxth

=> Pd= (maxp‘)2 * [(newavg – minth)/(maxth – minth)] where maxp‘ = 1.5 * maxp = 0.75

 

Working of Self Configuring RED:

=> It adapts maxp as shown in the pseudocode below: On every update of ‘newavg’:

=> if (minth < newavg < maxth)

=> status = between;

=> else if (newavg < minth && status != below)

=> status = below;

=> maxp = maxp ÷ ? 

=> else if (newavg > maxth && status != above)

=> status = above;

=> maxp = maxp x ?

Is there an upper and lower limit for maxp in this algorithm? In the original paper, the lower bound used was 0.02 and the upper bound used was 1.

Adaptive RED Queue Discipline:

The motivation of Adaptive RED is the same as self-configuring RED. Self-configuring RED tries to keep the average queue size with minimum and maximum threshold values. But Sally Floyd says that why don’t keep the average queue size in a tight range just in the center of minimum and maximum threshold values. Also, Adaptive RED removes the knobs and automatically sets them. Maximum drop probability is adapted based on the network availability, it is no longer a knob just like previous versions of RED. 

Main contributions in Adaptive RED

Adaptive RED vs Self Configuring RED

1. maxp is adapted not just to keep the average queue size between minth and maxth, but to keep the average queue size within a ‘target range’ halfway between minth and maxth. Average queue size can fluctuate on a large range in self-configuring due to which packet drops is likely to happen frequently. But what adaptive RED does is that it keeps the average queue size almost constant because it fluctuates in a very close target range which is just half of the minimum and maximum threshold values.

Example: 

=> if minth = 5 packets and maxth = 15 packets, 

=> then: target range = [minth + 0.4 x (maxth – minth),  minth + 0.6 x (maxth – minth)]

=> Hence, target range = [5 + 0.4 (15 – 5), 5 + 0.6 (15 – 5)] = [9, 11]

=> The average queue size will take the values 9, 10, and 11 always. There is no large fluctuation. 

2. maxp is adapted slowly, over time scales greater than a typical round-trip time, and in small steps. Max drop probability is not adapted very frequently. It is adapted in every 500 ms which is typically 4-5 RTT worth of time.

3. maxp is constrained to remain within the range [0.01, 0.5] (i.e., 1% to 50%). Self-configuring RED keeps max drop probability in range (0.02 to 1).

4. AIMD policy is used to adapt maxp, unlike MIMD policy which is used in Self Configuring RED. The max drop probability is increased additively and decreased multiplicatively unlike self-configuring where both were multiplicative.

Automatic setting of minimum threshold (minth)

Decide upon a suitable ‘target queue delay’ (i.e., acceptable queue delay). Network admin knows the bandwidth available, we can decide how much delay we can tolerate. Say 5 ms, which means once a packet is enqueued it must leave within 5 ms time. Hence, set the minth to be a function of the target queue delay.

=> min is calculated as:

=> minth = (target_queue_delay x C) ÷ 2 

=> where, C = capacity of the link in packets (can be obtained by: Bandwidth ÷ packet size), target_queue_delay is 5ms (is a user configurable parameter)

=> Sally Floyd’s recommendation to set the minth automatically is:

=> minth = max [5, (target_queue_delay x C) ÷ 2]

=> minth of 5 packets was found to work well for low and moderate link capacity. So minth of at least 5 packets is recommended to ensure that the throughput is not affected.

Automatic Setting of Maximum Threshold (maxth):

=> maxth is calculated as:

=>  maxth = 3 x minth

=> This ensures that the ‘target range’ for average queue size is 2 x minth

=> Suppose, if minth = 5 packets and maxth = 15 packets, 

 => then target range = [minth + 0.4 x (maxth – minth), minth + 0.6 x (maxth – minth)]

 => Hence, target range = [5 + 0.4 (15 – 5), 5 + 0.6 (15 – 5)] [9, 11] 

Automatic setting of wq:

wq= 1 - e(-1/C)

where, C is the link capacity in packets/second (i.e., Bandwidth ÷ packet size). If C is a big value then Wq will be a too-small value. Another way, if C is small then Wq will be larger.

=> The significance of Wq is that: 

=> If the queue size changes from one value (old) to another (new), say 

=> 60 to 61, 0 to 1 or 50 to 55 or anything then, it takes “-1 / ln (1 – wq)” packet arrivals for the ‘average queue size’ to reach 63% of the ‘new queue size’.

=> If current queue size changes from 60 to 61 and Wq=0.002 then if 

=> current queue size remains constant for 500 packet arrivals then average queue size will become 63% of current queue size, i.e. 38.

Adapting maxp:

=> It is adapted in every 500 ms. 

=> Every interval seconds: if(average_queue_size > target_range and maxp < 0.5)

=> increase maxp;

=> maxp <- maxp + α

=> else if(average_queue_size < target_range and maxp > 0.01)

=> decrease maxp;

=> maxp <- maxp * β

=> interval: 0.5 second

=> target_range: [minth + 0.4(maxth – minth), 

=> minth + 0.6(maxth – minth)]  

=> α: increment factor, α = min(0.01, maxp/4)

=>β: decrement factor, β = 0.9


Article Tags :