March 29

70
March 29 March 29 Scheduling ?

description

March 29. Scheduling ?. What is Packet Scheduling?. Decide when and what packet to send on output link. Classifier. Arbitrator. flow 1. 1. flow 2. Scheduler. 2. flow n. Buffer management. Select the next packet for transmission. Packet Scheduling ?. - PowerPoint PPT Presentation

Transcript of March 29

Page 1: March 29

March 29March 29

Scheduling ?

Page 2: March 29

What is Packet Scheduling?What is Packet Scheduling? Decide when and what packet to send on output link

1

2

Scheduler

flow 1

flow 2

flow n

Buffer management

• Select the next packet for transmission

ArbitratorClassifier

Page 3: March 29

Packet Scheduling ?Packet Scheduling ?

Scheduler

flow 1

flow 2

flow n

Buffer management

• Packet storage decision (when to drop)

• Packet transmission decision (packet to send )– desired transmission time ?

• QoS?• smallest one first?

– Schedulers differ in how they compute desired transmission times

• Controls the interaction among

– Traffic in the same class

– Traffic in the different QoS required classes

– Traffic in the admin. purpose class

Page 4: March 29

Characteristics of Scheduling Characteristics of Scheduling algorithmalgorithm

Basic properties– How to isolate flow? to guarantee service to one flow independent of the behavior of other flow

– How to support of excess traffic and fairness? Work conserving? If you send more than you are entitled to but resources are

available, can you take advantage of it and if yes, how much

– How complex it is? Computation complexity, management complexity

– How efficient it is? # flows, packets?

Page 5: March 29

Known scheduling !Known scheduling !FIFO, LIFOFair Queueing

– Min-Max– bit-by-bit round robin– Weighted bit-by-bit Fair Queueing (WFQ)– WFQ in a fluid flow system Generalized

Processor Sharing (GPS)

Packetized FQ(PGPS)

Page 6: March 29

First-Come First-ServedFirst-Come First-Served Algorithm:

– Packets are served in the order they arrive Departure time is arrival time plus time to empty buffer content First packet comes first packet out,

– Properties Very simple to implement No flow isolation or bandwidth guarantees

– One flow can hog the entire link if unconstrained Max delay is proportional to buffer size, not packet class

Page 7: March 29

Priority QueuingPriority Queuing Multiple FCFS queues, where high priority queues

always transmit before lower priority ones– Departure time is time of arrival plus time to empty buffer

content plus variable time (function of buffer content and arrivals in higher priority queues)

– Class i is guaranteed to have better delay than class j for i<j– Lower priority classes can be starved– Remains simple to implement (for few classes)

Page 8: March 29

Round-RobinRound-Robin Packets are classified and sent to “n”

queues– Queues are serviced in order 0..n-

1 Problems

– Can’t offer bandwidth or delay guarantees

– Packets can “park” in a queue, while empty queues are checked for servicing

– Insensitive to packet size (inherently unfair)

Scheduler

flow 1

flow 2

flow n

Buffer management

Page 9: March 29

Weighted Round-RobinWeighted Round-Robin Weighted Round-Robin

– Windowed Priority Queuing Each flow has its own queue and weight

wi Packets sent to “n” queues, like Priority

Queuing Server visits each queue in turn and

transmits wi packets (bits)

– Limited number of packets processed per queue per servicing round

wi packets for each of the “i” queues w1

w2

w3

w4

wi = i

Scheduler

flow 1

flow 2

flow n

Buffer management

Page 10: March 29

FIFO SchedulingFIFO Scheduling

Serving in the Queueing system?

server

Time

Page 11: March 29

FIFO SchedulingFIFO SchedulingIs it fair?

server

Time

Flow i

#of served packets

average

Flow i

Delay

average

FIFO favors the most greedy flow FIFO is hard to control the delay

Page 12: March 29

Fair Queueing?Fair Queueing? Can provide (QOS)

– Fairness: Make sure that a given flow gets enough transmission opportunities when it has packets waiting to be transmitted (is backlogged)

– Delay: Ensure upper bound on the maximum (average) amount of time a packet can wait in the buffer

– Jitter: Provide bound on the delay difference of consecutive packet transmissions (for the same flow)

– Loss: is a function of Buffer management Distribution of excess bandwidth (E) across active sessions

– Fair allocation gives each one of N active connections E/N+reserved BW

Page 13: March 29

Example 1Example 1

1.1 Mb/s

10 Mb/s

100 Mb/s

A

B

R1C

0.55Mb/s

0.55Mb/s

What is the “fair” allocation: (0.55Mb/s, 0.55Mb/s) or (1Mb/s, 0.1Mb/s)?

e.g. an http flow with a given(IP SA, IP DA, TCP SP, TCP DP)

Page 14: March 29

Example 2Example 2

1.1 Mb/s

10 Mb/s

100 Mb/s

A

B

R1 D

What is the “fair” allocation?0.2 Mb/sC

?Mb/s

?Mb/s

Page 15: March 29

Max-Min FairnessMax-Min Fairness

How can an Internet router “allocate” different rates to different flows?

First, let’s see how a router can allocate the “same” rate to different flows…-> Max-Min Fairness Algorithm

