Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mani Srivastava UCLA - EE Department Room: 7702-B Boelter Hall Tel: 310-267-2098 WWW: Copyright 2001.

Similar presentations


Presentation on theme: "Mani Srivastava UCLA - EE Department Room: 7702-B Boelter Hall Tel: 310-267-2098 WWW: Copyright 2001."— Presentation transcript:

1 Mani Srivastava UCLA - EE Department Room: 7702-B Boelter Hall Email: mbs@ee.ucla.edu Tel: 310-267-2098 WWW: http://www.ee.ucla.edu/~mbs Copyright 2001  Mani Srivastava Real-time Communications EE202A (Fall 2001): Lecture #6

2 2 Copyright 2001  Mani Srivastava Reading List for This Lecture n Required u Lahiri, K.; Raghunathan, A.; Lakshminarayana, G. LOTTERYBUS: A new high-performance communication architecture for system-on-chip designs. Proceedings of the 38 th ACM Design Automation Conference, 2001. n Recommended u none n Others u none

3 3 Copyright 2001  Mani Srivastava Real-time Communications n Analogous to real-time computation n Value of communication depends on the time at which the message is delivered to the recipient n Metrics u Throughput u Delay u Delay jitter u Loss rate u Fairness n Comes in hard & soft variety u Deterministic vs. statistical guarantees

4 4 Copyright 2001  Mani Srivastava Key Problem n Allocation and scheduling of communication resources u Point-to-point link e.g. wire (scheduling at transmitter) u Distributed link e.g. wireless (MAC) or bus (arbiter) u Entire network (routing) u Anywhere there is a shared resource! n Analogous to task scheduling on processors, but with certain crucial differences u Often no preemption or coarse pre-emption u Channels of time-varying quality/capacity

5 5 Copyright 2001  Mani Srivastava Type of Traffic Sources n Constant bit rate: periodic traffic u Fixed-size packets at periodic intervals u Analogous to periodic tasks with constant computation time in RM model n Variable bit rate: bursty traffic u Fixed-size packets at irregular intervals u Variable-size packets at regular intervals n Traffic characteristics may change as it passes through the communication system

6 6 Copyright 2001  Mani Srivastava Key Issues n Scheduling n Admission control (schedulability) n Policing (for “isolation”) n Goals: u meet performance and fairness metrics u high resource utilization (as measured by resource operator) u easy to implement  small work per data item, scale slowly with # of flows or tasks u easy admission control decisions  Schedulable region: set of all possible combinations of performance bounds that a scheduler can simultaneously meet

7 7 Copyright 2001  Mani Srivastava Fairness n Intuitively u each connection gets no more than what it wants u the excess, if any, is equally shared n Fairness is intuitively a good idea n Fairness also provides protection u traffic hogs cannot overrun others u automatically builds firewalls around heavy users u reverse is not true: protection may not lead to fairness AB C AB C Transfer half of excess Unsatisfied demand

8 8 Copyright 2001  Mani Srivastava Max-min Fairness n Maximize the minimum share of task or flow whose demand is not fully satisfied u Resources are allocated in order of increasing demand, normalized by weight u No task or flow gets a share larger than its demand u Task or flows with unsatisfied demands get resource shared in proportion to their weights

9 9 Copyright 2001  Mani Srivastava Example n Given u Four flows with demands 4, 2, 10, 4 and weights 2.5, 4, 0.5, and 1, and a resource with capacity C=16 n Steps u Normalize weights so that smallest is 1: 5, 8, 1, 2 u In each round give a flow a share  to its weight  Round 1: allocation is 5, 8, 1, 2 Results in 1 and 6 units extra for flows 1 & 2 = 7 Allocate this 7 to flows still in deficit according to re-normalized weights  Round 2: allocation is 7*1/3 and 7*2/3 to flows 3 & 4 Results in 2.666 excess for flow 4 while flow 3 is still short Allocate this 2.666 to flows still in deficit according to re-normalized weights  Round 3: allocation is 2.666 for flow 3 Results in flow 3 with a total of 6, i.e. a deficit of 4

