Presentation is loading. Please wait.

Presentation is loading. Please wait.

T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Weighted Fair Queuing Some slides used with.

Similar presentations


Presentation on theme: "T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Weighted Fair Queuing Some slides used with."— Presentation transcript:

1 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Weighted Fair Queuing Some slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang

2 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University2 Critical Features of TCP Increase rate until packet loss –What’s the problem? Use loss as indication of congestion –What’s the problem? Slow start to probe for initial rate –What’s the problem? AIMD mechanism oscillates around proper rate –What’s the problem? Relies on AIMD behavior of end hosts –What’s the problem?

3 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University3 Some Answers Increase rate until packet loss –Drives network into congestion –High queuing delay, inefficient Use loss as indication of congestion –Cannot distinguish congestion from packet corruption Slow start to probe for initial rate –Bad for short lived flows (e.g. most Web transfers, a lot of Internet traffic is web transfer) AIMD mechanism oscillates around proper rate –Rate is not smooth Bad for streaming applications (e.g. video) –Inefficient utilization Relies on AIMD behavior of end hosts for fairness –People can cheat (not use AIMD) –People can open many parallel connections

4 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University4 Can Routers Provide Bandwidth Guarantee to a Traffic Flow? If so, then sender can request for a bandwidth guarantee and knows exactly what rate to send at –No packet loss, no congestion –No need for probing bandwidth (slow start) –No AIMD oscillation –No cheating The answer is yes, but it’ll add complexity to routers

5 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University5 Weighted Fair Queuing Architecture 1 2 WFQ Scheduler flow 1 flow 2 flow n Classifier FIFO queue of packets in router memory buffer

6 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University6 Classifier Classifier takes a packet and matches it against flow definitions to decide which flow it belongs A “flow” is a sequence of packets that are related Examples: –All TCP packets from Eugene’s web browser on machine A to web server on machine B –All packets from Rice –All packets between Rice and CMU –All UDP packets from Rice ECE department A flow may be defined by bits in the packet –source/destination IP address (32 bits) or address prefix –source/destination port number (16 bits) –protocol type (8 bits) –type of service (4 bits) –even bits beyond TCP and IP headers could be used flow 1 flow 2 flow n Classifier Scheduler

7 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University7 Queue When packets arrive at an output port faster than the output link speed (perhaps only momentarily), c an hold excess packets in queue –Results in increased packet queuing delay, but postpones packet losses Still have to drop packets when buffer is full –For each queue, “drop tail” or “drop head” are common policies –i.e. drop last packet to arrive vs drop first packet in queue to make room

8 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University8 Scheduler Decides how the output link capacity is shared by flows A chance to be smart: Transmission of packets held in queues can be *scheduled* –Which stored packet goes out next? Which is more “important”? –Impacts quality of service flow 1 flow 2 flow n Classifier Scheduler

9 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University9 What is Weighted Fair Queuing? A mathematical model for bandwidth sharing Each flow i given a weight (importance) w i WFQ guarantees a minimum service rate to flow i –r i = R * w i / (w 1 + w 2 +... + w n ) –Implies isolation among flows (one cannot mess up another) w1w1 w2w2 wnwn R Packet queues

10 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University10 What is the Intuition? Fluid Flow w1w1 water pipes w2w2 w3w3 t1t1 t2t2 w2w2 w3w3 water buckets w1w1

11 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University11 Fluid Flow System: Example 1 12 3 12 4 34 5 56 Flow 2 (arrival traffic) time Flow 1 (arrival traffic) time 12 3 45 123456 Packet Size (bits) Packet inter-arrival time (ms) Arrival Rate (Kbps) Flow 1100010100 Flow 25001050 100 Kbps Flow 1 ( w 1 = 1) Flow 2 ( w 2 = 1) Service in fluid flow system time (ms) 01020304050607080

12 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University12 Fluid Flow System: Example 2 015210468 511111 Red flow has packets backlogged between time 0 and 10 –Backlogged flow  flow’s queue not empty Other flows have packets continuously backlogged All packets have the same size flows link weights

13 Service Rate and Packet Delay in Fluid Flow System WFQ guarantees a minimum service rate to flow i –r i = R * w i / (w 1 + w 2 +... + w n ) What worst case delays are experienced by individual packets in the FFS? T. S. Eugene Ngeugeneng at cs.rice.edu Rice University13 bits time (s) Service curve slope = r i Packet arrival curve Worst case packet delay

14 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University14 Implementation in Packet System Packet (Real) system: packet transmission cannot be preempted. Why? Solution: serve packets in the order in which they would have finished being transmitted in the fluid flow system

15 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University15 Packet System: Example 1 0210468 02 468 Select the packet that is waiting and finishes first in the fluid flow system Service in fluid flow system Packet system Assume for this example all packets are waiting from time 0

