1 / 29

Packet Scheduling (and QoS)

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

vachel
Download Presentation

Packet Scheduling (and QoS)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 CSci5221: Packet Scheduling 1 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAA

  2. 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 CSci5221: Packet Scheduling

  3. 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? CSci5221: Packet Scheduling Spring 2007 3

  4. 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 CSci5221: Packet Scheduling 4

  5. 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), … CSci5221: Packet Scheduling 5

  6. 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 CSci5221: Packet Scheduling

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

  8. Rate Guarantee: Virtual Clock • Each flow i is “guaranteed” to service with a bandwidth (i.e., a rate) of ri bits/sec • Obviously, ri< C (link capacity or output line speed) • Let Pij is the jth packet of flow i, if it arrives at the router at the time aij, and the packet size is Lij • assign packet Pij a “time stamp” fij: = max{aij,fi,j-1} + Lij/ri, • and schedule the packet at time fij (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 Pij the router by the time fij: = max{aij,fi,j-1}+ Lij/ri • This is referred to as the schedulability condition! roughly, we must have ri < C ! (i.e, sum of guaranteed rates of all flows < C) CSci5221: Packet Scheduling

  9. Earliest Deadline First (EDF) • Each flow is given a (pre-specified) deadline: • Deadline for ith flow is: di • Let Pij is the jth packet of flow i, if it arrives at the router at the time aij, and the packet size is Lij • assign packet Pij a “time stamp” fij: = aij + di, • 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 Pij to leave the router by time fij ? fij: = aij + di • Schedulability condition? • clearly, we have di > Lij /C, where c is link capacity, but this is not sufficient! CSci5221: Packet Scheduling

  10. 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 wi, and is served with (a minimum) rate wiC when backlogged (non-empty) • C link capacity,  wi =1 • if all queues backlogged, each queue served at rate of wiC; • otherwise, “spare capacity” proportionally allocated to each backlogged queue (thus the name “fair queueing”!) CSci5221: Packet Scheduling

  11. aij sij fij Ci WFQ Implementation • Concept of Virtual Time: • Packet arrival times of flow i packets: aij; size Lij • What would be the finish times of these packets if flow i were served by a dedicated link of Ci= wi C? Let sij be the time packet j of flow i being serviced and fij be the time it finishes transmission for 1st packet: si1 = ai1; f i1 = si1 +Li1/Ci for jth packet: sij = max {aij, fi,j-1 }; fij = sij + Lij/Ci Note that jth packet queued if aij < fi,j-1 “Ideal” dedicated link for flow i CSci5221: Packet Scheduling

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

  13. 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”: sij = max {aij, fi,j-1 }; fij = sij + Lij/Ci(t) • Schedule packets based on the (modified) virtual finish time fij • What states do we need to maintain to compute fij’s ? CSci5221: Packet Scheduling

  14. input interface output interface Backplane RO C 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 Question: can we build CIOQ that emulates any output queuing algorithm? CSci5221: Router Design

  15. 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(N2) CSci5221: Router Design

  16. 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” CSci5221: Router Design

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

  18. 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 CSci5221: Router Design

  19. 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)! CSci5221: Packet Scheduling

  20. 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 CSci5221: Packet Scheduling

  21. b min packets 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 rtokens/sec p tokens/sec M CSci5221: Packet Scheduling

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

  23. Basic QoS Theory: A Single Node • Concept of Arrival Curve (or “arrival envelope”) • Examples of arrival curves: • a constant bit rate flow: • a <r,b>-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? CSci5221: Packet Scheduling

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

  25. S 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) y(t) flow x(t) What does this equation intuitively mean? CSci5221: Packet Scheduling

  26. 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 bps bits Arrival curve R T Δt time CSci5221: Packet Scheduling

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

  28. slope r arrival curve  bits service curve b b wmax dmax M slope p slope R t T Backlog & Delay Bounds: Example • given arrival curve : and service curve Then and CSci5221: Packet Scheduling

  29. QoS Guarantees: A Single Node • Each flow i: traffic characterized/policed by dual leaky-bucket traffic policer: i(t) = min { rit+bi, pit+Mi} • Given a router with link capacity C • uses WFQ + dual-leaky bucket traffic shaper for each flow • allocate bandwidth Ri > ri (thus wi: = Ri/ C) and buffer space Bi for each flow i • U he previous formula, we can guarantee each flow i a maximum delay bound of Di=dmax (with b, p, R replaced by bi, pi, Ri) and no loss if Bi >= wmax for each flow i CSci5221: Packet Scheduling

More Related