Scheduling per QoS - sti.uniurb.it Didattico/QoS Scheduling.pdfSistemi di Comunicazioni Multimediali...
Transcript of Scheduling per QoS - sti.uniurb.it Didattico/QoS Scheduling.pdfSistemi di Comunicazioni Multimediali...
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 1/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 1
Scheduling for QoS Management
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 2/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 2
Outline
• What is Queue Management and Scheduling?
• Goals of schedul ing• Fairness (Conservation Law/Max-min fair
share)• Various schedul ing techniques• Research di rections in scheduling
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 3/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 3
What is Scheduling?
• Packets from multiple flows compete for same outgoing link
• Which packets should be given preference?
• How many packets should be transmi tted from a flow?
• Simple solution: First come best served• Complex solution: Provide QoS
guarantees
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 4/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 4
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 5/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 5
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 6/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 6
Conservation Law• Definition: Sum of the mean queuing delays received by the set of
multiplexed connections, weighted by their share of link’s load is independent of the scheduling discipline – Kleinrock
• Where:Constii
iii
N
iq
x
∑=
=
=
1ρ
λρ
flowsofnumber
scheduleratiflowoftimewaitmeani
iflowfrompacketsoftimeservicemeani
iflowofratearrivalmeani
iflowofnutilizatiomeani
Nqx
=
=
=
=
=
λρ
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 7/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 7
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 (tw,i) to each
• Another scheduling discipline– Mean queuing delay of i: tw,i= 0.5ms– What is the mean queuing delay for j (tw,j) ?
ρi =15/155, ρj =45/155;ρi * 1.0 + ρj * 1.0 = ρi * 0.5 + ρj * tw,j ;tw,j = 1.16
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 8/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 8
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 competing flow
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 9/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 9
Max-Min Fair Share• Let’s assume:
– 1, 2, …k competing f lows– Each demanding x1≤ x2 ≤ … ≤xk, where the total
resource is R unit• How it works:
– The flow with lowest demand (1) gets R/k unit– If R/k > x1, then R/k – x1 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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 10/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 10
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 11/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 11
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)
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 12/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 12
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 13/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 13
FCFS example
(a) No buffer occupied(b) Buffer full, packet dropped
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 14/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 14
Priority Queuing
• Multiple queues with priority 0 to n-1• Priority 0 served fi rst• 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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 15/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 15
Priority Queue example
The number of queues depends on the supported priority levels of the protocol
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 16/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 16
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/Kth of a
share of max-min resource– Achieves also max -min weighted f air share
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 17/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 17
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 ith 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:
)(/)(),,(/),,( jitjRtiR ϖϖττ ≥
τ
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 18/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 18
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 19/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 19
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 dif ferential treatment or specif ic
allocation of bandwidth to specif ic queues
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 20/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 20
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 21/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 21
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 4500MTU– 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)
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 22/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 22
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 23/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 23
DRR Example 1
Quantum = 500 for all queues (may have different quantum for each queue)
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 24/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 24
DRR Example 2
Packet 1 of q1 gets served (500 ≥ 500) => deficit counter = 0Packet 1 of q3 gets served (500 ≥ 200) => deficit counter = 300Packet 1 of q4 gets served (500 ≥ 400) => counter = 0
Reset, no outstanding packetsNo accumulate credits for a long period)
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 25/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 25
DRR Example 3
Packet 2 of q1 not served (500 < 700) => deficit counter = 500Packet 2 of q3 gets served (300+500 > 500)=> deficit counter = 300
Outstanding 400 bytes packet (packet 3)
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 26/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 26
DRR Example 4
Packet 3 of q1 gets served (500 + 500 > 700) => deficit counter = 0Packet 3 of q3 gets served (300 + 500 > 400) => deficit counter = 0
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 27/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 27
Deficit Round Robin
• Set the quantum to serve at l east an MTU of the link– Ex 1500 bytes for Ethernet
• Fairness problem at smal ler time scale– Shorter than a packet time
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 28/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 28
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 calculat ion• Hard to implement with variable packet size• QoS guarantees possible (get s bandwidth in
proportion of weight)∑= )(/)( jwiRwThroughputMin
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 29/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 29
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 bi packets arrive for a flow of class i. Last packet to complete service will suffer a maximum delay of dmax given by equation
∑= ))(/)(/(max jwiRwbd i
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 30/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 30
WFQ Delay with Token bucket
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 31/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 31
WFQ - Finish Time Calculation
• Following equation shows the fi nish time calculation where R(t) is called round number. Pc
m is the time required to transmit mth packet from cth connection and w(c) is the weight of connecti on c.
)(/))(,max( 1)( cwPtRFF cm
cmm
c += −
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 32/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 32
WFQ - Round Number
• This is the number a bit-by-bit round robin scheduler (in place of GPS’s 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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 33/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 33
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
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 34/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 34
WFQ – Example
• Finish time calculat ion– P1: F1
i = max(0, 0.0) + 2 = 2, where R(0) = 0, f irst– P2: F1
j = max(0, 1.0) + 2 = 3, where R(1) = 1, f irst– P3: F2
i= max(2, 1.5) + 3 = 5, where R(2) = 1.5, F1i = 2
– P4: F2j = max(3, 1.5) + 1 = 4, where R(2) = 1.5, F1
j = 3– P5: F1
k = max(0, 2.0) + 4 = 6, where R(3) = 2.0, first– P6: F3
i = max(5, 2.33) + 1 = 6, where R(4) = 2.33, F2i
= 5• Rate of round number is controlled by number of
active connections
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 35/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 35
WFQ – Round Number Calculation
• Iterated deletion problem– Inaccurate estimation of active connections– Done for every packet arrival
0
1
2
3
4
5
6
7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Legal Informatics – Computer law01 (Information Society
Domenico Condello isti information science and technology institute 36/number
Università degli studi di Urbino “Carlo Bo”Informatica ApplicataSistemi di Comunicazioni Multimediali
Massimo Parrucci Facoltà di Scienze e Tecnologie 36
Class Based Queuing