190 likes | 328 Views
CprE 458/558: Real-Time Systems. Real-Time Networks – WAN Packet Scheduling. Scheduler. Ensuring bandwidth (and delay), and buffer guarantees to connections Determining the service order among packets from different connections
E N D
CprE 458/558: Real-Time Systems Real-Time Networks – WAN Packet Scheduling CprE 458/558: Real-Time Systems (G. Manimaran)
Scheduler • Ensuring bandwidth (and delay), and buffer guarantees to connections • Determining the service order among packets from different connections • Scheduling algorithm has an associated admission control that is used during channel setup CprE 458/558: Real-Time Systems (G. Manimaran)
Scheduler requirements • Fairness – achieving fairness among competing flows • Performance bounds for the guaranteed flows • Efficiency -- schedulability • Protection – guarantees of well-behaving flows are protected from ill-behaving flows • Flexibility – accommodating a diverse mix of traffic class and rates • Ease of implementation – high speed implementation CprE 458/558: Real-Time Systems (G. Manimaran)
Fairness and Max-Min Fairness • Fairness • Providing equal share of the resource to all the flows • The notion of fairness is obvious if all the flows demand equal share of the resource • Typically different flows exhibit varying resource demands. The notion of Max-min fairness is employed in such situations CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min Fairness • Basic Idea: A fair share allocates • a source with a small demand what it wants, and evenly distributes unused resources to the big sources • Formally, max-min fair share allocation is defined as: • Resources are allocated in order of increasing demands • No source gets a resource share larger than its demands • Sources with unsatisfied demands get an equal share of the resource CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min Fairness: Example Four incoming flows with their corresponding demands Max-Min Scheduler 2 Output Link 2.6 10 4 5 The max-min fairness allocation proceeds in several rounds CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min Fairness: Example (1) • Round #1: Tentatively divide the resource (output bandwidth) into four equal portions of size 10 / 4 = 2.5 • Allocation = [2.5, 2.5, 2.5, 2.5] • Round #2: Deduct the excess resource allocation and redistribute equally among others CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min Fairness: Example (2) • Source 1’s demand is only 2.0 so deduct (2.5 - 2.0 = 0.5) and distribute the remaining amount of (0.5 / 3 = 0.167) to each of the rest three • Allocation = [2.0, 2.67, 2.67, 2.67] • Source 2’s demand is only 2.6 so deduct (2.67 - 2.6 = 0.07) and distribute the remaining amount of (0.07 / 2) to each of the rest two • Final Allocation = [2.0, 2.6, 2.7, 2.7] CprE 458/558: Real-Time Systems (G. Manimaran)
Working of the example [2.5, 2.5, 2.5, 2.5] Flow 1 has excess = 0.5 add (0.5 / 3) to each of the rest [2.0, 2.67, 2.67, 2.67] Flow 2 has excess = 0.07 add (0.07 / 2) to each of the rest [2.0, 2.6, 2.7, 2.7] CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min Fairness: Example Four incoming flows with their max-min resource (bandwidth) allocations / demands Max-Min Fairness Resource Allocation 2 / 2 Output Link 2.6 / 2.6 10 2.7 / 4 2.7 / 5 CprE 458/558: Real-Time Systems (G. Manimaran)
Weighted Max-Min Fairness • A max-min weighted fairness share is as follows • Resources are allocated in order of increasing demand, normalized by the weight • No source gets a resource share larger than its demand • Sources with unsatisfied demands get resource shares in proportion to their weights CprE 458/558: Real-Time Systems (G. Manimaran)
Weighted Max-Min Fairness: Example Four incoming flows with their corresponding demands Max-Min Scheduler W1 = 2.5 4 Output Link W2 = 4 2 16 W3 = 0.5 10 W4 = 1.0 4 The normalized weights are: [5, 8, 1, 2] Now pretend as if the number of flows are (5 + 8 + 1 + 2) = 16 instead of just 4 CprE 458/558: Real-Time Systems (G. Manimaran)
Working of the example • Divide the capacity into 16 equal parts • Flow 1’s share (capacity / 16) * 5 = (16 / 16) * 5 = 5 • Assign each flow an amount equal to its corresponding normalized weight • If there is excess allocation deduct it and redistribute it for the rest in a weighted manner CprE 458/558: Real-Time Systems (G. Manimaran)
Working of the example [5, 8, 1, 2] Flow 2 has excess = 6 Flow 1 has excess = 1 [4, 2, 3.33, 6.66] • We have to distribute excess “7” units among flows 3 and 4 • Their weights are 1 and 2 respectively • Therefore, flow 3 will get an additional share of (7/3) * 1 and flow 4 will get an additional share of (7/3) * 2 CprE 458/558: Real-Time Systems (G. Manimaran)
Working of the example [5, 8, 1, 2] Flow 2 has excess = 6 Flow 1 has excess = 1 [4, 2, 3.33, 6.66] Flow 4 has excess = 2.66 allocate it to flow 3 Final Allocation [4, 2, 6, 4] CprE 458/558: Real-Time Systems (G. Manimaran)
General Processor Sharing (GPS) or Fluid Flow Model for achieving Max-min Fairness Two incoming flows with their resource demands GPS Resource Allocation (Ideal, but Not practical) Output Link 5 10 5 The schedule (ideal, but not realizable in networks) 0 5 10 CprE 458/558: Real-Time Systems (G. Manimaran)
Max-Min fairness Approximation Two incoming flows with their resource demands Packetized GPS (Max-Min Fairness Approximation) Output Link 5 10 5 The schedule 5 units of time 5 units of time 0 5 10 CprE 458/558: Real-Time Systems (G. Manimaran)
A Simple Round Robin Scheduler • Cannot achieve max-min fairness • Need to handle weighted flows • Need to handle variable length packets Four incoming flows Round Robin Scheduler Output Link The schedule 0 CprE 458/558: Real-Time Systems (G. Manimaran)
Weighted Round Robin Scheduler Normalized weights are as follows: [2, 3, 1, 1] Four incoming flows with their corresponding weights Round Robin Scheduler 10 Output Link 15 5 5 • Cannot achieve max-min fairness • Need to handle variable length packets 0 CprE 458/558: Real-Time Systems (G. Manimaran)