10 10 Copyright 2001  Mani Srivastava Policing n Three criteria: u (Long term) Average (Sustained) Rate  100 packets per sec or 6000 packets per min??  crucial aspect is the interval length u Peak Rate  e.g., 6000 p p minute Avg and 1500 p p sec Peak u (Max.) Burst Size  Max. number of packets sent consecutively, i.e. over a short period of time

11 11 Copyright 2001  Mani Srivastava Leaky Bucket Mechanism n Provides a means for limiting input to specified Burst Size and Average Rate. Figure from: Kurose & Ross

12 12 Copyright 2001  Mani Srivastava Leaky Bucket Mechanism (contd.) n Bucket can hold b tokens; token are generated at a rate of r token/sec unless bucket is full of tokens n Over an interval of length t, the number of packets that are admitted is less than or equal to (r t + b) n How can one enforce a constraint on peak rate?

13 13 Copyright 2001  Mani Srivastava Real-time Communications over a Link n Scenario: applications sharing a link of fixed capacity n Which packet to send when? u FIFO u Priority queuing: preemptive, non-preemptive u Round robin u Weighted fair queuing u EDF n Which packet to discard if buffers at sender are full? n What if senders not at the same place? u Need multiple access mechanism u Need distributed implementation

14 14 Copyright 2001  Mani Srivastava Fundamental Choices n Number of priority levels u a priority level served only if higher levels don’t need service (multilevel priority with exhaustive service) n Work conserving vs. non-work conserving u never idle when packets await service u why bother with non-work conserving? n Degree of aggregation u cost, amount of state, how much individualization u aggregate to a class  members of class have same performance requirement  no protection within class n Service order within a level u FCFS (bandwidth hogs win, no guarantee on delays) u In order of a service tag (both protection & delay can be ensured)

15 15 Copyright 2001  Mani Srivastava Non-work-conserving Disciplines n Idea u Delay packet till eligible u Reduces delay-jitter => fewer buffers in network  E.g. traffic remains smooth as it proceeds through the network u How to choose eligibility time?  rate-jitter regulator: bounds maximum outgoing rate  delay-jitter regulator: compensates for variable delay at previous hop n Do we really need it? u one can remove delay-jitter at an endpoint instead  but it also reduces expensive switch memory u easy to computer end-to-end performance  sum of per-hop delay and delay jitter leads to tight end-to-end delay and delay-jitter bounds u wastes bandwidth  but can serve background traffic or tasks u increases mean delay u always punishes a misbehaving source u more complex to implement (more state)

16 16 Copyright 2001  Mani Srivastava The Conservation Law n The sum of mean delay for a flow or task, weighted by its mean utilization of the resource, is a constant if the scheduler is work- conserving u A work conserving scheduler can only reallocate delays among the flows or tasks u A non-work-conserving will only have a higher value

17 17 Copyright 2001  Mani Srivastava Priority Queuing n Flows classified according to priorities n Preemptive and non-preemptive versions n What can one say about schedulability? Figure from: Kurose & Ross

18 18 Copyright 2001  Mani Srivastava CAN Bus: Distributed Priority Queuing n Developed during late 80’s for automotive industry u an ISO defined serial communication bus u peer-to-peer, multi-server network u defined for the physical and data link layers u 250 Kbaud for basic CAN, 1 Mbaud for full CAN n Messages are sent if u host computer requests transmission of a message u channel is idle u message priority wins over the messages that other nodes intend to send at the same time

19 19 Copyright 2001  Mani Srivastava CAN Bus: Real-time Capability via Priority Arbitration n Non-destructive bit-wise arbitration n As each message is assigned a priority, a message with a higher priority that collides with another message with a lower priority would be allowed to continue transmitting n Transmitter with lower priority will detect mismatch of message sent and read back and temporarily halt n Another attempt will subsequently be made to send it once the bus is released

