Sie sind auf Seite 1von 38

Random Early Detection for Congestion Avoidance

EC440T Communication Networks

Introduction
Main idea: to provide congestion control at the router for TCP flows. Goals of RED
[primary goal] is to provide congestion avoidance by controlling the average queue size such that the router stays in a region of low delay and high throughput. To control misbehaving users

Definitions
congestion avoidance when impending congestion is indicated take action to avoid congestion incipient congestion congestion that is beginning to be apparent. need to notify connections of congestion at the router by either marking the packet [ECNexplicit congestion indication] or dropping the packet {This assumes a drop is an implied signal to the source host.}

Previous Work
Drop Tail Random Drop Early Random Drop Source Quench messages DECbit scheme

Drop Tail Router

FIFO queueing mechanism that drops packets when the queue overflows.

Random Drop Router

When a packet arrives and the queue is full, randomly choose a packet from the queue to drop.

Early Random Drop Router


?
Drop level

If the queue length exceeds a drop level, then the router drops each arriving packet with a fixed drop probability.

Source Quench message


Router sends source quench messages back to source before queue reaches capacity. Complex solution that gets router involved in end-to-end protocol.

DECbit scheme
Uses a congestion-indication bit in packet header to provide feedback about congestion. Average queue length is calculated for last (busy + idle) period plus current busy period. When average queue length exceeds one, set congestion-indicator bit in arriving packets header. If at least half of packets in sources last window have the bit set, then decrease the window exponentially.

Random Early Detection (RED)


Used for congestion avoidance in packet-switched networks. The gateway detects incipient congestion by computing the average queue size. The gateway could notify connections of congestion either by dropping packets arriving at the gateway or by setting a bit in packet headers. When the average queue size exceeds a preset threshold, the gateway drops or marks each arriving packet with a certain probability, where the exact probability is a function of the average queue size.

RED and DECbit scheme


Differs in the following aspects: RED does not try to explicitly send a congestion notification message to the source. How RED decides to drop the packet and when to drop the packet - different from DECbit scheme.

RED marking
RED gateways can mark a packet by dropping it at the gateway or by setting a bit in the packet header, depending on the transport protocol. When the average queue size exceeds a maximum threshold, the RED gateway marks every packet that arrives at the gateway. If RED gateways mark packets by dropping them rather than by setting a bit in the packet header when the average queue size exceeds the maximum threshold, then the RED gateway controls the average queue size even in the absence of a cooperating transport protocol.

RED Details
Compute average queue length
AvgLen = (1 - Weight) * AvgLen + Weight * SampleLen 0 < Weight < 1 SampleLen is queue length each time a packet arrives
MaxThreshold MinThreshold

Av gLen

RED Details (cont)


Two queue length thresholds
if AvgLen <= MinThreshold then enqueue the packet if MinThreshold < AvgLen < MaxThreshold then calculate probability P drop arriving packet with probability P if ManThreshold <= AvgLen then drop arriving packet

RED Algorithm
for each packet arrival calculate the average queue size avg if minth <= avg < maxth calculate the probability pa with probability pa: mark/drop the arriving packet else if maxth <= avg drop the arriving packet with probability 1

RED drop probability ( pa ) pb = maxP * (avg - minth)/(maxth - minth) [1] and pa = pb/ (1 - count x pb) [2] where count represents the number of unmarked packets that have arrived since the last marked packet. Note: this calculation assumes queue size is measured in packets. If queue is in bytes, we need to add [1.a] between [1] and [2] pb = pb x PacketSize/MaxPacketSize [1.a]

RED drop probability The computation of drop probability when the average queue size is between min and max, could be based on one of the above equations. It was proved that if second one is used, the algorithm is capable of randomizing the drop compared to the first method. After computing such a probability, RED will decide to drop the packet by generating a new uniform random variable over [0,1] and comparing with this probability.

RED (contd)
As avg varies from min to max, the packetmarking probability varies linearly from 0 to maxP. The final marking probability increases slowly as the count increases since the last marked packet. This makes closely spaced drops less likely than widely spaced drops. Without this step packets drops were found occur in clusters which would result in multiple drops in a single connection.

RED example
Let MaxP=0.02 and the count is set to 0. If the average queue length is halfway between two thresholds, then drop/mark probability would be p=0.01. An arriving packet has 99% chance of getting into the queue. With each successive packets that are not dropped, p would increase slowly, and by the time 50 packets arrive, the drop probability would be 0.02. If 99 packets arrive without any loss, p increase to 1 and the next packet would be dropped. Hence RED result in roughly even distribution of drops

average queue length (avg) avg = (1 - wq) x avg + wq x q where q is the newly measured queue length This exponential weighted moving average is designed such that short-term increases in queue size from bursty traffic or transient congestion do not significantly increase average queue size.

Drop probability function for RED


1
Dropping/Marking Probability