Page 16: March 29

Max-Min Fairness AlgorithmMax-Min Fairness AlgorithmA common way to allocate flowsA common way to allocate flows

N flows share a link of rate C. Flow f wishes to send at rate W(f), and is allocated rate R(f).

1. Pick the flow, f, with the smallest requested rate.

2. If W(f) < C/N, then set R(f) = W(f).

3. If W(f) > C/N, then set R(f) = C/N.

4. Set N = N – 1. C = C – R(f).

5. If N>0 goto 1.

Page 17: March 29

Max-Min fairness Example 1Max-Min fairness Example 1

Round 1: Since W(f1)<1.1/3(0.366), then Set R(f1) = 0.2

Round 2: Since W(f2)>0.9/2(0.45), then Set R(f2) = 0.9/2 = 0.45

Round 3: Since W(f3)>0.45/1(0.45), then Set R(f4) = 0.45/1 = 0.45

The smallest flow in the round

W(f1) = 0.2

W(f3) = 100

W(f2) = 10

3 flows share a link of rate 1.1Mbps. Flow f wishes to send at rate W(f), and is allocated rate R(f). C=1.1Mbps, N=3

Sorted list

0.450.2

0.45

C=1.1

Page 18: March 29

Max-Min Fairness Example 2Max-Min Fairness Example 2Another exampleAnother example

Round 1: Since W(f1)<1/4(0.25), then Set R(f1) = 0.1

Round 2: Since W(f2)>0.9/3(0.3), then Set R(f2) = 0.9/3 = 0.3

Round 3: Since W(f4)>0.6/2(0.3), then Set R(f4) = 0.6/2 = 0.3

Round 4: Since W(f3)>0.3/1(0.3), then Set R(f3) = 0.3/1 = 0.3

The smallest flow in the round

W(f1) = 0.1

W(f3) = 10

W(f4) = 5

W(f2) = 0.5

4 flows share a link of rate 1Mbps. Flow f wishes to send at rate W(f), and is allocated rate R(f). C=1Mbps, N=4

Sorted list

0.10.30.30.3

C=1

Page 19: March 29

Max-Min Fairness Example 3Max-Min Fairness Example 3Another exampleAnother example

The smallest flow in the round

3 flows share a link of rate 10Mbps. Flow f wishes to send at rate W(f), and is allocated rate R(f). C=10Mbps, N=3

Sorted list

8

6

244

2

C=10

Round 1: Since W(f1)<10/3(3.33), then Set R(f1) = 2

Round 2: Since W(f2)>8/2(4), then Set R(f2) = 8/2 = 4

Round 3: Since W(f3)>4/1(4), then Set R(f4) = 4/1 = 4

R(8) = 4 R(6) = 4 R(2) = 2

Max-Min fairness

Page 20: March 29

Bit-by-Bit Fair QueueingBit-by-Bit Fair Queueing1. Packets belonging to a flow are placed in a

FIFO. This is called “per-flow queueing”.2. FIFOs are scheduled one bit at a time, in a

round-robin fashion. 3. This is called Bit-by-Bit Fair Queueing.

Flow 1

Flow NClassification Scheduling

Bit-by-bit round robin

Order of service … …f1, f2, f3, f4, f5, f6, …fN…, f1,…

Page 21: March 29

Weighted Bit-by-Bit Fair Weighted Bit-by-Bit Fair QueueingQueueing

Likewise, flows can be allocated different rates by servicing a different number of bits

for each flow during each round.

10R(f1) = 1

R(f3) = 3R1

C

R(f4) = 3

R(f2) = 3

Order of service for the four queues:… f1, f2, f2, f2, f3, f3, f3, f4, f4, f4, f1,…

Also called “Generalized Processor Sharing (GPS)”

Page 22: March 29

R(f):R(f): Fair RateFair Rate Computation Computation ExampleExample

Associate a weight wi with each flow i

If link congested, compute R(f) such that

8

6

226

2

R(fi)= R(8) = 6 R(6) = 2 R(2) = 2

10(w1 = 3)

(w2 = 1)

(w3 = 1)

The smallest flow in the roundRound 1: Since W(f1)<10/5(2), then Set R(f1) = 2

Round 2: Since W(f2)>8/4(2), then Set R(f2) = 8/4 = 2

Round 3: Since W(f3)>6/1(6), then Set R(f4) = 6/1 = 6

Page 23: March 29

Generalized Processor Share-fluid Generalized Processor Share-fluid flow FQflow FQ

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=C

5C/wi

1C/wi

Page 24: March 29

Generalized Processor SharingGeneralized 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 all flows during [t1, t2)

