Presentation is loading. Please wait.

Presentation is loading. Please wait.

04/02/08 1 Packet Scheduling IT610 Prof. A. Sahoo KReSIT.

Similar presentations


Presentation on theme: "04/02/08 1 Packet Scheduling IT610 Prof. A. Sahoo KReSIT."— Presentation transcript:

1 04/02/08 1 Packet Scheduling IT610 Prof. A. Sahoo KReSIT

2 04/02/082 Packet Scheduling Responsible for enforcing resource allocation to individual flows Decides which packet should get resources Intuitively works like a dispatcher : it keeps track of how many packets each flow has sent and compares that with the amount of resources the flow has reserved. –Arriving packets from a flow are sent only when the flow has not used up the reserved resources

3 04/02/083 Basic Requirement Isolation and sharing: –Allow sharing of common resources in a controlled way –In circuit switched network full isolation, no sharing Under-utilization of resources –In datagram based internet (FCFS) resources are shared on a per-packet basis No isolation

4 04/02/084 Basic Requirement (Cont’d) ‏ Delay Bounds –Scheduler should provide some delay bound Either deterministic (guaranteed service) or statistical –Deterministic bounds give the best isolation –Statistical delay bound allow more efficient sharing, less isolation Bandwidth allocation –When there is a contention for resources, bw must be allocated fairly to all competing flows.

5 04/02/085 Types of scheduler Work Conserving –Scheduler is idle only when there are no packets waiting for transmission –Example : FCFS Non-work-conserving –Transmits packet when it is eligible for transmission –If no packets are eligible, scheduler will be idle even when there are packets in the queue. –Example : Rate controlled scheduler

6 04/02/086 Max-Min Fairness An allocation is fair if it satisfies max- min fairness –each connection gets no more than what it wants –the excess, if any, is equally shared

7 04/02/087 Max-Min Fairness N flows share a link of rate C. Flow f wishes to send at rate W(f), and is allocated rate R(f). Pick the flow, f, with the smallest W(f). If W(f) < C/N, then set R(f) = W(f). If W(f) > C/N, then set R(f) = C/N. Set N = N – 1. C = C – R(f). If N > 0 goto 1.

8 04/02/088 1 W(f 1 ) = 0.1 W(f 3 ) = 10 R1R1 C W(f 4 ) = 5 W(f 2 ) = 0.5 Max-Min Fairness: example Round 1: Set R(f 1 ) = 0.1 Round 2: Set R(f 2 ) = 0.9/3 = 0.3 Round 3: Set R(f 4 ) = 0.6/2 = 0.3 Round 4: Set R(f 3 ) = 0.3/1 = 0.3

9 04/02/089 Simple Priority scheduling Number of priority levels Packet is served from a given priority level only if no packets exist at higher levels (multilevel priority with exhaustive service) ‏ Higher priority will always have precedence over lower priority May lead to starvation of lower priority packets

10 04/02/0810 Deadline based scheduler Deadline based scheduler schedules packets based on the earliest deadline (EDF) principle. –Flow with lowest deadline gets scheduled first Delay and bw requirements are decoupled : flow requiring small bandwidth can get small delay. Admission control is more complex : has to do schedulability test and also make sure that total bw capacity is not exceeded

11 04/02/0811 Rate based scheduler Two components : regulator and a scheduler. Regulator determines eligibility time for the packet. The result is that the traffic is shaped by the regulator before it arrives at the scheduler. Examples : token bucket regulator Scheduler can do FCFS or fair queueing.

12 04/02/0812 Token bucket

13 04/02/0813 Round robin scheduling Scan class queues serving one from each class that has a non-empty queue –Assumption: Fixed packet length Pros and cons: –Provides Max-min fairness and Protection within contending flows –More complex than FIFO: per flow queue/state

14 04/02/0814 Weighted round robin Round robin: –Unfair if packets are of different length or weights are not equal Weighted round robin: –Serve more than one packet per visit –Number of packets are proportional to weights

15 04/02/0815 Weighted round robin W A =1.4 W B =0.2 W C =0.8 W A =7 W B =1 W C =4 Normalize Normalize the weights so that they become integer round length = 12

16 04/02/0816 Weighted RR – variable length packet If different connection have different packet size, then divide the weight of each connection with connection’s mean packet size before normalizing – weights {0.5, 0.75, 1.0}, –mean packet sizes {50, 500, 1500} –normalize weights: {0.5/50, 0.75/500, 1.0/1500} = { 0.01, 0.0015, 0.000666}, –normalize again {60, 9, 4}

17 04/02/0817 Generalized Processor Sharing For best effort service main requirement is fairness, protection. –GPS can provide fairness and protection. –Visit each non-empty queue in turn –Serve infinitesimal from each –GPS is not implementable; we can serve only packets

18 04/02/0818 GPS Generalized Processor Sharing (GPS) is an ideal fair-queuing algorithm based on the fluid model. If there are N flows served by a server with service rate R and the i th flow is assigned a weight Φ i and let S(i, τ, t) be the amount of data served for flow i, which is continuously backlogged during an interval (τ, t) then

19 04/02/0819 GPS (cont.) ‏ In interval (τ, t) the flow i receives a min fair share proportional to its weight Where V is the set of flows that are backlogged.

20 04/02/0820 GPS (cont.) ‏ If traffic source is constrained by a token bucket with burst size b and token rate r GPS can guarantee a delay bound of b/r.

