1 Congestion Control 2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”

Slides:



Advertisements
Similar presentations
2: Transport Layer 31 Transport Layer 3. 2: Transport Layer 32 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of.
Advertisements

Principles of Congestion Control Chapter 3.6 Computer Networking: A top-down approach.
3-1 TCP Protocol r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 12.
1 Ch. 7 : Internet Transport Protocols. 3-2 TCP reliable data transfer r TCP creates reliable service on top of IP’s unreliable service r pipelined segments.
Announcement Project 2 finally ready on Tlab Homework 2 due next Mon tonight –Will be graded and sent back before Tu. class Midterm next Th. in class –Review.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
1 Congestion Control 2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
10/7/ /9/2003 TCP and Congestion Control October 7-9, 2003.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
1 Flow Control 2 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of free buffer space  RcvWindow field in TCP.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
1 TCP latency modeling. 2 Q: How long does it take to receive an object from a Web server after sending a request? r TCP connection establishment r data.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Data Communication and Networks
Transport Layer3-1 Data Communication and Networks Lecture 8 Congestion Control October 28, 2004.
Transport Layer Congestion control. Transport Layer 3-2 Approaches towards congestion control End-to-end congestion control: r no explicit feedback.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 point-to-point:
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Transport Layer 4 2: Transport Layer 4.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer1 Flow and Congestion Control Ram Dantu (compiled from various text books)
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
1 John Magee 20 February 2014 CS 280: Transport Layer: Congestion Control Concepts, TCP Congestion Control Most slides adapted from Kurose and Ross, Computer.
CS-1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Advance Computer Networks Lecture#09 & 10 Instructor: Engr. Muhammad Mateen Yaqoob.
TCP. TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
Transport Layer session 1 TELE3118: Network Technologies Week 11: Transport Layer TCP Some slides have been taken from: r Computer Networking:
Chapter 3 outline 3.1 Transport-layer services
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Approaches towards congestion control
Chapter 3 outline 3.1 transport-layer services
COMP 431 Internet Services & Protocols
Chapter 3 outline 3.1 Transport-layer services
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Flow and Congestion Control
TCP Review.
Congestion Control.
October 1st, 2013 CS-1652 Jack Lange University of Pittsburgh
TCP 3: Transport Layer.
Chapter 3 outline 3.1 Transport-layer services
CS-1652 Congestion Control Jack Lange University of Pittsburgh
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 point-to-point:
Flow Control.
October 4th, 2011 CS-1652 Jack Lange University of Pittsburgh
Presentation transcript:

1 Congestion Control

2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle” r manifestations: m lost packets (buffer overflow at routers) m long delays (queuing in router buffers) r a highly important problem!

3 Causes/costs of congestion: scenario 1 r two senders, two receivers r one router, r infinite buffers r no retransmission

4 Causes/costs of congestion: scenario 1 r Throughput increases with load r Maximum total load C (Each session C/2) r Large delays when congested m The load is stochastic

5 Causes/costs of congestion: scenario 2 r one router, finite buffers r sender retransmission of lost packet

6 Causes/costs of congestion: scenario 2 r always: (goodput) m Like to maximize goodput! r “perfect” retransmission: m retransmit only when loss: r Actual retransmission of delayed (not lost) packet r makes larger (than perfect case) for same in out = out in out > in

7 Causes/costs of congestion: scenario 2 “costs” of congestion: r more work (retrans) for given “goodput” r unneeded retransmissions: link carries (and delivers) multiple copies of pkt out ’ in out ’ in

8 Causes/costs of congestion: scenario 3 r four senders r multihop paths r timeout/retransmit in Q: what happens as and increase ? in

9 Causes/costs of congestion: scenario 3 Another “cost” of congestion: r when packet dropped, any “upstream” transmission capacity used for that packet was wasted!

10 Approaches towards congestion control End-end congestion control: r no explicit feedback from network r congestion inferred from end-system observed loss, delay r approach taken by TCP Network-assisted congestion control: r routers provide feedback to end systems m single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) m explicit rate sender should send at Two broad approaches towards congestion control:

11 Goals of congestion control r Throughput: m Maximize goodput m the total number of bits end-end r Fairness: m Give different sessions “equal” share. m Max-min fairness Maximize the minimum rate session. m Single link: Capacity R sessions m Each sessions: R/m

12 Max-min fairness r Model: Graph G(V,e) and sessions s 1 … s m r For each session s i a rate r i is selected. r The rates are a Max-Min fair allocation: m The allocation is maximal No r i can be simply increased m Increasing allocation r i requires reducing Some session j r j ≤ r i r Maximize minimum rate session.

13 Max-min fairness: Algorithm r Model: Graph G(V,e) and sessions s 1 … s m r Algorithmic view: m For each link compute its fair share f(e). Capacity / # session m select minimal fair share link. m Each session passing on it, allocate f(e). m Subtract the capacities and delete sessions m continue recessively. r Fluid view.

14 Max-min fairness r Example r Throughput versus fairness.

