| 1 |
.TH RED 8 "13 December 2001" "iproute2" "Linux" |
| 2 |
.SH NAME |
| 3 |
red \- Random Early Detection |
| 4 |
.SH SYNOPSIS |
| 5 |
.B tc qdisc ... red |
| 6 |
.B limit |
| 7 |
bytes |
| 8 |
.B [ min |
| 9 |
bytes |
| 10 |
.B ] [ max |
| 11 |
bytes |
| 12 |
.B ] avpkt |
| 13 |
bytes |
| 14 |
.B [ burst |
| 15 |
packets |
| 16 |
.B ] [ ecn ] [ harddrop ] [ nodrop ] [ bandwidth |
| 17 |
rate |
| 18 |
.B ] [ probability |
| 19 |
chance |
| 20 |
.B ] [ adaptive ] [ qevent early_drop block |
| 21 |
index |
| 22 |
.B ] [ qevent mark block |
| 23 |
index |
| 24 |
.B ] |
| 25 |
|
| 26 |
.SH DESCRIPTION |
| 27 |
Random Early Detection is a classless qdisc which manages its queue size |
| 28 |
smartly. Regular queues simply drop packets from the tail when they are |
| 29 |
full, which may not be the optimal behaviour. RED also performs tail drop, |
| 30 |
but does so in a more gradual way. |
| 31 |
|
| 32 |
Once the queue hits a certain average length, packets enqueued have a |
| 33 |
configurable chance of being marked (which may mean dropped). This chance |
| 34 |
increases linearly up to a point called the |
| 35 |
.B max |
| 36 |
average queue length, although the queue might get bigger. |
| 37 |
|
| 38 |
This has a host of benefits over simple taildrop, while not being processor |
| 39 |
intensive. It prevents synchronous retransmits after a burst in traffic, |
| 40 |
which cause further retransmits, etc. |
| 41 |
|
| 42 |
The goal is to have a small queue size, which is good for interactivity |
| 43 |
while not disturbing TCP/IP traffic with too many sudden drops after a burst |
| 44 |
of traffic. |
| 45 |
|
| 46 |
Depending on if ECN is configured, marking either means dropping or |
| 47 |
purely marking a packet as overlimit. |
| 48 |
.SH ALGORITHM |
| 49 |
The average queue size is used for determining the marking |
| 50 |
probability. This is calculated using an Exponential Weighted Moving |
| 51 |
Average, which can be more or less sensitive to bursts. |
| 52 |
|
| 53 |
When the average queue size is below |
| 54 |
.B min |
| 55 |
bytes, no packet will ever be marked. When it exceeds |
| 56 |
.B min, |
| 57 |
the probability of doing so climbs linearly up |
| 58 |
to |
| 59 |
.B probability, |
| 60 |
until the average queue size hits |
| 61 |
.B max |
| 62 |
bytes. Because |
| 63 |
.B probability |
| 64 |
is normally not set to 100%, the queue size might |
| 65 |
conceivably rise above |
| 66 |
.B max |
| 67 |
bytes, so the |
| 68 |
.B limit |
| 69 |
parameter is provided to set a hard maximum for the size of the queue. |
| 70 |
|
| 71 |
.SH PARAMETERS |
| 72 |
.TP |
| 73 |
min |
| 74 |
Average queue size at which marking becomes a possibility. Defaults to |
| 75 |
.B max |
| 76 |
/3 |
| 77 |
|
| 78 |
.TP |
| 79 |
max |
| 80 |
At this average queue size, the marking probability is maximal. Should be at |
| 81 |
least twice |
| 82 |
.B min |
| 83 |
to prevent synchronous retransmits, higher for low |
| 84 |
.B min. |
| 85 |
Default to |
| 86 |
.B limit |
| 87 |
/4 |
| 88 |
.TP |
| 89 |
probability |
| 90 |
Maximum probability for marking, specified as a floating point |
| 91 |
number from 0.0 to 1.0. Suggested values are 0.01 or 0.02 (1 or 2%, |
| 92 |
respectively). Default : 0.02 |
| 93 |
.TP |
| 94 |
limit |
| 95 |
Hard limit on the real (not average) queue size in bytes. Further packets |
| 96 |
are dropped. Should be set higher than max+burst. It is advised to set this |
| 97 |
a few times higher than |
| 98 |
.B max. |
| 99 |
.TP |
| 100 |
burst |
| 101 |
Used for determining how fast the average queue size is influenced by the |
| 102 |
real queue size. Larger values make the calculation more sluggish, allowing |
| 103 |
longer bursts of traffic before marking starts. Real life experiments |
| 104 |
support the following guideline: (min+min+max)/(3*avpkt). |
| 105 |
.TP |
| 106 |
avpkt |
| 107 |
Specified in bytes. Used with burst to determine the time constant for |
| 108 |
average queue size calculations. 1000 is a good value. |
| 109 |
.TP |
| 110 |
bandwidth |
| 111 |
This rate is used for calculating the average queue size after some |
| 112 |
idle time. Should be set to the bandwidth of your interface. Does not mean |
| 113 |
that RED will shape for you! Optional. Default : 10Mbit |
| 114 |
.TP |
| 115 |
ecn |
| 116 |
As mentioned before, RED can either 'mark' or 'drop'. Explicit Congestion |
| 117 |
Notification allows RED to notify remote hosts that their rate exceeds the |
| 118 |
amount of bandwidth available. Non-ECN capable hosts can only be notified by |
| 119 |
dropping a packet. If this parameter is specified, packets which indicate |
| 120 |
that their hosts honor ECN will only be marked and not dropped, unless the |
| 121 |
queue size hits |
| 122 |
.B limit |
| 123 |
bytes. Recommended. |
| 124 |
.TP |
| 125 |
harddrop |
| 126 |
If average flow queue size is above |
| 127 |
.B max |
| 128 |
bytes, this parameter forces a drop instead of ecn marking. |
| 129 |
.TP |
| 130 |
nodrop |
| 131 |
With this parameter, traffic that should be marked, but is not ECN-capable, is |
| 132 |
enqueued. Without the parameter it is early-dropped. |
| 133 |
.TP |
| 134 |
adaptive |
| 135 |
(Added in linux-3.3) Sets RED in adaptive mode as described in http://icir.org/floyd/papers/adaptiveRed.pdf |
| 136 |
.nf |
| 137 |
Goal of Adaptive RED is to make 'probability' dynamic value between 1% and 50% to reach the target average queue : |
| 138 |
.B (max - min) / 2 |
| 139 |
.fi |
| 140 |
|
| 141 |
.SH QEVENTS |
| 142 |
See tc (8) for some general notes about qevents. The RED qdisc supports the |
| 143 |
following qevents: |
| 144 |
|
| 145 |
.TP |
| 146 |
early_drop |
| 147 |
The associated block is executed when packets are early-dropped. This includes |
| 148 |
non-ECT packets in ECN mode. |
| 149 |
.TP |
| 150 |
mark |
| 151 |
The associated block is executed when packets are marked in ECN mode. |
| 152 |
|
| 153 |
.SH EXAMPLE |
| 154 |
|
| 155 |
.P |
| 156 |
# tc qdisc add dev eth0 parent 1:1 handle 10: red |
| 157 |
limit 400000 min 30000 max 90000 avpkt 1000 |
| 158 |
burst 55 ecn adaptive bandwidth 10Mbit |
| 159 |
|
| 160 |
.SH SEE ALSO |
| 161 |
.BR tc (8), |
| 162 |
.BR tc-choke (8) |
| 163 |
|
| 164 |
.SH SOURCES |
| 165 |
.TP |
| 166 |
o |
| 167 |
Floyd, S., and Jacobson, V., Random Early Detection gateways for |
| 168 |
Congestion Avoidance. http://www.aciri.org/floyd/papers/red/red.html |
| 169 |
.TP |
| 170 |
o |
| 171 |
Some changes to the algorithm by Alexey N. Kuznetsov. |
| 172 |
.TP |
| 173 |
o |
| 174 |
Adaptive RED : http://icir.org/floyd/papers/adaptiveRed.pdf |
| 175 |
|
| 176 |
.SH AUTHORS |
| 177 |
Alexey N. Kuznetsov, <[email protected]>, Alexey Makarenko |
| 178 |
<[email protected]>, J Hadi Salim <[email protected]>, |
| 179 |
Eric Dumazet <[email protected]>. |
| 180 |
This manpage maintained by bert hubert <[email protected]> |