Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fair Queueing.

Similar presentations


Presentation on theme: "Fair Queueing."— Presentation transcript:

1 Fair Queueing

2 First-Come-First Served (FIFO)
Packets are transmitted in the order of their arrival Advantage: Very simple to implement Disadvantage: Cannot give different service to different types of connections Each flow (even with low data rate) can experience long delays

3 Static Priority Also called Head-of-Line (HOL) queueing:
Each traffic flow belong to a class Each class has a priority One FIFO queue for each class Transmit from the highest priority queue with a backlog Advantage: Simple Disadvantage: Tends to “starve” the lower priority classes

4 Fair Queueing Attempts to implement a scheduler that simultaneously serves all flows with a backlog at the same rate Not easy to implement Fair Queuing in a packet network FIFO Fair Queueing

5 Discussion of Fair Rate Allocation
See class notes

6 Fair Scheduling Algorithms
Fair Queueing (FQ), a.k.a as Processor Sharing (PS)  Objective: Achieve fair rate allocation Weighted Fair Queueing (WFQ), a.k.a. Generalized Processor Sharing (GPS)  Objective: Achieve weighted fair rate allocation Problem: How to realize a fair rate allocation when Traffic is transmitted in packet of variable size Transmission of a packet cannot be interrupted

7 Fair Queuing in packet networks
Approach: Take a fluid-flow view of traffic View output link as a “pipe” with a given width Transmitted traffic flows like a fluid through the pipe  Scheduler can transmit traffic from multiple flows at the same time Scheduler controls the “output rate” for each flow  Output rates are set to satisfy “fairness” Result is a fluid flow schedule Approximate fluid-flow schedule by a packet-level scheduling algorithm

8 Fair Queuing (FQ): From fluid to packets
Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps) Flow 1 1000 10 100 Flow 2 500 50 Flow 1 (f1 = 1) 100 Kbps Flow 2 (f2 = 1) Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time Service in fluid flow system 10 20 30 40 50 60 70 80 time (ms) Slide from Ion Stoica

9 Fair Queueing (FQ): From fluid to packets (complete)
Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps) Flow 1 1000 10 100 Flow 2 500 50 Flow 1 (f1 = 1) 100 Kbps Flow 2 (f2 = 1) Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time 1 2 3 4 5 6 Service in fluid flow system time (ms) 10 20 30 40 50 60 70 80

10 Fair Scheduling (fluid flow)
5000 5000 Flow 1 Flow 2 4000 4000 3000 3000 2000 2000 1000 1000 10 20 30 40 50 60 70 80 10 20 30 40 50 60 70 80

11 Fair Scheduling (fluid flow)
5000 5000 Flow 1 Flow 2 4000 4000 3000 3000 2000 2000 1000 1000 10 20 30 40 50 60 70 80 10 20 30 40 50 60 70 80

12 Fair Scheduling (FQ) (fluid flow view)
There are N flows At any time t, all backlogged flows are served at the same rate of: where B(t) is the set of backlogged flows at time t C is the capacity of the link The total rate guarantee to a flow j is:

13 Weighted Fair Scheduling (WFQ) (fluid flow view)
There are N flows with weights f1 , f2 , …,fN The service given to two backlogged flows is proportional to their weights At any time t , the rate allocated to a backlogged flow i is: where B(t) is the set of backlogged flows at time t C is the capacity of the link The total rate guarantee to a flow is:

14 FQ/WFQ Scheduling for Packets (packet-level view)
Packet-level implementation of FQ and WFQ tries to emulate the fluid-flow version Scheduling decision: Always select the packet that will finish next in the ideal fluid-flow FQ/WFQ system

15 WFQ scheduling (with place holder)
Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps) Flow 1 1000 10 100 Flow 2 500 50 Flow 1 (f1 = 1) 100 Kbps Flow 2 (f2 = 1) Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time 1 2 3 4 5 6 Service in fluid flow system time (ms) 10 20 30 40 50 60 70 80 Service in packet system 10 20 30 40 50 60 70 80 time (ms)

16 WFQ scheduling (complete)
Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps) Flow 1 1000 10 100 Flow 2 500 50 Flow 1 (f1 = 1) 100 Kbps Flow 2 (f2 = 1) Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time 1 2 3 4 5 6 Service in fluid flow system time (ms) 10 20 30 40 50 60 70 80 Service in packet system 1 2 1 3 2 3 4 4 5 5 6 10 20 30 40 50 60 70 80 time (ms) Slide from Ion Stoica