15 Case study: ATM ABR congestion control ABR: available bit rate: r “elastic service” r if sender’s path “underloaded”: m sender can use available bandwidth r if sender’s path congested: m sender lowers rate m a minimum guaranteed rate r Aim: m coordinate increase/decrease rate m avoid loss!

16 Case study: ATM ABR congestion control RM (resource management) cells: r sent by sender, in between data cells m one out of every 32 cells. r RM cells returned to sender by receiver r Each router modifies the RM cell r Info in RM cell set by switches m “network-assisted” r 2 bit info. m NI bit: no increase in rate (mild congestion) m CI bit: congestion indication (lower rate)

17 Case study: ATM ABR congestion control r two-byte ER (explicit rate) field in RM cell m congested switch may lower ER value in cell m sender’ send rate thus minimum supportable rate on path r EFCI bit in data cells: set to 1 in congested switch m if data cell preceding RM cell has EFCI set, sender sets CI bit in returned RM cell

18 Case study: ATM ABR congestion control r How does the router selects its action: m selects a rate m Set congestion bits m Vendor dependent functionality r Advantages: m fast response m accurate response r Disadvantages: m network level design m Increase router tasks (load). m Interoperability issues.

19 End to end control

20 End to end feedback r Abstraction: m Alarm flag. m observable at the end stations

21 Simple Abstraction

22 Simple Abstraction

23 Simple feedback model r Every RTT receive feedback m High Congestion Decrease rate m Low congestion Increase rate r Variable rate controls the sending rate.

24 Multiplicative Update r Congestion: m Rate = Rate/2 r No Congestion: m Rate= Rate *2 r Performance m Fast response m Un-fair: Ratios unchanged

25 Additive Update r Congestion: m Rate = Rate -1 r No Congestion: m Rate= Rate +1 r Performance m Slow response r Fairness: m Divides spare BW equally m Difference remains unchanged

26 AIMD Scheme r Additive Increase m Fairness: ratios improves r Multiplicative Decrease m Fairness: ratio unchanged m Fast response r Performance: m Congestion - Fast response m Fairness overflow

27 AIMD: Two users, One link BW limit Fairness Rate of User 1 Rate of User 2

28 TCP: Congestion Control

29 TCP Congestion Control r Closed-loop, end-to-end, window-based congestion control r Designed by Van Jacobson in late 1980s, based on the AIMD alg. of Dah-Ming Chu and Raj Jain r Works well so far: the bandwidth of the Internet has increased by more than 200,000 times r Many versions m TCP/Tahoe: this is a less optimized version m TCP/Reno: many OSs today implement Reno type congestion control m TCP/Vegas: not currently used For more details: see TCP/IP illustrated; or read for linux implementation

30 TCP & AIMD: congestion r Dynamic window size [Van Jacobson] m Initialization: MI Slow start m Steady state: AIMD Congestion Avoidance r Congestion = timeout m TCP Taheo r Congestion = timeout || 3 duplicate ACK m TCP Reno & TCP new Reno r Congestion = higher latency m TCP Vegas

31 TCP Congestion Control r end-end control (no network assistance)  transmission rate limited by congestion window size, Congwin, over segments: r w segments, each with MSS bytes sent in one RTT: throughput = w * MSS RTT Bytes/sec Congwin

32 TCP congestion control: r Basic structure: r two “phases” m slow start - MI m congestion avoidance- AIMD r important variables:  Congwin: window size  threshold: defines threshold between the slow start phase and the congestion avoidance phase r “probing” for usable bandwidth:  ideally: transmit as fast as possible ( Congwin as large as possible) without loss  increase Congwin until congestion (loss)  Congestion: decrease Congwin, then begin probing (increasing) again

33 Visualization of the Two Phases threshold Congwing Slow start Congestion avoidance

34 TCP Slowstart: MI r exponential increase (per RTT) in window size (not so slow!) r In case of timeout: m Threshold=CongWin/2 initialize: Congwin = 1 for (each segment ACKed) Congwin++ until (congestion event OR CongWin > threshold) Slowstart algorithm Host A one segment RTT Host B time two segments four segments

35 TCP Taheo Congestion Avoidance /* slowstart is over */ /* Congwin > threshold */ Until (timeout) { /* loss event */ every ACK: Congwin += 1/Congwin } threshold = Congwin/2 Congwin = 1 perform slowstart Congestion avoidance TCP Taheo

36 TCP Reno r Fast retransmit: m Try to avoid waiting for timeout r Fast recovery: m Try to avoid slowstart. r Single packet drop: great!

