Scheduling for QoS Management Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 1/number 1
Outline What is Queue Management and Scheduling? Goals of scheduling Fairness (Conservation Law/Max-min fair share) Various scheduling techniques Research directions in scheduling Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 2/number 2
What is Scheduling? Packets from multiple flows compete for same outgoi ng link Which packets shoul d be given preference? How many packets shoul d be transmitted from a flow? Simple solution: First come best served Complex solution: Provide QoS guarantees Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 3/number 3
Scheduling Goals Sharing bandwidth Fairness to competing flows Meeting bandwidth guarantees (max and min) Meeting loss guarantees (mul tiple level) Meeting delay guarantees (mul tiple level) Reducing delay variations Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 4/number 4
Some Definitions Flow Packets sharing the same source and destination address, source and destination port, same protocol identification are considered to belong to a flow Work conserving scheduler It is not idle when any of the queues has a packet waiting to be served A server can remain idle wasting bandwidth to reduce burstiness of traffic while entering a downstream network element A work conserving server follows the conservation low Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 5/number 5
Conservation Law Definition: Sum of the mean queuing delays received by the set of multiplexed connections, weighted by their share of links load is independent of the scheduling discipline Kleinrock ρ i = λ i x i Where: ρi λ x q i i i N N i = 1 ρ i q i = Const = mean utilization of flow i = mean arrival rate of flow i = mean service time of packets from flow i = mean wait time of flow i at scheduler = number of flows Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 6/number 6
Example of Conservation Low A flow can receive lower delay from a work conserving scheduler only at the expense of another flow Example: two sources i and j through a router i generates 15Mbps, j generates 45Mbps Outgoing link speed: 155Mbps FCFS scheduling Mean queuing delay of 1ms (t w,i ) to each Another scheduling discipline Mean queuing delay of i: t w,i = 0.5ms What is the mean queuing delay for j (t w,j )? ρ i =15/155, ρ j =45/155; ρ i * 1.0 + ρ j * 1.0 = ρ i * 0.5 + ρ j * t w,j ; t w,j = 1.16 Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 7/number 7
Max-Min Fair Share Scope Fair share allocat ion of resources How it works Allocates the smallest of all demands from all flows Distribute remaining resources equally competing of the flows This scheme guarantees that a fl ow either gets what it wants or it is not worse than any other competi ng flow Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 8/number 8
Max-Min Fair Share Lets assume: 1, 2, k competing flows Each demanding x 1 x 2 x k, where the total resource is R unit How it works: The flow with lowest demand (1) gets R/k unit If R/k > x 1, then R/k x 1 goes back to resource pool Remaining k-1 flows get additional R/k + (R/k x1)/(k- 1) The process iterates until: All resources are exhausted All demands have been met Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 9/number 9
Example of MMFS Consider: ATM network with outgoing link capacity of 155Mbps 5 competing sources with bandwidth: (1)23, (2)27, (3)35, (4)45, (5)55Mbps Initially The resource is divided equally: 155/5 = 31Mbps each The first (1) takes 31Mbps Then The remaining 8Mbps (31-23) are divided equally among the remaining 4 sources (2Mbps each), thus 33Mbps. The second source needs only 27Mbps, the residual 6 (33-27) are divided among the remaining 3 sources (2Mpbs each), thus 33+2=35Mpbs each The algorithm stops allocation since all of the sources need 35Mbps or more Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 10/number
Scheduling Disciplines First come first serve (FCFS) Priority (PQ) Round Robin (RR)/Weighed round robin Deficit round robin (DRR) Weighted fair queuing (WFQ) Class based queuing (CBQ) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 11/number
First Come First Serve Packets enqueued into a common buffer Server serves packet from front of queue No fair sharing of bandwidth A greedy source can occupy most of the queue and cause delay to other flows using the same queue TCP flows get penalized (congest ion sensitive) w.r.t. UDP (no congest ion control) No flow isolation No priority or QoS guarantee Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 12/number
FCFS example (a) No buffer occupied (b) Buffer full, packet dropped Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 13/number
Priority Queuing Multiple queues with priority 0 to n-1 Priority 0 served first Priority i served only if 0 to i-1 empty Highest priority lowest delay/loss, highest bandwidth Possible starvation of lower class FCFS can be used i n each queue Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 14/number
Priority Queue example The number of queues depends on the supported pri ority levels of the protocol Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 15/number
Generalized Processor Sharing Ideal work conserving scheme Flows kept in separate queue Serve infinitesimal amount of data from each queue Serve all active queues in f inite time Weight can be associat ed with each queue Each queue is served in proportion of its weight Achieves max-min fair share If there are K active flows, each one gets 1/K th of a share of max-min resource Achieves also max -min weighted f air share Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 16/number
Generalized Processor Sharing In GPS terminology, a connection is called backlogged when it has data present in queue Lets assume that there are K flows to be served by a server implementing GPS with weights τ ω(1),.. ω(k) Service rate of i th flow in interval [, t] is represented as R(i,,t). For any backlogged flow i in interval [,t] and for another flow j, the following equation holds: R( i, τ, t) / R( j, τ, t) ϖ ( i) / ϖ ( j) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 17/number
Generalized Processor Sharing Max-Min fair share is achieved by allocating the residual resource such that i t gets shared by the backlogged connection in proportion of its weight GPS is an ideal scheme, because i t serves an infinitesimal amount of data Variations can be implemented in real systems Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 18/number
Round Robin Flows kept in separate queues Serve one packet from each non-empty queue Can be seen as GPS where one packet replaces infinitesimal data Fair share Load balancing among f lows No advantage to being greedy What if packet size variable? No bandwidth guarantee Large packet queue gains more bandwidth (long time spent here) Not possible differential treatment or specific allocation of bandwidth to specif ic queues Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 19/number
Weighted Round Robin Modification to RR Allows variable length packet Serves n packet from a queue depending on a weight n adjusted to specif ic fraction of link share Assume 3 ATM sources (small cell size) wit h weights 0.75, 1.0 and 1.5. If these weights are normalised to integer values, each source will be served 3, 4 and 6 cells in each round Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 20/number
Weighted Round Robin Needs to know packet size a priori Large packets receive more than allocated weight Need to adjust weight depending on the mean packet size Example: Serial link 500MTU, ethernet 1500MTU and FDDI 4500MT U Weights: 0.33, 0.66, 1.0 Weight normalized with packet size: 6, 4, 2 packets Fairness problem at small time scale In the example above, W RR is not fair on a time scale of less than 9000 byte transmission time (72 µs at 1000Mbps) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 21/number
Deficit Round Robin Improves WRR Serves variable length packets No need to know packet size a priori How it works Initially serves each queue quantum (queue based) worth of bits if packet less than or equal to quantum, serve it else increment deficit_counter (queue based) by quantum If no more outstanding packet, reset deficit_counter (Why?) Set quantum to minimum MTU of all incoming links Serves more packets at a time if their size is less than the quantum Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 22/number
DRR Example 1 Quantum = 500 for all queues (may have different quantum for each queue) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 23/number
DRR Example 2 Packet 1 of q1 gets served (500 500) => deficit counter = 0 Packet 1 of q3 gets served (500 200) => deficit counter = 300 Packet 1 of q4 gets served (500 400) => counter = 0 Reset, no outstanding packets No accumulate credits for a long period) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 24/number
DRR Example 3 Packet 2 of q1 not served (500 < 700) => deficit counter = 500 Packet 2 of q3 gets served (300+500 > 500)=> deficit counter = 300 Outstanding 400 bytes packet (packet 3) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 25/number
DRR Example 4 Packet 3 of q1 gets served (500 + 500 > 700) => deficit counter = 0 Packet 3 of q3 gets served (300 + 500 > 400) => deficit counter = 0 Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 26/number
Deficit Round Robin Set the quantum to serve at l east an MTU of the link Ex 1500 bytes for Ethernet Fairness problem at smaller time scale Shorter than a packet time Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 27/number
Weighted Fair Queuing Packets tagged with a value identifying the time last bit of packet should be transmitted using GPS simulation Packet with lowest tag value transmitted by scheduler Uses complex finish time calculation Hard to implement with variable packet size QoS guarantees possible (get s bandwidth in proportion of weight) Min Throughput = Rw( i) / w( j) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 28/number
WFQ Delay Bounds Delay can be bounded if flows can be policed (token bucket) Flows regulated by token bucket are put in dif ferent queues Each queue has assigned weight With token bucket policing, assume that initially the token bucket is full and a burst of b i packets arrive for a flow of class i. Last packet to complete service will suffer a maximum delay of d max given by equation d max = bi /( Rw( i) / w( j)) Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 29/number
WFQ Delay with Token bucket Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 30/number
WFQ - Finish Time Calculation Following equation shows the fi nish time calculation where R(t) is called round number. P c m is the time required to transmit m th packet from c th connection and w(c) is the weight of connecti on c. F c = c m ( m) max( F ( )) / ( ) 1, R t + P w c c m Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 31/number
WFQ - Round Number This is the number a bit-by-bit round robin scheduler (in place of GPSs non-implementable infinitesimal data) has completed at a given time The round number is a variable that depends on number of active queues to be served (inversely proportional to the number of active queues). The more queues to serve, the longer a round will take to complete Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 32/number
WFQ Example Assume: Three equally weighted connections: i, j, k Link service rate = 1 unit/s Packet details: P1: arrival time 0, connection i, size = 2 units P2: arrival time 1, connection j, size = 2 units P3: arrival time 2, connection i, size = 3 units P4: arrival time 2, connection j, size = 1 units P5: arrival time 3, connection k, size = 4 units P6: arrival time 4, connection i, size = 1 units Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 33/number
WFQ Example Finish time calculation P1: F 1i = max(0, 0.0) + 2 = 2, where R(0) = 0, first P2: F 1j = max(0, 1.0) + 2 = 3, where R(1) = 1, first P3: F 2i = max(2, 1.5) + 3 = 5, where R(2) = 1.5, F 1i = 2 P4: F 2j = max(3, 1.5) + 1 = 4, where R(2) = 1.5, F 1j = 3 P5: F 1k = max(0, 2.0) + 4 = 6, where R(3) = 2.0, first P6: F 3i = max(5, 2.33) + 1 = 6, where R(4) = 2.33, F 2 i = 5 Rate of round number is controlled by number of active connections Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 34/number
WFQ Round Number Calculation 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Iterated deletion problem Inaccurate estimation of active connections Done for every packet arrival Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 35/number
Class Based Queuing Domenico Massimo Parrucci Condello isti information science Facoltà and di Scienze technology e Tecnologie institute 36/number