The Greedy Algorithm for Buffer Management: A Personal Perspective Zvi Lotker Some slide contributed by Prof Boaz Patt-Shamir.

Slides:



Advertisements
Similar presentations
Tight Bounds for Online Class- constrained Packing Hadas Shachnai Bell Labs and The Technion IIT Tami Tamir The Technion IIT.
Advertisements

Price Of Anarchy: Routing
1 CNPA B Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Prompt Mechanisms for Online Auctions Speaker: Shahar Dobzinski Joint work with Richard Cole and Lisa Fleischer.
Institute of Computer Science University of Wroclaw Geometric Aspects of Online Packet Buffering An Optimal Randomized Algorithm for Two Buffers Marcin.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches Marcin Bieńkowski.
2007/3/6 1 Online Chasing Problems for Regular n-gons Hiroshi Fujiwara* Kazuo Iwama Kouki Yonezawa.
Competitive Analysis of Buffer Policies with SLA Commitments Boaz Patt-Shamir, Tel Aviv University Gabriel Scalosub, University of Toronto Yuval Shavitt,
Dynamic Internet Congestion with Bursts Stefan Schmid Roger Wattenhofer Distributed Computing Group, ETH Zurich 13th International Conference On High Performance.
Worst-case Fair Weighted Fair Queueing (WF²Q) by Jon C.R. Bennett & Hui Zhang Presented by Vitali Greenberg.
1 Ecole Polytechnque, Nov 7, 2007 Scheduling Unit Jobs to Maximize Throughput Jobs:  all have processing time (length) = 1  release time r j  deadline.
2002/04/18Chin-Kai Wu, CS, NTHU1 Jitter Control in QoS Network Yishay Mansour and Boaz Patt-Shamir IEEE/ACM TRANSACTIONS ON NETWORKING, VOL. 9, NO. 4,
Competitive Buffer Management with Packet Dependencies Alex Kesselman, Google Boaz Patt-Shamir, Tel Aviv University Gabriel Scalosub, University of Toronto.
Energy-Efficient Rate Scheduling in Wireless Links A Geometric Approach Yashar Ganjali High Performance Networking Group Stanford University
October 5th, 2005 Jitter Regulation for Multiple Streams David Hay and Gabriel Scalosub Technion, Israel.
Convergence Time to Nash Equilibria in Load Balancing Eyal Even-Dar, Tel-Aviv University Alex Kesselman, Tel-Aviv University Yishay Mansour, Tel-Aviv University.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
Competitive Buffer Management with Packet Dependencies Alex Kesselman, Google Boaz Patt-Shamir, Tel Aviv University Gabriel Scalosub, University of Toronto.
1 Worst-Case Equilibria Elias Koutsoupias and Christos Papadimitriou Proceedings of the 16th Annual Symposium on Theoretical Aspects of Computer Science.
Chain: Operator Scheduling for Memory Minimization in Data Stream Systems Authors: Brian Babcock, Shivnath Babu, Mayur Datar, and Rajeev Motwani (Dept.
Online Packet Switching Techniques and algorithms Yossi Azar Tel Aviv University.
CS144, Stanford University Error in Q3-7. CS144, Stanford University Using longest prefix matching, the IP address will match which entry? a /8.
Online Function Tracking with Generalized Penalties Marcin Bieńkowski Institute of Computer Science, University of Wrocław, Poland Stefan Schmid Deutsche.
Asaf Cohen (joint work with Rami Atar) Department of Mathematics University of Michigan Financial Mathematics Seminar University of Michigan March 11,
Competitive On-Line Admission Control and Routing By: Gabi Kliot Presentation version.
Yossi Azar Tel Aviv University Joint work with Ilan Cohen Serving in the Dark 1.
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Department of Computer Science Stanley P. Y. Fung Online Preemptive Scheduling with Immediate Decision or Notification and Penalties.
Competitive Queue Policies for Differentiated Services Seminar in Packet Networks1 Competitive Queue Policies for Differentiated Services William.
CSCI 256 Data Structures and Algorithm Analysis Lecture 6 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Loss-Bounded Analysis for Differentiated Services. By Alexander Kesselman and Yishay Mansour Presented By Sharon Lubasz
Frequency Capping in Online Advertising Moran Feldman Technion Joint work with: Niv Buchbinder,The Open University of Israel Arpita Ghosh,Yahoo! Research.
Non-Preemptive Buffer Management for Latency Sensitive Packets Moran Feldman Technion Seffi Naor Technion.
Buffering problems Moran Feldman Technion Based on joint work with Seffi Naor.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
Competitive Queueing Policies for QoS Switches Nir Andelman Yishay Mansour An Zhu TAUTAUStanford.
Tel Hai Academic College Department of Computer Science Prof. Reuven Aviv Markov Models for data flow In Computer Networks Resource: Fayez Gebali, Analysis.
GRF Overview Simple as UBR from end system view – End system does no policing or traffic shaping – May transmit at line rate of ATM adaptor Modest requirements.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
QoS & Queuing Theory CS352.
Randomized Queue Management for DiffServ
Topics discussed in this section:
Packet Forwarding.
Chapter 6 Queuing Disciplines
Haim Kaplan and Uri Zwick
Exercise Exercise Proof that
Greedy Algorithms / Interval Scheduling Yin Tat Lee
Alternating Bit Protocol
Maximal Independent Set
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Brian Babcock, Shivnath Babu, Mayur Datar, and Rajeev Motwani
On-time Network On-chip
Offset-Time-Based QoS Scheme
A new and improved algorithm for online bin packing
Richard Anderson Lecture 6 Greedy Algorithms
Greedy Algorithms / Caching Problem Yin Tat Lee
Network Simulation NET441
The Byzantine Secretary Problem
Richard Anderson Lecture 7 Greedy Algorithms
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Richard Anderson Winter 2019 Lecture 7
Clustering.
The Selection Problem.
Richard Anderson Autumn 2015 Lecture 7
CSE 486/586 Distributed Systems Reliable Multicast --- 2
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches
Competitively Chasing Convex Bodies
Richard Anderson Autumn 2019 Lecture 7
Presentation transcript:

The Greedy Algorithm for Buffer Management: A Personal Perspective Zvi Lotker Some slide contributed by Prof Boaz Patt-Shamir

Thanks! Credits: Aiello, Kesselman, Kushilevits, Kimbrel, Lotker, Mansour, Ostrovski, Rosen,Schieber, Sviridenko, van Stee (apologies for the others!)

Schematic Switch Structure link buffer input portsoutput ports buffer management incoming packets outgoing stream dropped packets

Model Discrete time. Packets: size = 1 Buffer space B In each step: Set of packets arrive: arbitrary! One packet transmitted: Alg. Set of packets dropped: Alg. Restriction: FIFO (a packet cannot be transmitted before an earlier packet ) Two values:  >1 Goal: maximize total value transmitted buffer management

5 Simple Results Theorem: Any deterministic algorithm has competitive ratio of at least Greedy Algorithm: upon overflow, discard cheapest packets Theorem: Competitiveness of Greedy at most 4.

6 The Lower Bound: Setup The algorithm is fixed for any input sequence The adversary picks an input sequence. To prove the bound, we consider two sequences If the algorithm does well on one, it does badly on the other We consider packets with one of two values: 1, and  >1. We construct the sequences parametrized by ,and then 1. Bound the best response of the algorithm (mininimize CR) 2. Choose  to maximize CR

7 The Lower Bound: Scenario B packets of value 1 arrive at time 0. In each time step 1..t, a single packet of value  >1 arrives. This continues until the algorithm transmits an  -value packet (i.e., the algorithm has no more 1-value packets) t “small”: no more packets. t “large”: B  -value packets arrive in together at time t+1.

8 The Lower Bound: Math Equating the two expressions and solving for t yields Letting t 0 (  ):=t 0 ( ,B)/B we get Which is maximized at   , for C 

An optimal off-line algorithm Sort all packets in decreasing value Resolve ties in favor of earlier packets (to get a unique schedule) Construct schedule: Start with an empty schedule Scan packets in order: add packet to schedule if resulting schedule is feasible

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 1: overflow resolution Sort all packets by decreasing value and within each value class, by increasing index.

An optimal off-line algorithm phase 2: re-order the packets in Fifo order.

20 Simple Upper Bound: Argument Consider a time interval [t,t+B]. Let A be the set of packets arriving in that interval. OPT can accept at most the 2B top packets of A B transmitted, B stored GREEDY sends in [t,t+2B] at least the B top packets of A. No packet can push them out in [t,t+B] If a value V is stored at time t+B, at least value V is sent in [t+B,t+2B]

21 Simple Upper Bound: Math OPT can accept at most the 2B top packets of A GREEDY sends in [t,t+2B] at least the B top packets of

22 Is It Really 4? Answer: competitive ratio can’t be better than 2 Bad scenario: is “cheap”, “valuable” GREEDY loses B out of 2B valuable packets B

23 Why 2? OPT discards all cheap packets immediately, sends only valuable ones. lose B cheap packets

24 Intermediate Summary Greedy Algorithm: Annoying gap in the analysis Buffer overflows: A hint of a much more general model Context: Adversarial Queuing Theory Basic question, rephrased: When are we guaranteed to avoid overflows Our viewpoint: overflows happen. Deal with them… These motivated the next step [STOC’01]

25 FIFO Buffers: Elegant Upper Bound Potential function: Idea: When OPT sends a valuable packet, potential can account for it by an excess packet in Greedy’s buffer. Total value in buffer of OPT Total value in the of ALG Value of first |Q OPT | packets in buffer of ALG

26 FIFO Buffers: Elegant Upper Bound Lemma: 2·ALG(t) - OPT(t)  . Proof: Wlog, OPT never preempts. Now, case analysis. Delivery: Assume both send together. Greedy sends maximal # packets. Therefore   -OPT(t) + 2ALG(t). Arrival: Need to prove that   0. If OPT rejects, result is immediate, because val(Q ALG ) may only increase.

27 FIFO Buffers: Elegant Upper Bound Lemma: 2·ALG(t) -OPT(t)  . Arrival: Need to prove that   0. If Greedy accepts: net change in first two terms  0, change in last term  0. If Greedy rejects & OPT accepts: increase in first term cannot be larger than decrease in last term: each packet in Q ALG at least as valuable as rejected packet. 2 nd term unchanged. QED

28 FIFO Buffers: Elegant Upper Bound Lemma: 2·ALG(t) -OPT(t)  . Theorem: ALG  ½ OPT. Proof: sum over steps, use Lemma, observe that initial and final  value is 0. QED

29 Not All Greedys Are Created Equal When an overflow occurs, may have several packets of the same value eligible to be discarded. Does it matter which we throw away? Tail-Drop: drop the newest Head-Drop: drop the oldest Theorem: Head-Drop is the best greedy algorithm (up to 3/2 better than Tail-Drop).

30 Head-Drop is the Best Greedy Algorithm The proof is based on two observations 1. All Greedy algorithms have the same buffer occupancy 2. Out of all Greedy algorithms, head-drop always has the least weight in its buffer The competitive viewpoint: A low-value packet sent is a waste of bandwidth

31 Head-Drop Beats Tail-Drop 3:2 Tail Drop Head Drop B/2 +B 1 + 3/2B

Overflows happen What should be dropped? Simplified model for QoS: each packet has a value, either 1 or  >1 Motivation: Each stream has a traffic descriptor Packets not conforming to their descriptors are marked In ATM: Cell Loss Prioirity (CLP) bit Conforming packets are expensive, non-conforming are cheap

Previous work GREEDY Algorithm [KLMPSS ’ 01]: Competitive ratio is 2, for any packet values DiffServ [KM ’ 01]: Competitive ratio  1.88 (2 packet values) Algorithm: each expensive packet ejects  cheap packets ahead of it Lower bound [KLMPSS ’ 01]: Competitive ratio for DiffServ  1.28

The Mark&Flush Algorithm for DiffServ: competitive ratio ~1.30 This work

Remainder of the talk Introduction  Off-line Algorithm  The mark & flush  Basic lemma  The worst case  Open problems

phase 1: overflow resolution The mark & flush Algorithm

phase 1: overflow resolution Greedy tail-drop phase 2: preemption Each expensive packet marks r cheap packets ahead of it. Marked packets are discarded when they reach the head of the buffer. NOTE: head-drop only! The Mark&Flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm

phase 2: preemption The mark & flush Algorithm If mf preempts a packet then mf send an expansive packet

Lemma 1: OPT(1) =mf(1) Let A be an arrival sequence such that v(on(1))=v(opt(1)). Then there exists another input sequence A' such that |A'|<|A| and Cr(A')  Cr(A).

Example Opt= On=

Example Opt= On= A`(1)=A(1)  A(2)-{p} A`(t)=A(t+1)

Example Opt= On= A`(1)=A(1)  A(2)-{p} A`(t)=A(t+1)

Example Opt= On= 7 7

Example Opt= On= 6 6 A`(1)=A(1)  A(2)-{p}  Drop A`(t)=A(t+1)

Example Opt= On= 6 6 A`(1)=A(1)  A(2)-{p}  Drop A`(t)=A(t+1)

The Main Lemma: Proof (1) If the common value of the first packet is 1, then both algorithms send the first packet  Can omit it from input stream to get A’ Not difficult to see remainder of schedules don’t change Cr(A) = mf A /opt A < (mf A -1)/(opt A -1) = Cr(A')

The Main Lemma: Proof (2) If the common value of the first packet is , then both algorithms send the first packet p OPT drops all cheap packets that arrive at t=1.  Define: A' (1)=Arrive[1,2]\{p}  Dropped mf (1) A' (t)=A(t+1) for t>1 Can show: remainder of OPT, MF don’t change Cr(A) = mf A /opt A < (mf A -  ) /(opt A -  ) = Cr(A')

Lemma 1: OPT starts cheap If the first packet sent by OPT is cheap, then it is the first packet to arrive. Proof: By our tie-breaking rule of OPT.

Lemma 2: OPT starts cheap If the first packet sent by OPT is cheap, then opt accepts all expensive packets until the first time the buffer of opt is empty. Proof: If opt dropped an expensive and the buffer is not empty then we can reject the first packet and accept the first expensive packets that opt dropped.

Lemma 3: OPT starts cheap Let A be an arrival sequence such that Val(opt(1))=1, Val(on(1))=  and opt does not accept some packet that arrives in the time interval [1,t z ]. Then there exists an arrival sequence A' such that |A'|<|A| and Cr(A')  Cr(A)

mf opt Lemma 3: OPT starts cheap p1p1 p2p2 p3p3 p4p4 p4p4

mf opt Lemma 3: OPT starts cheap p1p1 p2p2 p3p3 p4p4 p4p4

splitting point Def: Let A be an arrival sequence with duration t e. A time step t is called a splitting point if t<t e, there are no cheap packets in the buffers of on and opt, and and the number of expensive is equal.

splitting point Lemma Let A be an arrival sequence with splitting point t 0. Then there exists an arrival sequence A' such that |A'|<|A| and Cr(A')  Cr(A).

Example Opt= On=

Example Opt= On=

Lemma 4: OPT starts cheap Let A be an arrival sequence with no splitting points such that Val(opt(1))=1, Val(on(1))= , and opt does not drop any packet during steps 1, …,t z. Then Cr(A)  (r+  )/  Proof The buffer of mf is empty at time t z Mf don ’ t reject an expansive packets. Cr(A)  (n 1 +  n  )/ (n ’ 1 +  n  ) n 1  n ’ 1 +r n   n ’ 1 =0 Cr(A)  (r n  +  n  )/ (  n  ) = (r+  )/ 

Lemma 1: OPT starts expensive Suppose that Val(opt(1))=  and that Val(on(1))=1.Then there exists a time t e such that: opt sends only expensive packets in steps 1, …,t e. The buffer of opt and mf is full with expansive packets at time t e Prove : The first packet is cheap. If Opt don ’ t send the fist cheap packet then By our tie- breaking rule of OPT the buffer of OPT must be full with expansive The buffer of mf has more expansive packets than opt

Lemma 2: OPT starts expensive Suppose that Val(opt(1))=  and that Val(on(1))=1. Then for all time steps t  t e, Exp(Q opt (t))  Exp(Q on (t))  Exp(Q opt (t))+B/(r+1). Prove : By induction on time

Lemma 3: OPT starts expensive Let A be an unsplittable arrival sequence Suppose that Val(opt(1))=  and that Val(on(1))=1. Then if there exist t 1 <t e such that Exp(Q on (t 1 ))=B and Exp(Q opt (t e ))=B, then there exists another arrival sequence A' such that |A'|<|A| and Cr(A)  Cr(A`). Prove : We add an expansive packet to A at time t 1

Lemma 4: OPT starts expensive Let A be an arrival sequence with no splitting points such that Val(opt(1))= , Val(on(1))=1, and Exp(Q on (t))=B iff Exp(Q opt (t))=B then Cr(A)  (2+r)  /(1+  (1+r)) Proof Both mf and opt send the same nuber of packets Opt send only expansive packets. Cr(A)   (n 1 + n  )/ (n 1 +  n  ) B  n  n 1  B/(1+r) Cr(A)  (2+r)  /(1+  (1+r))

Two worst cases M&f

Two worst cases Opt sends only expensive packets Cr  (2+r)/(1+  +  r)

Two worst cases Opt sends all the packets Cr  (  +r)/ 

Put the pieces together Cr  max{(  +r)/ ,  (2+r)/(1+  +  r)} Solving the eq (  +r)/  =  (2+r)/(1+  +  r) We get that r(  )=(-1-  +  (4(  -1)  2 +(1+  ) 2 )/(2  )=   +0.5+O(1/   ) Cr=(-1-  + 2  2 +  (1+2  - 3  2 +4  3 )/(2  2 )=1+ 1/   +O(1/  )

Open problems (mandatory?) Close the gap What about more than two values? How about a network of buffers?

The Main Lemma: Pruning Let A be an arrival sequence such that OPT and MF send packets of the same value at the first step. Then there exists a shorter arrival sequence A' such that CompRatio(A)  CompRatio(A').

The Main Lemma: Proof (1) If the common value of the first packet is 1, then both algorithms send the first packet  Can omit it from input stream to get A’ Not difficult to see remainder of schedules don’t change Cr(A) = mf A /opt A < (mf A -1)/(opt A -1) = Cr(A')

The Main Lemma: Proof (2) If the common value of the first packet is , then both algorithms send the first packet p OPT drops all cheap packets that arrive at t=1.  Define: A' (1)=Arrive[1,2]\{p}  Dropped mf (1) A' (t)=A(t+1) for t>1 Can show: remainder of OPT, MF don’t change Cr(A) = mf A /opt A < (mf A -  ) /(opt A -  ) = Cr(A')