1 / 77

Project 2 is out!

Project 2 is out!. Goal: implement reliable transport protocol We give you the receiver, you implement the sender Our receiver uses sliding window and cumulative acks. Grading Policy. The grades will be based on correctness and performance , not adherence to a specified algorithm.

chessa
Télécharger la présentation

Project 2 is out!

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. Project 2 is out! Goal: implement reliable transport protocol • We give you the receiver, you implement the sender • Our receiver uses sliding window and cumulative acks

  2. Grading Policy The grades will be based on correctness and performance, not adherence to a specified algorithm.

  3. Correctness Is the file sent the same as file received? You need to handle… • Loss • Corrupted packets • Re-ordering of packets What are corner cases associated with each of these?

  4. Performance Is the transfer timely, with a reasonable number of packets sent? • How long to wait before sending new packets / resending old packets? • How many packets to send? Stop-and-wait probably waits too long… Go-back-n probably sends too much… Think scale.

  5. Grading Policy • We provide you with a testing framework, including one test case • You need to implement further tests! • We have a whole suite of tests full of juicy corner cases…

  6. But I have questions… • General questions about reliable transport • Ask your TA • Project specific questions • Andrew(andrewor@berkeley) • Colin(cs@cs.berkeley) • Radhika(radhika@eecs.berkeley)

  7. Collaboration Policy Projects are designed to be solved independently, but you may work with a partner if you wish (but at most two people can work together). Grading will remain the same whether you choose to work alone or with a partner; both partners will receive the same grade regardless of the distribution of work between the two partners (so choose a partner wisely!).

  8. Collaboration Policy (continued) You may not share code with any classmates other than your partner. You may discuss the assignment requirements or general programming decisions (e.g., what data structures were used to store routing tables) - away from a computer and without sharing code- but you should not discuss the detailed nature of your solution (e.g., what algorithm was used to compute the routing table).

  9. TCP: Congestion Control EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/~ee122/ Material thanks to Ion Stoica, Scott Shenker, Jennifer Rexford, Nick McKeown, and many other colleagues

  10. Last lecture • Flow control: adjusting the sending rate to keep from overwhelming aslow receiver Today • Congestion control:adjusting the sending rate to keep from overloading thenetwork

  11. Statistical Multiplexing  Congestion • If two packets arrive at the same time • A router can only transmit one • … and either buffers or drops the other • If many packets arrive in a short period of time • The router cannot keep up with the arriving traffic • … delays traffic, and the buffer may eventually overflow • Internet traffic is bursty

  12. Congestion is undesirable Typical queuing system with bursty arrivals Average Packet delay Average Packet loss Load Load Must balance utilization versus delay and loss

  13. Who Takes Care of Congestion? • Network? End hosts?Both? • TCP’s approach: • End hosts adjust sending rate • Based on implicit feedback from network • Not the only approach • A consequence of history rather than planning

  14. Some History: TCP in the 1980s • Sending rate only limited by flow control • Packet drops  senders (repeatedly!) retransmit a full window’s worth of packets • Led to “congestion collapse” starting Oct. 1986 • Throughput on the NSF network dropped from 32Kbits/s to 40bits/sec • “Fixed” by Van Jacobson’s development of TCP’s congestion control (CC) algorithms

  15. Jacobson’s Approach • Extend TCP’s existing window-based protocol but adapt the window size in response to congestion • required no upgrades to routers or applications! • patch of a few lines of code to TCP implementations • A pragmatic and effective solution • but many other approaches exist • Extensively improved on since • topic now sees less activity in ISP contexts • but is making a comeback in datacenter environments

  16. Three Issues to Consider • Discovering the available (bottleneck) bandwidth • Adjusting to variations in bandwidth • Sharing bandwidth between flows

  17. A B Abstract View • Ignore internal structure of router and model it as having a single queue for a particular input-output pair Receiving Host Sending Host Buffer in Router

  18. A B Discovering available bandwidth • Pick sending rate to match bottleneck bandwidth • Without any a priori knowledge • Could be gigabit link, could be a modem 100 Mbps

  19. A B Adjusting to variations in bandwidth • Adjust rate to match instantaneous bandwidth • Assuming you have rough idea of bandwidth BW(t)

  20. A1 B1 BW(t) A2 B2 A3 B3 Multiple flows and sharing bandwidth Two Issues: • Adjust total sending rate to match bandwidth • Allocation of bandwidth between flows

  21. Reality Congestion control is a resource allocation problem involving many flows, many links, and complicated global dynamics

  22. View from a single flow packet loss • Knee – point after which • Throughput increases slowly • Delay increases fast • Cliff – point after which • Throughput starts to drop to zero (congestion collapse) • Delay approaches infinity knee cliff Throughput congestion collapse Load Delay Load

  23. General Approaches (0) Send without care • Many packet drops

  24. General Approaches (0) Send without care (1) Reservations • Pre-arrange bandwidth allocations • Requires negotiation before sending packets • Low utilization

  25. General Approaches (0) Send without care (1) Reservations (2) Pricing • Don’t drop packets for the high-bidders • Requires payment model

  26. General Approaches (0) Send without care (1) Reservations (2) Pricing (3) Dynamic Adjustment • Hosts probe network; infer level of congestion; adjust • Network reports congestion level to hosts; hosts adjust • Combinations of the above • Simple to implement but suboptimal, messy dynamics

  27. General Approaches (0) Send without care (1) Reservations (2) Pricing (3) Dynamic Adjustment All three techniques have their place • Generalityof dynamic adjustment has proven powerful • Doesn’t presume business model, traffic characteristics, application requirements; does assume good citizenship

  28. TCP’s Approach in a Nutshell • TCP connection has window • Controls number of packets in flight • Sending rate: ~Window/RTT • Vary window size to control sending rate

  29. All These Windows… • Congestion Window: CWND • How many bytes can be sent without overflowing routers • Computed by the sender using congestion control algorithm • Flow control window: AdvertisedWindow (RWND) • How many bytes can be sent without overflowing receiver’s buffers • Determined by the receiver and reported to the sender • Sender-side window = minimum{CWND, RWND} • Assume for this lecture that RWND >> CWND

  30. Note • This lecture will talk about CWND in units of MSS • (Recall MSS: Maximum Segment Size, the amount of payload data in a TCP packet) • This is only for pedagogical purposes • Keep in mind that real implementations maintain CWND in bytes

  31. Two Basic Questions • How does the sender detect congestion? • How does the sender adjust its sending rate? • To address three issues • Finding available bottleneck bandwidth • Adjusting to bandwidth variations • Sharing bandwidth

  32. Detecting Congestion • Packet delays • Tricky: noisy signal (delay often varies considerably) • Router tell endhosts they’re congested • Packet loss • Fail-safe signal that TCP already has to detect • Complication: non-congestive loss (checksum errors) • Two indicators of packet loss • No ACK after certain time interval: timeout • Multiple duplicate ACKs

  33. Not All Losses the Same • Duplicate ACKs: isolated loss • Still getting ACKs • Timeout: much more serious • Not enough dupacks • Must have suffered several losses • Will adjust rate differently for each case

  34. Rate Adjustment • Basic structure: • Upon receipt of ACK (of new data): increase rate • Upon detection of loss: decrease rate • How we increase/decrease the rate depends on the phase of congestion control we’re in: • Discovering available bottleneck bandwidth vs. • Adjusting to bandwidth variations

  35. Bandwidth Discovery with Slow Start • Goal: estimate available bandwidth • start slow (for safety) • but ramp up quickly (for efficiency) • Consider • RTT = 100ms, MSS=1000bytes • Window size to fill 1Mbps of BW = 12.5 packets • Window size to fill1Gbps = 12,500 packets • Either is possible!

  36. “Slow Start” Phase • Sender starts at a slow rate but increases exponentiallyuntil first loss • Start with a small congestion window • Initially, CWND = 1 • So, initial sending rate is MSS/RTT • Double the CWND for each RTT with no loss

  37. 3 4 8 D A A D D D A A A A A Slow Start in Action • For each RTT: double CWND • Simpler implementation: for each ACK, CWND += 1 1 2 Src D D D Dest

  38. Adjusting to Varying Bandwidth • Slow start gave an estimate of available bandwidth • Now, want to track variations in this available bandwidth, oscillating around its current value • Repeated probing (rate increase) and backoff (rate decrease) • TCP uses: “Additive Increase Multiplicative Decrease” (AIMD) • We’ll see why shortly…

  39. AIMD • Additive increase • Window grows by one MSS for every RTT with no loss • For each successful RTT, CWND = CWND + 1 • Simple implementation: • for each ACK, CWND = CWND+ 1/CWND • Multiplicative decrease • On loss of packet, divide congestion window in half • On loss, CWND = CWND/2

  40. Leads to the TCP “Sawtooth” Window Loss t Exponential“slow start”

  41. Slow-Start vs. AIMD • When does a sender stop Slow-Start and start Additive Increase? • Introduce a “slow start threshold” (ssthresh) • Initialized to a large value • On timeout, ssthresh = CWND/2 • When CWND = ssthresh, sender switches from slow-start to AIMD-style increase

  42. Why AIMD?

  43. Recall: Three Issues • Discovering the available (bottleneck) bandwidth • Slow Start • Adjusting to variations in bandwidth • AIMD • Sharing bandwidth between flows

  44. Goals for bandwidth sharing • Efficiency: High utilization of link bandwidth • Fairness: Each flow gets equal share

  45. Why AIMD? • Some rate adjustment options: Every RTT, we can • Multiplicative increase or decrease: CWND a*CWND • Additive increase or decrease: CWND CWND + b • Four alternatives: • AIAD: gentle increase, gentle decrease • AIMD: gentle increase, drastic decrease • MIAD: drastic increase, gentle decrease • MIMD: drastic increase and decrease

  46. Simple Model of Congestion Control 1 Fairness line Efficiency line • Two users • rates x1 and x2 • Congestion when x1+x2 > 1 • Unused capacity when x1+x2 <1 • Fair when x1 =x2 User 2’s rate (x2) congested   inefficient 1 User 1’s rate (x1)

  47. Efficient: x1+x2=1 Fair Congested: x1+x2=1.2 (0.7, 0.5) (0.2, 0.5) (0.5, 0.5) Inefficient: x1+x2=0.7 (0.7, 0.3) Efficient: x1+x2=1 Not fair Example 1 fairness line User 2: x2 congested   inefficient efficiency line 1 User 1: x1

  48. (x1-aD+aI),x2-aD+aI)) (x1-aD,x2-aD) AIAD fairness line • Increase: x + aI • Decrease: x - aD • Does not converge to fairness (x1,x2) User 2: x2 congested   inefficient efficiency line User 1: x1

  49. (bIbDx1,bIbDx2) (bdx1,bdx2) MIMD fairness line • Increase: x*bI • Decrease: x*bD • Does not converge to fairness (x1,x2) User 2: x2 congested   inefficient efficiency line User 1: x1

  50. (bDx1+aI,bDx2+aI) (bDx1,bDx2) AIMD fairness line (x1,x2) • Increase: x+aI • Decrease: x*bD • Converges to fairness User 2: x2 congested   inefficient efficiency line User 1: x1

More Related