cs 268: packet scheduling

41
CS 268: Packet Scheduling Ion Stoica March 29, 2004

Upload: brenna

Post on 18-Jan-2016

44 views

Category:

Documents


6 download

DESCRIPTION

CS 268: Packet Scheduling. Ion Stoica March 29, 2004. Packet Scheduling. Decide when and what packet to send on output link Usually implemented at output interface. flow 1. Classifier. flow 2. Scheduler. 1. 2. flow n. Buffer management. Why Packet Scheduling?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 268: Packet Scheduling

CS 268: Packet Scheduling

Ion Stoica

March 29, 2004

Page 2: CS 268: Packet Scheduling

[email protected] 2

Packet Scheduling

Decide when and what packet to send on output link- Usually implemented at output interface

1

2

Scheduler

flow 1

flow 2

flow n

Classifier

Buffer management

Page 3: CS 268: Packet Scheduling

[email protected] 3

Why Packet Scheduling?

Can provide per flow or per aggregate protection Can provide absolute and relative differentiation

in terms of- Delay

- Bandwidth

- Loss

Page 4: CS 268: Packet Scheduling

[email protected] 4

Fair Queueing

In a fluid flow system it reduces to bit-by-bit round robin among flows

- Each flow receives min(ri, f) , where

• ri – flow arrival rate

• f – link fair rate (see next slide)

Weighted Fair Queueing (WFQ) – associate a weight with each flow [Demers, Keshav & Shenker ’89]

- In a fluid flow system it reduces to bit-by-bit round robin

WFQ in a fluid flow system Generalized Processor Sharing (GPS) [Parekh & Gallager ’92]

Page 5: CS 268: Packet Scheduling

[email protected] 5

Fair Rate Computation

If link congested, compute f such that

Cfri

