Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSci5221: Packet Scheduling11 Packet Scheduling (and QoS) Packet Scheduling and Queue Management Beyond FIFO: –Class-based Queueing: Priority Queueing,

Similar presentations


Presentation on theme: "CSci5221: Packet Scheduling11 Packet Scheduling (and QoS) Packet Scheduling and Queue Management Beyond FIFO: –Class-based Queueing: Priority Queueing,"— Presentation transcript:

1 CSci5221: Packet Scheduling11 Packet Scheduling (and QoS) Packet Scheduling and Queue Management Beyond FIFO: –Class-based Queueing: Priority Queueing, Round-Robin, etc. –Per-Flow Queueing: Weighted Fair Queueing (or Generalized Processor Sharing) –Other Active Queue Management (AQM) Schemes Traffic Shaping and Policing –Lucky Buckets Optional: Basic QoS Theory -- A Single Node Case –fluid model, arrival and service curves –bandwidth and delay guarantees TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAA

2 CSci5221: Packet Scheduling2 Scheduling Policy: FIFO Scheduling: choosing the next packet for transmission on a link can be done following a number of policies FIFO: in order of arrival to the queue; packets that arrive to a full buffer are either discarded, or a discard policy is used to determine which packet to discard among the arrival and those already queued Simplest scheduling policy, default policy

3 CSci5221: Packet Scheduling3Spring 20073 Beyond FIFO Many applications (e.g., voice, video, on-line gaming, etc.) may have more stringent “quality-of-service” (QoS) or performance requirements We may have give different treatments to packets belonging to different applications (or users) – e.g. in an enterprise network, government or military network Examples of QoS requirements or “guarantees” –Delay: e.g., all packets of certain type or application will be transmitted within D seconds of their arrival at the router –Bandwidth: e.g., all packets of certain type or application will be transmitted with a minimum bandwidth of R bits/s at the router –Delay jitter: e.g., the difference or variation in delays of consecutive packets will be larger than V seconds In general, FIFO may not be enough! –Or really?

4 CSci5221: Packet Scheduling44 Packet Scheduling: Taxonomy “class-based” vs. “per-flow” –Examples: premium, gold and silver services; types of applications –“flows”: what is a flow? pre-emptive vs. non-preemptive: –non-preemptive: packet currently being transmitted will not be terminated --- assumed in most scheduling algorithms work-conserving vs. non-work-conserving –work-conserving: whenever there are packets queued, scheduler will schedule a packet for transmission –non-work-conserving: transmission may be idle even there may be packets queued

5 CSci5221: Packet Scheduling55 Examples of Packet Schedulers “Classic” Queueing Mechanisms –priority queueing –round-robin QoS-oriented Packet Scheduling Algorithms –virtual clock –fair queueing/weighted fair queueing a.k.a. Generalized Processor Sharing –earliest deadline first Other active queue management schemes –many developed/proposed to work with TCP and its invariants to provide certain “fairness” properties –e.g., RED (Random Early Drop), REM (random early marking), …

6 CSci5221: Packet Scheduling6 Scheduling Policy: Priority Queueing Priority Queuing: classes have different priorities; class may depend on explicit marking or other header info, eg IP source or destination, TCP Port numbers, etc. Transmit a packet from the highest priority class with a non-empty queue Preemptive and non-preemptive versions

7 CSci5221: Packet Scheduling7 Scheduling Policy: Round Robin Round Robin: scan class queues serving one from each class that has a non-empty queue Extension: “weighted” round robin

8 CSci5221: Packet Scheduling8 Rate Guarantee: Virtual Clock Each flow i is “guaranteed” to service with a bandwidth (i.e., a rate) of r i bits/sec –Obviously, r i < C (link capacity or output line speed) –Let P ij is the jth packet of flow i, if it arrives at the router at the time a ij, and the packet size is L ij –assign packet P ij a “time stamp” f ij : = max{a ij,f i,j-1 } + L ij /r i, –and schedule the packet at time f ij (can we do it !?) This is the “virtual clock” scheduling alg. When can we guarantee that for each flow, it is being served with a rate of ri? –Or more precisely, each packet P ij the router by the time f ij : = max{a ij,f i,j-1 } + L ij /r i –This is referred to as the schedulability condition! roughly, we must have  r i < C ! (i.e, sum of guaranteed rates of all flows < C)