17 Packet-level Implementation of WFQ
Problems to deal with: The finishing time of a packet in the fluid-flow system may depend on arrivals after a packet has been selected packet-level version of WFQ cannot be 100% accurate Once started, packet transmission cannot be preemtped Implementation: When a packet arrives, it is assigned a “virtual finishing time” This is the finishing time in the fluid flow system if the set of backlogged flows does not change after packet arrival Orders packets in increasing order of virtual finishing times Compute virtual finishing time with the help of a system virtual time

18 Rate of system virtual time
B(t) : the set of backlogged flows at time t The rate allocated to a backlogged flow i at time t is or : service that a backlogged flow with weight 1 receives in GPS Rate of Rate of system virtual time

19 WFQ: System Virtual Time
WFQ uses a System Virtual Time which tracks the progress of GPS system Suppose the times when the set B(t) changes are Let Bl be the set of backlogged flows in time interval Then we have When fewer flows are active, virtual time moves faster

20 WFQ: Implementation Virtual finish time of k-th packet from flow j
ajk is the arrival time and Lkj is thesize of the k-th packet from flow j Packets are sorted and transmitted in the order of virtual finishing times Virtual times needs to be computed only at arrival time of packets must keep track of the busy set Bl

21 WFQ Example (packet level)
Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time 5000 Virtual time V(t) 4000 Time t 10 20 30 40 50 60 70 80 V(t) (x 100) Fn1 (x 100) Fn2 (x 100) 3000 2000 actual transmission order 1 2 1 3 2 3 4 4 5 5 6 1000 10 20 30 40 50 60 70 80 time t time (ms) 10 20 30 40 50 60 70 80

22 WFQ Example (packet level)
Flow 1 (arrival traffic) 1 2 3 4 5 time Flow 2 (arrival traffic) 1 2 3 4 5 6 time 5000 Virtual time V(t) 4000 Time t 10 20 30 40 50 60 70 80 V(t) (x 100) 25 35 45 Fn1 (x 100) Fn2 (x 100) 3000 2000 actual transmission order 1 2 1 3 2 3 4 4 5 5 6 1000 10 20 30 40 50 60 70 80 time t time (ms) 10 20 30 40 50 60 70 80

23 Approximations of Fair Queueing
Since the packet implementation of WFQ is complex, packet switches often use approximations: Weighted Round Robin (WRR) Virtual Clock (VC) Many others

24 Weighted Round Robin (WRR)
Simple emulation of GPS Operates in “rounds” Li is the average packet size of flow i Calculate the number of packets to be served in each round: For each flow i: xi = wi / Li x = mini { xi } For each flow i: packets_per_roundi = xi / x WRR is a good approximation of GPS if All flows are active Over long periods of time

25 Virtual Clock (VC) Emulates a system with transmissions in periodic intervals Two state variables for each flow j: auxVCj virtual transmission time of the flow rj reserved rate The variable auxVCj keeps track of hypothetical departure times. If all traffic from flow j is limited to the reserved rate, then auxVCj is the departure time of an arrival. Upon arrival of a packet from flow j with size Ljk at time ajk: auxVCj = max (auxVCj , ajk ) + Ljk / rj Stamp auxVCj in packet header Packet are transmitted in increasing order of virtual transmission times

26 Virtual clock order (with auxVCi)
Example: Virtual Clock (with place holder) C = 1 Mbps, r1=r2=r3=1/3 Mbps, L=1000 bits wall clock (ms)= 1 3 4 6 7 8 9 2 5 10 11 1 2 3 4 5 6 7 8 9 10 11 r1=1/3 auxVC1 1 2 3 4 5 6 7 8 9 10 11 12 time r2=1/3 auxVC2 1 2 3 4 5 6 7 8 9 10 11 12 time r3=1/3 auxVC3 1 2 3 4 time Virtual clock order (with auxVCi) time

27 Example: Virtual Clock C = 1 Mbps, r1=r2=r3=1/3 Mbps, L=1000 bits
wall clock (ms)= 1 3 4 6 7 8 9 2 5 10 11 r1=1/3 auxVC1= 1 2 3 4 5 6 7 8 9 10 11 12 time 3 6 9 12 15 18 r2=1/3 auxVC2 = 1 2 3 4 5 6 7 8 9 10 11 12 time 3 6 9 12 15 18 r3=1/3 auxVC3 = 1 2 3 4 time 3 6 9 12 Virtual clock order (with auxVCi) 1 1 1 2 2 2 3 3 3 4 4 4 time 3 3 3 6 6 6 9 9 9 12 12 12

