CS 204: Scheduling Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 - - PowerPoint PPT Presentation

cs 204 scheduling
SMART_READER_LITE
LIVE PREVIEW

CS 204: Scheduling Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 - - PowerPoint PPT Presentation

CS 204: Scheduling Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring16/ 1 Overview What is scheduling? Round robin Q: How should a Weighted round robin common resource be


slide-1
SLIDE 1

CS 204: Scheduling

Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring16/

1

slide-2
SLIDE 2

Overview

  • What is scheduling?
  • Round robin
  • Weighted round robin
  • Generalized processor sharing (GPS)
  • Implementations of GPS
  • Deficit round robin
  • Weighted fair queuing
  • Rate control with GPS: Leaky bucket
  • Paper discussion

2

Q: How should a common resource be shared between multiple users?

slide-3
SLIDE 3

What is scheduling?

  • Send packets from multiple hosts
  • Required features
  • Fair
  • Easy to implement
  • Scalable
  • Work-conserving
  • Desirable features
  • Admission control
  • QoS for different types of traffic

3

H1 H2 H3 Whose data gets transmitted?

slide-4
SLIDE 4

What is NOT scheduling?

4

H1 H2 H3 centralized scheduling random access

Uplink? Downlink?

slide-5
SLIDE 5

Toy example

5

Sender A: 5-bit packets Sender C: 2-bit packets Sender B: 7-bit packets Total bandwidth = 12 bits/s

slide-6
SLIDE 6

Fairness

  • How much of the link does each user get?
  • One measure of fairness: max-min fair
  • Maximize the minimum rate across all users

6

Sender A: 5-bit packets Sender C: 2-bit packets Sender B: 7-bit packets

5 5 2 4 6 2 Max-min fair NOT max-min fair

slide-7
SLIDE 7

Round robin

  • Choose 1 packet from each subqueue

7

After one round 5 7 After two rounds 10 5 2

slide-8
SLIDE 8

Weighted round robin

  • Choose certain # packets from each subqueue
  • # of packets sent = weight / packet size

8

5 5 2 Weights 5/5 = 1 à 7 5/7 à 5 2/2 = 1 à 7 # packets sent 7 packets * 5 bits/packet = 35 bits 5 packets * 7 bits/packet = 35 bits 7 packets * 2 bits/packet = 14 bits Number of bits sent

slide-9
SLIDE 9

Overview

  • What is scheduling?
  • Round robin
  • Weighted round robin
  • Generalized processor sharing (GPS)
  • Implementations of GPS
  • Deficit round robin
  • Weighted fair queuing
  • Rate control with GPS: Leaky bucket
  • Paper discussion

9

Q: How should a common resource be shared between multiple users?

slide-10
SLIDE 10

Bit-by-bit Round Robin

  • Not implementable

10

After one round 5 5 2 After two rounds 10 10 4

slide-11
SLIDE 11

Generalized processor sharing

  • Send infinitesimal amount of bits each round
  • Idealized version of bit-by-bit round robin
  • Not implementable, but achieves perfect fairness

11

2/12 5/12 5/12 How to implement this?

slide-12
SLIDE 12

Overview

  • What is scheduling?
  • FIFO
  • Round robin
  • Weighted round robin
  • Generalized processor sharing (GPS)
  • Implementations of GPS
  • Deficit round robin
  • Weighted fair queuing
  • Rate control with GPS: Leaky bucket
  • Paper discussion

12

Q: How should a common resource be shared between multiple users?

slide-13
SLIDE 13
  • See which packets would finish first under GPS
  • Send packets in that order

Weighted fair queuing

13

time P1, P1 P1 P2 P2,P2 P3,P3 After one round 5 5 2 After two rounds 10 10 4 O(log(n)) complexity Need to sort the list of finishing times

slide-14
SLIDE 14
  • Problem: what if new user enters the system?

Weighted fair queuing (2)

14

time P1, P1 P1 P2 P1, P2 P1 P1, P1 P2 time P2,P2 P3,P3 P3 P2, Finishing times are different, need to be updated!

slide-15
SLIDE 15
  • Solution: use “virtual time” = # of bit-by-bit round robin rounds

Weighted fair queuing (3)

15

P1 = 5 P1 = 2 P1 = 7 P2 = 10 P2 = 6 P1 P1, P1 P2 time P2,P2 P3,P3 GPS: virtual time

1

Bit-by-bit RR: 2 3 4 5 6 7 8 9 10

slide-16
SLIDE 16
  • Let’s calculate the virtual finishing time with the new user

Weighted fair queuing (4)

16

virtual time P1 = 5 P1 = 2 P1 = 7 P2 = 10 P2 = 6 P1 P1, P1 time P2 P3 P1, P2 P3 P2, GPS: Bit-by-bit RR: 1 2 3 4 5 6 7 8 9 10 11

slide-17
SLIDE 17

Weighted fair queuing (5)

17

P1 = 5 P1 = 2 P1 = 7 P2 = 10 P2 = 6

  • Even if new user joins, the “virtual time” stays the same

virtual time

11 10 9 8 7 6 5 4 3 2 1

Bit-by-bit RR: virtual time

10 9 8 7 6 5 4 3 2 1

Bit-by-bit RR: P1 = 5 P1 = 2 P1 = 7 P2 = 10 P2 = 6 The virtual finishing times stayed the same!

Note: BBRR virtual time is shown here for ease of exposition; WFQ virtual time is slightly different. See Parekh-Gallager for details.

slide-18
SLIDE 18

Deficit round robin

  • That seems confusing… is there a simpler way?

18

Q = 5 Q = 5 Q = 2

  • Define a quantum Q for each subqueue
  • Define a counter C for each subqueue
  • How many bits allowed to be sent each

turn

slide-19
SLIDE 19

Deficit round robin

19

After one round 10 2 After two rounds 13 7 4 Q = 5 Q = 5 Q = 2 O(1), but less accurate D = Q = 5 Send D = 0 D = Q = 5 Cannot send D = 5 D = Q = 2 Send D = 0 D = Q = 5 Send D = 0 D = D + Q = 10 Send D = 3 D = Q = 2 Send D = 0 D = Q = 5 Send D = 0

slide-20
SLIDE 20

Overview

  • What is scheduling?
  • FIFO
  • Round robin
  • Weighted round robin
  • Generalized processor sharing (GPS)
  • Implementations of GPS
  • Deficit round robin
  • Weighted fair queuing
  • Rate control with GPS: Leaky bucket
  • Paper discussion

20

Q: How should a common resource be shared between multiple users?

slide-21
SLIDE 21

Performance guarantees with GPS

  • GPS implementations give us an average throughput
  • What about delay guarantee?

21

slide-22
SLIDE 22

Leaky Bucket

22

Tokens arrive with rate ak Bucket can hold Bk tokens Packets can only leave if accompanied by a token If the buffer is full, how many packets can leave during time interval T?

slide-23
SLIDE 23

GPS + Leaky Bucket

  • Max delay experienced by a bit:
  • Why?
  • 1. At most Bk packets waiting in GPS

scheduler

  • 2. Delay = (Bk pkts) / (ρk pkts/s)

23

GPS scheduler K leaky buckets

slide-24
SLIDE 24

Sources

  • An Introduction to Computer Networks, Peter Dordal

http://intronetworks.cs.luc.edu/current/html/queuing.html

  • A. Parekh and R. Gallager, “A Generalized Processor Sharing Approach

to Flow Control in Integrated Services Networks: The Single-Node Case”, ToN 1993.

24