9 CSci5221: Packet Scheduling9 Earliest Deadline First (EDF) Each flow is given a (pre-specified) deadline: –Deadline for ith flow is: d i – Let P ij is the jth packet of flow i, if it arrives at the router at the time a ij, and the packet size is L ij –assign packet P ij a “time stamp” f ij : = a ij + d i, –and schedule the packet with the earliest time stamp When can we guarantee that the deadline for each flow is met? –Namely, for each flow i, can we guarantee each packet P ij to leave the router by time f ij ? f ij : = a ij + d i –Schedulability condition? clearly, we have d i > L ij /C, where c is link capacity, but this is not sufficient!

10 CSci5221: Packet Scheduling10 Scheduling Policy: WFQ Weighted Fair Queuing (WFQ): is a generalized Round Robin (and Virtual Clock) –no concept of “round”, no fixed order of serving queues –based on “fluid model”: if queue assigned a weight w i, and is served with (a minimum) rate w i C when backlogged (non-empty) C link capacity,  w i =1 –if all queues backlogged, each queue served at rate of w i C; –otherwise, “spare capacity” proportionally allocated to each backlogged queue (thus the name “fair queueing”!)

11 CSci5221: Packet Scheduling11 WFQ Implementation Concept of Virtual Time: –Packet arrival times of flow i packets: a ij ; size L ij –What would be the finish times of these packets if flow i were served by a dedicated link of C i = w i C? Let s ij be the time packet j of flow i being serviced and f ij be the time it finishes transmission for 1 st packet: s i1 = a i1 ; f i1 = s i1 +L i1 /C i for jth packet: s ij = max {a ij, f i,j-1 }; f ij = s ij + L ij /C i Note that jth packet queued if a ij < f i,j-1 a ij s ij f ij CiCi “Ideal” dedicated link for flow i

12 CSci5221: Packet Scheduling12 Virtual Clock Scheduling Algorithm Virtual Clock: a “first” approximation of WFQ –Given N flows, each assigned with weight w i,  w i =1 –Calculate the virtual finish time f ij of each packet of each flow as if it were served at a rate of C i =w i C –Schedule packets based on f ij, i.e., packet with smallest f ij among all queued packets is selected for transmission why not scheduled based on s ij ? What is the key difference between Virtual Clock and Weighted Fair Queueing –WFQ: also know as Generalized Processor Sharing (GPS)

13 CSci5221: Packet Scheduling13 WFQ Implementation (cont’d) “Ideal dedicated link” model does not take into account the distribution of “spare capacity” when some queues are empty –Need to keep track which queues are backlogged and which are empty Let denote the set of queues backlogged at time t Then for each flow/queue, its actual service rate is which is time-dependent Modification of the “ideal dedicated link model”: s ij = max {a ij, f i,j-1 }; f ij = s ij + L ij /C i (t) Schedule packets based on the (modified) virtual finish time f ij What states do we need to maintain to compute f ij ’s ?

14 CSci5221: Router Design14 Recall: Combined Input-Output Queued (CIOQ) Routers Both input and output interfaces store packets Advantages –Easy to built Utilization 1 can be achieved with limited input/output speedup (<= 2) Disadvantages –Harder to design algorithms Two congestion points Need to design flow control input interfaceoutput interface Backplane C RORO Question: can we build CIOQ that emulates any output queuing algorithm?

15 CSci5221: Router Design15 Output Queue Emulation using CIOQ (with Speed-up) Stable Marriage Problem -- Gale Shapely Algorithm (GSA) As long as there is a free man m –m proposes to highest ranked women w in his list he hasn’t proposed yet –If w is free, m and w are engaged –If w is engaged to m’ and w prefers m to m’, w releases m’ Otherwise m remains free A stable matching exists for every set of preference lists Complexity: worst-case O(N 2 )

16 CSci5221: Router Design16 Stable Marriage Problem Consider N women and N men Each woman/man ranks each man/woman in the order of their preferences Stable matching, a matching with no blocking pairs Blocking pair; let p(i) denote the pair of i –There are matched pairs (k, p(k)) and (j, p(j)) such that k prefers p(j) to p(k), and p(j) prefers k to j GSA in the previous slide: –male optimal, female “perssimal”