28 Virtual clock order (with auxVCi)
Example: Virtual Clock (with place holder) C = 1 Mbps, r1=r2=r3=1/3 Mbps, L=1000 bits “auxVCj = max (auxVCj , ajk ) + Ljk / rj” prevents credit accumulation of idle flows wall clock (ms)= 1 3 4 6 7 8 9 2 5 10 11 r1=1/3 auxVC1 1 2 3 4 time r2=1/3 auxVC2 1 2 3 4 time r3=1/3 auxVC3 1 2 3 4 time Virtual clock order (with auxVCi) time

29 Virtual clock order (with auxVCi)
Example: Virtual Clock (complete) C = 1 Mbps, r1=r2=r3=1/3 Mbps, L=1000 bits “auxVCj = max (auxVCj , ajk ) + Ljk / rj” prevents credit accumulation of idle flows 1 3 4 6 7 8 9 2 5 10 11 wall clock (ms)= r1=1/3 auxVC1 1 2 3 4 time 3 6 9 12 r2=1/3 auxVC2 1 2 3 4 time 3 6 9 12 r3=1/3 auxVC3 1 2 3 4 time 9 12 15 18 Virtual clock order (with auxVCi) 1 1 2 2 1 3 3 2 4 4 3 4 time 3 3 6 6 9 9 9 12 12 12 15 18

30 Problem with Virtual Clock (with place holder)
Flow that gets more than reserved rate may be penalized in the future 1 3 4 6 7 8 9 2 5 10 11 9 10 11 r1=1/3 auxVC1= 1 2 3 4 5 6 7 8 time 3 6 9 12 15 18 21 24 r2=1/3 auxVC2 = 1 2 3 4 time 8 11 14 17 r3=1/3 auxVC3 = 1 2 3 4 time 8 11 14 17 Virtual clock order (with auxVCi) time

31 Problem with Virtual Clock (with place holder)
Flow that gets more than reserved rate may be penalized in the future 1 3 4 6 7 8 9 2 5 10 11 r1=1/3 auxVC1= 1 2 3 4 5 6 7 8 time 3 6 9 12 15 18 21 24 r2=1/3 auxVC2 = 1 2 3 4 time 8 11 14 17 r3=1/3 auxVC3 = 1 2 3 4 time 8 1 14 17 1 2 3 4 5 1 1 2 2 3 3 4 4 6 7 8 Virtual clock order (with auxVCi) time 3 6 9 12 15 8 8 11 11 14 14 17 17 18 21 24 time

32 Problem with Virtual Clock (complete)
Flow that gets more than reserved rate may be penalized in the future wall clock (ms)= 1 2 3 4 5 6 7 8 9 10 11

33 Worst-Case Fair Fair Queueing (WF2Q)

34 WFQ and WF2Q … … 12 flows, all packets have size 1, C = 1: Flow 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Flow 1 f1 = 0.5 time Flow 2 f2 = 0.05 time Flow 11 f11 = 0.05 time fluid flow system 20 2 6 4 21

35 WFQ and WF2Q … … … … 12 flows, all packets have size 1, C = 1: Flow 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Flow 1 f1 = 0.5 time Flow 2 f2 = 0.05 time Flow 11 f11 = 0.05 time Flow 1 fluid flow system Flow 2 Flow 11 20 2 6 4 21

36 WFQ transmission order
WFQ and WF2Q 12 flows, all packets have size 1, C = 1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Flow 1 f1 = 0.5 time Flow 2 f2 = 0.05 time Flow 11 f11 = 0.05 time WFQ transmission order time 10 20 21

37 Worst-Case Fair Fair Queueing
Issue: While WFQ never falls behind the fluid-flow schedule by more than one packet size, it can run ahead of the fluid-flow schedule by an arbitrary amount. WF2Q Scheduling: Only considers packets for transmission that have already started transmission in the fluid-flow system Of these, it selects the packet with the smallest finishing time (in the fluid-flow system) WF2Q Properties: Like WFQ, WF2Q never falls behind the fluid-flow schedule by more than one packet size ( same end-to-end delay bounds as WFQ) Unlike WFQ, it never runs ahead of the fluid-flow schedule by more than one packet size

38 WFQ and WF2Q … … 12 flows, all packets have size 1, C = 1: Flow 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Flow 1 f1 = 0.5 time Flow 2 f2 = 0.05 time Flow 11 f11 = 0.05 time WFQ transmission order WF2Q transmission order time 10 20 21

39 WFQ and WF2Q … … 12 flows, all packets have size 1, C = 1: Flow 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Flow 1 f1 = 0.5 time Flow 2 f2 = 0.05 time Flow 11 f11 = 0.05 time WFQ transmission order WF2Q transmission order time 10 20 21


Download ppt "Fair Queueing."

Similar presentations


Ads by Google