37 Fast Retransmit r Timeout period often relatively long: m long delay before resending lost packet r Detect lost segments via duplicate ACKs m sender often sends many segments back-to- back m if segment is lost, there will likely be many duplicate ACKs r If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: m resend segment before timer expires Packets Acknowledgements (waiting seq#)

38 Fast Recovery r Fast recovery: m After retransmission do not enter slowstart. m Threshold = Congwin/2 m Congwin = 3 + Congwin/2 m Each duplicate ACK received Congwin++ m After new ACK Congwin = Threshold return to congestion avoidance

39 TCP Congestion Window Trace

40 TCP Vegas: r Idea: track the RTT m Try to avoid packet loss m latency increases: lower rate m latency very low: increase rate r Implementation: m sample_RTT: current RTT m Base_RTT: min. over sample_RTT m Expected = Congwin / Base_RTT m Actual = number of packets sent / sample_RTT m  =Expected - Actual

41 TCP Vegas r  = Expected - Actual r Congestion Avoidance: m two parameters:  and ,  <  m If (  <  ) Congwin = Congwin +1 m If (  >  ) Congwin = Congwin -1 m Otherwise no change m Note: Once per RTT r Slowstart m parameter  m If (  >  ) then move to congestion avoidance r Timeout: same as TCP Taheo

42 TCP Dynamics: Rate r TCP Reno with NO Fast Retransmit or Recovery r Sending rate: Congwin*MSS / RTT r Assume fixed RTT W W/2 r Actual Sending rate: m between W*MSS / RTT and (1/2) W*MSS / RTT m Average (3/4) W*MSS / RTT

43 TCP Dynamics: Loss r Loss rate (TCP Reno) m No Fast Retransmit or Recovery r Consider a cycle r Total packet sent: m about (3/8) W 2 MSS/RTT = O(W 2 ) m One packet loss r Loss Probability: p=O(1/W 2 ) or W=O(1/  p) W W/2

44 TCP latency modeling Q: How long does it take to receive an object from a Web server after sending a request? r TCP connection establishment r data transfer delay Notation, assumptions: r Assume one link between client and server of rate R r Assume: fixed congestion window, W segments r S: MSS (bits) r O: object size (bits) r no retransmissions m no loss, no corruption

45 TCP latency modeling Optimal Setting: Time = O/R Two cases to consider: r WS/R > RTT + S/R: m ACK for first segment in window returns before window’s worth of data sent r WS/R < RTT + S/R: m wait for ACK after sending window’s worth of data sent

46 TCP latency Modeling Case 1: latency = 2RTT + O/R Case 2: latency = 2RTT + O/R + (K-1)[S/R + RTT - WS/R] K:= O/WS

47 TCP Latency Modeling: Slow Start r Now suppose window grows according to slow start. r Will show that the latency of one object of size O is: where P is the number of times TCP stalls at server: - where Q is the number of times the server would stall if the object were of infinite size. - and K is the number of windows that cover the object.

48 TCP Latency Modeling: Slow Start (cont.) Example: O/S = 15 segments K = 4 windows Q = 2 P = min{K-1,Q} = 2 Server stalls P=2 times.

49 TCP Latency Modeling: Slow Start (cont.)

50 TCP: Flow Control

51 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of free buffer space  RcvWindow field in TCP segment sender: keeps the amount of transmitted, unACKed data less than most recently received RcvWindow sender won’t overrun receiver’s buffers by transmitting too much, too fast flow control receiver buffering RcvBuffer = size or TCP Receive Buffer RcvWindow = amount of spare room in Buffer

52 TCP Flow Control: How it Works  spare room in buffer = RcvWindow source port # dest port # application data (variable length) sequence number acknowledgement number rcvr window size ptr urgent data checksum F SR PAU head len not used Options (variable length)

53 TCP: setting timeouts

54 TCP Round Trip Time and Timeout Q: how to set TCP timeout value? r longer than RTT m note: RTT will vary r too short: premature timeout m unnecessary retransmissions r too long: slow reaction to segment loss Q: how to estimate RTT?  SampleRTT : measured time from segment transmission until ACK receipt m ignore retransmissions, cumulatively ACKed segments  SampleRTT will vary, want estimated RTT “smoother”  use several recent measurements, not just current SampleRTT

55 High-level Idea Set timeout = average + safe margin

56 Estimating Round Trip Time EstimatedRTT = (1-  )*EstimatedRTT +  *SampleRTT r Exponential weighted moving average r influence of past sample decreases exponentially fast  typical value:  =  SampleRTT : measured time from segment transmission until ACK receipt  SampleRTT will vary, want a “smoother” estimated RTT use several recent measurements, not just current SampleRTT

57 Setting Timeout Problem:  using the average of SampleRTT will generate many timeouts due to network variations Solution:  EstimtedRTT plus “safety margin”  large variation in EstimatedRTT -> larger safety margin TimeoutInterval = EstimatedRTT + 4*DevRTT DevRTT = (1-  )*DevRTT +  *|SampleRTT-EstimatedRTT| (typically,  = 0.25) Then set timeout interval: RTT freq.

58 An Example TCP Session

59 TCP Round Trip Time and Timeout EstimatedRTT = (1-x)*EstimatedRTT + x*SampleRTT r Exponential weighted moving average r influence of given sample decreases exponentially fast r typical value of x: 0.1 Setting the timeout  EstimtedRTT plus “safety margin”  large variation in EstimatedRTT -> larger safety margin Timeout = EstimatedRTT + 4*Deviation Deviation = (1-x)*Deviation + x*|SampleRTT-EstimatedRTT|