17 CSci5221: Router Design17 Example If men propose to women, the stable matching is –1 st round: (1,2), (2,1), (3,4), (4,1) -> w1 releases m2 –2 nd round: (2,4) ->w4 releases m3; –3 rd round: (3,3); –final match: (1,2), (2,4), (3,3), (4,1) What is the stable matching if women propose to men? 1 2 4 3 1 2 1 4 3 2 3 4 3 2 1 4 1 2 4 3 menpref. list 1 1 4 3 2 2 3 1 4 2 3 1 2 3 4 4 2 1 4 3 womenpref. list

18 CSci5221: Router Design18 OQ Emulation with a Speedup of 2 Each input and output maintains a preference list Input preference list: list of cells at that input ordered in the inverse order of their arrival Output preference list: list of all input cells to be forwarded to that output ordered by the times they would be served in an Output Queueing schedule Use GSA to match inputs to outputs –Outputs initiate the matching Can emulate all work-conserving schedulers

19 CSci5221: Packet Scheduling19 Traffic Policing Mechanisms Three criteria: –(Long term) Average Rate E.g., 100 packets per second, crucial aspect is the time interval over which rate is measured, as well as the time interval the “long-term” average is defined. –Peak Rate: e.g., 100 packets per second on average and 1500 packets per second at maximum (peak) –(Max.) Burst Size: Max. number of bytes (or packets) sent “instantaneously” (i.e. over a very short period of time)!

20 CSci5221: Packet Scheduling20 Leaky/Token Bucket Mechanism Leaky/Token Bucket mechanism, provides a means for limiting input to specified Burst Size and Average Rate –Leaky: when token bucket full, tokens lost

21 CSci5221: Packet Scheduling21 Dual Leaky/Token Bucket Limiting input to specified Burst Size  Average Rate  and Peak Rate r –one with buffer: token rate r and buffer size b –another with “no” buffer: token rate p in practice: needs to be “packetized” - buffer of max. packet size M b M min packets p tokens/sec r  tokens/sec

22 Optional Material (for your reference only) Basic QoS Theory --- a Single Node Case CSci5221: Packet Scheduling22

23 CSci5221: Packet Scheduling23 Basic QoS Theory: A Single Node Concept of Arrival Curve (or “arrival envelope”) Examples of arrival curves: –a constant bit rate flow: –a -leaky-bucket-policed flow: –a dual-leaky-bucket-policed flow: where p is the peak rate, M is the max. pkt size What does this equation intuitively mean?

24 CSci5221: Packet Scheduling24 Illustration of Arrival Curve Arrival curve – maximum amount of bits transmitted during an interval of time Δt ΔtΔt bits Arrival curve time bps bits Arrival curve time bps 0 12345 1 2 1234 5 1 2 3 4 (R=2,b=1,r=1) ΔtΔt

25 CSci5221: Packet Scheduling25 Service Curve Concept of Service Curve –Let a link (or rather a scheduler) as a “server” S –y(t): cumulative amount of traffic (in bits) of a flow leaving scheduler S by time t (>=0) S flow x(t) y(t) What does this equation intuitively mean?

26 CSci5221: Packet Scheduling26 Service Curve: Example A fixed delay server (defined in IETF IntServ) –For a flow with a bandwidth reservation R at a router, IETF IntServ (will be discussed later) assumes a router S will guarantee a service curve of the following form: where T represents the packetization and other processing delay incurred by router S in processing packets of the flow ΔtΔt bits Arrival curve time bps T R

27 CSci5221: Packet Scheduling27 Backlog and Delay Bounds t bits arrival curve  service curve  ^ w ( t ) ^ d ( t )

28 CSci5221: Packet Scheduling28 Backlog & Delay Bounds: Example given arrival curve : and service curve Then bits slope r arrival curve slope p M b T slope R w max d max service curve  t and

29 CSci5221: Packet Scheduling29 QoS Guarantees: A Single Node Each flow i: traffic characterized/policed by dual leaky-bucket traffic policer: Given a router with link capacity C – uses WFQ + dual-leaky bucket traffic shaper for each flow – allocate bandwidth R i > r i (thus w i : = R i / C) and buffer space B i for each flow i U he previous formula, we can guarantee each flow i a maximum delay bound of D i = d max (with b, p, R replaced by b i, p i, R i ) and no loss if B i >= w max for each flow i


Download ppt "CSci5221: Packet Scheduling11 Packet Scheduling (and QoS) Packet Scheduling and Queue Management Beyond FIFO: –Class-based Queueing: Priority Queueing,"

Similar presentations


Ads by Google