– B(t) – number of flows backlogged

)(),(),(

)(

tBiwdtttW

w

dtttW

tBj ji

i

)(

),(

),(

)(

tBidtttW

dtttW

w

w i

tBj j

i

Page 25: March 29

GPS ExampleGPS Example

OUT

6

14

14??

?

1(w1 = 1/2)

(w2 = 1/3)

(w3 = 1/6)

r3=1/3

r2 =2/31/2

1/3

1/6

tdtdt2

)()(

tBiw

w

tBj j

iir

w2=1/3

w1=1/2

w3=1/6

INdtdt2

Page 26: March 29

GPS ExampleGPS Example

Three flows with weights/rates w1=1/2, w2=1/3, w3=1/6

Initially, only flows 2 and 3 are active (dt)

Flows 1, 2, and 3 are ultimately active (dt2)

3/16/13/1

6/1;3/2

6/13/1

3/132

rr

6/16/13/12/1

6/1,3/1

6/13/12/13/1

,2/16/13/12/1

2/1321

rrr

OUT

r3=1/3

t dt

r2 =2/31/2

1/3

1/6

dt2

Page 27: March 29

27

Properties of GPSProperties 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]

Work-conserving for high link utilization

Page 28: March 29

Summary of Fluid Flow Fair Summary of Fluid Flow Fair QueueingQueueing

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

– Each flow receives R(fi) , where fi – flow arrival rate

Weighted bit-by-bit Fair Queueing (WFQ) – associate a weight with each flow [Demers and etc.’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 29: March 29

Packet vs. Fluid SystemPacket vs. Fluid System GPS is defined in an idealized fluid flow model

– Multiple queues can be serviced simultaneously– No non-preemption unit (preemptive)

Real system are packet systems– One queue is served at any given time– Packet transmission is not preempted

Goal– Define packet algorithms approximating the fluid system– Maintain most of the important properties

Page 30: March 29

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 Packet Approximation of Fluid SystemSystem

Page 31: March 29

Packetized GPS AlgorithmPacketized GPS Algorithm

Problem: We need to serve a whole packet at a time.

Solution: 1. Determine what time a packet, p, would complete if

we served flows bit-by-bit. Call this the packet’s finishing time, F(p).

2. Serve packets in the order of increasing finishing time.

Theorem: Packet p will depart before F(p) + Trmax

“Packetized Generalized Processor Sharing (PGPS)”

Page 32: March 29

From Fluid to PacketsFrom Fluid to Packets Deviation : the fluid model (GPS) vs.(PGPS=WFQ)

How to minimize it?– Cannot interrupt packet transmission once started

Granularity in how transmission opportunities are allocated Inability to change decision even if higher priority (allocated rate)

packets arrive

Approach– Emulate the fluid system (GPS) as closely as possible

Desired transmission time is finish transmission time in fluid system Select packet with smallest finish transmission time in the fluid

system (assuming there would be no more arrivals after this time)

Page 33: March 29

Approximating GPS with WFQApproximating GPS with WFQ Fluid GPS system service order (ideal)

1 2 3 546

10

0 2 104 6 8 PGPS (also called Weighted Fair Queueing)

– select the first packet that finishes in GPS (service order)

1 2 3 4 5 6 7 8 9 10

Virtual Finish time 12 3 4 5

6,7,…

Page 34: March 29

Packetized GPS (Weighted Fair Queueing)Packetized GPS (Weighted Fair Queueing)

flow 1flow 2.. flow n

Cbuffer

GPS emulator thatdetermines virtual

departure times (VDT) ofpackets

arrival timesand packetlengths

VDTs of packets

Packets are transmitted inorder of their VDTs

Page 35: March 29

time

Cumulativebytes

A(t)D(t)

R

B(t)

Deterministic analysis of a Deterministic analysis of a router queuerouter queue

FIFO delay, d(t)

RA(t) D(t)

Model of router buffer

B(t)

D(t): Service process

A(t): Arrival process

Page 36: March 29
Page 37: March 29
Page 38: March 29
Page 39: March 29

Assume same packet size

If arrived and queue is available enque

Else drop

At every tick, if queue is not empty deque and send it

Example

25MBs computer and network

Router 2MBs in steady state

If IMB burst (40msec) , AveRate = 2MB

Rho = 2MB/s C = 1MB

25MB in 40msecCapacity 250KB

Allow token for 2MB/sec

Page 40: March 29

Want to speedup when large burst comes

Token/DeltaT

Save token in idle upto n

Never discard packet-regulate

host

Page 41: March 29

Token capacity = 250KB

Token arrives at the rate of 2MB/sec

Assume token is full when 1MB burst arrives

40ms? NO

C+rhoS= MS

S = C/(M-rho)

250KB/(25MB/sec-2MB/sec)

250/(23)sec is about 11sec

Page 42: March 29

Resource ResrvationPacket SchedulingAnd Integrated Service

Page 43: March 29
Page 44: March 29
Page 45: March 29
Page 46: March 29
Page 47: March 29
Page 48: March 29
Page 49: March 29
Page 50: March 29
Page 51: March 29
Page 52: March 29
Page 53: March 29
Page 54: March 29
Page 55: March 29
Page 56: March 29
Page 57: March 29
Page 58: March 29
Page 59: March 29
Page 60: March 29
Page 61: March 29
Page 62: March 29
Page 63: March 29
Page 64: March 29
Page 65: March 29
Page 66: March 29
Page 67: March 29
Page 68: March 29
Page 69: March 29

BGP – The Exterior Gateway Routing BGP – The Exterior Gateway Routing ProtocolProtocol

Page 70: March 29