the transport layer tcp congestion control
play

The Transport Layer: TCP & Congestion Control Smith College, - PDF document

The Transport Layer: TCP & Congestion Control Smith College, CSC 249 Feb 20, 2018 1 Overview: TCP Basics q Recap: using SEQ and ACK numbers v SEQ random initial number for numbering the bytes in the application message v ACKnowledge


  1. The Transport Layer: TCP & Congestion Control Smith College, CSC 249 Feb 20, 2018 1 Overview: TCP Basics q Recap: using SEQ and ACK numbers v SEQ random initial number for numbering the bytes in the application message v “ACKnowledge” next byte expected v Read chapter to review q TCP congestion control v Read through multiple times! q TCP flow control 2 1

  2. TCP: SEQ and ACK numbers source port # Host A dest port # Host B sequence number Seq=92, 8 bytes data acknowledgement number source port # dest port # head U A P R S F receive window sequence number len acknowledgement number head U A P R S F ACK=100 receive window len application data (variable length) Seq=100, 20 bytes data application data (variable length) ACK=120 time 3-3 TCP: Cumulative ACK Host B Host A Seq=92, 8 bytes data ACK=100 Seq=100, 20 bytes data timer X loss 0 2 1 = K C A time Cumulative ACK scenario 3-4 2

  3. TCP possible sender events: (1) Data received from application: 1. Create a segment and assign a SEQ number v SEQ # is byte-stream number of first data byte in segment 2. Start timer if it is not already running v Timer is for the oldest un-acked segment v Expiration interval: TimeOutInterval (2) Timeout (ACK not received): 1. Retransmit segment that caused the timeout 2. Restart the timer (3) ACK received for previously unacked segments 1. Update what is known to be acked 2. Start timer if there are outstanding segments 5 TCP: retransmission scenarios Host A Host A Host B Host B Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=92 timeout Seq=100, 20 bytes data timeout ACK=100 ACK=100 X ACK=120 loss Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=92 timeout ACK=120 0 0 1 = K C A SendBase = 100 premature timeout time time lost ACK scenario 1) What is/was ‘A’s next step? 2) What does ‘B’ then do? 6 3

  4. What does ‘A’ do next, and when does it do it? Host A Host B seq # x1 seq # x2 seq # x3 X ACK x1 seq # x4 seq # x5 ACK x1 ACK x1 triple ACK x1 duplicate resend seq X2 ACKs Fast retransmit, timeout before the timer times out time 7 New Today: Principles of Congestion Control q Packet loss is caused by overflowing router buffers q Retransmission treats the symptom q Congestion control treats the cause q What are costs of congestion? v v v v 8 4

  5. TCP Congestion Control q Three questions 1. How does a sender sense congestion? 2. How does a sender limit its sending rate? 3. What algorithm is used to change the send-rate? 10 TCP Congestion Control: details How does sender perceive congestion? q A loss event is ? v A timeout or v 3 duplicate ACKs How does sender limit its send rate? q TCP sender reduces the send rate via changing a variable value, the “ CongWin, ” after a loss event LastByteSent-LastByteAcked ≤ CongWin 12 5

  6. TCP Congestion Control Window q CongWin is dynamic, function of perceived network congestion q Sender limits transmission: LastByteSent-LastByteAcked ≤ CongWin q Changing CongWin changes the SendRate 13 TCP Congestion Control Algorithm 14 6

  7. TCP Congestion Control Algorithm Three major mechanisms: 1) Slow start 2) Congestion Avoidancce • AIMD = additive increase, multiplicative decrease 3) Fast Recovery: • Reaction to timeout events versus 3 duplicate ACKs Are used to adjust... ? v Adjust CongWin 15 TCP Slow Start 1) When connection begins, CongWin = 1 MSS v Available bandwidth probably much greater v Desirable to quickly ramp up to respectable rate 2) Increase rate exponentially fast until first loss event v Grow window 1MSS for each ACK received q Summary: initial rate is slow but ramps up exponentially fast 16 7

  8. TCP: detecting, reacting to loss § Loss indicated by timeout • cwnd set to 1 MSS; • Window ( cwnd ) grows exponentially (slow start) to the threshold, then grows linearly § Loss indicated by 3 duplicate ACKs • Duplicate ACKs indicate network capable of delivering some segments • cwnd is cut in half window then grows linearly 17 TCP Slow Start with Exp. Increase q When connection Host A Host B begins, increase rate exponentially until one segment RTT first loss event: v Double CongWin every two segments RTT v Increment CongWin for every ACK received four segments time 18 8

  9. TCP: Congestion algorithm switching from slow start to CA Implementation: § variable ssthresh § on loss event, ssthresh is set to 1/2 of cwnd just before loss event 19 Reaction to Loss Events q Exponential increase switches to linear increase when CongWin gets to the ‘ threshold ’ value (size) 20 9

  10. Identify everything on this graph 21 Summary: TCP Congestion Control Increase Sending Rate Phase Options: 1. When CongWin is below Threshold , sender in slow-start phase, window grows exponentially. 2. When CongWin is above Threshold , sender is in congestion-avoidance phase, window grows linearly. Decrease Sending Rate Phase Options: 1. When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold . 2. When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS. 27 10

Recommend


More recommend