i ),min(

8

6

244

2

f = 4: min(8, 4) = 4 min(6, 4) = 4 min(2, 4) = 2

10

Page 6: CS 268: Packet Scheduling

[email protected] 6

Fair Rate Computation in GPS

Associate a weight wi with each flow i If link congested, compute f such that

Cwfr ii

i ),min(

8

6

244

2

f = 2: min(8, 2*3) = 6 min(6, 2*1) = 2 min(2, 2*1) = 2

10(w1 = 3)

(w2 = 1)

(w3 = 1)

Page 7: CS 268: Packet Scheduling

[email protected] 7

Generalized Processor Sharing

0 152 104 6 8

5 1 1 11 1

Red session has packets backlogged between time 0 and 10

Other sessions have packets continuously backlogged

flows

link

Page 8: CS 268: Packet Scheduling

[email protected] 8

Generalized Processor Sharing

A work conserving GPS is defined as

where- wi – weight of flow i

- Wi(t1, t2) – total service received by flow i during [t1, t2)

- W(t1, t2) – total service allocated to al flows during [t1, t2)

- B(t) – number of backlogged flows

)(),(),(

)(

tBiw

dtttW

w

dtttWi

tBj ji

Page 9: CS 268: Packet Scheduling

9

Properties of GPS

End-to-end delay bounds for guaranteed service [Parekh and Gallager ‘93]

Fair allocation of bandwidth for best effort service [Demers et al. ‘89, Parekh and Gallager ‘92]

Page 10: CS 268: Packet Scheduling

[email protected] 10

Packet vs. Fluid System

GPS is defined in an idealized fluid flow model- Multiple queues can be serviced simultaneously

Real system are packet systems- One queue is served at any given time

- Packet transmission cannot be preempted

Goal- Define packet algorithms approximating the fluid

system

- Maintain most of the important properties

Page 11: CS 268: Packet Scheduling

[email protected] 11

Standard techniques of approximating fluid GPS- Select packet that finishes first in GPS assuming that

there are no future arrivals

Important properties of GPS- Finishing order of packets currently in system

independent of future arrivals

Implementation based on virtual time- Assign virtual finish time to each packet upon arrival

- Packets served in increasing order of virtual times

Packet Approximation of Fluid System

Page 12: CS 268: Packet Scheduling

[email protected] 12

System Virtual Time

Virtual time (VGPS) – service that backlogged flow with weight = 1 would receive in GPS

)(),(

),()(

tBiw

dtttWwdtttW

tBj jii

t

W

wt

V

tBj j

GPS

)(

1)()(

tBit

W

w

w

t

W

tBj j

ii

)(1

),(2

1)(

21 tBidtt

W

wwttW

t

tttBj j

ii

Page 13: CS 268: Packet Scheduling

[email protected] 13

Service Allocation in GPS

The service received by flow i during an interval [t1,t2), while it is backlogged is

)(),(2

121 tBidt

t

VwttW

t

tt

GPSii

)())()((),( 1221 tBitVtVwttW GPSGPSii

Page 14: CS 268: Packet Scheduling

[email protected] 14

Virtual Time Implementation of Weighted Fair Queueing

w j

kjk

jkj

LSF

0)0( V GPS

))(,max( 1 kj

kj

kj aVFS

if session j backlogged

in general

ajk – arrival time of packet k of flow j

Sjk – virtual starting time of packet k of flow j

Fjk – virtual finishing time of packet k of flow j

Ljk – length of packet k of flow j

1 kj

kj FS

Page 15: CS 268: Packet Scheduling

[email protected] 15

Virtual Time Implementation of Weighted Fair Queueing

Need only to keep per flow not per packet state System virtual time is used to reset a flow’s virtual start

time when a flow becomes backlogged again after being idle

Page 16: CS 268: Packet Scheduling

[email protected] 16

System Virtual Time in GPS

0 4 128 16

1/2

1/81/81/81/8

)(tVGPS

2*C

C2*C

Page 17: CS 268: Packet Scheduling

[email protected] 17

Virtual Start and Finish Times

Utilize the time the packets would start Sik and finish Fi

k in a fluid system

0 4 128 16

kiFkiS

i

kik

ik

i w

LSF

)(tVGPS

Page 18: CS 268: Packet Scheduling

[email protected] 18

Goals in Designing Packet Fair Queueing Algorithms

Improve worst-case fairness (see next):- Use Smallest Eligible virtual Finish time First (SEFF) policy

- Examples: WF2Q, WF2Q+

Reduce complexity- Use simpler virtual time functions

- Examples: SCFQ, SFQ, DRR, FBFQ, leap-forward Virtual Clock, WF2Q+

Improve resource allocation flexibility- Service Curve

Page 19: CS 268: Packet Scheduling

[email protected] 19

Worst-case Fair Index (WFI)

Maximum discrepancy between the service received by a flow in the fluid flow system and in the packet system

In WFQ, WFI = O(n), where n is total number of backlogged flows

In WF2Q, WFI = 1

Page 20: CS 268: Packet Scheduling

[email protected] 20

WFI example

Fluid-Flow (GPS)

WFQ (smallest finish time first): WFI = 2.5

WF2Q (earliest finish time first); WFI = 1

Page 21: CS 268: Packet Scheduling

[email protected] 21

Hierarchical Resource Sharing

Resource contention/sharing at different levels

Resource management policies should be set at different levels, by different entities

- Resource owner

- Service providers

- Organizations

- Applications

Link

Provider 1

seminar video

Stat

Stanford.Berkeley

Provider 2

WEB

155 Mbps

50 Mbps50 Mbps

10 Mbps20 Mbps

100 Mbps 55 Mbps

Campus

seminar audio

EECS

Page 22: CS 268: Packet Scheduling

[email protected] 22

Hierarchical-GPS Example

4 1

1 11 1

Red session has packets backlogged at time 5

Other sessions have packets continuously backlogged

5

0 10 20

10

1

First red packet arrives at 5 …and it is served at 7.5

Page 23: CS 268: Packet Scheduling

[email protected] 23

Packet Approximation of H-GPS

Idea 1- Select packet finishing first in H-

GPS assuming there are no future arrivals

- Problem:

• Finish order in system dependent on future arrivals

• Virtual time implementation won’t work

Idea 2- Use a hierarchy of PFQ to

approximate H-GPS

6 4

321

GPS GPS GPS

GPS GPS

GPS

10

Packetized H-GPSH-GPS

6 4

321

GPS GPS GPS

GPS GPS

GPS

10

Page 24: CS 268: Packet Scheduling

[email protected] 24

Problems with Idea 1

The order of the 4th blue packet finish time and of the 1st green packet finish time changes as a result of a red packet arrival

Make decision here

4 1

1 11 1

5

10

1

Blue packet finish first

Green packet finish first

Page 25: CS 268: Packet Scheduling

[email protected] 25

Hierarchical-WFQ Example

A packet on the second level can miss its deadline (finish time) by an amount of time that in the worst case is proportional to WFI 4 1

1 11 1

5

10

1

First red packet arrives at 5 …but it is served at 11 !

First level packet schedule

Second level packet schedule

Page 26: CS 268: Packet Scheduling

[email protected] 26

Hierarchical-WF2Q Example

In WF2Q, all packets meet their deadlines modulo time to transmit a packet (at the line speed) at each level

4 1

1 11 1

5

10

1

First red packet arrives at 5 ..and it is served at 7

First level packet schedule

Second level packet schedule

Page 27: CS 268: Packet Scheduling

[email protected] 27

WF2Q+

WFQ and WF2Q- Need to emulate fluid GPS system- High complexity

WF2Q+- Provide same delay bound and WFI as WF2Q- Lower complexity

Key difference: virtual time computation

- - sequence number of the packet at the head of the queue of flow i

- - virtual starting time of the packet at the head of queue i- B(t) - set of packets backlogged at time t in the packet system

))(min),,()(max()( )(

)(22

th

itBiQWFQWF

iSttWtVtV

)( thi

)( thi

iS

Page 28: CS 268: Packet Scheduling

[email protected] 28

Example Hierarchy

Page 29: CS 268: Packet Scheduling

[email protected] 29

Uncorrelated Cross Traffic

Delay under H-WFQ

Delay under H-WF2Q+Delay under H-SFQ

Delay under H-SCFQ

20ms

60ms

40ms

20ms

60ms

40ms

Page 30: CS 268: Packet Scheduling

[email protected] 30

Correlated Cross Traffic

Delay under H-WFQ

Delay under H-WF2Q+Delay under H-SFQ

Delay under H-SCFQ

20ms

60ms

40ms

20ms

60ms

40ms

Page 31: CS 268: Packet Scheduling

[email protected] 31

Why Service Curve?

WFQ, WF2Q, H-WF2Q+ - Guarantee a minimum rate:

- A packet is served no later than its finish time in GPS (H-GPS) modulo the sum of the maximum packet transmission time at each level

For better resource utilization we need to specify more sophisticated services

Solution: QoS Service curve model

N

j ji wwC1

/

Page 32: CS 268: Packet Scheduling

[email protected] 32

What is a Service Model?

The QoS measures (delay,throughput, loss, cost) depend on offered traffic, and possibly other external processes.

A service model attempts to characterize the relationship between offered traffic, delivered traffic, and possibly other external processes.

“external process”

Network elementoffered traffic

delivered traffic

(connection oriented)

Page 33: CS 268: Packet Scheduling

[email protected] 33

Arrival and Departure Process

Network ElementRin Rout

Rin(t) = arrival process = amount of data arriving up to time t

Rout(t) = departure process = amount of data departing up to time t

bits

t

delay

buffer

Page 34: CS 268: Packet Scheduling

[email protected] 34

Traffic Envelope (Arrival Curve)

Maximum amount of service that a flow can send during an interval of time t

slope = max average rate

b(t) = Envelope

slope = peak rate

t

“Burstiness Constraint”

Page 35: CS 268: Packet Scheduling

[email protected] 35

Service Curve

Assume a flow that is idle at time s and it is backlogged during the interval (s, t)

Service curve: the minimum service received by the flow during the interval (s, t)

Page 36: CS 268: Packet Scheduling

[email protected] 36

Big Picture

t t

slope = C

t

Rin(t)

Service curvebits bits

bits

Rout(t)

Page 37: CS 268: Packet Scheduling

[email protected] 37

Delay and Buffer Bounds

t

S (t) = service curve

E(t) = Envelope (arrival curve)

Maximum delay

Maximum buffer

bits

Page 38: CS 268: Packet Scheduling

[email protected] 38

Service Curve-based Earliest Deadline (SCED)

Packet deadline – time at which the packet would be served assuming that the flow receives no more than its service curve

Serve packets in the increasing order of their deadlines

Properties- If sum of all service curves <= C*t

- All packets will meet their deadlines modulo the transmission time of the packet of maximum length, i.e., Lmax/C

bits

Deadline of 4-th packet

12

34

t

Page 39: CS 268: Packet Scheduling

[email protected] 39

Linear Service Curves: Example

t

bits

t

bits

t

Arrival curves

t

bits

t t

bitsbits

bits

Service curves

Arrival process

Deadlinecomputation

VideoFTP

t

Video packets have to wait after ftp packets

Page 40: CS 268: Packet Scheduling

[email protected] 40

Non-Linear Service Curves: Example

t

bits

t

bits

t

Arrival curves

t

bits

t t

bitsbits

bits

Service curves

Arrival process

Deadlinecomputation

t

Video FTP

Video packets transmittedas soon as they arrive

Page 41: CS 268: Packet Scheduling

[email protected] 41

Summary

WF2Q+ guarantees that each packet is served no later than its finish time in GPS modulo transmission time of maximum length packet

- Support hierarchical link sharing SCED guarantees that each packet meets its

deadline modulo transmission time of maximum length packet

- Decouple bandwidth and delay allocations Question: does SCED support hierarchical link

sharing?- No (why not?)

Hierarchical Fair Service Curve (H-FSC) [SZN97]- Support nonlinear service curves- Support hierarchical link sharing