Sei sulla pagina 1di 49

Packet Scheduling

Survey and Tutorial


Guansong Zhang
EL938 Report

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 ? Output buffered and shared memory switches (routers) dominate Transmission links (especially long haul links) are scare resources
Guansong Zhang Page 2

A popular topic in 1990s

04/15/02

Where is Packet Scheduling ?


Inside a network: Switches & Routers Inside a switch or a router:
Input buffer Output buffer Shared memory

Packet scheduling is necessary when multiple packets compete for a common outgoing link
04/15/02 Guansong Zhang Page 3

Why Packet Scheduling


Required by both IntServ & DiffServ model Quality of Service (QoS) control:
Delay Delay jitter Bandwidth Fairness
04/15/02 Guansong Zhang Page 4

A General Structure Inside a Router

Switch Fabric

04/15/02

Speedup factor 1~N


Guansong Zhang Page 5

Basic Model of Packet Scheduler


Output Buffered Switches Multiple flows (sessions, connections) Single server Service discipline:
Different packet scheduling algorithms

04/15/02

Guansong Zhang

Page 6

Classification of Packet Schedulers


A general classification
Work-conserving
The server is never idle when a packet is buffered in the system The server could be idle even there are buffered packet in the system

non-work-conserving

Based on internal architecture:


Sorted-priority Frame-based

04/15/02

Guansong Zhang

Page 7

Classification of Packet Schedulers


Sorted-priority
A system potential (a global variable) is updated each time a packet arrives or departs A timestamp is computed as a function of the system potential for each packet Packets are sorted and transmitted based on their timestamps Time is split into frames of fixed or variable length Each session makes a reservation in terms of maximum traffic it is allowed to transmit during a frame period The reservation is made according to a sessions allocated rate
Guansong Zhang Page 8

Frame-based

04/15/02

Several Well-known Schedulers


Round-robin
Weighted round-robin Deficit round-robin

Generalized processor sharing (GPS) Weighted fair queueing (P-GPS) Virtual clock Self-clocked fair queueing
04/15/02 Guansong Zhang Page 9

Round-robin Schedulers
Basic scheme: serve all backlogged sessions in a round-robin fashion Weighted round-robin (fixed-length packets):

Deficit round-robin (variable-length packets):

Time is divided into frames Each sessions is assigned a weight in terms of number of packets that could be served during a frame A counter is maintained for each session to record the number of packets that have been served during the current frame Each session is assigned a weight in terms of number of bits (or bytes)
Guansong Zhang Page 10

04/15/02

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:
04/15/02 Guansong Zhang Page 11

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 scheduler The timestamp TSi associated with the k-th packet arriving at t of flow i is calculated as:

04/15/02

Guansong Zhang

Page 12

Virtual Clock Scheduler


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

VC achieves worst-case delay for a leaky-bucket controlled session comparable to WFQ However, VC can not bound short-term unfairness
04/15/02 Guansong Zhang Page 13

Self-clocked Fair Queueing


SCFQ is another packetized approximation of GPS scheduler with low implementation complexity V(t) is defined as the timestamp TScur of the packet currently in service The timestamp of an arrival packet is calculated as: SCFQ achieves short-term fairness better than WFQ However, the worst-case delay is proportional to the number of sessions in the scheduler
04/15/02 Guansong Zhang Page 14

Latency-Rate Servers
LR-server defines a general class of schedulers Each specific scheduler S that belongs to LRserver is only characterized by a parameter S, named latency LR-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.

04/15/02

Guansong Zhang

Page 15

Example: A Network of LR-Servers


E
Session i

C B F D

A i

04/15/02

Guansong Zhang

Page 16

Definition of LR-Servers
Assumption:
Non-cut-through server Ai(, 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 idle Backlogged 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)

04/15/02

Guansong Zhang

Page 17

Definition of LR-Servers
Session 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 rate This definition facilitates LR-servers to be able to analyze a broad range of schedulers

04/15/02

Guansong Zhang

Page 18

Definition of LR-Servers
A 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,
S S W i , j ( , t ) max(0, i (t i )) iS is the minimum non-negative number that satisfies the above inequality The right-hand side of the above equation defines an envelope to bound the minimum service offered to session i during a busy period
04/15/02 Guansong Zhang Page 19

An example of the behavior of an LR server

04/15/02

Guansong Zhang

Page 20

Analysis of a Single LR Server


Assumption:
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 + ii Delay: Di i/i + i Output traffic conforms to (i + ii , i)
Guansong Zhang

04/15/02

Page 21

Analysis of a network of LR Servers


Session i passes through a chain of LR servers in the network Result 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:

04/15/02

Guansong Zhang

Page 22

Analysis of a network of LR Servers


Result 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
04/15/02 Guansong Zhang Page 23

Fairness of LR Servers
Normalized service: Wi(,t)/i A scheduler is perfectly fair if, For a packetized scheduler, it is close to fair if, This definition originated from SCFQ paper
04/15/02 Guansong Zhang

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

|Wi(,t)/i - Wj(,t)/j| FS FS is a constant, named fairness of server S

Page 24

Example: Unfairness of VirtualClock Scheduler


Two sessions and each one is allocated half of bandwidth Each packet is unity length Service rate is unity VirtualClock cannot bound fairness, if the traffic burstiness is unbounded
04/15/02 Guansong Zhang Page 25

