Fair Queueing Fair Queueing Attempts to implement a

  • Slides: 27
Download presentation
Fair Queueing

Fair Queueing

Fair Queueing – Attempts to implement a scheduler that simultaneously serves all flows with

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 2

Discussion of Fair Rate Allocation • See class notes 3

Discussion of Fair Rate Allocation • See class notes 3

Fair Scheduling Algorithms • Fair Queueing (FQ), a. k. a as Processor Sharing (PS)

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 1. Traffic is transmitted in packet of variable size 2. Transmission of a packet cannot be interrupted 4

Fair Queuing in packet networks • Approach: 1. Take a fluid-flow view of traffic

Fair Queuing in packet networks • Approach: 1. 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 2. Approximate fluid-flow schedule by a packet-level scheduling algorithm 5

Fair Queuing (FQ): From fluid to packets Packet Size (bits) Packet inter-arrival time (ms)

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 10 50 Flow 1 (f 1 = 1) 100 Kbps Flow 2 (f 2 = 1) Flow 1 (arrival traffic) 1 2 4 5 time Flow 2 (arrival traffic) Service in fluid flow system 3 1 0 10 20 2 30 3 40 4 50 5 60 6 70 time 80 time (ms) 6 Slide from Ion Stoica

Fair Queueing (FQ): From fluid to packets (complete) Packet Size (bits) Packet inter-arrival time

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 10 50 Flow 1 (f 1 = 1) 100 Kbps Flow 2 (f 2 = 1) Flow 1 (arrival traffic) 1 2 5 time Flow 2 (arrival traffic) Service in fluid flow system 4 3 1 1 0 3 4 3 2 10 2 1 20 6 4 2 30 5 3 40 5 4 50 time 5 60 6 70 80 time (ms) 7

Fair Scheduling (fluid flow) 5000 Flow 2 Flow 1 4000 3000 2000 1000 0

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

Fair Scheduling (fluid flow) 5000 Flow 2 Flow 1 4000 3000 2000 1000 0

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

Fair Scheduling (FQ) (fluid flow view) • There are N flows • At any

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: 10

Weighted Fair Scheduling (WFQ) (fluid flow view) • There are N flows with weights

Weighted Fair Scheduling (WFQ) (fluid flow view) • There are N flows with weights f 1 , f 2 , …, f. N • 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: 11

FQ/WFQ Scheduling for Packets (packet-level view) • Packet-level implementation of FQ and WFQ tries

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 12

WFQ scheduling (with place holder) Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps)

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

WFQ scheduling (complete) Packet Size (bits) Packet inter-arrival time (ms) Rate (Kbps) Flow 1

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

Packet-level Implementation of WFQ Problems to deal with: • The finishing time of a

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 15

System Virtual Time • B(t) : the set of backlogged flows at time t

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 Rate of system virtual time : service that a backlogged flow with weight 1 receives in GPS Rate of 16

WFQ: System Virtual Time • WFQ uses a System Virtual Time which tracks the

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 17

WFQ: Implementation • Virtual finish time of k-th packet from flow j • ajk

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 time needs to be computed only at arrival time of packets – must keep track of the busy set Bl 18

WFQ Example (packet level) Flow 1 (arrival traffic) 1 2 Flow 2 (arrival traffic)

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

WFQ Example (packet level) 5000 4000 Virtual time V(t) Flow 1 (arrival traffic) 1

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

Worst-Case Fair Queueing (WF 2 Q)

Worst-Case Fair Queueing (WF 2 Q)

WFQ and WF 2 Q • 12 flows, all packets have size 1, C

WFQ and WF 2 Q • 12 flows, all packets have size 1, C = 1: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Flow 1 f 1 = 0. 5 time Flow 2 f 2 = 0. 05 time … … Flow 11 f 11 = 0. 05 time fluid flow system 0 2 4 6 20 21 22

WFQ and WF 2 Q • 12 flows, all packets have size 1, C

WFQ and WF 2 Q • 12 flows, all packets have size 1, C = 1: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Flow 1 f 1 = 0. 5 time Flow 2 f 2 = 0. 05 time … … Flow 11 f 11 = 0. 05 time Flow 1 fluid flow system Flow 2 … … Flow 11 0 2 4 6 20 21 23

WFQ and WF 2 Q • 12 flows, all packets have size 1, C

WFQ and WF 2 Q • 12 flows, all packets have size 1, C = 1: 0 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 f 1 = 0. 5 time Flow 2 f 2 = 0. 05 time … … Flow 11 f 11 = 0. 05 time WFQ transmission order 0 10 20 21 time 24

Worst-Case Fair Queueing • Issue: While WFQ never falls behind the fluid-flow schedule by

Worst-Case 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. • WF 2 Q 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) • WF 2 Q Properties: – Like WFQ, WF 2 Q 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 25

WFQ and WF 2 Q • 12 flows, all packets have size 1, C

WFQ and WF 2 Q • 12 flows, all packets have size 1, C = 1: 0 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 f 1 = 0. 5 time Flow 2 f 2 = 0. 05 time … … Flow 11 f 11 = 0. 05 time WFQ transmission order WF 2 Q transmission order 0 10 20 21 time 26

WFQ and WF 2 Q • 12 flows, all packets have size 1, C

WFQ and WF 2 Q • 12 flows, all packets have size 1, C = 1: 0 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 f 1 = 0. 5 time Flow 2 f 2 = 0. 05 time … … Flow 11 f 11 = 0. 05 time WFQ transmission order WF 2 Q transmission order 0 10 20 21 time 27