37
1 Raj Jain The Ohio State University A Survey of A Survey of A Survey of A Survey of Scheduling Scheduling Scheduling Scheduling Methods Methods Methods Methods Raj Jain Professor of Computer and Information Science The Ohio State University Columbus, OH 43210-1277 Contact: [email protected] http://www. cis . ohio -state.edu/~jain/

A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

1

Raj JainThe Ohio State University

A Survey ofA Survey ofA Survey ofA Survey ofSchedulingSchedulingSchedulingScheduling

MethodsMethodsMethodsMethods

Raj JainProfessor of Computer and Information Science

The Ohio State University

Columbus, OH 43210-1277

Contact: [email protected]

http://www.cis.ohio-state.edu/~jain/

Raj Jain
jain@cse horizontal
Page 2: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

2

Raj JainThe Ohio State University

❑ Goals

❑ Metrics

❑ Classification

❑ Scheduling Methods

Overview

Page 3: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

3

Raj JainThe Ohio State University

Scheduling: GoalsScheduling: Goals❑ Sharing bandwidth

❑ Sharing bandwidth fairly

❑ Meeting bandwidth guarantees (min and max)⇒ Provide isolation between users

❑ Meeting loss guarantees (multiple levels)

❑ Meeting delay guarantees (multiple levels)

❑ Reducing delay variation

Page 4: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

4

Raj JainThe Ohio State University

Goals (Goals (ContCont))❑ Guarantees require call admission control,

policing, shaping, drop policies,buffer allocation, and scheduling

❑ These issues are, therefore, related.

❑ For example, zero-loss can be obtained byallocating PCR (but no multiplexing gain).

Page 5: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

5

Raj JainThe Ohio State University

Scheduling: MethodsScheduling: Methods❑ FCFS

❑ Round Robin

❑ Priority Queueing

❑ Priority Queueing with Windows

❑ Generalized Processor Sharing (GPS)

❑ VirtualClock

❑ Weighted Fair Queueing (WFQ), WF2Q, WF2Q+

❑ Self-Clocked Fair Queueing (SCFQ)

❑ Stop and Go

❑ Rate Controlled Service Descipline (RCSD)

Page 6: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

6

Raj JainThe Ohio State University

Scheduling MetricsScheduling Metrics❑ Complexity of enqueue+dequeue processes

❑ Fairness: If two flows are backlogged, differencebetween their weighted throughputs is bounded

❑ Complexity of adding and releasing connections (orchanging quotas in ABR)

❑ Delay bounds should not depend upon behavior ofother flows, number of other flows, reservations ofother flows

Page 7: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

7

Raj JainThe Ohio State University

Scheduling ClassificationScheduling Classification❑ Work conserving vs nonconserving

❑ Sorted priority vs frame based

❑ Control vs accomodate distortion

Page 8: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

8

Raj JainThe Ohio State University

Work Conserving Work Conserving vsvsNonconservingNonconserving

❑ Conserving: Server not idle if there is work.

❑ Produces lower average delay, higher delay var.

❑ Produces high total throughput

❑ Examples: GPS, WFQ, VirtualClock

❑ Nonconserving: Better for multiple hops

❑ May produce lower worst case end-to-end delay

❑ May produce higher network throughput

❑ Reshaping at every hop ⇒ additive hop delays

❑ Examples: Stop & Go

Page 9: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

9

Raj JainThe Ohio State University

Sorted PrioritySorted Priority vs vsFrame BasedFrame Based

❑ Sorted Priority: Virtual time for each flow/packet

❑ Generally has a O(log(V)) complexity

❑ Examples: VirtualClock, WFQ

❑ Frame Based: Time split into fixed/variable frames

❑ Each flow reserves the time per frame

❑ Delay and bandwidth allocations are dependent

❑ Examples: Stop and Go uses constant frame size.DRR, WRR allow variable frame size

Frame

Page 10: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

10

Raj JainThe Ohio State University

Control DistortionControl Distortion vs vsAccomodateAccomodate distortion distortion

❑ Burstiness of the traffic increases along the path ⇒Need more resources

❑ Control Distortion: Reshape at each hop ⇒ Non-work conserving

❑ Example: Stop and Go, HRR, Jitter EDD

❑ Accomodate Distortion: Do not reshape

❑ Example: VirtualClock, Fair Queueing, GPS,Delay EDD

Page 11: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

11

Raj JainThe Ohio State University

FCFSFCFS❑ Unfair

❑ No isolation among users

Page 12: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

12

Raj JainThe Ohio State University

Round RobinRound Robin

❑ Parking lot problem: Distance sources get lower

❑ Classify incoming traffic into flows (Src-Dest pairs)

❑ Round-robin among flows

❑ Known Problems:Ignores packet length ⇒ Fair Queueing

