1 / 56

CMPE 150 Fall 2005 Lecture 27

CMPE 150 Fall 2005 Lecture 27. Introduction to Computer Networks . Announcements. Homework 5 posted. Due, Mon, 12.05. Lab tonight! Final exam: December 7 th . 4-7pm In class. Closed books/notes. Comprehensive. Course evaluation. Last day of class. CE 151 will be offered in Winter 06!.

minor
Download Presentation

CMPE 150 Fall 2005 Lecture 27

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPE 150Fall 2005Lecture 27 Introduction to Computer Networks

  2. Announcements • Homework 5 posted. • Due, Mon, 12.05. • Lab tonight! • Final exam: December 7th. 4-7pm • In class. • Closed books/notes. • Comprehensive. • Course evaluation. • Last day of class. • CE 151 will be offered in Winter 06!

  3. Today • Transport Layer (Cont’d). • Chapter 6 of Tanenbaum.

  4. The Transport Layer • End-to-end. • Communication from source to destination host. • Only hosts run transport-level protocols. • Under user’s control as opposed to network layer which is controlled/owned by carrier.

  5. The Transport Service • Service provided to application layer. • Transport entity: process that implements the transport protocol running on a host. • Typically at OS kernel, or user-level process.

  6. Connection Establishment

  7. Three-Way Handshake • Solves the problem of getting 2 sides to agree on initial sequence number. 2 1 CR: connection request. CR (seq=x) ACK(seq=y,ACK=x) DATA(seq=x, ACK=y)

  8. Delayed Duplicates 2 1 . Old duplicate CR. . The ACK from host 2 tries to verify if host 1 was trying to open a new connection with seq=x. . Host 1 rejects host 2’s attempt to establish. Host 2 realizes it was a duplicate CR and aborts connection. * CR(seq=x) ACK(seq=y, ACK=x) REJECT(ACK=y)

  9. Delayed Duplicates 2 1 . Old duplicate CR and ACK to connection accepted. * CR(seq=x) ACK(seq=y, ACK=x) DATA(seq=x, ACK=z) REJECT(ACK=y)

  10. TCP Connection Establishment 6-31

  11. Sequence Numbers versus Time 1 Seq. #’s . Linear relation between time and initial sequence number. Time

  12. Connection Release • Asymmetric release: telephone system. • When one party hangs up, connection breaks. • May cause data loss. • Symmetric release: • Treats connection as 2 separate unidirectional connections. • Requires each to be released separately.

  13. Symmetric Release • How to determine when all data has been sent and connection could be released? • 2-army problem: Blue army 2 Blue army 1 . White army larger than either blue armies. . Blue army together is larger. . If each blue army attacks, it’ll be defeated. They win if attack together. White army

  14. 2-Army Problem • To synchronize attack, they must use messengers that need to cross valley: unreliable. • Is there a protocol that allows blue army to win? No. • Blue army 1 sends message to blue army 2. • Blue army 2 sends ACK back. • Blue army 2 is not sure whether ACK was received.

  15. 2-Army Problem (Cont’d) • Use 2-way handshake. • Blue army 1 ACKs back but it’ll never know if the ACK was received. • Applying to connection release: • Neither side is prepared to disconnect until convinced other side is prepared to disconnect. • In practice, hosts are willing to take risks.

  16. Connection Release Protocol DR: disconnection request. Send DR+ start timer DR DR Send DR+ start timer Release connection ACK Send ACK Release connection

  17. Connection Release: Scenario 1 DR: disconnection request. Send DR+ start timer DR DR Send DR+ start timer Release connection ACK Send ACK Timeout: Release connection

  18. Connection Release: Scenario 2 DR: disconnection request. Send DR+ start timer DR DR Send DR+ start timer Timeout: send DR+ start timer DR Send DR+ start timer DR Release connection ACK

  19. TCP Connection Release • Each side released independently. • TCP segment with FIN bit set. • Means that side has no more data to send. • When both sides have shutdown, connection is released,

  20. TCP Connection Release FIN FIN ACK FIN FIN ACK Timers to avoid 2-army problem.

  21. TCP Reliability • Reliability. • Ordering. • Duplicate detection.

  22. TCP Reliability: Mechanisms • Acknowledgements. • Timers. • Sequence numbers.

  23. Delayed ACKs • ACKs are delayed waiting for data to be sent in the “other” direction. • Either data will be sent or delayed ACK timer expires.

  24. TCP Flow Control

  25. Window Flow Control: Sender effective window advertised window (from receiver) Sent but not acked Not yet sent Sequence numbers send buffer last byte ACKed last byte sent

  26. Window Flow Control: Receiver Receive buffer (possible window) ACKed but not delivered to user recv’d but not ACKed Sequence numbers missing data advertised window

  27. Problem: Rapid Wrap-Around • Sequence number is 32 bits long. • Wraparound time vs. link speed: • 1.5Mbps: 6.4 hours • 10Mbps: 57 minutes • 45Mbps: 13 minutes • 100Mbps: 6 minutes • 622Mbps: 55 seconds • 1.2Gbps: 28 seconds • Protection Against Wrapped Sequences (PAWS extension): Use timestamp option to extend sequence number space.

  28. Silly Window Syndrome

  29. Window Advancement Issues • What if window is full? • Sender sends full window, but ACK is lost. • Sender sends 1-byte probes (solicits new ACK). • Silly window syndrome (RFC-813) • Receiver avoids small window advances. • Silly Window Avoidance: delay ACKing (receiver) or avoid sending small segments (sender). • Sender avoids sending small chunks (like telnet). • Nagle’s algorithm (RFC-896): send 1st partial packet, but not more until it’s ACKed or you have a full packet

  30. TCP Congestion Control

  31. What is Congestion Control? • “Efforts made by network nodes to prevent or respond to overload condition”, [Peterson&Davie]. • Prevent senders from sending too much data into network. • Flow control? • Prevents (faster) sender from overrunning (slower) receiver. • Both concepts are often confused as they share common mechanisms.

  32. TCP Congestion Control • (a) A fast network feeding a low capacity receiver. • (b) A slow network feeding a high-capacityreceiver.

  33. Why do congestion control? • Use network resources efficiently. • Preserve fair network resource allocation. • Prevent or avoid congestion collapse. • Congestion collapse is not just a theory! • Has been frequently observed in many networks.

  34. 10 Mbps 1.5 Mbps 10 Mbps Congestion Collapse • If both sources send full speed, the router is completely overwhelmed • congestion collapse: senders lose data from congestion and they resend, causing more congestion (can be self-reinforcing).

  35. Network dynamics delay throughput load load

  36. E2E congestion control • Why do it at the transport layer? • Real fix to congestion is to slow down sender. • Use law of “conservation of packets”. • Keep number of packets in the network constant. • Don’t inject new packet until old one leaves. • Congestion indicator: packet loss.

  37. Congestion Control Design • Avoidance or detection/recovery? • Avoidance keeps system at knee of curve • Requires some congestion signal. • Detection/recovery responds to loss after the fact. • TCP • Which is TCP? • Congestion detection/recovery. • How does TCP do it? • Slow start, congestion avoidance, exponential backoff.

  38. TCP congestion control • Underlying design principle: packet conservation • At equilibrium, inject packet into network only when one is removed. • Basis for stability of physical systems.

  39. Self-clocking • If we have large actual window, should we send data in one shot? • No, use ACKs to clock sending new data.

  40. ..Self-clocking Pr Pb receiver sender Ab As Ar

  41. TCP congestion control basics • Like, flow control, also window based. • Sender keeps congestion window (cwin). • Each sender keeps 2 windows: receiver’s advertised window and congestion window. • Sender’s maximum window: min(advertised window, cwin). • Sender’s actual window: • Max window - unacknowledged segments.

  42. TCP congestion control mechanisms • Collection of interrelated mechanisms: • Slow start. • Congestion avoidance. • Accurate retransmission timeout estimation. • Fast retransmit. • Fast recovery.

  43. TCP congestion window • New congestion window cwnd • What the network can handle, • versus flow control window (wnd): what the other end can handle • Actual congestion window: • min (wnd, cwnd).

  44. When to increase/decrease? A control theory problem: Observe network. Reduce window if congested. Increase window if not congested. Constraints: Efficiency. Fairness. Stability (too much oscillation is bad). Out-of-date info RTT is fundamental limit to how quickly you can react How to adjust window?

  45. Slow start [Jacobson 1988] • How do we get this self-clocking behavior to start? • Initialize cwnd = 1. • Upon receipt of every ack, cwnd = cwnd + 1 • Implications • Window actually increases in RTT * log2W (exponential increase). • Can overshoot window and cause packet loss. • Connection’s congestion window starts at 1 segment.

  46. Slow start example one RTT 0R 1 one pkt time 1R 1 2 3 2R 2 3 4 6 5 7 3R 4 5 6 7 8 10 12 14 9 11 13 15

  47. When to End Slow-Start? • Want to end when the pipe is full. • When cwnd > ssthresh. • Start with large ssthresh, but then refine it. • On packet loss. • cwnd=1 and go back to slow start. • ssthresh = cwnd / 2 • assume that pipe size was somewhere between last good window (cwnd/2) and current window (cwnd). • Eventually, ssthresh is right and transition to congestion avoidance without packet loss.

  48. Congestion avoidance • Upon receiving ACK • Increase cwnd by 1/cwnd. • This is additive increase. • Why not multiplicative increase? • Growing too fast in equilibrium => oscillations

  49. TCP Congestion Control: Operation cwin timeout threshold threshold time

  50. TCP Retransmission Timer • When segment sent, retransmission timer starts. • If segment ACKed, timer stops. • If time out, segment retransmitted and timer starts again.

More Related