Congestion Control Reading: Sections 6.1-6.4Course AnnouncementsGoals of Today’s LectureNo Problem Under Circuit SwitchingIP Best-Effort Design PhilosophyCongestion is UnavoidableThe Problem of CongestionWays to Deal With CongestionMany Important QuestionsInferring From Implicit FeedbackWhere Congestion Happens: LinksHow it Looks to the End HostWhat Can the End Host Do?TCP Congestion WindowAdditive Increase, Multiplicative Decrease (AIMD)Leads to the TCP “Sawtooth”Practical DetailsReceiver Window vs. Congestion WindowHow Should a New Flow Start“Slow Start” PhaseSlow Start in ActionSlow Start and the TCP SawtoothTwo Kinds of Loss in TCPRepeating Slow Start After TimeoutRepeating Slow Start After Idle PeriodTCP Achieves Some Notion of FairnessWhat About Cheating?Queuing MechanismsBursty Loss From Drop-Tail QueuingSlow Feedback from Drop TailRandom Early Detection (RED)Properties of REDProblems With REDExplicit Congestion NotificationOther TCP MechanismsMotivation for Nagle’s AlgorithmNagle’s AlgorithmSlide 38Motivation for Delayed ACKTCP Header Allows PiggybackingExample of PiggybackingIncreasing Likelihood of PiggybackingDelayed ACKConclusionsCongestion ControlReading: Sections 6.1-6.4COS 461: Computer NetworksSpring 2009 (MW 1:30-2:50 in CS 105)Mike FreedmanTeaching Assistants: Wyatt Lloyd and Jeff Terracehttp://www.cs.princeton.edu/courses/archive/spring09/cos461/1Course Announcements•Second programming assignment is posted–Web proxy server–Due Sunday March 8 at 11:59pm–More challenging than the first assignment•Good to get started on the next assignment–To go to office hours early if you encounter problems2Goals of Today’s Lecture•Congestion in IP networks–Unavoidable due to best-effort service model–IP philosophy: decentralized control at end hosts•Congestion control by the TCP senders–Infers congestion is occurring (e.g., from packet losses)–Slows down to alleviate congestion, for the greater good•TCP congestion-control algorithm–Additive-increase, multiplicative-decrease–Slow start and slow-start restart•Active Queue Management (AQM)–Random Early Detection (RED)–Explicit Congestion Notification (ECN)3No Problem Under Circuit Switching•Source establishes connection to destination–Nodes reserve resources for the connection–Circuit rejected if the resources aren’t available–Cannot have more than the network can handle4IP Best-Effort Design Philosophy•Best-effort delivery–Let everybody send–Network tries to deliver what it can–… and just drop the rest5sourcedestinationIP networkCongestion is Unavoidable•Two packets arrive at the same time–The node can only transmit one–… and either buffer or drop the other•If many packets arrive in short period of time–The node cannot keep up with the arriving traffic–… and the buffer may eventually overflow6The Problem of Congestion•What is congestion?–Load is higher than capacity•What do IP routers do?–Drop the excess packets•Why is this bad?–Wasted bandwidth for retransmissions7LoadGoodput“congestion collapse”Increase in load that results in a decrease in useful work done.Ways to Deal With Congestion•Ignore the problem–Many dropped (and retransmitted) packets–Can cause congestion collapse•Reservations, like in circuit switching–Pre-arrange bandwidth allocations–Requires negotiation before sending packets•Pricing–Don’t drop packets for the high-bidders–Requires a payment model•Dynamic adjustment (TCP)–Every sender infers the level of congestion–Each adapts its sending rate “for the greater good”8Many Important Questions•How does the sender know there is congestion?–Explicit feedback from the network?–Inference based on network performance?•How should the sender adapt?–Explicit sending rate computed by the network?–End host coordinates with other hosts?–End host thinks globally but acts locally?•What is the performance objective?–Maximizing goodput, even if some users suffer more?–Fairness? (Whatever the heck that means!)•How fast should new TCP senders send?9Inferring From Implicit Feedback•What does the end host see?•What can the end host change?10?Where Congestion Happens: Links•Simple resource allocation: FIFO queue & drop-tail•Access to the bandwidth: first-in first-out queue–Packets transmitted in the order they arrive•Access to the buffer space: drop-tail queuing–If the queue is full, drop the incoming packet11How it Looks to the End Host•Packet delay–Packet experiences high delay•Packet loss–Packet gets dropped along the way•How does TCP sender learn this?–Delay•Round-trip time estimate–Loss•Timeout •Duplicate acknowledgments12What Can the End Host Do?•Upon detecting congestion (well, packet loss)–Decrease the sending rate–End host does its part to alleviate the congestion•But, what if conditions change?–Suppose there is more bandwidth available–Would be a shame to stay at a low sending rate•Upon not detecting congestion–Increase the sending rate, a little at a time–And see if the packets are successfully delivered13TCP Congestion Window•Each TCP sender maintains a congestion window–Maximum number of bytes to have in transit–I.e., number of bytes still awaiting acknowledgments•Adapting the congestion window–Decrease upon losing a packet: backing off–Increase upon success: optimistically exploring–Always struggling to find the right transfer rate•Both good and bad–Pro: avoids having explicit feedback from network–Con: under-shooting and over-shooting the rate14Additive Increase, Multiplicative Decrease (AIMD)•How much to increase and decrease?–Increase linearly, decrease multiplicatively–A necessary condition for stability of TCP–Consequences of over-sized window are much worse than having an under-sized window•Over-sized window: packets dropped and retransmitted•Under-sized window: somewhat lower throughput•Multiplicative decrease–On loss of packet, divide congestion window in half•Additive increase–On success for last window of data, increase linearly15Leads to the TCP “Sawtooth”16tWindowhalvedLossPractical Details•Congestion window–Represented in bytes, not in packets (Why?)–Packets have MSS (Maximum Segment Size) bytes•Increasing the congestion window–Increase by MSS on success for last window of data•Decreasing the congestion window–Never drop congestion window
View Full Document