CS 268: Lecture 8 Router Support for Congeston Control Ion Stoca Computer Scence Dvson Department of Electrcal Engneerng and Computer Scences Unversty of Calforna, Berkeley Berkeley, CA 9472-1776 Router Support For Congeston Management Tradtonal Internet - Congeston control mechansms at end-systems, manly mplemented n TCP - Routers play lttle role Router mechansms affectng congeston management - Schedulng - Buffer management Tradtonal routers - FIFO - Tal drop 2 1
Drawbacks of FIFO wth Tal-drop Buffer lock out by msbehavng flows Synchronzng effect for multple TCP flows Burst or multple consecutve packet drops - Bad for TCP fast recovery 3 FIFO Router wth Two TCP Sessons 4 2
RED FIFO schedulng Buffer management: - Probablstcally dscard packets - Probablty s computed as a functon of average queue length (why average?) Dscard Probablty 1 mn_th max_th queue_len Average Queue Length 5 RED (cont d) mn_th mnmum threshold max_th maxmum threshold avg_len average queue length - avg_len = (1-w)*avg_len + w*sample_len Dscard Probablty 1 mn_th max_th queue_len Average Queue Length 6 3
RED (cont d) If (avg_len < mn_th) enqueue packet If (avg_len > max_th) drop packet If (avg_len >= mn_th and avg_len < max_th) enqueue packet wth probablty P Dscard Probablty (P) 1 mn_th max_th queue_len Average Queue Length 7 RED (cont d) P = max_p*(avg_len mn_th)/(max_th mn_th) Improvements to spread the drops P = P/(1 count*p), where count how many packets were consecutvely enqueued snce last drop Dscard Probablty max_p P 1 mn_th max_th queue_len Average Queue Length avg_len 8 4
RED Advantages Absorb burst better Avods synchronzaton Sgnal end systems earler 9 RED Router wth Two TCP Sessons 1 5
Problems wth RED Throughput(Mbps) 1 9 8 7 6 5 4 3 2 1 No protecton: f a flow msbehaves t wll hurt the other flows Example: 1 UDP (1 Mbps) and 31 TCP s sharng a 1 Mbps lnk UDP RED 1 4 7 1 13 16 19 22 25 28 31 Flow Number 11 Soluton? Round-robn among dfferent flows [Nagle 87] - One queue per flow 12 6
Round-Robn Dscusson Advantages: protecton among flows - Msbehavng flows wll not affect the performance of wellbehavng flows - FIFO does not have such a property Dsadvantages: - More complex than FIFO: per flow queue/state - Based toward large packets a flow receves servce proportonal to the number of packets (When s ths bad?) 13 Soluton? Bt-by-bt round robn Can you do ths n practce? No, packets cannot be preempted (why?) we can only approxmate t 14 7
Far Queueng (FQ) [DKS 89] Defne a flud flow system: a system n whch flows are served bt-by-bt Then serve packets n the ncreasng order of ther deadlnes Advantages - Each flow wll receve exactly ts far rate Note: - FQ acheves max-mn farness 15 Denote - C lnk capacty - N number of flows - r arrval rate Max-Mn Farness Max-mn far rate computaton: 1. compute C/N 2. f there are flows such that r <= C/N, update C and N C = C 3. f no, f = C/N; termnate 4. go to 1 s. t r C A flow can receve at most the far rate,.e., mn(f, r ) r 16 8
Example C = 1; r 1 = 8, r 2 = 6, r 3 = 2; N = 3 C/3 = 3.33 C = C r3 = 8; N = 2 C/2 = 4; f = 4 f = 4 mn(8, 4) = 4 mn(6, 4) = 4 mn(2, 4) = 2 17 Alternate Way to Compute Far Rate If lnk congested, compute f such that mn( r, f ) = C f = 4 mn(8, 4) = 4 mn(6, 4) = 4 mn(2, 4) = 2 18 9
Implementng Far Queueng Idea: serve packets n the order n whch they would have fnshed transmsson n the flud flow system 19 Example Flow 1 (arrval traffc) 1 2 3 4 5 6 tme Flow 2 (arrval traffc) 1 2 3 4 5 tme Servce n flud flow system 1 2 1 2 3 3 4 4 5 6 5 tme Packet system 1 2 1 3 2 3 4 4 5 5 6 tme 2 1
System Vrtual Tme: V(t) Measure servce, nstead of tme V(t) slope rate at whch every actve flow receves servce - C lnk capacty - N(t) number of actve flows n flud flow system at tme t V(t) V ( t) t = C N ( t) tme Servce n flud flow system 1 2 1 2 3 3 4 4 5 6 5 tme 21 Far Queueng Implementaton Defne k - F - fnshng tme of packet k of flow (n system vrtual tme reference system) k a L - - arrval tme of packet k of flow - k - length of packet k of flow The fnshng tme of packet k+1 of flow s F k + 1 = max( V ( a k ), F k ) + L k + 1 22 11
Weghted Far Queueng (WFQ) What f we don't want exact farness? - E.g.,: fle servers Assgn weght w to each flow And change vrtual fnshng tme F k + 1 = max( V ( a k ), F k ) + L w k + 1 23 Smulaton Example 1 UDP (1 Mbps) and 31 TCPs sharng a 1 Mbps lnk UDP (#1) TCP (#2) UDP (#1) TCP (#2) TCP (#32) 1 Mbps) TCP (#32) Throughput(Mbps) 1 9 8 7 6 5 4 3 2 1 Stateless soluton: Random Early Detecton (RED) 1 4 7 1 13 16 19 22 25 28 31 Flow Number Throughput(Mbps).5.45.4.35.3.25.2.15.1.5 Stateful soluton: Far Queueng 1 4 7 1 13 16 19 22 25 28 31 Flow Number 24 12
Core-Stateless Far Queueng (CSFQ) Far Queueng requres per flow state n routers - Maybe mpractcal for very hgh speed routers Core Stateless Far Queueng elmnates the state at core routers but only approxmates FQ s behavor 25 Insght If each packet of a flow wth arrval rate r s forwarded wth probablty P = mn 1, f r the rate of flow s forwarded traffc r s f r ' = r P = r mn 1, = mn( r, f ) r No need to mantan per-flow state f r s carred n the packet - Need to update rate n packet to r 26 13
CSFQ A contguous and trusted regon of network n whch - Edge nodes perform per flow operatons - Core nodes do not perform any per flow operatons 27 Algorthm Outlne Ingress nodes: estmate rate r for each flow and nsert t n the packets headers 28 14
Algorthm Outlne Ingress nodes: estmate rate r for each flow and nsert t n the packets headers 29 Algorthm Outlne Core node: - Compute far rate f on the output lnk - Enqueue packet wth probablty P = mn(1, f / r) - Update packet label to r = mn(r, f ) 3 15
Algorthm Outlne Egress node: remove state from packet s header 31 Example: CSFQ Assume estmated far rate f = 4 - flow 1, r = 8 => P = mn(1, 4/8) =.5 expected rate of forwarded traffc 8*P = 4 - flow 2, r = 6 => P = mn(1, 4/6) =.67 expected rate of forwarded traffc 6*P = 4 - flow 3, r = 2 => P = mn(1, 4/2) = 1 expected rate of forwarded traffc 2 8 6 2 1 8 8 8 8 8 6 6 6 6 2 2 Core Node (1 Mbps) FIFO 4 4 4 4 4 4 2 2 32 16
Far Rate Estmaton 8 6 2 Observaton: rate of aggregate forwarded rate (R) s a monotonc and non-decreasng functon of estmated ( f ) rate C=1 mn( 8, f ) mn( 6, f ) R ( f ) = mn(8, f ) + mn(6, f ) + mn(2, f ) mn( 2, f ) R( f ) 16 1 C 6 1 2 3 4 5 6 7 8 9 1 f 33 UDP (#1) TCP (#2) TCP (#32) Throughput(Mbps).5.45.4.35.3.25.2.15.1.5 1 Mbps) Stateful soluton: Far Queueng Smulaton Example UDP (#1) TCP (#2) TCP (#32) 1 4 7 1 13 16 19 22 25 28 31 Flow Number Throughput(Mbps) Throughput(Mbps) 1 9 8 7 6 5 4 3 2 1.5.45.4.35.3.25.2.15.1.5 Stateless soluton: Random Early Detecton 1 4 7 1 13 16 19 22 25 28 31 Flow Number Our Soluton: Core-Stateless Far Queueng 34 1 4 7 1 13 16 19 22 25 28 31 Flow Number 17
Summary FQ does not elmnate congeston t just manages the congeston You need both end-host congeston control and router support for congeston control - End-host congeston control to adapt - Router congeston control to protect/solate Don t forget buffer management: you stll need to drop n case of congeston. Whch packet s would you drop n FQ? - One possblty: packet from the longest queue 35 Announcements Project feedback - Tuesday, Feb 14, 12:3-2pm - Wednesday, Feb 15, 11:3-1pm 36 18