20 20 Copyright 2001  Mani Srivastava An Example n There are two transmitters A and B active at one time. Transmitter A has higher priority than B

21 21 Copyright 2001  Mani Srivastava Round Robin n Scan class queues serving one from each class that has a non-empty queue Figure from: Kurose & Ross

22 22 Copyright 2001  Mani Srivastava Weighted Round Robin n Round-robin unfair if packets are of different length or weights are not equal n Different weights, fixed packet size u serve more than one packet per visit, after normalizing to obtain integer weights n Different weights, variable size packets u normalize weights by mean packet size  e.g. 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} n Problems u with variable size packets and different weights, need to know mean packet size in advance u fair only over time scales > round time  round time can be large  can lead to long periods of unfairness

23 23 Copyright 2001  Mani Srivastava Generalized Processor Sharing (GPS) n Generalized Round Robin u In any time interval, allocates resource in proportion to the weight among the set of all backlogged connections (i.e. non empty queue) u Serves infinitesimal resource to each n Achieves max-min fairness n Provide a class with a differentiated amount of service over a given period of time n But is non-implementable Figure from: S. Keshav, Cornell

24 24 Copyright 2001  Mani Srivastava Weighted Fair Queueing (WFQ) n Deals better with variable size packets and weights n GPS is fairest discipline n Find the finish time of a packet, had we been doing GPS n Then serve packets in order of their finish times Figure from: Kurose & Ross

25 25 Copyright 2001  Mani Srivastava WFQ: First Cut n Suppose, in each round, the server served one bit from each active connection (bit-by-bit round robin) n Round number is the number of rounds already completed u can be fractional n If a packet of length p arrives to an empty queue when the round number is R, it will complete service when the round number is R + p => finish number is R + p u independent of the number of other connections! n If a packet arrives to a non-empty queue, and the previous packet has a finish number of f, then the packet’s finish number is f+p n Serve packets in order of finish numbers from: S. Keshav, Cornell

26 26 Copyright 2001  Mani Srivastava A Catch n A queue may need to be considered non-empty even if it has no packets in it u e.g. packets of length 1 from connections A and B, on a link of speed 1 bit/sec  at time 1, packet from A served, round number = 0.5  A has no packets in its queue, yet should be considered non- empty, because a packet arriving to it at time 1 should have finish number 1+ p n A connection is active if the last packet served from it, or in its queue, has a finish number greater than the current round number from: S. Keshav, Cornell

27 27 Copyright 2001  Mani Srivastava WFQ continued n To sum up, assuming we know the current round number R n Finish number of packet of length p u if arriving to active connection = previous finish number + p u if arriving to an inactive connection = R + p n Dealing with weights u replace p by p/w n To implement, we need to know two things: u is connection active? u if not, what is the current round number? n Answer to both questions depends on computing the current round number (why?) from: S. Keshav, Cornell

28 28 Copyright 2001  Mani Srivastava WFQ: computing the round number n Naively: round number = number of rounds of service completed so far u what if a server has not served all connections in a round? u what if new conversations join in halfway through a round? n Redefine round number as a real-valued variable that increases at a rate inversely proportional to the number of currently active connections u replace # of connections by sum of weights n With this change, WFQ emulates GPS instead of bit-by- bit RR from: S. Keshav, Cornell

29 29 Copyright 2001  Mani Srivastava WFQ and GPS n In GPS, a packet completes service when the round number increases beyond the packet’s finish number n In WFQ, the finish time of a packet is not the same as its finish number n Once assigned, the finish number does not depend on future packet arrivals and departures n The finish number of a packet is independent of the other connections awaiting service u because the rate of increase of the round number varies with the number of active connections

