Download presentation
Presentation is loading. Please wait.
Published byShonda Harrell Modified over 6 years ago
1
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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
2
Critical Features of TCP
Increase rate until packet loss What’s the problem? Use loss as indication of congestion Slow start to probe for initial rate AIMD mechanism oscillates around proper rate Relies on AIMD behavior of end hosts T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
3
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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
4
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 ??? T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
5
Guaranteeing Performance Requires Flow Isolation
FIFO queue of packets in router memory buffer flow 1 Classifier flow 2 Scheduler 1 2 flow n T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
6
Classifier A “flow” is a sequence of packets that are related
Classifier takes a packet and matches it against flow definitions to decide which flow it belongs 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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
7
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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
8
What is Weighted Fair Queuing?
Packet queues w1 w2 R wn A mathematical model for flow scheduling Each flow i given a weight (importance) wi WFQ guarantees a minimum service rate to flow i ri = R * wi / (w1 + w wn) Implies isolation among flows (one cannot mess up another) T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
9
What is the Intuition? Fluid Flow
water pipes w2 w3 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
10
Fluid Flow System: Example 1
Packet Size (bits) Packet inter-arrival time (ms) Arrival Rate (Kbps) Flow 1 1000 10 100 Flow 2 500 50 Flow 1 (w1 = 1) 100 Kbps Flow 2 (w2 = 1) 1 2 3 4 5 Flow 1 (arrival traffic) time Flow 2 (arrival traffic) time 1 2 3 4 5 6 Service in fluid flow system time (ms) 10 20 30 40 50 60 70 80 1 2 3 1 2 4 3 5 6 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
11
Fluid Flow System: Example 2
link 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 weights 5 1 1 1 1 1 2 4 6 8 10 15 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
12
Service Rate and Packet Delay in Fluid Flow System
WFQ guarantees a minimum service rate to flow i ri = R * wi / (w1 + w wn) What worst case delays are experienced by individual packets in the FFS? Service curve slope = ri bits Worst case packet delay Packet arrival curve time (s) T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
13
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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
14
Packet System: Example 1
Assume for this example all packets are waiting from time 0 Service in fluid flow system 2 4 6 8 10 Select the packet that is waiting and finishes first in the fluid flow system Packet system 2 4 6 8 10 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
15
Packet System: Example 2
1 2 3 4 5 Flow 1 (arrival traffic) time Flow 2 (arrival traffic) time 1 2 3 4 5 6 Service in fluid flow system 1 2 3 1 2 4 3 1 4 3 5 4 3 5 5 6 5 time (ms) Select the packet that is waiting and finishes first in the fluid flow system Packet system 1 2 1 3 2 3 4 4 5 5 6 time T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
16
Implementation Challenge
Four flows, each with weight 1 Flow 1 time Flow 2 time Flow 3 time Flow 4 time ε 1 2 3 Finish times computed at time 0 time time Finish times re-computed at time ε Note that finishing order of packets from flows 1, 2, and 3 unaffected 1 2 3 4 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
17
Implementation Challenge
Need to compute the finish time of a packet in the fluid flow system… … but the finish time may change as new flows arrive! Need to update the finish times of all packets that are in service in the fluid flow system when a new flow arrives But this is very expensive; a high speed router may need to handle hundred of thousands of flows! The new finish times don’t affect ordering of packets that are in service in the fluid flow system (a lot of work for nothing) Can we capture ordering without using real world finish times?? T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
18
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 (depends only on weight and packet size); the finishing round number does not change even when new flows arrive Packet queues 30 bits 3 100 bits/sec How many seconds spent in each round? Note the answer depends on the total weights 5 20 bits 34 bits 17 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
19
Solution: Virtual Time
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 new flow arrives Packet ordering based on virtual finishing time is the same as that based on real finishing time. Need to compute system virtual time function V(t) index of the round in the bit-by-bit round robin scheme at time t T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
20
Example All flow weight = 1
time Flow 2 time Flow 3 time Flow 4 time ε All flow weight = 1 Suppose each packet is 1000 bits, so takes 1000 rounds to finish. So, first packets of F1, F2, F3 finish 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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
21
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. Flow 1 (w1 = 1) time Flow 2 (w2 = 1) time 3 4 5 1 2 1 2 3 4 5 6 V(t) C/2 C T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
22
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 wi weight of flow i The virtual finishing time of packet k+1 of flow i is Smallest virtual finishing time first scheduling policy / wi T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
23
Recall in the Fluid Flow System
Service curve slope = ri bits Worst case packet delay Packet arrival curve time (s) T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
24
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 See proof at the end of the slide deck T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
25
Internet Today FIFO queues are used for most network traffic
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 T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
26
Remainder of this set of slides are for your reference only
Remainder of this set of slides are for your reference only. They will not be needed for assignments. T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
27
Proof (1) Packet pk with length Lk Subscript: index of pkt sent
in pkt system Fluid Flow System Behavior uk: finish ak: arrival time Packet System Behavior tk: finish ak: arrival time Want to prove: Lmax: largest allowed pkt r: network link rate T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
28
Proof (2) Let m be the largest packet index such that um > uk but tm < tk More generally, we have um > uk ≥ ui and tm < ti < tk Fluid Flow System Behavior ... ui uk um time Packet System Behavior ... ti tm tk time T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
29
Proof (3) tm tk ti pm started transmission at Thus Q.E.D.
Packet System Behavior ... ti tm tk time pm started transmission at Thus Q.E.D. T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
30
Another Insight Recall m is the largest packet index such that um > uk but tm < tk If no such pm exists, then simply tk ≤ uk That is, the packet system can be ahead of the fluid flow system by an unbounded amount 2 10 4 6 8 Service in fluid flow system Packet T. S. Eugene Ng eugeneng at cs.rice.edu Rice University
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.