Characteristic of Several Schedulers

04/15/02

Guansong Zhang

Page 26

Design Objectives of a Fair Queueing Algorithm

Delay (latency) and burstiness comparable to WFQ Simple timestamp computation


The complexity of WFQ is O(V), not good

Bounded fairness (comparable to SCFQ) Introduce another class of schedulers, named Rate Proportional Server (RPS)
Latency comparable to WFQ
04/15/02 Guansong Zhang Page 27

RPS Potential Function


A 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

04/15/02

Guansong Zhang

Page 28

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)

04/15/02

Guansong Zhang

Page 29

How About Potentials of Idle Sessions ?


Ideally, the Pi(t) of an idle session must increase in the same way as it were backlogged Introduce system potential, P(t), that keeps track of the total work done by the scheduler Update Pi(t) with P(t) when session I becomes backlogged to account for the service it missed Generally, P(t) can be defined as a non-decreasing function of Pi(t-) and t,
P(t) = f(Pi(t-), t), i=1..V GPS: P(t) = Pi(t) VirtualClock: P(t) = t
04/15/02 Guansong Zhang Page 30

An Interesting Illustration

04/15/02

Guansong Zhang

Page 31

RPS Definition (Fluid Model)


A rate proportional server has the following properties:
Sum of i r Properties of Pi(t)
Remain constant when not backlogged Pi(t) = max( Pi(t-), P(t) ), when become backlogged Pi(t) = Pi() + Wi(,t) / i P(t2) P(t1) t2 t1 P(t) min (Pj(t)), where jB(t)
04/15/02 Guansong Zhang Page 32

Conditions for P(t)

RPS Definition (contd)


Service discipline:
Among the backlogged connections, only the set of connections with the minimum potential at time t is served Each 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


04/15/02 Guansong Zhang

Page 33

Illustration of the Evolution of Potential Functions in RPS

04/15/02

Guansong Zhang

Page 34

Packetized RPS (PRPS)


A PRPS is defined in terms of the fluidmodel as one that transmits packets in increasing order of their finishing potential Finishing potential of a packet of session i equals to Pi(t), where t is time when the packet finishes service in the fluid server Finishing potential is used to timestamp the arrival packet
04/15/02 Guansong Zhang Page 35

Difference Bound Between PRPS & RPS


For all packets in PRPS, At any time t, At any time t,

04/15/02

Guansong Zhang

Page 36

Delay Analysis of PRPS


A PRPS is an LR server with latency:

The latency of PRPS is the same as that of WFQ

04/15/02

Guansong Zhang

Page 37

Fairness Analysis of PRPS


The choice of system potential function has a significant influence on the fairness of service provided to the sessions PRPS guarantee the average service offered to each session, implying it is a long term concept However, 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)
04/15/02 Guansong Zhang Page 38

Fairness Analysis of PRPS (contd)


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,

04/15/02

Guansong Zhang

Page 39

Fairness Analysis of PRPS (contd)


Extend the above result to PRPS,

Ci is defined as,

04/15/02

Guansong Zhang

Page 40

Fair RPS (FRPS)


It can be seen from above that the fairness of an RPS is determined by the choice of the system potential function The definition of fair RPS:

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)
04/15/02 Guansong Zhang Page 41

A finite constant P can be found such that: P(t) Pi(t) P, for any iB(t)

Base Potential Function


A base potential function SP(t) is a nondecreasing 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
04/15/02 Guansong Zhang Page 42

Construction of FRPS
During a system-busy period, the function P(t) is a piecewise linear function of time t At time 0< 1< < k, the system potential is updated as: At any time t between update, The interval between updates is bounded,
j+1 - j T P(t) = P(j) + (t- j), j<t<j+1 P(j) = max( P(j-), SP(j) )

04/15/02

Guansong Zhang

Page 43

Two examples of FRPS


Frame-based fair queueing (FFQ)
SP(t) = k x T

Starting potential fair queueing (SPFQ)


SP(t) = min{Si(t)} iB(t)
04/15/02 Guansong Zhang Page 44

Properties of SPFQ
Fairness 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

04/15/02

Guansong Zhang

Page 45

Topics Remained to be Discussed


How to achieve better fairness ?
Worst-case fair Weighted Fair Queuing (WF2Q) and WF2Q+ Shaped RPS

Introduce another fairness measurement, named worst-case fair index (WFI) E.g. shaped VirtualClock & shaped SPFQ

How to support difference class of service simultaneously ?


Hierarchical packet fair queueing (H-PFQ)
Guansong Zhang

04/15/02

Page 46

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

04/15/02

Guansong Zhang

Page 47

Reference (contd)
S. Golestani A selfclocked fair queueing scheme for broadband applications, in Proceedings of IEEE INFOCOM, April 1994 M. 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, 1996 J. C. R. Bennett and H. Zhang, Hierarchical packet fair queueing algorithms, in IEEE/ACM Tran. on Networking, Oct 1997 D. Stiliadis and A. Varma, A general methodology for design efficient traffic scheduling and shaping algorithms, in Proc. IEEE INFOCOM, Apr 1997 F. M. Chiussi and A. Francini, A distributed scheduling architecture for scalable packet switches, in IEEE JSAC, Dec 2000

04/15/02

Guansong Zhang

Page 48

Questions & Comments ? Thank you

49

Potrebbero piacerti anche