maxP 0 Minth Maxth


Average Queue Length

Queue Size

RED (contd)
If RED drops a small percentage of packets, the effect will be to cause few TCP connections to reduce their window sizes; thus reducing the packet arrival rate at the router. Av. Queue length will then decrease and congestion is avoided. Sine RED drops packets randomly, probability that RED drops packets of a particular connection is roughly proportional to that connections share of the bandwidth (flow that is sending relatively large number of packets is providing more candidates for random dropping)

RED parameter settings


minth, maxth depend on desired average queue size bursty traffic increase minth to maintain link utilization. maxth depends on maximum average delay allowed Difference should be larger than typical increase in calculated average queue size over one RTT. RED most effective when average queue size is larger than typical increase in calculated queue size in one round-trip time rule of thumb: maxth at least twice minth . However, maxth = 3 times minth some experiments shown. There should be enough free buffer space above maxth to absorb natural burst that occur in Internet traffic without forcing the router to enter drop tail mode

RED example
Consider a RED gateway with MaxP = 0.0275, and with an average queue length halfway between the two thresholds MinP and MaxP. a. Find the drop probability Pcount, for count = 1 and count = 50

RED example
AvgLength = (MinThreshold + MaxThreshold) / 2 pb =TempP = MaxP*(AvgLength MinThreshold) / (MaxThreshold MinThreshold) = 0.0275*(0.5) = 0.01375 pa = TempP / (1 1*TempP) = 0.01375/ (1 - 0.01375) = 0.01375/ 0.98625 = 0.01394 P50 = TempP / (1 50*TempP) = 0.01375/ (1 - 0.6875)

RED parameter selection


If the weight wq is too large, then the averaging procedure will not filter out transient congestion at the gateway. Assume that the queue is initially empty, with an average queue size of zero, and then the queue increases from 0 to L packets over L packet arrivals. After the Lth packet arrives at the gateway, the average queue size is given by

RED parameter selection

RED parameter selection


RED gateways are designed to keep the calculated average queue size below a certain threshold. However, this serves little purpose if the calculated average is not a reasonable reflection of the current average queue size. If wq is set too low, then responds too slowly to changes in the actual queue size. In this case, the gateway is unable to detect the initial stages of congestion

RED Implementation
Efficient implementation of RED algorithm requires only a small number of add and shift instructions for each packet arrival. RED gateway algorithm need not impair the gateway's ability to process packets. For every packet arrival at the gateway queue, the RED gateway calculates the average queue size as follows. As long as wq is chosen as a (negative) power of 2, this can be implemented with one shift and two additions.

RED Implementation
The calculation of the average queue size is modified when a packet arrives at the gateway to an empty queue. In this case the gateway calculates m, the number of packets that might have been transmitted by the gateway during the time that the line was free. The gateway calculates the average queue size as if m packets had arrived at the gateway with a queue size of zero. Let q_time is the start of the queue idle time and s is a typical transmission time for a small packet.

RED Implementation
When a packet arrives at the gateway and the average queue size exceeds the max_threshold, the packet is marked (dropped). However, when a packet arrives at the gateway and the average queue size is between the two thresholds the initial packet-marking probability p_b is computed.

RED Implementation
In this case, a new pseudorandom number R is computed for each arriving packet, where R = Random [0,1] is from the uniform distribution on [0,1]. These random numbers could be obtained from a table of random numbers stored in memory. The arriving packet is dropped if the following occurs (If p_b is approximated by a negative power of 2, then this can be efficiently computed).

Packet-marking probability
goal: want to uniformly spread out marked packets It is undesirable to have too many marked packets close together, and it is also undesirable to have too long an interval between marked packets. Both of these events can result in global synchronization, with several connections reducing their windows at the same time, Method 1: geometric random variable each packet marked with probability pb Method 2: uniform random variable marking probability is pb/ (1 - count x pb) where count is the number of unmarked packets arrived since last marked packet.

Method 1 (contd)
Let the average queue size be constant. Each packet is marked with probability pb .

Let the inter marking time X be the number of packets that arrive, after a marked packet, until the next packet is marked. Because each packet is marked with probability

Method 2 (contd)
It is always desirable to have X to be a uniform random variable (0,1,2,,1/ pb). Let count be the number of unmarked packets that have arrived since the last marked packet. The uniform probability is achieved if the marking probability is

pa = pb/ (1 - count x pb)

maxp
RED performs best when packetmarking probability changes fairly slowly as the average queue size changes Recommend that maxp never greater than 0.1

Conclusions
RED is effective mechanism for congestion avoidance at the router in cooperation with TCP.

Reference
Random Early Detection Gateways for Congestion Avoidance Sally Floyd and Van Jacobson Lawrence Berkeley Laboratory University of California August 1993 IEEE/ACM Transactions on Networking

Das könnte Ihnen auch gefallen