CSC 257/457 – Computer Networks

CSC 257/457 – Computer Networks

CSC 257/457 – Computer Networks Fall 2017 MW 4:50 pm – 6:05 pm CSB 601 Announcement Project 3 is out CSC 457 seminar/survey paper Proposed topic write-up: due on October 28th Transport Layer 3-2 CHAPTER 3 (TRANSPORT LAYER) Chapter 3 Transport Layer A note on the use of these Powerpoint slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you see the animations; and can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: Computer § If you use these slides (e.g., in a class) that you mention their source (after all, we’d like people to use our book!) Networking: A Top § If you post any slides on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this Down Approach material. 7th edition Thanks and enjoy! JFK/KWR Jim Kurose, Keith Ross All material copyright 1996-2016 Pearson/Addison Wesley J.F Kurose and K.W. Ross, All Rights Reserved April 2016 Transport Layer 2-4 TCP round trip time, timeout Q: how to set TCP timeout value? • longer than RTT • but RTT varies • too short: – premature timeout, unnecessary retransmissions • too long: –slow reaction to segment loss Transport Layer 3-5 TCP round trip time, timeout Q: how to estimate RTT? • SampleRTT: measured time from segment transmission until ACK receipt – ignore retransmissions • SampleRTT will vary --- we want estimated RTT “smoother” – average several recent measurements, not just current SampleRTT Transport Layer 3-6 TCP round trip time, timeout EstimatedRTT = (1- a)*EstimatedRTT + a*SampleRTT § exponential weighted moving average § influence of past sample decreases exponentially fast § typical value: a = 0.125RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 350 RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 300 250 RTT (milliseconds) 200 RTT (milliseconds) sampleRTT 150 EstimatedRTT 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) Transporttime (seconds)Layer 3-7 SampleRTT Estimated RTT TCP round trip time, timeout • timeout interval: EstimatedRTT +“safety margin” – large variation in EstimatedRTT -> larger safety margin TimeoutInterval = EstimatedRTT + 4*DevRTT estimated RTT “safety margin” * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/Transport Layer 3-8 TCP round trip time, timeout • timeout interval: EstimatedRTT plus “safety margin” – large variation in EstimatedRTT -> larger safety margin • estimate SampleRTT deviation from EstimatedRTT: DevRTT = (1-b)*DevRTT + b*|SampleRTT-EstimatedRTT| (typically, b = 0.25) TimeoutInterval = EstimatedRTT + 4*DevRTT estimated RTT “safety margin” * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/Transport Layer 3-9 Chapter 3 outline 3.1 transport-layer services 3.5 connection-oriented 3.2 multiplexing and transport: TCP demultiplexing • segment structure 3.3 connectionless transport: • reliable data transfer UDP • flow control • connection management 3.4 principles of reliable data transfer 3.6 principles of congestion control 3.7 TCP congestion control Transport Layer 3-10 TCP reliable data transfer • TCP creates rdt service on top of IP’s unreliable service – pipelined segments let’s initially consider – cumulative acks simplified TCP sender: – single retransmission timer – ignore duplicate acks • retransmissions triggered by: – ignore flow control, congestion control – timeout events – duplicate acks Transport Layer 3-11 TCP sender events: data rcvd from app: • create segment with seq # • seq # is byte-stream number of first data byte in segment • start timer if not already running • think of timer as for oldest unacked segment • expiration interval: TimeOutInterval Transport Layer 3-12 TCP sender events: timeout: • retransmit segment that caused timeout • restart timer ack rcvd: • if ack acknowledges previously unacked segments • update what is known to be ACKed • start timer if there are still unacked segments Transport Layer 3-13 TCP sender (simplified) data received from application above create segment, seq. #: NextSeqNum pass segment to IP (i.e., “send”) NextSeqNum = NextSeqNum + length(data) if (timer currently not running) L start timer NextSeqNum = InitialSeqNum wait SendBase = InitialSeqNum for event timeout retransmit not-yet-acked segment with smallest seq. # start timer ACK received, with ACK field value y if (y > SendBase) { SendBase = y /* SendBase–1: last cumulatively ACKed byte */ if (there are currently not-yet-acked segments) start timer else stop timer } Transport Layer 3-14 TCP: retransmission scenarios Host A Host B Host A Host B SendBase=92 Seq=92, 8 bytes of data Seq=92, 8 bytes of data Seq=100, 20 bytes of data ACK=100 timeout X timeout ACK=100 ACK=120 Seq=92, 8 bytes of data Seq=92, 8 SendBase=100 bytes of data SendBase=120 ACK=100 ACK=120 SendBase=120 lost ACK scenario premature timeout Transport Layer 3-15 TCP: retransmission scenarios Host A Host B Seq=92, 8 bytes of data Seq=100, 20 bytes of data ACK=100 X timeout ACK=120 Seq=120, 15 bytes of data cumulative ACK Transport Layer 3-16 TCP ACK generation [RFC 1122, RFC 2581] event at receiver TCP receiver action arrival of in-order segment with delayed ACK. Wait up to 500ms expected seq #. All data up to for next segment. If no next segment, expected seq # already ACKed send ACK arrival of in-order segment with immediately send single cumulative expected seq #. One other ACK, ACKing both in-order segments segment has ACK pending arrival of out-of-order segment immediately send duplicate ACK, higher-than-expect seq. # . indicating seq. # of next expected byte Gap detected arrival of segment that immediate send ACK, provided that partially or completely fills gap segment starts at lower end of gap Transport Layer 3-17 TCP fast retransmit if sender receives 3 ACKs for same data (“triple duplicate ACKs”), resend unacked segment with smallest seq(“triple# duplicate ACKs”), § likely that unacked segment lost, so don’t wait for timeout Transport Layer 3-18 TCP fast retransmit Host A Host B Seq=92, 8 bytes of data Seq=100, 20 bytes of data X ACK=100 ACK=100 timeout ACK=100 ACK=100 Seq=100, 20 bytes of data fast retransmit after sender receipt of tripleTransport duplicateLayer ACK 3-19 Chapter 3 outline 3.1 transport-layer services 3.5 connection-oriented 3.2 multiplexing and transport: TCP demultiplexing • segment structure 3.3 connectionless transport: • reliable data transfer UDP • flow control • connection management 3.4 principles of reliable data transfer 3.6 principles of congestion control 3.7 TCP congestion control Transport Layer 3-20 http://cpham.perso.univ-pau.fr/Paper/TUTORIAL/HOTI- 06/HOTI-tutorial-Part2.pdf TCP flow control application application may process remove data from application TCP socket buffers …. TCP socket OS receiver buffers … slower than TCP receiver is delivering (sender is sending) TCP code IP flow control code receiver controls sender, so sender won’t overflow receiver’s buffer by transmitting from sender too much, too fast receiver protocol stack Transport Layer 3-22 http://cpham.perso.univ-pau.fr/Paper/TUTORIAL/HOTI- 06/HOTI-tutorial-Part2.pdf TCP flow control to application process RcvBuffer buffered data rwnd free buffer space TCP segment payloads receiver-side buffering Transport Layer 3-24 Chapter 3 outline 3.1 transport-layer services 3.5 connection-oriented 3.2 multiplexing and transport: TCP demultiplexing • segment structure 3.3 connectionless transport: • reliable data transfer UDP • flow control • connection management 3.4 principles of reliable data transfer 3.6 principles of congestion control 3.7 TCP congestion control Transport Layer 3-25 TCP congestion control: additive increase multiplicative decrease § approach: sender increases transmission rate (window size), probing for usable bandwidth, until loss occurs • additive increase: increase cwnd by 1 MSS every RTT until loss detected • multiplicative decrease: cut cwnd in half after loss additively increase window size … …. until loss occurs (then cut window in half) AIMD saw tooth behavior: probing for bandwidth sender TCP cwnd: congestion window size window congestion time Transport Layer 3-26 TCP Congestion Control: details sender sequence number space cwnd TCP sending rate: • roughly: send cwnd bytes, wait RTT for ACKS, then send more bytes last byte last byte ACKed sent, not- sent yet ACKed (“in- flight”) cwnd rate ~ bytes/sec • sender limits transmission: RTT LastByteSent- < cwnd LastByteAcked • cwnd is dynamic, function of perceived network congestion Transport Layer 3-27 TCP Slow Start Host A Host B • when connection begins, increase rate exponentially until first loss event: • initially cwnd = 1 MSS • double cwnd every RTT RTT • done by incrementing cwnd for every ACK received • summary: initial rate is slow but ramps up exponentially fast time Transport Layer 3-28 TCP: detecting, reacting to loss • loss indicated by timeout: • cwnd set to 1 MSS; • window then grows exponentially (as in slow start) to threshold, then grows linearly • loss indicated by 3 duplicate ACKs: TCP Reno • dup ACKs indicate network capable of delivering some segments • cwnd is cut in half window then grows linearly • TCP Tahoe always sets cwnd to 1 (timeout or 3 duplicate acks) Transport Layer 3-29 TCP: switching from slow start to CA Q: when should the exponential increase switch to linear? A: when cwnd gets to 1/2 of its value before timeout. Implementation: • variable ssthresh • on loss event, ssthresh is set to 1/2 of cwnd just before loss event * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/Transport Layer 3-30 Summary: TCP Congestion Control New New new ACK ACK! duplicate ACK ACK! cwnd = cwnd + MSS .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    42 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us