30 30 Copyright 2001  Mani Srivastava Example n Link of rate 1 unit/sec n Flows A, B, & C of equal weight n Packets of 1, 2, & 2 units arrive at t=0 u Finish numbers = 1, 2, 2 n Packet of size 2 at t=4 on A u Round number R at t=4? n t=0: 3 active connections, dR/dt = 1/3 n t=3: R=1 n 1st packet of A completes at R=1 in GPS emulation n Thus A gets inactive at t=3 n dR/dt=1/2 in [3,4] n At t=4, R = 1.5 u 2nd packet of A gets F = 1.5+2 = 3.5 n Server becomes idle when the second packet of A finishes service, at R=3.5 n In GPS, B & C finish service simultaneously at t=5.5 u In the remaining 1.5 time units, dR/dt=1 n So, R=3.5 at t=7 n Service order: ABCA (or, ACBA)

31 31 Copyright 2001  Mani Srivastava WFQ Implementation n On packet arrival: u use source + destination address (or VCI) to classify it and look up finish number of last packet served (or waiting to be served) u Re-compute round number u compute finish number u insert in priority queue sorted by finish numbers u if no space, drop the packet with largest finish number n On service completion u select the packet with the lowest finish number

32 32 Copyright 2001  Mani Srivastava Analysis n Un-weighted case: u if GPS has served x bits from connection A by time t u WFQ would have served at least x - P bits, where P is the largest possible packet in the network n WFQ could send more than GPS would => absolute fairness bound > P n To reduce bound, choose smallest finish number only among packets that have started service in the corresponding GPS system (WF 2 Q) u requires a regulator to determine eligible packets

33 33 Copyright 2001  Mani Srivastava Evaluation n Pros u like GPS, it provides protection u can obtain worst-case end-to-end delay bound u gives users incentive to use intelligent flow control (and also provides rate information implicitly) n Cons u needs per-connection state u iterated deletion is complicated u requires a priority queue

34 34 Copyright 2001  Mani Srivastava WFQ Performance n Turns out that WFQ also provides performance guarantees n Bandwidth bound u ratio of weights * link capacity u e.g. connections with weights 1, 2, 7; link capacity 10 u connections get at least 1, 2, 7 units of b/w each n End-to-end delay bound u assumes that the connection doesn’t send ‘too much’ (otherwise its packets will be stuck in queues) u more precisely, connection should be leaky-bucket regulated u # bits sent in time [t 1, t 2 ] <= r (t 2 - t 1 ) + b

35 35 Copyright 2001  Mani Srivastava WFQ + Leaky Bucket Figure from: Kurose & Ross

36 36 Copyright 2001  Mani Srivastava Parekh-Gallager Theorem n Let u a connection be allocated weights at each of K WFQ schedulers along its path such that the bandwidth allocated at the k-th scheduler is g k u g = smallest g k  the connection be leaky-bucket regulated such that # bits sent in time [t 1, t 2 ] <= r (t 2 - t 1 ) + b u the kth scheduler have a rate r(k) n Let the largest packet allowed in the connection be P c, and in the connection be P n

37 37 Copyright 2001  Mani Srivastava Significance n Theorem shows that WFQ can provide end-to- end delay bounds n So WFQ provides both fairness and performance guarantees n Bound holds regardless of cross traffic behavior n Can be generalized for networks where schedulers are variants of WFQ, and the link service rate changes over time

38 38 Copyright 2001  Mani Srivastava Problems n To get a delay bound, need to pick g u the lower the delay bounds, the larger g needs to be u large g => exclusion of more competitors from link u g can be very large, in some cases 80 times the peak rate! n Sources must be leaky-bucket regulated u but choosing leaky-bucket parameters is problematic n WFQ couples delay and bandwidth allocations u low delay requires allocating more bandwidth u wastes bandwidth for low-bandwidth low-delay sources

39 39 Copyright 2001  Mani Srivastava Rate-controlled Scheduling n A class of disciplines u two components: regulator and scheduler u incoming packets are placed in regulator where they wait to become eligible u then they are put in the scheduler n Regulator shapes the traffic, scheduler provides performance guarantees


Download ppt "Mani Srivastava UCLA - EE Department Room: 7702-B Boelter Hall Tel: 310-267-2098 WWW: Copyright 2001."

Similar presentations


Ads by Google