❑ Ref: Nagle

S1 S1 S1

Page 13: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

13

Raj JainThe Ohio State University

PriorityPriority Queueing Queueing❑ Also known as head of line (HOL)

❑ Priority 0 through n-1

❑ Priority 0 is always serviced first.

❑ Priority i is serviced only if 0 through i-1 are empty

❑ Highest priority has the lowest delay, highestthroughput, lowest loss

❑ Lower priority classes may be starved if higherpriority are overloaded

Page 14: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

14

Raj JainThe Ohio State University

PriorityPriority Queueing Queueingwith Windowswith Windows

❑ Maximum ni packets from ith priorityduring a single round

❑ Come back to higher priority unless ni packets havebeen served

❑ Guarantees non-starvation but increases the delay forhigher priorities

❑ Large ni ⇒ Priority queueing.Small ni ⇒ Round robin

Page 15: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

15

Raj JainThe Ohio State University

Priority with WindowsPriority with Windows((ContCont))

❑ ni's determine min bandwidth allocationsand delays

❑ Quantitative relationships between ni and delays orloss not provided.

❑ VLSI design implemented

❑ Refs: El-Gebaly et al and Sabaa et al.

Page 16: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

16

Raj JainThe Ohio State University

VirtualClockVirtualClock❑ Goals: Provide average reserved

throughput Ri b/s

❑ Provides isolation between users

❑ Upon packet arrival:

❑ VirtualClocki=Max{wall clock time,VirtualClocki}

❑ Timestamp the packet with VirtualClocki

❑ VirtualClocki = VirtualClocki + packet size/Ri

❑ Transmit packets in order of increasing timestamps

Page 17: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

17

Raj JainThe Ohio State University

VirtualClockVirtualClock ( (ContCont))❑ Possible to implement with one timestamp

per flow rather than one per packet

❑ Known Problems: Flows do not accumulate credits

❑ Flows using idle bandwidth are penalized later⇒ Virtual Clock is Unfair ⇒ Several proposedfixes, e.g., Time-shift scheduling

❑ No CAC policy ⇒ no delay bounds

❑ Need to implement priority queues⇒ O(log V) complexity, V=# of VCs

❑ Refs: Zhang, Srinivasan et al, Stilidias and Varma,Cobb et al

Page 18: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

18

Raj JainThe Ohio State University

Generalized ProcessorGeneralized ProcessorSharingSharing

❑ Idealized policy to split bandwidth

❑ Each user has a fraction si of the bandwidth

❑ All unused bandwidth is allocated in proportion tothe fraction φi

❑ At time t, ith active user gets a fraction ri

ri = φi /Σactive j φj

❑ Weighted round-robin with infinitely small servicequantum

Page 19: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

19

Raj JainThe Ohio State University

GPS Example: ArrivalsGPS Example: Arrivals❑ Eleven Sources. First source gets 0.5.

Other 10 sources get 0.05 each. Firstsource sends 10 cells. 2-11 send one each at t=0.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

Page 20: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

20

Raj JainThe Ohio State University

GPS Example: ServiceGPS Example: Service❑ Each cell of the first source takes 2 units

of time. Sources 2-11 take 20 units each.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

Page 21: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

21

Raj JainThe Ohio State University

Weighted Fair QueueingWeighted Fair Queueing❑ Approximates bit-by-bit round robin.

Compute GPS finish time and schedulethe packet with the smallest finish time.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

Page 22: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

22

Raj JainThe Ohio State University

Weighted FairWeighted Fair Queueing Queueing(WFQ)(WFQ)

❑ Basis of IETF's integrated services

❑ Naive implementation requires O(log(m)), m=# of packets

❑ Keshav's implementation requires O(log(V)), V=# of flows

❑ Known Properties: CAC and End-to-end delaybounds have been derived for leaky-bucket shapedsources

❑ Parekh and Gallagher showed that leaky bucket+FQ ⇒ delay guarantees

Page 23: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

23

Raj JainThe Ohio State University

WFQ (WFQ (ContCont))❑ Known Problems:

❑ Need large bandwidth reservation toget small delay bound.

❑ Complex to implement.

❑ Packets can be serviced much earlier than GPS.Can introduce significant unfairness over GPS.

❑ Refs: Demers et al, Keshav, Srinivasan et al

Page 24: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

24

Raj JainThe Ohio State University

GPS Example 2: ArrivalsGPS Example 2: Arrivals❑ Eleven Sources. First source gets 0.5.

Other 10 sources get 0.05 each. Firstsource sends 11 cells. 2-11 send one each at t=0.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

p111

Page 25: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

25

Raj JainThe Ohio State University

GPS Example 2: ServiceGPS Example 2: Service❑ Each cell of the first source takes 2 units

of time. Sources 2-11 take 20 units each.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

