tcp congestion control algorithms and analysis
play

TCP Congestion Control: Algorithms and Analysis Simon S. Lam - PDF document

TCP Congestion Control: Algorithms and Analysis Simon S. Lam Department of Computer Sciences Department of Computer Sciences The University of Texas at Austin Littles Law Average population g p p = (average delay) x N 1 average delay


  1. TCP Congestion Control: Algorithms and Analysis Simon S. Lam Department of Computer Sciences Department of Computer Sciences The University of Texas at Austin Little’s Law Average population g p p = (average delay) x N 1 average delay delayi   (throughput) N i 1  where N is number of departures throughput N/T  where T is duration of observation average population (to be defined) average population (to be defined) Try homework problem at http://www.cs.utexas.edu/users/lam/cs356/homework/hw2.html TCP Congestion Control (Simon Lam) 2 1

  2. in system n ( t ) Number Time t  1 T average population  n ( t ) dt 0 T TCP Congestion Control (Simon Lam) 3 Sliding Window Protocol  Consider an infinite array, Source, at the sender, and an infinite array, Sink, at the receiver. send window Source: P1 0 1 2 a–1 a s–1 s Sender acknowledged unacknowledged next expected r + RW – 1 Sink : received P2 0 1 2 r Receiver delivered receive window RW receive window size SW send window size (s - a  SW) TCP Congestion Control (Simon Lam) 4 2

  3. Sliding Windows in Action  Data unit r has just been received by P2  Receive window slides forward  P2 sends cumulative ack with sequence P d l k h number it expects to receive next (r+3) send window Source: P1 0 1 2 a–1 a s–1 s Sender acknowledged unacknowledged r+3 next expected r + RW – 1 Sink: P2 0 1 2 r Receiver delivered receive window TCP Congestion Control (Simon Lam) 5 Sliding Windows in Action  P1 has just received cumulative ack with r+3 as next expected sequence number  Send window slides forward send window Source: P1 0 1 2 a–1 a s–1 s Sender acknowledged next expected r + RW – 1 Sink: P2 0 1 2 r Receiver delivered receive window TCP Congestion Control (Simon Lam) 6 3

  4. Window Flow Control RTT 1 2 W Source 1 2 W time ACKs data Destination 1 2 W 1 2 W time time  ~ W packets per RTT when no loss  Lost packet detected by missing ACK (note: timeout value T O > RTT) TCP Congestion Control (Simon Lam) 7 Throughput (send rate)  Limit the number of unacked transmitted packets in the network to window size W W  Throughput packets/sec  RTT  W MSS = bytes/sec RTT  Where did we apply Little’s Law? Answer: Consider send buffer TCP Congestion Control (Simon Lam) 8 4

  5. Clarifications  Average number in the send buffer is typically less than W unless packet arrival rate to send buffer is infinite -> previous formula provides a throughput upper bound throughput upper bound  If each packet may be lost with rate p, then the average delay is     (1 p ) RTT p T O Since T O > RTT, actual throughput is smaller.  With loss, goodput is g p    (1 (1 p ) th ) throughput h t  Note: in some papers and other context (e.g., random access protocols), goodput is called throughput . To avoid confusion, throughput is called send rate TCP Congestion Control (Simon Lam) 9 Effect of Congestion  W too big for each of many flows -> congestion  Packet loss -> transmissions on links prior to packet loss are wasted loss are wasted  Congestion collapse due too many retransmissions and too much waste  October 1986, Internet had its first congestion collapse goodput load TCP Congestion Control (Simon Lam) 10 5

  6. TCP Window Control  Receiver flow control  Avoid overloading receiver  Avoid overloading receiver  rwnd: receiver (advertised) window  Receiver sends rwnd to sender  Network congestion control  Sender tries to avoid overloading network  It infers available network capacity from “loss indications” i di ti ”  cwnd: congestion window  Sender sets W = min (cwnd, rwnd) TCP Congestion Control (Simon Lam) 11 Receiver Flow Control  Receiver advertises rwnd with each packet it sends sends  Size of rwnd indicates available space in receive buffer  decreased when data is received from IP layer and ack’d  increased when data is consumed by application  increased when data is consumed by application process TCP Congestion Control (Simon Lam) 12 6

  7. Network Congestion Control  Sender calculates cwnd from indications of network congestion  Congestion indications  Congestion indications  timeout (loss)  dupACK (loss likely)  queueing delay  mark (needs ECN)  TCP algorithms to calculate cwnd  Tahoe, Reno, Vegas, …  Link algorithms:  RED, REM … TCP Congestion Control (Simon Lam) 13 TCP & AQM p l (t) p l ( ) x i (t) Congestion measures p l (t) for distributed feedback control of x i (t) Congestion measures p l (t) for distributed feedback control of x i (t)  loss and dupACK (DropTail)  queueing delay (Vegas) with the help of active queue management (AQM)  queue length (RED)  price (REM) TCP Congestion Control (Simon Lam) 14 7

  8. TCP Congestion Control  Tahoe (Jacobson 1988)  Slow Start  Congestion Avoidance  Fast Retransmit F t R t it  Reno (Jacobson 1990)  Fast Recovery  Its variants: NewReno, SACK  Vegas (Brakmo & Peterson 1994)  New Congestion Avoidance  AQM  RED (Floyd & Jacobson 1993) E (Fl d & b 1 ) • Probabilistic marking or dropping  REM (Athuraliya & Low 2000) • Clear buffer, match rate  Others… TCP Congestion Control (Simon Lam) 15 Slow Start  Start with cwnd = 1  On each successful ACK, increment cwnd cwnd  cwnd + 1 cwnd  cwnd + 1  Exponential growth of cwnd each RTT: cwnd  2 x cwnd  Enter CA when cwnd >= ssthresh  For initial slow start, ssthresh is set to a very large , y g value (e.g., 65 Kbytes) Note: for clarity, cwnd, rwnd, and ssthresh are counted in packets (segments) rather than in bytes TCP Congestion Control (Simon Lam) 16 8

  9. Slow Start sender receiver cwnd 1 1 data packet 1 RTT ACK 2 3 4 5 6 7 8 cwnd  cwnd + 1 (for each ACK) TCP Congestion Control (Simon Lam) 17 Congestion Avoidance  CA starts when sender receiver cwnd cwnd  ssthresh cwnd  ssthresh 1 1 data packet  On each successful ACK 2 1 RTT ACK: cwnd  cwnd + 1/cwnd 3  Linear growth of cwnd each RTT: 4 cwnd  cwnd + 1 TCP Congestion Control (Simon Lam) 18 9

  10. Packet Loss  Assumption: loss indicates congestion  P  Packet loss detected by k t l d t t d b  Retransmission timeout (RTO timer)  Duplicate ACKs (at least 3) Packets 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Acknowledgements 1 2 3 3 3 3 TCP Congestion Control (Simon Lam) 19 Fast Retransmit  A timeout is quite long (> RTT)  Upon receiving 3 dupACKs, immediately p g p , y retransmit without waiting for timeout  Adjusts ssthresh ssthresh  max(flightsize/2, 2) where flightsize is number of outstanding packets, h fli htsiz is numb f utst ndin p ck ts which may be less than W = min(rwnd, cwnd)  Enter Slow Start (cwnd = 1) TCP Congestion Control (Simon Lam) 20 10

  11. TCP Tahoe (Jacobson 1988) cwnd time time SS CA (in RTTs) SS: Slow Start CA: Congestion Avoidance TCP Congestion Control (Simon Lam) 21 Successive Timeouts  When there is another timeout, double the timeout value  Keep doing so for each additional loss-  Keep doing so for each additional loss- retransmission  Exponential backoff up to max timeout value equal to 64 times initial timeout value Note: red line in figure denotes a loss indication TCP Congestion Control (Simon Lam) 22 11

  12. Summary: Tahoe  Basic ideas  Probe network for spare capacity during SS and CA and increase send rate CA and increase send rate  Drastically reduce rate on congestion indication  Self-clocking  Error recovery by retransmission  Round trip time estimation (to get T O value) f or ever y ACK { i f ( W i f ( W < sst hr esh) t hen W < sst hr esh) t hen W ++ ++ ( SS) ( SS) el se W += 1/ W ( CA) } f or ever y l oss i ndi cat i on { sst hr esh = W / 2 W = 1 } TCP Congestion Control (Simon Lam) 23 TCP Tahoe (Jacobson 1988) cwnd time SS CA SS: Slow Start CA: Congestion Avoidance TCP Congestion Control (Simon Lam) 24 12

  13. TCP Reno (Jacobson 1990) cwnd time SS CA SS: Slow Start CA: Congestion Avoidance Fast retransmission/fast recovery TCP Congestion Control (Simon Lam) 25 TCP Reno (another scenario) TO 3 dupACKs cwnd halved Slow start until cwnd reaches ssthresh Initial slow start t TCP Congestion Control (Simon Lam) 26 13

Recommend


More recommend