Scheduling An Engineering Approach to Computer Networking.

Slides:



Advertisements
Similar presentations
Multicost (or QoS) routing For example: More generally, Minimize f(V)=f(V 1,…,V k ) over all paths.
Advertisements

Computer Networking Lecture 20 – Queue Management and QoS.
1 CNPA B Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009.
1 CONGESTION CONTROL. 2 Congestion Control When one part of the subnet (e.g. one or more routers in an area) becomes overloaded, congestion results. Because.
CSIT560 Internet Infrastructure: Switches and Routers Active Queue Management Presented By: Gary Po, Henry Hui and Kenny Chong.
Congestion Control Reasons: - too many packets in the network and not enough buffer space S = rate at which packets are generated R = rate at which receivers.
Engineering Internet QoS
Courtesy: Nick McKeown, Stanford 1 Intro to Quality of Service Tahir Azim.
Scheduling An Engineering Approach to Computer Networking.
CS 4700 / CS 5700 Network Fundamentals Lecture 12: Router-Aided Congestion Control (Drop it like it’s hot) Revised 3/18/13.
Receiver-driven Layered Multicast S. McCanne, V. Jacobsen and M. Vetterli SIGCOMM 1996.
Differentiated Services. Service Differentiation in the Internet Different applications have varying bandwidth, delay, and reliability requirements How.
Scheduling CS 215 W Keshav Chpt 9 Problem: given N packet streams contending for the same channel, how to schedule pkt transmissions?
CS 268: Lecture 15/16 (Packet Scheduling) Ion Stoica April 8/10, 2002.
Networking Issues in LAN Telephony Brian Yang
Generalized Processing Sharing (GPS) Is work conserving Is a fluid model Service Guarantee –GPS discipline can provide an end-to-end bounded- delay service.
Service Disciplines for Guaranteed Performance Service Hui Zhang, “Service Disciplines for Guaranteed Performance Service in Packet-Switching Networks,”
Analysis and Simulation of a Fair Queuing Algorithm
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Packet Scheduling and QoS Computer Science Division Department of Electrical Engineering and.
Scheduling. Outline What is scheduling Why we need it Requirements of a scheduling discipline Fundamental choices Scheduling best effort connections Scheduling.
תזכורת  שבוע הבא אין הרצאה m יום א, נובמבר 15, 2009  שיעור השלמה m יום שישי, דצמבר 11, 2009 Lecture 4: Nov 8, 2009 # 1.
ACN: Congestion Control1 Congestion Control and Resource Allocation.
Computer Networking Lecture 17 – Queue Management As usual: Thanks to Srini Seshan and Dave Anderson.
Lecture 5: Congestion Control l Challenge: how do we efficiently share network resources among billions of hosts? n Last time: TCP n This time: Alternative.
Mani Srivastava UCLA - EE Department Room: 7702-B Boelter Hall Tel: WWW: Copyright 2001.
Promoting the Use of End-to-End Congestion Control & Random Early Detection of Network Congestion.
Lecture 4#-1 Scheduling: Buffer Management. Lecture 4#-2 The setting.
CSc 461/561 CSc 461/561 Multimedia Systems Part C: 3. QoS.
7/15/2015HY220: Ιάκωβος Μαυροειδής1 HY220 Schedulers.
Packet Scheduling From Ion Stoica. 2 Packet Scheduling  Decide when and what packet to send on output link -Usually implemented at output interface 1.
Packet Scheduling and Buffer Management in Routers (A Step Toward Quality-of-service) 10-1.
CSE QoS in IP. CSE Improving QOS in IP Networks Thus far: “making the best of best effort”
CS640: Introduction to Computer Networks Aditya Akella Lecture 20 - Queuing and Basics of QoS.
Univ. of TehranAdv. topics in Computer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
CONGESTION CONTROL and RESOURCE ALLOCATION. Definition Resource Allocation : Process by which network elements try to meet the competing demands that.
ACN: RED paper1 Random Early Detection Gateways for Congestion Avoidance Sally Floyd and Van Jacobson, IEEE Transactions on Networking, Vol.1, No. 4, (Aug.
1 Lecture 14 High-speed TCP connections Wraparound Keeping the pipeline full Estimating RTT Fairness of TCP congestion control Internet resource allocation.
Fair Queueing. 2 First-Come-First Served (FIFO) Packets are transmitted in the order of their arrival Advantage: –Very simple to implement Disadvantage:
Queueing and Scheduling Traffic is moved by connecting end-systems to switches, and switches to each other Traffic is moved by connecting end-systems to.
March 29 Scheduling ?. What is Packet Scheduling? Decide when and what packet to send on output link 1 2 Scheduler flow 1 flow 2 flow n Buffer management.
Queueing and Active Queue Management Aditya Akella 02/26/2007.
9.7 Other Congestion Related Issues Outline Queuing Discipline Avoiding Congestion.
Packet Scheduling and Buffer Management Switches S.Keshav: “ An Engineering Approach to Networking”
CS640: Introduction to Computer Networks Aditya Akella Lecture 20 - Queuing and Basics of QoS.
Scheduling CS 218 Fall 02 - Keshav Chpt 9 Nov 5, 2003 Problem: given N packet streams contending for the same channel, how to schedule pkt transmissions?
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Weighted Fair Queuing Some slides used with.
Lecture Network layer -- May Congestion control Algorithms.
Random Early Detection (RED) Router notifies source before congestion happens - just drop the packet (TCP will timeout and adjust its window) - could make.
1 Fair Queuing Hamed Khanmirza Principles of Network University of Tehran.
Queue Scheduling Disciplines
Multicost (or QoS) routing For example: More generally, Minimize f(V)=f(V 1,…,V k ) over all paths.
Spring Computer Networks1 Congestion Control Sections 6.1 – 6.4 Outline Preliminaries Queuing Discipline Reacting to Congestion Avoiding Congestion.
Providing QoS in IP Networks
Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.
Scheduling for QoS Management. Engineering Internet QoS2 Outline  What is Queue Management and Scheduling?  Goals of scheduling  Fairness (Conservation.
1 Lecture 15 Internet resource allocation and QoS Resource Reservation Protocol Integrated Services Differentiated Services.
04/02/08 1 Packet Scheduling IT610 Prof. A. Sahoo KReSIT.
QoS & Queuing Theory CS352.
Topics discussed in this section:
CONGESTION CONTROL.
Queuing and Queue Management
Principles of Communication Networks
Scheduling.
Scheduling: Buffer Management
Computer Science Division
Congestion Control, Quality of Service, & Internetworking
Network Simulation NET441
EECS 122: Introduction to Computer Networks Packet Scheduling and QoS
An Engineering Approach to Computer Networking
کنترل جریان امیدرضا معروضی.
Presentation transcript:

Scheduling An Engineering Approach to Computer Networking

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Scheduling Sharing always results in contention Sharing always results in contention A scheduling discipline resolves contention: A scheduling discipline resolves contention: whos next? whos next? Key to fairly sharing resources and providing performance guarantees Key to fairly sharing resources and providing performance guarantees

Components A scheduling discipline does two things: A scheduling discipline does two things: decides service order decides service order manages queue of service requests manages queue of service requests Example: Example: consider queries awaiting web server consider queries awaiting web server scheduling discipline decides service order scheduling discipline decides service order and also if some query should be ignored and also if some query should be ignored

Where? Anywhere where contention may occur Anywhere where contention may occur At every layer of protocol stack At every layer of protocol stack Usually studied at network layer, at output queues of switches Usually studied at network layer, at output queues of switches

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Why do we need one? Because future applications need it Because future applications need it We expect two types of future applications We expect two types of future applications best-effort (adaptive, non-real time) best-effort (adaptive, non-real time) e.g. , some types of file transfer e.g. , some types of file transfer guaranteed service (non-adaptive, real time) guaranteed service (non-adaptive, real time) e.g. packet voice, interactive video, stock quotes e.g. packet voice, interactive video, stock quotes

What can scheduling disciplines do? Give different users different qualities of service Give different users different qualities of service Example of passengers waiting to board a plane Example of passengers waiting to board a plane early boarders spend less time waiting early boarders spend less time waiting bumped off passengers are lost! bumped off passengers are lost! Scheduling disciplines can allocate Scheduling disciplines can allocate bandwidth bandwidth delay delay loss loss They also determine how fair the network is They also determine how fair the network is

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Requirements An ideal scheduling discipline An ideal scheduling discipline is easy to implement is easy to implement is fair is fair provides performance bounds provides performance bounds allows easy admission control decisions allows easy admission control decisions to decide whether a new flow can be allowed to decide whether a new flow can be allowed

Requirements: 1. Ease of implementation Scheduling discipline has to make a decision once every few microseconds! Scheduling discipline has to make a decision once every few microseconds! Should be implementable in a few instructions or hardware Should be implementable in a few instructions or hardware for hardware: critical constraint is VLSI space for hardware: critical constraint is VLSI space Work per packet should scale less than linearly with number of active connections Work per packet should scale less than linearly with number of active connections

Requirements: 2. Fairness Scheduling discipline allocates a resource Scheduling discipline allocates a resource An allocation is fair if it satisfies min-max fairness An allocation is fair if it satisfies min-max fairness Intuitively Intuitively each connection gets no more than what it wants each connection gets no more than what it wants the excess, if any, is equally shared the excess, if any, is equally shared AB C AB C Transfer half of excess Unsatisfied demand

Fairness (contd.) Fairness is intuitively a good idea Fairness is intuitively a good idea But it also provides protection But it also provides protection traffic hogs cannot overrun others traffic hogs cannot overrun others automatically builds firewalls around heavy users automatically builds firewalls around heavy users Fairness is a global objective, but scheduling is local Fairness is a global objective, but scheduling is local Each endpoint must restrict its flow to the smallest fair allocation Each endpoint must restrict its flow to the smallest fair allocation Dynamics + delay => global fairness may never be achieved Dynamics + delay => global fairness may never be achieved

Requirements: 3. Performance bounds What is it? What is it? A way to obtain a desired level of service A way to obtain a desired level of service Can be deterministic or statistical Can be deterministic or statistical Common parameters are Common parameters are bandwidth bandwidth delay delay delay-jitter delay-jitter loss loss

Bandwidth Specified as minimum bandwidth measured over a prespecified interval Specified as minimum bandwidth measured over a prespecified interval E.g. > 5Mbps over intervals of > 1 sec E.g. > 5Mbps over intervals of > 1 sec Meaningless without an interval! Meaningless without an interval! Can be a bound on average (sustained) rate or peak rate Can be a bound on average (sustained) rate or peak rate Peak is measured over a small inteval Peak is measured over a small inteval Average is asymptote as intervals increase without bound Average is asymptote as intervals increase without bound

Delay and delay-jitter Bound on some parameter of the delay distribution curve Bound on some parameter of the delay distribution curve

Reqments: 4. Ease of admission control Admission control needed to provide QoS Admission control needed to provide QoS Overloaded resource cannot guarantee performance Overloaded resource cannot guarantee performance Choice of scheduling discipline affects ease of admission control algorithm Choice of scheduling discipline affects ease of admission control algorithm

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Fundamental choices 1. Number of priority levels 2. Work-conserving vs. non-work-conserving 3. Degree of aggregation 4. Service order within a level

Choices: 1. Priority Packet is served from a given priority level only if no packets exist at higher levels (multilevel priority with exhaustive service) Packet is served from a given priority level only if no packets exist at higher levels (multilevel priority with exhaustive service) Highest level gets lowest delay Highest level gets lowest delay Watch out for starvation! Watch out for starvation! Usually map priority levels to delay classes Usually map priority levels to delay classes Low bandwidth urgent messages RealtimeNon-realtime Priority

Choices: 2. Work conserving vs. non- work-conserving Work conserving discipline is never idle when packets await service Work conserving discipline is never idle when packets await service Why bother with non-work conserving? Why bother with non-work conserving?

Non-work-conserving disciplines Key conceptual idea: delay packet till eligible Key conceptual idea: delay packet till eligible Reduces delay-jitter => fewer buffers in network Reduces delay-jitter => fewer buffers in network How to choose eligibility time? How to choose eligibility time? rate-jitter regulator rate-jitter regulator bounds maximum outgoing rate bounds maximum outgoing rate delay-jitter regulator delay-jitter regulator compensates for variable delay at previous hop compensates for variable delay at previous hop

Do we need non-work-conservation? Can remove delay-jitter at an endpoint instead Can remove delay-jitter at an endpoint instead but also reduces size of switch buffers… but also reduces size of switch buffers… Increases mean delay Increases mean delay not a problem for playback applications not a problem for playback applications Wastes bandwidth Wastes bandwidth can serve best-effort packets instead can serve best-effort packets instead Always punishes a misbehaving source Always punishes a misbehaving source cant have it both ways cant have it both ways Bottom line: not too bad, implementation cost may be the biggest problem Bottom line: not too bad, implementation cost may be the biggest problem

Choices: 3. Degree of aggregation More aggregation More aggregation less state less state cheaper cheaper smaller VLSI smaller VLSI less to advertise less to advertise BUT: less individualization BUT: less individualization Solution Solution aggregate to a class, members of class have same performance requirement aggregate to a class, members of class have same performance requirement no protection within class no protection within class

Choices: 4. Service within a priority level In order of arrival (FCFS) or in order of a service tag In order of arrival (FCFS) or in order of a service tag Service tags => can arbitrarily reorder queue Service tags => can arbitrarily reorder queue Need to sort queue, which can be expensive Need to sort queue, which can be expensive FCFS FCFS bandwidth hogs win (no protection) bandwidth hogs win (no protection) no guarantee on delays no guarantee on delays Service tags Service tags with appropriate choice, both protection and delay bounds possible with appropriate choice, both protection and delay bounds possible

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Scheduling best-effort connections Main requirement is fairness Main requirement is fairness Achievable using Generalized processor sharing (GPS) Achievable using Generalized processor sharing (GPS) Visit each non-empty queue in turn Visit each non-empty queue in turn Serve infinitesimal from each Serve infinitesimal from each Why is this fair? Why is this fair? How can we give weights to connections? How can we give weights to connections?

More on GPS GPS is unimplementable! GPS is unimplementable! we cannot serve infinitesimals, only packets we cannot serve infinitesimals, only packets No packet discipline can be as fair as GPS No packet discipline can be as fair as GPS while a packet is being served, we are unfair to others while a packet is being served, we are unfair to others Degree of unfairness can be bounded Degree of unfairness can be bounded Define: work(I,a,b) = # bits transmitted for connection I in time [a,b] Define: work(I,a,b) = # bits transmitted for connection I in time [a,b] Absolute fairness bound for discipline S Absolute fairness bound for discipline S Max (work_GPS(I,a,b) - work_S(I, a,b)) Max (work_GPS(I,a,b) - work_S(I, a,b)) Relative fairness bound for discipline S Relative fairness bound for discipline S Max (work_S(I,a,b) - work_S(J,a,b)) Max (work_S(I,a,b) - work_S(J,a,b))

What next? We cant implement GPS We cant implement GPS So, lets see how to emulate it So, lets see how to emulate it We want to be as fair as possible We want to be as fair as possible But also have an efficient implementation But also have an efficient implementation

Weighted round robin Serve a packet from each non-empty queue in turn Serve a packet from each non-empty queue in turn Unfair if packets are of different length or weights are not equal Unfair if packets are of different length or weights are not equal Different weights, fixed packet size Different weights, fixed packet size serve more than one packet per visit, after normalizing to obtain integer weights serve more than one packet per visit, after normalizing to obtain integer weights Different weights, variable size packets Different weights, variable size packets normalize weights by mean packet size normalize weights by mean packet size e.g. weights {0.5, 0.75, 1.0}, mean packet sizes {50, 500, 1500} 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, , }, normalize again {60, 9, 4} normalize weights: {0.5/50, 0.75/500, 1.0/1500} = { 0.01, , }, normalize again {60, 9, 4}

Problems with Weighted Round Robin With variable size packets and different weights, need to know mean packet size in advance With variable size packets and different weights, need to know mean packet size in advance Can be unfair for long periods of time Can be unfair for long periods of time E.g. E.g. T3 trunk with 500 connections, each connection has mean packet length 500 bytes, 250 with weight 1, 250 with weight 10 T3 trunk with 500 connections, each connection has mean packet length 500 bytes, 250 with weight 1, 250 with weight 10 Each packet takes 500 * 8/45 Mbps = 88.8 microseconds Each packet takes 500 * 8/45 Mbps = 88.8 microseconds Round time =2750 * 88.8 = ms Round time =2750 * 88.8 = ms

Weighted Fair Queueing (WFQ) Deals better with variable size packets and weights Deals better with variable size packets and weights GPS is fairest discipline GPS is fairest discipline Find the finish time of a packet, had we been doing GPS Find the finish time of a packet, had we been doing GPS Then serve packets in order of their finish times Then serve packets in order of their finish times

WFQ: first cut Suppose, in each round, the server served one bit from each active connection Suppose, in each round, the server served one bit from each active connection Round number is the number of rounds already completed Round number is the number of rounds already completed can be fractional can be fractional 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 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 independent of the number of other connections! independent of the number of other connections! If a packet arrives to a non-empty queue, and the previous packet has a finish number of f, then the packets finish number is f+p If a packet arrives to a non-empty queue, and the previous packet has a finish number of f, then the packets finish number is f+p Serve packets in order of finish numbers Serve packets in order of finish numbers

A catch A queue may need to be considered non-empty even if it has no packets in it A queue may need to be considered non-empty even if it has no packets in it e.g. packets of length 1 from connections A and B, on a link of speed 1 bit/sec 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 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 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 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 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

WFQ continued To sum up, assuming we know the current round number R To sum up, assuming we know the current round number R Finish number of packet of length p Finish number of packet of length p if arriving to active connection = previous finish number + p if arriving to active connection = previous finish number + p if arriving to an inactive connection = R + p if arriving to an inactive connection = R + p (How should we deal with weights?) (How should we deal with weights?) To implement, we need to know two things: To implement, we need to know two things: is connection active? is connection active? if not, what is the current round number? if not, what is the current round number? Answer to both questions depends on computing the current round number (why?) Answer to both questions depends on computing the current round number (why?)

WFQ: computing the round number Naively: round number = number of rounds of service completed so far Naively: round number = number of rounds of service completed so far what if a server has not served all connections in a round? what if a server has not served all connections in a round? what if new conversations join in halfway through a round? what if new conversations join in halfway through a round? Redefine round number as a real-valued variable that increases at a rate inversely proportional to the number of currently active connections Redefine round number as a real-valued variable that increases at a rate inversely proportional to the number of currently active connections this takes care of both problems (why?) this takes care of both problems (why?) With this change, WFQ emulates GPS instead of bit-by-bit RR With this change, WFQ emulates GPS instead of bit-by-bit RR

Problem: iterated deletion A sever recomputes round number on each packet arrival A sever recomputes round number on each packet arrival At any recomputation, the number of conversations can go up at most by one, but can go down to zero At any recomputation, the number of conversations can go up at most by one, but can go down to zero => overestimation => overestimation Trick Trick use previous count to compute round number use previous count to compute round number if this makes some conversation inactive, recompute if this makes some conversation inactive, recompute repeat until no conversations become inactive repeat until no conversations become inactive Round number # active conversations

WFQ implementation On packet arrival: On packet arrival: use source + destination address (or VCI) to classify it and look up finish number of last packet served (or waiting to be served) use source + destination address (or VCI) to classify it and look up finish number of last packet served (or waiting to be served) recompute round number recompute round number compute finish number compute finish number insert in priority queue sorted by finish numbers insert in priority queue sorted by finish numbers if no space, drop the packet with largest finish number if no space, drop the packet with largest finish number On service completion On service completion select the packet with the lowest finish number select the packet with the lowest finish number

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

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

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Scheduling guaranteed-service connections With best-effort connections, goal is fairness With best-effort connections, goal is fairness With guaranteed-service connections With guaranteed-service connections what performance guarantees are achievable? what performance guarantees are achievable? how easy is admission control? how easy is admission control? We now study some scheduling disciplines that provide performance guarantees We now study some scheduling disciplines that provide performance guarantees

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

Parekh-Gallager theorem Let a connection be allocated weights at each WFQ scheduler along its path, so that the least bandwidth it is allocated is g Let a connection be allocated weights at each WFQ scheduler along its path, so that the least bandwidth it is allocated is g Let it be leaky-bucket regulated such that # bits sent in time [t 1, t 2 ] <= (t 2 - t 1 ) + Let it be leaky-bucket regulated such that # bits sent in time [t 1, t 2 ] <= (t 2 - t 1 ) + Let the connection pass through K schedulers, where the kth scheduler has a rate r(k) Let the connection pass through K schedulers, where the kth scheduler has a rate r(k) Let the largest packet allowed in the network be P Let the largest packet allowed in the network be P

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

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

Delay-Earliest Due Date Earliest-due-date: packet with earliest deadline selected Earliest-due-date: packet with earliest deadline selected Delay-EDD prescribes how to assign deadlines to packets Delay-EDD prescribes how to assign deadlines to packets A source is required to send slower than its peak rate A source is required to send slower than its peak rate Bandwidth at scheduler reserved at peak rate Bandwidth at scheduler reserved at peak rate Deadline = expected arrival time + delay bound Deadline = expected arrival time + delay bound If a source sends faster than contract, delay bound will not apply If a source sends faster than contract, delay bound will not apply Each packet gets a hard delay bound Each packet gets a hard delay bound Delay bound is independent of bandwidth requirement Delay bound is independent of bandwidth requirement but reservation is at a connections peak rate but reservation is at a connections peak rate Implementation requires per-connection state and a priority queue Implementation requires per-connection state and a priority queue

Rate-controlled scheduling A class of disciplines A class of disciplines two components: regulator and scheduler two components: regulator and scheduler incoming packets are placed in regulator where they wait to become eligible incoming packets are placed in regulator where they wait to become eligible then they are put in the scheduler then they are put in the scheduler Regulator shapes the traffic, scheduler provides performance guarantees Regulator shapes the traffic, scheduler provides performance guarantees

Examples Recall Recall rate-jitter regulator rate-jitter regulator bounds maximum outgoing rate bounds maximum outgoing rate delay-jitter regulator delay-jitter regulator compensates for variable delay at previous hop compensates for variable delay at previous hop Rate-jitter regulator + FIFO Rate-jitter regulator + FIFO similar to Delay-EDD (what is the difference?) similar to Delay-EDD (what is the difference?) Rate-jitter regulator + multi-priority FIFO Rate-jitter regulator + multi-priority FIFO gives both bandwidth and delay guarantees (RCSP) gives both bandwidth and delay guarantees (RCSP) Delay-jitter regulator + EDD Delay-jitter regulator + EDD gives bandwidth, delay,and delay-jitter bounds (Jitter-EDD) gives bandwidth, delay,and delay-jitter bounds (Jitter-EDD)

Analysis First regulator on path monitors and regulates traffic => bandwidth bound First regulator on path monitors and regulates traffic => bandwidth bound End-to-end delay bound End-to-end delay bound delay-jitter regulator delay-jitter regulator reconstructs traffic => end-to-end delay is fixed (= worst- case delay at each hop) reconstructs traffic => end-to-end delay is fixed (= worst- case delay at each hop) rate-jitter regulator rate-jitter regulator partially reconstructs traffic partially reconstructs traffic can show that end-to-end delay bound is smaller than (sum of delay bound at each hop + delay at first hop) can show that end-to-end delay bound is smaller than (sum of delay bound at each hop + delay at first hop)

Decoupling Can give a low-bandwidth connection a low delay without overbooking Can give a low-bandwidth connection a low delay without overbooking E.g consider connection A with rate 64 Kbps sent to a router with rate-jitter regulation and multipriority FCFS scheduling E.g consider connection A with rate 64 Kbps sent to a router with rate-jitter regulation and multipriority FCFS scheduling After sending a packet of length l, next packet is eligible at time (now + l/64 Kbps) After sending a packet of length l, next packet is eligible at time (now + l/64 Kbps) If placed at highest-priority queue, all packets from A get low delay If placed at highest-priority queue, all packets from A get low delay Can decouple delay and bandwidth bounds, unlike WFQ Can decouple delay and bandwidth bounds, unlike WFQ

Evaluation Pros Pros flexibility: ability to emulate other disciplines flexibility: ability to emulate other disciplines can decouple bandwidth and delay assignments can decouple bandwidth and delay assignments end-to-end delay bounds are easily computed end-to-end delay bounds are easily computed do not require complicated schedulers to guarantee protection do not require complicated schedulers to guarantee protection can provide delay-jitter bounds can provide delay-jitter bounds Cons Cons require an additional regulator at each output port require an additional regulator at each output port delay-jitter bounds at the expense of increasing mean delay delay-jitter bounds at the expense of increasing mean delay delay-jitter regulation is expensive (clock synch, timestamps) delay-jitter regulation is expensive (clock synch, timestamps)

Summary Two sorts of applications: best effort and guaranteed service Two sorts of applications: best effort and guaranteed service Best effort connections require fair service Best effort connections require fair service provided by GPS, which is unimplementable provided by GPS, which is unimplementable emulated by WFQ and its variants emulated by WFQ and its variants Guaranteed service connections require performance guarantees Guaranteed service connections require performance guarantees provided by WFQ, but this is expensive provided by WFQ, but this is expensive may be better to use rate-controlled schedulers may be better to use rate-controlled schedulers

Outline What is scheduling What is scheduling Why we need it Why we need it Requirements of a scheduling discipline Requirements of a scheduling discipline Fundamental choices Fundamental choices Scheduling best effort connections Scheduling best effort connections Scheduling guaranteed-service connections Scheduling guaranteed-service connections Packet drop strategies Packet drop strategies

Packet dropping Packets that cannot be served immediately are buffered Packets that cannot be served immediately are buffered Full buffers => packet drop strategy Full buffers => packet drop strategy Packet losses happen almost always from best-effort connections (why?) Packet losses happen almost always from best-effort connections (why?) Shouldnt drop packets unless imperative Shouldnt drop packets unless imperative packet drop wastes resources (why?) packet drop wastes resources (why?)

Classification of drop strategies 1. Degree of aggregation 2. Drop priorities 3. Early or late 4. Drop position

1. Degree of aggregation Degree of discrimination in selecting a packet to drop Degree of discrimination in selecting a packet to drop E.g. in vanilla FIFO, all packets are in the same class E.g. in vanilla FIFO, all packets are in the same class Instead, can classify packets and drop packets selectively Instead, can classify packets and drop packets selectively The finer the classification the better the protection The finer the classification the better the protection Max-min fair allocation of buffers to classes Max-min fair allocation of buffers to classes drop packet from class with the longest queue (why?) drop packet from class with the longest queue (why?)

2. Drop priorities Drop lower-priority packets first Drop lower-priority packets first How to choose? How to choose? endpoint marks packets endpoint marks packets regulator marks packets regulator marks packets congestion loss priority (CLP) bit in packet header congestion loss priority (CLP) bit in packet header

CLP bit: pros and cons Pros Pros if network has spare capacity, all traffic is carried if network has spare capacity, all traffic is carried during congestion, load is automatically shed during congestion, load is automatically shed Cons Cons separating priorities within a single connection is hard separating priorities within a single connection is hard what prevents all packets being marked as high priority? what prevents all packets being marked as high priority?

2. Drop priority (contd.) Special case of AAL5 Special case of AAL5 want to drop an entire frame, not individual cells want to drop an entire frame, not individual cells cells belonging to the selected frame are preferentially dropped cells belonging to the selected frame are preferentially dropped Drop packets from nearby hosts first Drop packets from nearby hosts first because they have used the least network resources because they have used the least network resources cant do it on Internet because hop count (TTL) decreases cant do it on Internet because hop count (TTL) decreases

3. Early vs. late drop Early drop => drop even if space is available Early drop => drop even if space is available signals endpoints to reduce rate signals endpoints to reduce rate cooperative sources get lower overall delays, uncooperative sources get severe packet loss cooperative sources get lower overall delays, uncooperative sources get severe packet loss Early random drop Early random drop drop arriving packet with fixed drop probability if queue length exceeds threshold drop arriving packet with fixed drop probability if queue length exceeds threshold intuition: misbehaving sources more likely to send packets and see packet losses intuition: misbehaving sources more likely to send packets and see packet losses doesnt work! doesnt work!

3. Early vs. late drop: RED Random early detection (RED) makes three improvements Random early detection (RED) makes three improvements Metric is moving average of queue lengths Metric is moving average of queue lengths small bursts pass through unharmed small bursts pass through unharmed only affects sustained overloads only affects sustained overloads Packet drop probability is a function of mean queue length Packet drop probability is a function of mean queue length prevents severe reaction to mild overload prevents severe reaction to mild overload Can mark packets instead of dropping them Can mark packets instead of dropping them allows sources to detect network state without losses allows sources to detect network state without losses RED improves performance of a network of cooperating TCP sources RED improves performance of a network of cooperating TCP sources No bias against bursty sources No bias against bursty sources Controls queue length regardless of endpoint cooperation Controls queue length regardless of endpoint cooperation

4. Drop position Can drop a packet from head, tail, or random position in the queue Can drop a packet from head, tail, or random position in the queue Tail Tail easy easy default approach default approach Head Head harder harder lets source detect loss earlier lets source detect loss earlier

4. Drop position (contd.) Random Random hardest hardest if no aggregation, hurts hogs most if no aggregation, hurts hogs most unlikely to make it to real routers unlikely to make it to real routers Drop entire longest queue Drop entire longest queue easy easy almost as effective as drop tail from longest queue almost as effective as drop tail from longest queue