|
|
|
|
|
|
General RED algorithm:
compute average queue length;
if ( avg. queue length < minthreshold )
{
admit new packet to output queue;
}
else ( minthreshold < avg. queue length < maxthreshold )
{
mark new packet with probability Prob(queue length);
}
else
{
always mark new packet;
}
|
|
|
Advantage:
|
Disadvantage:
|
|
|
|
Meaning of the variables:
curr_time = current time
q_idle_time = the time when the queue last became empty
wq = weight (a constant between 0 and 1)
|
Notes:
|
Example: Suppose avg = 0 and the first 3 queue length measures are q1, q2, and q3
Initially:
avg = 0
|
|
|
count = number of UNMARKED packets since the last marked packet
|
The RED drop code is found around line 508 in the file red.cc
|
|
They are given by the 2 dotted lines in the figure
|
|
|
(Analogy: keep the car on the high way moving and you can get more cars through. Longer lines not only slows the traffic, in fact, a lower number of car per time unit will get through to the destination)
|
|
Example:
$ns duplex-link $n1 $n2 10Mb 10ms RED
|
The name of the parameters (OTcl instance variables) are:
|
Examples:
Queue/RED set q_weight_ 0.002
Queue/RED set thresh_ 10
Queue/RED set maxthresh_ 20
Queue/RED set setbit_ true
|
Try changing the Min Threshold and Max Threshold.
DropTail experiment:
|
RED experiment:
|
Setting the parameters in RED is more like Black Magic than anything else...
And this is supposed to work in a WORD WIDE Internet - not gonna happen.