21 04/02/0821 Weighted Fair Queuing (WFQ) ‏ WFQ is approximation of GPS : does not assume infinitesimal packet size Scheduler needs to find the finish time of a packet if packet was processed in fluid model (this is known as the finish number). Then packets are scheduled in the increasing order of their finish number.

22 04/02/0822 WFQ (cont.) ‏ In effect, WFQ simulates GPS on the side and uses the result to determine service order. WFQ supports bandwidth allocation and delay bounds Have been widely used in routers to support QoS.

23 04/02/0823 WFQ details Uses notions of round number and finish number Suppose, in each round, the server served one bit from each active connection Round number is the number of rounds already completed –can be fractional –also called virtual time

24 04/02/0824 Weighted Fair Queueing (WFQ) ‏ Deals better with variable size packets and weights Also known as packet-by-packet GPS (PGPS) ‏ Find finish time of a packet, had we been doing GPS (this is the finish number); serve packets in order of their finish number

25 04/02/0825 WFQ (cont.) ‏ Computation of finish number complex for a general case. For a simple case where all flows are backlogged all the time, the finish number of packet k from flow i is equal to the finish number of the previous packet from the same flow plus the time for transmitting the current packet (in GPS) :

26 04/02/0826 WFQ (Cont.) ‏ But in a more general case flows may move back and forth between backlogged and non-backlogged : so there will be idle time between packets. The finish number in this case R(t) = round number at the arrival of packet k = virtual time of the system at time t

27 04/02/0827 WFQ (Cont.) ‏ Due to packetization effect, the worst-case delay for WFQ is more than GPS and the worst case delay when a flow goes through K WFQ schedulers is L max is the max packet size in the system, r i is the reserved rate of flow i, R m is the service rate of hop m. L i is the max packet size of flow i

28 04/02/0828 WFQ (Cont.) ‏ First term : GPS delay for leaky bucket traffic Second term : Worst case delay of a packet of flow i which has a guaranteed rate r i Third term : packet may have to wait after the current packet to be served (packet may be blocked by a max size packet) ‏

29 04/02/0829 WFQ Example  A r = 1  A =  B =  C = 1 B C  CC t=0: Packets of sizes 1,2,2 arrive at connections A, B, C. t=4: Packet of size 2 arrives at connection A

30 04/02/0830 Example (contd.) ‏ At time 0, slope of 1/3, –Finish number of A = 1, Finish number of B, C = 2 At time 3, connection A become inactive, slope becomes 1/2 At time 4, –second packet at A gets finish number 2 + 1.5 = 3.5, Slope decreases to 1/3

31 04/02/0831 Example (contd.) ‏ At time 5.5, –round number becomes 2 and connection B and C become inactive, Slope becomes 1 At time 7, –round number becomes 3.5 and A becomes inactive.

32 04/02/0832 WFQ Evaluation Protection –The rate provided to each flow is not affected by the sending rate of other flows. –This firewalling property is desirable by public networks. Requires per connection scheduler state Computing round numbers with iterated deletion is costly Bound on end to end delay for a regulated (e.g., token bucket) source.

33 04/02/0833 Iterated Deletion Problem in WFQ The main problem in computing packet’s finish number is determining the current round number (virtual time) of the simulated GPS server –Due to iterated deletion problem –Rate of increase of round number changes as flows becomes active or inactive –Example: Rate is 1/3 (three connections active) ‏ One would think the round number will be 1 at time t=3 But a flow may become inactive at t=2. Thus the round number at t=3 would be 1/3 * 2 + 1/2 * 1 = 1.167 –Another connection may have finish number less than 1.167, then the above calculation would have to be redone. –Hence a WFQ server has to check if round number should be recalculated on every packet arrival and departure It has to do a fairly complex computation every few microseconds!!

34 04/02/0834 Variants of WFQ There are less expensive variants of WFQ –Self Clocked Fair Queueing (SCFQ) ‏ –Start Time Fair queueing –Worst Case fair WFQ (WF 2 Q) ‏ –WRR

35 04/02/0835 SCFQ Avoid the costly computation of round number The finish number of a packet is given by Where CF = finish number of the packet currently being served The worst case latency in this case could be All the (N-1) connections may have a tie (finish number) with the currently served packet.

36 04/02/0836 Start Time Fair Queuing SCFQ has simpler finish number calculation, but at the cost of increased worst case delay STFQ has finish number and start number –Start number of a packet arriving into inactive connection is the current round number Otherwise it is the finish number of the previous packet –Round number is set to start number of the current packet –Packets scheduled in the increasing order of start number

37 04/02/0837 WF 2 Q WFQ can result in bursty service for a flow (many packets of a flow is served before other flows are served) ‏ In WF 2 Q, instead of choosing the packet with smallest finish number among all packets, the scheduler chooses smallest finish number among all packet that would have started service in the GPS system.

38 04/02/0838 WF 2 Q Example Every packet is of length 1 1 flow with weight 0.5 (flow A) ‏ 10 flows each with weight 0.05 10 packets from flow A arrives at t=0 1 packet each from the other 10 flows arrive at t=0

39 04/02/0839 WF 2 Q Example 1 10 2 Flow A WFQ 20

40 04/02/0840 WF 2 Q Example 20 4 Flow A GPS 2

41 04/02/0841 WF 2 Q Example Flow A WF 2 Q 132


Download ppt "04/02/08 1 Packet Scheduling IT610 Prof. A. Sahoo KReSIT."

Similar presentations


Ads by Google