packet scheduling

49
Packet Scheduling Survey and Tutorial Guansong Zhang EL938 Report

Upload: suresh-hakunamatata

Post on 26-Oct-2014

15 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Packet Scheduling

Packet Scheduling

Survey and Tutorial

Guansong Zhang

EL938 Report

Page 2: Packet Scheduling

04/15/02 Guansong Zhang Page 2

What is Packet Scheduling ?Multiple packets exist in a buffer and they share a common outgoing link:

What is the policy to choose a packet for service ?How does this policy affect the performance ?

A popular topic in 1990sOutput buffered and shared memory switches (routers) dominateTransmission links (especially long haul links) are scare resources

Page 3: Packet Scheduling

04/15/02 Guansong Zhang Page 3

Where is Packet Scheduling ?Inside a network: Switches & RoutersInside a switch or a router:

Input bufferOutput bufferShared memory

Packet scheduling is necessary when multiple packets compete for a common outgoing link

Page 4: Packet Scheduling

04/15/02 Guansong Zhang Page 4

Why Packet SchedulingRequired by both IntServ & DiffServ modelQuality of Service (QoS) control:

DelayDelay jitterBandwidthFairness

Page 5: Packet Scheduling

04/15/02 Guansong Zhang Page 5

A General Structure Inside a Router

Switch Fabric

11

…… … …

NN

Speedup factor 1~N

Page 6: Packet Scheduling

04/15/02 Guansong Zhang Page 6

Basic Model of Packet SchedulerOutput Buffered SwitchesMultiple flows (sessions, connections)Single serverService discipline:

Different packet scheduling algorithms

Page 7: Packet Scheduling

04/15/02 Guansong Zhang Page 7

Classification of Packet SchedulersA general classification

Work-conservingThe server is never idle when a packet is buffered in the system

non-work-conservingThe server could be idle even there are buffered packet in the system

Based on internal architecture:Sorted-priorityFrame-based

Page 8: Packet Scheduling

04/15/02 Guansong Zhang Page 8

Classification of Packet SchedulersSorted-priority

A system potential (a global variable) is updated each time a packet arrives or departsA timestamp is computed as a function of the system potential for each packetPackets are sorted and transmitted based on their timestamps

Frame-basedTime is split into frames of fixed or variable lengthEach session makes a reservation in terms of maximum traffic it is allowed to transmit during a frame periodThe reservation is made according to a session’s allocated rate

Page 9: Packet Scheduling

04/15/02 Guansong Zhang Page 9

Several Well-known SchedulersRound-robin

Weighted round-robinDeficit round-robin

Generalized processor sharing (GPS)Weighted fair queueing (P-GPS)Virtual clockSelf-clocked fair queueing

Page 10: Packet Scheduling

04/15/02 Guansong Zhang Page 10

Round-robin SchedulersBasic scheme: serve all backlogged sessions in a round-robin fashionWeighted round-robin (fixed-length packets):

Time is divided into framesEach sessions is assigned a weight in terms of number of packets that could be served during a frameA counter is maintained for each session to record the number of packets that have been served during the current frame

Deficit round-robin (variable-length packets):Each session is assigned a weight in terms of number of bits (or bytes)

Page 11: Packet Scheduling

04/15/02 Guansong Zhang Page 11

Generalized Processor Sharing

GPS is an ideal scheduling discipline with respect to a fluid-model:

The minimum service that a connection can receive in any interval of time is:

Page 12: Packet Scheduling

04/15/02 Guansong Zhang Page 12

Weighed Fair Queueing (P-GPS)WFQ is the Packetized version of GPS defined in terms of a system potential (virtual time) V(t):

Maintaining V(t) requires a GPS system is simulated in parallel with the WFQ schedulerThe timestamp TSi associated with the k-th packet arriving at t of flow i is calculated as:

Page 13: Packet Scheduling

04/15/02 Guansong Zhang Page 13

Virtual Clock SchedulerVC is proposed before GPS but can be looked as an approximation of GPSVirtual time V(t) is define as real time tThus, the timestamp of a packet is defined as:

VC achieves worst-case delay for a leaky-bucket controlled session comparable to WFQHowever, VC can not bound short-term unfairness

Page 14: Packet Scheduling

04/15/02 Guansong Zhang Page 14

Self-clocked Fair QueueingSCFQ is another packetized approximation of GPS scheduler with low implementation complexityV(t) is defined as the timestamp TScur of the packet currently in serviceThe timestamp of an arrival packet is calculated as:

SCFQ achieves short-term fairness better than WFQHowever, the worst-case delay is proportional to the number of sessions in the scheduler

Page 15: Packet Scheduling

04/15/02 Guansong Zhang Page 15

Latency-Rate ServersLR-server defines a general class of schedulersEach specific scheduler S that belongs to LR-server is only characterized by a parameter θS, named latencyLR-server provides a convenient way to analyze the worst-case behaviors, such as delay, buffer requirement, and internal burstiness in an arbitrary topology network where a broad range of schedulers are employed.

Page 16: Packet Scheduling

04/15/02 Guansong Zhang Page 16

Example: A Network of LR-Servers

AB

C

D

E

F

ρi

Session i

Page 17: Packet Scheduling

04/15/02 Guansong Zhang Page 17

Definition of LR-ServersAssumption:

Non-cut-through serverAi(τ, t) and Wi(τ, t) are increased only when the last bit of a packet arrives/leaves the server

System busy period: a maximal interval of time during which the server is never idleBacklogged period for session i: any period of time during which packets belonging to that session are continuously queued in the system

Define Qi(t) = Ai(0, t) – Wi(0,t)

Page 18: Packet Scheduling

04/15/02 Guansong Zhang Page 18

Definition of LR-ServersSession i busy period: a maximal interval of time (τ1,τ2] such that for any time t∈(τ1,τ2], Ai(τ1,t) ≥ρi(t- τ1)

Note that a session busy period is only related to the arrival traffic and allocated rateThis definition facilitates LR-servers to be able to analyze a broad range of schedulers

Page 19: Packet Scheduling

04/15/02 Guansong Zhang Page 19