p111

Page 26: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

26

Raj JainThe Ohio State University

WFQ: ServiceWFQ: Service❑ Packets finish at the same time or earlier

than GPS. Some packets finish much earlier.Long period of no service ⇒ Unfair.

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

p111

Page 27: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

27

Raj JainThe Ohio State University

Worst Case Fair WeightedWorst Case Fair WeightedFair Queuing (WF2Q )Fair Queuing (WF2Q )

❑ WF2Q fixes the unfairness problem in WFQ.

❑ WFQ: Among packets waiting in the system,pick one that will finish service first under GPS.

❑ WF2Q: Among packets waiting in the systemthat have started service under GPS, select onethat will finish first under GPS.

❑ WF2Q provides service close to GPS (difference inpacket service time bounded by max. packet size).

❑ WF2Q+ is an simpler implementation of WF2Q

❑ Refs: Jon Bennett, Hui Zhang.

Page 28: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

28

Raj JainThe Ohio State University

WF2Q: ServiceWF2Q: Service

S1S2S3S4S5S6S7S8S9S10S11

Time0 10 20

p111

Page 29: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

29

Raj JainThe Ohio State University

Self-Clocked FairSelf-Clocked FairQueueing (SCFQ)Queueing (SCFQ)

❑ Computational complexity of computingvirtual finishing time in WFQ dependsupon the number of times flows change from idle tobusy and vice versa. SCFQ reduces it to O(1).Dequeue and enqueue is still O(log(V))

❑ Uses system clock instead of wall clock (as inVirtual Clock)

❑ A packet's tag = Length/rate + Max{tag of previouspacket in that flow, tag of packet in service at thetime of arrival}

❑ Ref: Golestani

Page 30: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

30

Raj JainThe Ohio State University

Stop and GoStop and Go

❑ Time is divided into constant size frames

❑ An arriving packet leaves on the next departing frame

❑ Server cannot idle if there are eligible packets

❑ Known Properties: Shaping maintained throughout⇒ Delay bound possible ⇒ Tight delay jitter

❑ Non-Work conserving. Link idle if no packets forcurrent frame but there are the next frame

❑ Known Problems: Allocation = PCR ⇒ Inefficient

L1

L2

L3 L1L3L2

Page 31: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

31

Raj JainThe Ohio State University

Rate ControlledRate ControlledService DisciplinesService Disciplines

❑ Rate-Controller (shaper) + Packet SchedulerDecouples bandwidth allocation and delay bounds

Regulator 1

Regulator 2

Regulator h

Priority 1

Priority n

Non-real-timeNon-real-time Input

Real-timeInput

Rate Controller Scheduler

Page 32: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

32

Raj JainThe Ohio State University

RCSD (RCSD (ContCont))❑ Rate Controller:

❑ Each packet is assigned an eligibilitytime on arrival

❑ Packet is held in rate controller and released toscheduler at its eligibility time

❑ Many different schedulers and rate controllers canbe combined to produce different algorithms.

Rate-Jitter

Delay-Jitter

Earliest due dateStatic priorityFCFS

×

Page 33: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

33

Raj JainThe Ohio State University

CBRrt-VBR

nrt-VBR ABR UBR

Multi-class SchedulingMulti-class SchedulingFor ATMFor ATM

❑ Each class has an allocation = Guaranteed underoverload

❑ Some classes need minimum delay ⇒ have priority.

❑ Some classes are greedy: They will send more thanallocated and will want to use all left-over. No left-over capacity.

❑ Left-over capacity must be fairly allocated.

Page 34: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

36

Raj JainThe Ohio State University

Scheduling Methods:Scheduling Methods:ComparisonComparison

Algorithm Unfairness ComplexityRound Robin ∞ O(1)Fair Queueing Max O(log(V))SCFQ 2Max O(log(V))DRR 3 Max O(1)Virtual Clock ∞ O(log(V))WRR Max O(1)

Page 35: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

37

Raj JainThe Ohio State University

SummarySummary

❑ Schedulers can provide bandwidth, delay, lossguarantees

❑ Large # of VCs ⇒ Need O(1) complexity

❑ Frequent rate changes ⇒ Allocation to a VC shoulddepend upon that VC’s demands and not on others

❑ Non-work conserving schedulers provide end-to-end delay guarantees.

Page 36: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

38

Raj JainThe Ohio State University

ReferencesReferences❑ For detailed list of references, see

http://www.cis.ohio-state.edu/~jain/refs/ref_schd.htm

Page 37: A Survey of Scheduling Methods - Washington University in ...jain/talks/ftp/sched.pdf · Algorithm Unfairness Complexity Round Robin ∞ O(1) Fair Queueing Max O(log(V)) SCFQ 2Max

39

Raj JainThe Ohio State University

Thank You!Thank You!