16 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University16 Packet System: Example 2 12132344556 Packet system time 12 3 12 4 34 5 56 Service in fluid flow system time (ms) Select the packet that is waiting and finishes first in the fluid flow system Flow 2 (arrival traffic) time Flow 1 (arrival traffic) time 12 3 45 123456

17 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University17 Implementation Challenge Need to compute the finish time of a packet in the fluid flow system… … but the finish time may change as new packets arrive! Need to update the finish times of all packets that are in service in the fluid flow system when a new packet arrives –But this is very expensive; a high speed router may need to handle hundred of thousands of flows!

18 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University18 Example Four flows, each with weight 1 Flow 1 time ε Flow 2 Flow 3 Flow 4 0123 Finish times computed at time 0 time Finish times re-computed at time ε 01234

19 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University19 Bit-by-Bit Round Robin Insight If flows can be served one bit at a time, the fluid flow system can be approximated by bit-by-bit weighted round robin –During each round from each flow that has data to send, send a number of bits equal to the flow’s weight Each packet therefore requires a fixed number of rounds to finish

20 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University20 Solution: Virtual Time Key Observation: while the finish times of packets may change when a new packet arrives, the order in which packets finish doesn’t! –Only the order is important for scheduling Solution: instead of the packet finish time, maintain the round # when a packet finishes (virtual finishing time) –Virtual finishing time doesn’t change when a packet arrives Need to compute system virtual time function V(t) –index of the round in the bit-by-bit round robin scheme at time t

21 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University21 Example Suppose each packet is 1000 bits, so takes 1000 rounds to finish So, packets of F1, F2, F3 finishes at virtual time 1000 When packet F4 arrives at virtual time 1 (after one round), the virtual finish time of packet F4 is 1001 But the virtual finish time of packet F1,2,3 remains 1000 Finishing order is preserved Flow 1 time ε Flow 2 Flow 3 Flow 4

22 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University22 Computing System Virtual Time (Round #): V(t) V(t) increases inversely proportionally to the sum of the weights of the backlogged flows Since round # increases slower when there are more flows to visit each round. 12 3 12 4 34 5 56 Flow 2 (w2 = 1) Flow 1 (w1 = 1) time C C/2V(t)

23 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University23 Weighted Fair Queuing Implementation Define – virtual finishing time of packet k of flow i – arrival time of packet k of flow i – length of packet k of flow i –w i weight of flow i The finishing time of packet k+1 of flow i is Smallest finishing time first scheduling policy / w i

24 Recall in the Fluid Flow System T. S. Eugene Ngeugeneng at cs.rice.edu Rice University24 bits time (s) Service curve slope = r i Packet arrival curve Worst case packet delay

25 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University25 Properties of WFQ Implementation Theorem: WFQ guarantees that any packet is finished within max_packet_length/link_rate of its finish time in the fluid flow system –Thus WFQ can guarantee bandwidth and delay Weights assigned appropriately and admission control is performed Packets paced by sender according to guaranteed bandwidth –Another way to use WFQ is to assign all flows the same weight and perform no admission control Every flow gets a “max-min” fair share, provides performance isolation among flows How do we prove this?

26 Proof (1) T. S. Eugene Ngeugeneng at cs.rice.edu Rice University26 Packet p k with length L k Subscript: index of pkt sent in pkt system time Packet System Behavior a k : arrival t k : finish time Fluid Flow System Behavior a k : arrival u k : finish Want to prove: L max : largest allowed pkt r: network link rate

27 Proof (2) T. S. Eugene Ngeugeneng at cs.rice.edu Rice University27 time Packet System Behavior tmtm tktk... titi time Fluid Flow System Behavior umum ukuk... uiui Let m be the largest packet index such that u m > u k but t m < t k More generally, we have u m > u k ≥ u i and t m < t i < t k

28 Proof (3) T. S. Eugene Ngeugeneng at cs.rice.edu Rice University28 time Packet System Behavior tmtm tktk... titi p m started transmission at Thus Q.E.D.

29 Another Insight T. S. Eugene Ngeugeneng at cs.rice.edu Rice University29 Recall m is the largest packet index such that u m > u k but t m < t k If no such p m exists, then simply t k ≤ u k That is, the packet system can be ahead of the fluid flow system by an unbounded amount 0210468 Service in fluid flow system Packet system

30 T. S. Eugene Ngeugeneng at cs.rice.edu Rice University30 Internet Today FIFO queues are used at most routers –No classifier, no scheduler, best-effort Sophisticated mechanisms tend to be more common near the “edge” of the network –E.g. At campus routers –Use classifier to pick out BitTorrent packets –Use scheduler to limit bandwidth consumed by BitTorrent traffic


Download ppt "T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Weighted Fair Queuing Some slides used with."

Similar presentations


Ads by Google