Definition of LR-ServersA server S belongs in the class LR if and only if all times t after time τ that the jth busy period of session i started and until the packets that arrived during this period are serviced,

))(,0max(),(, θτρτ Sii

Sji ttW −−≥

is the minimum non-negative number that satisfies the above inequalityThe right-hand side of the above equation defines an envelope to bound the minimum service offered to session i during a busy period

θ Si

Page 20: Packet Scheduling

04/15/02 Guansong Zhang Page 20

An example of the behavior of an LR server

Page 21: Packet Scheduling

04/15/02 Guansong Zhang Page 21

Analysis of a Single LR ServerAssumption:

Input traffic of session I is leaky-bucket smoothed, Ai(τ,t) ≤ σi+ρi(t-τ)Allocated rate is at least equal to the average arrival rate

If S is an LR server, the following bounds must hold:

Backlog: Qi(t) ≤ σi + ρiθiDelay: Di ≤ σi/ρi + θiOutput traffic conforms to (σi + ρiθi , ρi)

Page 22: Packet Scheduling

04/15/02 Guansong Zhang Page 22

Analysis of a network of LR ServersSession i passes through a chain of LR servers in the networkResult I: The output traffic of the kth server conforms to a leaky bucket process with parameters:

Result II: The maximum backlog in the kth node of a session is bounded as:

Page 23: Packet Scheduling

04/15/02 Guansong Zhang Page 23

Analysis of a network of LR ServersResult III: The maximum delay of a session I in a network of LR servers, consisting of K servers in series, is bounded as:

It is interesting to notice that the results from a series of LR servers is the same as that from a single LR server with a latency that equals to the sum of the formers

Page 24: Packet Scheduling

04/15/02 Guansong Zhang Page 24

Fairness of LR ServersNormalized service: Wi(τ,t)/ρiA scheduler is perfectly fair if,

|Wi(τ,t)/ρi - Wj(τ,t)/ρj| = 0E.g. GPS is perfectly fair

For a packetized scheduler, it is close to fair if,

|Wi(τ,t)/ρi - Wj(τ,t)/ρj| ≤ FS

FS is a constant, named fairness of server SThis definition originated from SCFQ paper

Page 25: Packet Scheduling

04/15/02 Guansong Zhang Page 25

Example: Unfairness of VirtualClock Scheduler

Two sessions and each one is allocated half of bandwidthEach packet is unity lengthService rate is unityVirtualClock cannot bound fairness, if the traffic burstiness is unbounded

Page 26: Packet Scheduling

04/15/02 Guansong Zhang Page 26

Characteristic of Several Schedulers

Page 27: Packet Scheduling

04/15/02 Guansong Zhang Page 27

Design Objectives of a Fair Queueing Algorithm

Delay (latency) and burstiness comparable to WFQSimple timestamp computation

The complexity of WFQ is O(V), not goodBounded fairness (comparable to SCFQ)Introduce another class of schedulers, named Rate Proportional Server (RPS)

Latency comparable to WFQ

Page 28: Packet Scheduling

04/15/02 Guansong Zhang Page 28

RPS – Potential FunctionA function represents the state of each connection in a scheduler, named potential, Pi(t)The potential of a connection is a non-decreasing function of time during a system-busy period

All potentials can be initialized to zero at the beginning of a system-busy period

Pi(t) increases exactly by the normalized service session i received when it is backlogged

Pi(t) – Pi(τ) = Wi(t, τ) / ρi

Page 29: Packet Scheduling

04/15/02 Guansong Zhang Page 29

Why Potential Functions ?A fair algorithm must attempt to increase the potentials of all backlogged connections at the same rate, in another word, equalize the potential of each connection

E.g. all sorted-priority schedulers (GPS, WFQ, VirtualClock, SCFQ)

Page 30: Packet Scheduling

04/15/02 Guansong Zhang Page 30

How About Potentials of Idle Sessions ?

Ideally, the Pi(t) of an idle session must increase in the same way as it were backloggedIntroduce system potential, P(t), that keeps track of the total work done by the schedulerUpdate Pi(t) with P(t) when session I becomes backlogged to account for the service it missedGenerally, P(t) can be defined as a non-decreasing function of Pi(t-) and t,

P(t) = f(Pi(t-), t), i=1..VGPS: P(t) = Pi(t)VirtualClock: P(t) = t

Page 31: Packet Scheduling

04/15/02 Guansong Zhang Page 31

An Interesting Illustration

Page 32: Packet Scheduling

04/15/02 Guansong Zhang Page 32

RPS – Definition (Fluid Model)A rate proportional server has the following properties:

Sum of ρi ≤ rProperties of Pi(t)

Remain constant when not backloggedPi(t) = max( Pi(t-), P(t) ), when become backloggedPi(t) = Pi(τ) + Wi(τ,t) / ρi

Conditions for P(t)P(t2) – P(t1) ≥ t2 – t1P(t) ≤ min (Pj(t)), where j∈B(t)

Page 33: Packet Scheduling

04/15/02 Guansong Zhang Page 33

RPS – Definition (cont’d)Service discipline:

Among the backlogged connections, only the set of connections with the minimum potential at time t is servedEach connection in this set is served with an instantaneous rate proportional to its reservation, so as to increase the potentials of the connections in this set at the same rate

It is proved that RPS is LR with zero latency

Page 34: Packet Scheduling

04/15/02 Guansong Zhang Page 34

Illustration of the Evolution of Potential Functions in RPS

Page 35: Packet Scheduling

04/15/02 Guansong Zhang Page 35

Packetized RPS (PRPS)A PRPS is defined in terms of the fluid-model as one that transmits packets in increasing order of their finishing potentialFinishing potential of a packet of session i equals to Pi(t), where t is time when the packet finishes service in the fluid serverFinishing potential is used to timestamp the arrival packet

Page 36: Packet Scheduling

04/15/02 Guansong Zhang Page 36

Difference Bound Between PRPS & RPS

For all packets in PRPS,

At any time t,

At any time t,

Page 37: Packet Scheduling

04/15/02 Guansong Zhang Page 37

Delay Analysis of PRPSA PRPS is an LR server with latency:

The latency of PRPS is the same as that of WFQ

Page 38: Packet Scheduling

04/15/02 Guansong Zhang Page 38

Fairness Analysis of PRPSThe choice of system potential function has a significant influence on the fairness of service provided to the sessionsPRPS guarantee the average service offered to each session, implying it is a long term conceptHowever, if the system potential lags far behind the potential of backlogged sessions, PRPS may penalized sessions for service received in excess of their reservation at an earlier time (e.g. VirtualClock Scheduler)

Page 39: Packet Scheduling

04/15/02 Guansong Zhang Page 39

Fairness Analysis of PRPS (cont’d)If the system potential function in a RPS never lags behind more than a finite amount ∆P from the potential of the connections that are served in the system, the difference in normalized service offered to any two connections during any interval of time that they are continuously backlogged is also bounded by ∆P, that is,

Page 40: Packet Scheduling

04/15/02 Guansong Zhang Page 40

Fairness Analysis of PRPS (cont’d)

Extend the above result to PRPS,

Ci is defined as,

Page 41: Packet Scheduling

04/15/02 Guansong Zhang Page 41

Fair RPS (FRPS)It can be seen from above that the fairness of an RPS is determined by the choice of the system potential functionThe definition of fair RPS:

A finite constant ∆P can be found such that: P(t) ≥ Pi(t) – ∆P, for any i∈B(t)

The above constraint can be satisfied by the use of a re-calibration mechanism periodically to bound the maximum difference between P(t) and Pi(t)

Page 42: Packet Scheduling

04/15/02 Guansong Zhang Page 42

Base Potential FunctionA base potential function SP(t) is a non-decreasing function with the following properties:

Any RPS server can achieve bounded fairness by periodically re-calibrating the system potential using the base potential function, if the interval between re-calibration is bounded

Page 43: Packet Scheduling

04/15/02 Guansong Zhang Page 43

Construction of FRPSDuring a system-busy period, the function P(t) is a piecewise linear function of time tAt time τ0< τ1< … < τk, the system potential is updated as:

P(τj) = max( P(τj-), SP(τj) )At any time t between update,

P(t) = P(τj) + (t- τj), τj<t<τj+1

The interval between updates is bounded,τj+1 - τj≤ ∆T

Page 44: Packet Scheduling

04/15/02 Guansong Zhang Page 44

Two examples of FRPSFrame-based fair queueing (FFQ)

SP(t) = k x TStarting potential fair queueing (SPFQ)

SP(t) = min{Si(t)}i∈B(t)

Page 45: Packet Scheduling

04/15/02 Guansong Zhang Page 45

Properties of SPFQFairness of SPFQ, comparable to WFQ

According to the definition of SSPFQ(t), the complexity for system potential updating is O(logV), which is fine since at least O(logV) is necessary to do departure selection

Page 46: Packet Scheduling

04/15/02 Guansong Zhang Page 46

Topics Remained to be DiscussedHow to achieve better fairness ?

Worst-case fair Weighted Fair Queuing (WF2Q) and WF2Q+

Introduce another fairness measurement, named worst-case fair index (WFI)

Shaped RPSE.g. shaped VirtualClock & shaped SPFQ

How to support difference class of service simultaneously ?

Hierarchical packet fair queueing (H-PFQ)

Page 47: Packet Scheduling

04/15/02 Guansong Zhang Page 47

Reference[1] D. Stiliadis and A. Varma, "Latency-Rate Servers: A General Model for Analysis of Traffic Scheduling Algorithms" in IEEE/ACM Transactions on Networking, October 1998[2] D. Stiliadis and A. Varma, ”Rate Proportional Servers: A Design Methodology for Fair Queueing Algorithms," in IEEE/ACM Transactions on Networking, April 1998[3] D. Stiliadis and A. Varma, ``Efficient Fair Queueing Algorithms for Packet Switched Networks," in IEEE/ACM Transactions on Networking, April 1998[4] A. K. Parekh and R. G. Gallager “A generalized processor sharing approach to flow control: the single node case,” in Proc. of IEEE INFOCOM, May 1992[5] L. Zhang, “Virtual clock: a new traffic control algorithm for packet switching networks,” in Proc. ACM SIGCOMM, Sep 1990

Page 48: Packet Scheduling

04/15/02 Guansong Zhang Page 48

Reference (cont’d)S. Golestani “A selfclocked fair queueing scheme for broadband applications,” in Proceedings of IEEE INFOCOM, April 1994M. Shreedhar and G. Varghese “Ecient fair queueing using deficit round robin,” in Proceedings of ACM SIGCOMM, Sep 1995

J. C. R. Bennett and H. Zhang, “WF2Q: worst-case fair weighted fair queueing,” in Proceeding of IEEE INFOCOM, Mar, 1996J. C. R. Bennett and H. Zhang, “Hierarchical packet fair queueing algorithms,” in IEEE/ACM Tran. on Networking, Oct 1997D. Stiliadis and A. Varma, “A general methodology for design efficient traffic scheduling and shaping algorithms,” in Proc. IEEE INFOCOM, Apr 1997F. M. Chiussi and A. Francini, “A distributed scheduling architecture for scalable packet switches,” in IEEE JSAC, Dec 2000

Page 49: Packet Scheduling

49

Questions & Comments ?

Thank you ☺