nnouncemens TCP Congesion Conrol Projec #3 should be ou onigh Can do individual or in a eam of 2 people Firs phase due November 16 - no slip days Exercise good (beer) ime managemen EE 122: Inro o Communicaion Neworks Fall 2006 (MW 4-5:30 in Donner 155) Vern Paxson Ts: Dilip nony Joseph and Sukun Kim hp://ins.eecs.berkeley.edu/~ee122/ Maerials wih hanks o Jennifer Rexford, Ion Soica, and colleagues a Princeon and UC Berkeley 1 2 Goals of Today s Lecure Sae diagrams Tool for undersanding complex proocols Principles of congesion conrol Learning ha congesion is occurring daping o alleviae he congesion TCP congesion conrol ddiive-increase, muliplicaive-decrease NCK- ( fas reransmission ) and imeou-based deecion Slow sar and slow-sar resar 3 Sae Diagrams For complicaed proocols, operaion depends criically on curren mode of operaion Imporan ool for capure his: sae diagram any given ime, proocol endpoin is in a paricular sae Dicaes is curren behavior Endpoin ransiions o oher saes on evens Ineracion wih lower layer Recepion of cerain ypes of packes Ineracion wih upper layer New daa arrives o send, or received daa is consumed Timers 4 TCP Sae Diagram 5 6 1
How Fas Should TCP Send? Flow Conrol 7 8 Sliding llow a larger amoun of daa in fligh llow sender o ge ahead of he receiver hough no oo far ahead TCP Sending process Las bye wrien TCP Receiving process Las bye read TCP Header for Receiver Buffering dverised window informs sender of receiver s buffer space HdrLen Source por 0 Checksum Sequence number cknowledgmen Flags Desinaion por dverised window Opions (variable) Urgen poiner Daa Nex bye expeced Las bye CKed Sender Receiver Las bye received Las bye sen 9 10 dverised Limis Rae If he window is W, hen sender can send no faser han W/RTT byes/sec Receiver implicily limis sender o rae ha receiver can susain If sender is going o fas, window adverisemens ge smaller & smaller Termed Flow Conrol In original TCP design, ha was i - sole proocol mechanism conrolling sender s rae How Fas Should TCP Send? Congesion Conrol Wha s missing? 12 11 2
I s No Jus The Sender & Receiver Congesion is Unavoidable Flow conrol keeps one fas sender from overwhelming a slow receiver Congesion conrol keeps a se of senders from overloading he nework Three congesion conrol problems: djusing o boleneck bandwidh Wihou any a priori knowledge Could be a Gbps link; could be a modem djusing o variaions in bandwidh Sharing bandwidh beween flows 13 Two packes arrive a he same ime The node can only ransmi one and eiher buffers or drops he oher If many packes arrive in a shor period of ime The node canno keep up wih he arriving raffic and he buffer may evenually overflow 14, Delay, and Power Typical behavior of queuing sysems wih bursy arrivals: verage Packe delay simple meric of how well he nework is performing: Power Power = Delay opimal load Congesion Collapse Definiion: Increase in nework load resuls in a decrease of useful work done Due o: Undelivered packes Packes consume resources and are dropped laer in nework Spurious reransmissions of packes sill in fligh Unnecessary reransmissions lead o more load! Pouring gasoline on a fire Mid-1980s: Inerne grinds o a hal Unil Jacobson/Karels devise TCP congesion conrol Goal: maximize power 15 16 View from a Single Flow General pproaches Knee poin afer which Throughpu increases very slowly Delay increases quickly Cliff poin afer which Throughpu sars o decrease very fas o zero (congesion collapse) Delay approaches infiniy Throughpu Delay knee cliff packe loss congesion collapse 17 Send wihou care Many packe drops Disaser: leads o congesion collapse (1) Reservaions Pre-arrange bandwidh allocaions Requires negoiaion before sending packes Poenially low uilizaion (difficul o sa-mux) (2) Pricing Don drop packes for he highes bidders Requires paymen model 18 3
General pproaches (con d) (3) Dynamic djusmen Probe nework o es level of congesion Speed up when no congesion Slow down when congesion Drawbacks: Subopimal Messy dynamics Seems complicaed o implemen Bu clever algorihms acually prey simple (Jacobson/Karels 88) ll hree echniques have heir place Bu for generic Inerne usage, dynamic adjusmen is he mos appropriae due o pricing srucure, raffic characerisics, and good ciizenship 19 Idea of TCP Congesion Conrol Each source deermines he available capaciy so i knows how many packes o have in fligh Congesion window (CWND) Maximum # of unacknowledged byes o have in fligh Congesion-conrol equivalen of receiver window Max = min{congesion window, receiver window} Send a he rae of he slowes componen daping he congesion window Decrease upon deecing congesion Increase upon lack of congesion: opimisic exploraion 20 Deecing Congesion How can a TCP sender deermine ha nework is under sress? Nework could ell i (ICMP Source Quench) Risky, because during imes of overload he signal iself could be dropped! Packe delays go up (knee of load-delay curve) Tricky, because a noisy signal (delay ofen varies considerably) Packe loss Fail-safe signal ha TCP already has o deec Complicaion: non-congesive loss (checksum errors) 21 5 Minue Break Quesions Before We Proceed? 22 ddiive Increase, Muliplicaive Decrease Leads o he TCP Sawooh How much o increase and decrease? Increase linearly, decrease muliplicaively (IMD) Necessary condiion for sabiliy of TCP Consequences of over-sized window much worse han having an under-sized window Over-sized window: packes dropped and reransmied Under-sized window: somewha lower hroughpu Loss ddiive increase On success for las window of daa, increase linearly One packe (MSS) per RTT Muliplicaive decrease On loss of packe, divide congesion window in half 23 halved 24 4
Managing he Congesion Increasing CWND Increase by MSS on success (= no loss) for las window of daa One approach: rack firs packe in fligh, new window sars when i s ack d, a which poin: CWND += MSS noher: increase a fracion of MSS per received CK # packes (and hus CKs) per window: CWND / MSS Incremen per CK: CWND += MSS * (MSS / CWND) Is acually slighly super-linear Decreasing he congesion window Cu in half on loss deeced by NCK ( fas reransmi ) Cu all he way o 1 MSS on loss deeced by imeou Never drop CWND below 1 MSS 25 Geing Sared Need o sar wih a small CWND o avoid overloading he nework. Bu, could ake a long ime o ge sared! 26 Slow Sar Phase Sar wih a small congesion window Iniially, CWND is 1 MSS (*) So, iniial sending rae is MSS/RTT Tha could be prey waseful Migh be much less han he acual bandwidh Linear increase akes a long ime o accelerae Slow-sar phase (acually fas sar ) Sender sars a a slow rae (hence he name) bu increases he rae exponenially Slow Sar in cion Src Des Double CWND per round-rip ime Simple implemenaion: on each ack, CWND += MSS 1 2 4 8 D D D D D D D unil he firs loss even 27 28 Slow Sar and he TCP Sawooh Loss Exponenial slow sar Why is i called slow-sar? Because TCP originally had no congesion conrol mechanism. The source would jus sar by sending a whole window s worh of daa. 29 Loss Deecion in TCP, Scheme #1 Quick NCK-based deecion Triple duplicae CK ( hree dups ) Packe n is los, bu packes n+1, n+2,, arrive On each arrival of a packe no in sequence, receiver generaes an CK s always, CK is for seq.no. jus beyond highes in-sequence So as n+1, n+2, arrive, receiver generaes repeaed CKs for seq.no. n duplicae acknowledgmens since hey all look he same Sender sees hree of hese and immediaely reransmis packe n (and only n) Muliplicaive decrease and keep going Termed Fas Reransmission 30 5
Fas Reransmission Loss Deecion in TCP, Scheme #2 Resend a segmen afer 3 duplicae CKs Duplicae CK means ha an ou-of sequence segmen was received cwnd = 1 cwnd = 2 cwnd = 3 cwnd = 4 Noes: 3 duplicae CKs are for nex CKs expeced packe cwnd = 2 Packe reordering can cause duplicae CKs may be oo small o generae enough duplicae CKs CK 2 CK 3 CK 4 CK 4 CK 4 CK 4 segmen 1 segmen 2 segmen 3 segmen 4 segmen 5 segmen 6 segmen 7 segmen 4 31 Timeou Sender sars a imer ha runs for RTO seconds Every ime ack for new daa arrives, resar imer If imer expires: Se SSTHRESH CWND ( Slow-Sar Threshold ) Se CWND MSS (avoid a burs) Reransmi firs los packe Execue Slow Sar unil CWND > SSTHRESH fer which swich o ddiive Increase Termed: Congesion voidance 32 Repeaing Slow Sar fer Timeou Summary Fas Reransmission Slow sar in operaion unil i reaches half of previous CWND, I.e., SSTHRESH Timeou SSThresh Se o Here Slow-sar resar: Go back o CWND of 1, bu ake advanage of knowing he previous value of CWND. 33 Congesion is ineviable Inerne does no reserve resources in advance TCP acively ries o grab capaciy Congesion conrol criical for avoiding collapse IMD: ddiive increase, muliplicaive decrease Congesion deeced via packe loss (fail-safe) NCK-based fas reransmission on hree dups Timeou Slow sar o find iniial sending rae & o resar afer imeou Nex class TCP performance 34 6