Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 7.2: Resource Allocation and Congestion.

Similar presentations


Presentation on theme: "ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 7.2: Resource Allocation and Congestion."— Presentation transcript:

1 ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 7.2: Resource Allocation and Congestion Control Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 1

2 Problem Statement Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 2 We have seen enough layers of protocol hierarchy to understand how data can be transferred among processes across heterogeneous networks Problem – How to effectively and fairly allocate resources among a collection of competing users? – It is related to Resource Allocation and Congestion Control

3 Resource Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 3 Resources – Bandwidth of the links – Buffers at the routers and switches

4 Congestion Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 4 Packets contend at a router for the use of a link, with each contending packet placed in a queue waiting for its turn to be transmitted over the link When too many packets are contending for the same link – The queue overflows – Packets get dropped Network is congested! Network should provide a congestion control mechanism to deal with such a situation

5 Congestion Control & Resource Allocation Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 5 Congestion control and Resource Allocation – Two sides of the same coin If the network takes active role in allocating resources – The congestion may be avoided – No need for congestion control On the other hand, we can always let the sources send as much data as they want - Then recover from the congestion when it occurs - Easier approach but it can be disruptive because many packets many be discarded by the network before congestions can be controlled

6 Congestion Control & Resource Allocation Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 6 Congestion control and resource allocations involve both hosts and network elements such as routers In network elements, e.g., routers: – Various queuing disciplines can be used to control the order in which packets get transmitted and which packets get dropped: Queuing issues At the hosts’ end – The congestion control mechanism paces how fast sources are allowed to send packets: TCP Congestion Control

7 Queuing: FIFO Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 7 FIFO: Simple queuing model First come first served Drop packets if buffers is full (tail drop) FIFO: scheduling policy Tail drop: drop policy Problem? All flows are treated the same Fast rate flow fills up buffer Slow rate may not get service

8 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 8 Attempt to neutralize the advantage of high rate flows – Maintain a queue for each flow – Service the queues in a round-robin – (RR) fashion – Drop packets when a queue is full How about packet sizes? – Not all flows use the same packet size. For example, if a router is managing two flows, one with 1000-byte packets and the other with 500-byte packets. A simple round-robin will give the first flow two thirds of the link’s bandwidth and the second flow only one-third of its bandwidth

9 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 9 – What we really want is bit-by-bit round-robin; that is, the router transmits a bit from flow 1, then a bit from flow 2, and so on. – Can we interleave the bits from different packets? – The FQ mechanism therefore simulates this behavior by first determining when a given packet would finish being transmitted if it were being sent using bit-by-bit round- robin, and then using this finishing time to sequence the packets for transmission.

10 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 10 – To understand the algorithm for approximating bit-by-bit round robin, consider the behavior of a single flow – For this flow, assume a clock ticks once each time one bits transmitted. Then P i : denote the length of packet i, i.e., number of clock ticks S i : time when the router starts to transmit packet i F i : time when router finishes transmitting packet i Clearly, F i = S i + P i

11 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 11 When do we start transmitting packet i? Depends on whether packet i arrived before or after the router finishes transmitting packet i-1 for the flow Let A i denote the time that packet i arrives at the router Then S i = max(F i-1, A i ) F i = max(F i-1, A i ) + P i

12 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 12 – Now for every flow, we calculate F i for each packet that arrives using our formula – We then treat all the F i as timestamps – Next packet to transmit is always the packet that has the lowest timestamp The packet that should finish transmission before all others

13 Fair Queuing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 13 Fair Queuing Example of fair queuing in action: (a) packets with earlier finishing times are sent first; (b) sending of a packet already in progress is completed

14 TCP Congestion Control Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 14 The idea: Each source to determine how much capacity is available in the network, so that it knows how many packets it can safely have in transit. But how? TCP maintains a variable for each connection, called CongestionWindow, which is used by the source to limit how much data it is allowed to have in transit at a given time. The congestion window is congestion control’s counterpart to flow control’s advertised window.

15 TCP Congestion Control Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 15 – TCP’s effective window is revised as follows: MaxWindow = MIN(CongestionWindow, AdvertisedWindow) EffectiveWindow = MaxWindow − (LastByteSent − LastByteAcked). – That is, MaxWindow replaces AdvertisedWindow in the calculation of EffectiveWindow. – But now, how to determine CongestionWindow? Remember we obtain AdvertisedWindow from Receiver!!

16 TCP Congestion Control Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 16 The answer is that the TCP source sets the CongestionWindow based on the level of congestion it perceives to exist in the network. This involves decreasing the congestion window when the level of congestion goes up and increasing the congestion window when the level of congestion goes down. The mechanism is commonly called additive increase/multiplicative decrease (AIMD)

17 TCP Congestion Control: AIMD Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 17 – How does the source determine that the network is congested and that it should decrease the congestion window? TCP interprets timeouts as a sign of congestion and reduces the rate at which it is transmitting. Specifically, each time a timeout occurs, the source sets CongestionWindow to half of its previous value. This halving of the CongestionWindow for each timeout corresponds to the “multiplicative decrease” part of AIMD.

18 TCP Congestion Control: AIMD Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 18 – We also need to be able to increase the congestion window to take advantage of newly available capacity in the network. – This is the “additive increase” part of AIMD, and it works as follows. Every time the source successfully sends a CongestionWindow’s worth of packets—that is, each packet sent out during the last RTT has been ACKed—it adds the equivalent of 1 packet to CongestionWindow.

19 TCP Congestion Control: AIMD Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 19 Additive Increase Multiplicative Decrease Packets in transit during additive increase, with one packet being added each RTT.

20 TCP Congestion Control: Slow Start Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 20 – The additive increase mechanism just described is the right approach to use when the source is operating close to the available capacity of the network, but it takes too long to ramp up a connection when it is starting from scratch. – TCP therefore provides a second mechanism, ironically called slow start, that is used to increase the congestion window rapidly from a cold start. – Slow start effectively increases the congestion window exponentially, rather than linearly.

21 TCP Congestion Control: Slow Start Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 21 – Specifically, the source starts out by setting CongestionWindow to one packet. – When the ACK for this packet arrives, TCP adds 1 to CongestionWindow and then sends two packets. – Upon receiving the corresponding two ACKs, TCP increments CongestionWindow by 2—one for each ACK— and next sends four packets. – The end result is that TCP effectively doubles the number of packets it has in transit every RTT.

22 TCP Congestion Control: Slow Start Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 22 Packets in transit during slow start.

23 Congestion Control: Fast Retransmit Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 23 – The mechanisms described so far were part of the original proposal to add congestion control to TCP. – It was soon discovered, however, that the coarse-grained implementation of TCP timeouts led to long periods of time during which the connection went dead while waiting for a timer to expire. – Because of this, a new mechanism called fast retransmit was added to TCP: Receiver: Send duplicate ACK; Transmitter: Retransmit when seeing 3 duplicate ACKs.

24 Congestion Control: Fast Retransmit Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 24 Fast retransmit – Waiting for timeout may be expensive – Arrival of duplicate ACKs indicate out-of- order packet arrival – If three duplicate acknowledgments are received, retransmit

25 Congestion Control: Further Discussions Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527Computer Networks 25 TCP: Try to control congestion when it happens – Alternative is to try avoid congestion in the first place Goal is to predict the congestion and take early precautions Congestion avoidance mechanisms (but not widely adopted) – DECbit scheme – Random early detection (RED) – Source-based congestion avoidance


Download ppt "ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 7.2: Resource Allocation and Congestion."

Similar presentations


Ads by Google