# An optimal algorithm for 2-bounded delay buffer management with lookahead

The bounded delay buffer management problem, which was proposed by Kesselman et al. (STOC 2001 and SIAM Journal on Computing 33(3), 2004), is an online problem focusing on buffer management of a switch supporting Quality of Service (QoS). The problem definition is as follows: Packets arrive to a buffer over time and each packet is specified by the release time, deadline and value. An algorithm can transmit at most one packet from the buffer at each integer time and can gain its value as the profit if transmitting a packet by its deadline after its release time. The objective of this problem is to maximize the gained profit. We say that an instance of the problem is s-bounded if for any packet, an algorithm has at most s chances to transmit it. For any s ≥ 2, Hajek (CISS 2001) showed that the competitive ratio of any deterministic algorithm is at least (1 + √(5))/2 ≈ 1.619. It is conjectured that there exists an algorithm whose competitive ratio matching this lower bound for any s. However, it has not been shown yet. Then, when s = 2, Böhm et al. (ISAAC 2016) introduced the lookahead ability to an online algorithm, that is the algorithm can gain information about future arriving packets, and showed that the algorithm achieves the competitive ratio of (-1 + √(13))/2 ≈ 1.303. Also, they showed that the competitive ratio of any deterministic algorithm is at least (1 + √(17))/4 ≈ 1.281. In this paper, for the 2-bounded model with lookahead, we design an algorithm with a matching competitive ratio of (1 + √(17))/4.

04/30/2020

### Randomized Two-Valued Bounded Delay Online Buffer Management

In the bounded delay buffer management problem unit size packets arrive ...
12/07/2020

### Breaking the Barrier of 2 for the Competitiveness of Longest Queue Drop

We consider the problem of managing the buffer of a shared-memory switch...
07/18/2018

### A φ-Competitive Algorithm for Scheduling Packets with Deadlines

In the online packet scheduling problem with deadlines (PacketScheduling...
05/22/2021

### An Algorithm for Reordering Buffer Management Problem and Experimental Evaluations on Discrete Distributions

In the reordering buffer management problem, a sequence of requests must...
07/09/2019

### New Competitiveness Bounds for the Shared Memory Switch

We consider one of the simplest and best known buffer management archite...
07/13/2018

### Optimal Algorithms for Right-Sizing Data Centers - Extended Version

Electricity cost is a dominant and rapidly growing expense in data cente...
06/08/2021

### Decentralized Learning in Online Queuing Systems

Motivated by packet routing in computer networks, online queuing systems...

## 1 Introduction

The online buffer management problem proposed by Aiello et al. [1] formulates the management of buffers to store arriving packets in a network switch with Quality of Service (QoS) support as an online problem. This problem has received much attention among online problems and has been studied for the last fifteen years, which leads to developing various variants of this problem (see comprehensive surveys [16, 28]). Kesselman et al. [23] proposed the bounded delay buffer management problem as one of the variants, whose definition is as follows: Packets arrive to a buffer over time. A packet is specified by the release time , value and deadline . An algorithm is allowed to transfer at most one packet at each integer time. If the algorithm transmits a packet between its release time and deadline, it can gain its value as the profit. The objective of this problem is to maximize the gained profit. The performance of an online algorithm for this problem is evaluated using competitive analysis [11, 29]. If for any problem instance, the profit of an optimal offline algorithm is at most times that of an online algorithm , then we say that the competitive ratio of is at most . We call a problem instance the -bounded instance (or -bounded delay buffer management problem) in which for any packet , . For any , Hajek [18] showed that the competitive ratio of any deterministic algorithm is at least . Also, it is conjectured that for any , there exists a deterministic algorithm with a competitive ratio of (see, e.g. [16]), which has not been proved yet.

There is much research among online problems to reduce the competitive ratio of an online algorithm for the original problems by adding extra abilities to the algorithm. One of the major methods is called the lookahead ability, with which an online algorithm can obtain information about arriving packets in the near future. This ability is introduced to various online problems: The bin packing problem [17], the paging problem [2, 12], the list update problem [3], the scheduling problem [27] and so on. Then, Böhm et al. [10] introduced the lookahead ability to the bounded delay buffer management problem, that is, they gave an online algorithm for this problem an ability to obtain the information about future arriving packets and analyzed its performance.

Previous Results and Our Results.    Böhm et al. [10] studied the 2-bounded bounded delay buffer management problem with lookahead. They designed a deterministic algorithm whose competitive ratio is at most . Also, they proved that the competitive ratio of any deterministic algorithm is at least .

In this paper, we showed an optimal online algorithm for this problem, that is, its competitive ratio is exactly .

Related Results.    As mentioned above, for the -bounded delay model without lookahead, Hajek [18] showed that the competitive ratio of any deterministic algorithm is at least in the case of . Independently, this bound was also shown in [13, 4, 30]. For , Englert and Westermann [15] developed a deterministic online algorithm whose competitive ratio is at most , which is the current best upper bound. For each  [23], 3 [5, 9], and 4 [10], an algorithm with a competitive ratio of was designed. For any , an algorithm with a competitive ratio of larger than but less than 2 was shown [5, 9]. Moreover, in the case where an algorithm must decide which packet to transmit on the basis of the current buffer situation, called the  memoryless case, some results were shown [5, 9, 15]. The agreeable deadline variant has also been studied. In this variant, the larger the release times of packets are, the larger their deadlines are. Specifically, for any packets and , if . The lower bound of by Hajek [18] is applicable to this variant. Li et al. [25, 21] displayed an optimal algorithm, whose competitive ratio matches the lower bound. The case in which for any packet , has also been studied, called the -uniform delay variant, which is a specialized variant of the agreeable deadline variant. The current best upper and lower bounds for this variant are  [25, 21] and  [14], respectively.

The research on randomized algorithms for the bounded delay buffer management problem has also been conducted extensively [13, 5, 9, 6, 19, 20, 21, 22]. In the case in which is general, the current best upper and lower bounds are  [5, 9, 22] and  [13], respectively, against an oblivious adversary were shown. Upper and lower bounds of  [6, 22] and  [6], respectively, against an adaptive adversary were shown. For any fixed , lower bounds are the same with the bounds in the case in which is general while upper bounds are  [22] against the both adversaries.

A generalization of the bounded delay buffer management problem has been studied, called the weighted item collection problem [7, 8, 22]. In this problem, an online algorithm does not know the deadline of each packet but knows the relative order of the deadlines of packets. Many other variants of the buffer management problem have been studied extensively (see e.g. [16, 28]).

## 2 Model Description

We formally give the definition of the 2-bounded delay buffer management problem with lookahead, which is addressed in this paper. An input of this problem is a sequence of phases. Time begins with zero and a phase occurs at an integer time. Each phase consists of three subphases. The first occurring subphase is the arrival subphase. At an arrival subphase, arbitrary many packets can arrive to a buffer. The buffer has no capacity limit and hence, all arriving packets can always be accepted to the buffer. A packet is characterized by the release time, deadline and value, denoted by , and respectively. Arrival times and deadlines are non-negative integers and values are positive reals. holds because we focus on 2-bounded instances. The second subphase is the transmission phase. At a transmission subphase, an algorithm can transmit at most one packet from its buffer if any packet. At the transmission subphase at a time , the algorithm can obtain the information about packets arriving at time using the lookahead ability. The third subphase is the expiration subphase. At an expiration subphase, a packet which has reached its deadline is discarded from its buffer. That is, at the expiration subphase at a time , all the packets in the buffer such that are discarded.

The profit of an algorithm is the sum of the values of packets transmitted by the algorithm. The objective of this problem is to maximize the gained profit. Let denote the profit of an algorithm for an input . Let be an optimal offline algorithm. We say that the competitive ratio of an online algorithm is at most if for any input , .

For ease of analysis, we assume that when does not store any packet in its buffer, the input is over. It is easy to see that this assumption does not affect the performance analysis of an algorithm.

## 3 Matching Upper Bound

### 3.1 Notation and Definitions for Algorithm

We give definitions before defining our algorithm CompareWithPartialOPT (). For any integer time , denotes the set of packets in ’s buffer immediately before the arrival subphase at time . That is, each packet in the set is not transmitted before , and . For integer times and and an input , let be an offline algorithm such that if the packets in ’s buffer immediately before the arrival subphase at time is equal to those in , and the subinput of during time is given to , that is, packets such that arrive to ’s buffer during time , then is allowed to transmit packets only from time to inclusive, and chooses the packets whose total profit is maximized. If there exist packets with the same value in ’s buffer, follows a fixed tie breaking rule. Also, denotes the set of packets transmitted by during time . Note that for any and , the following relations hold because of the optimality of packets transmitted by during time :

 P(t,t′,t′)⊆P(t,t′+1,t′+1) (1)
 P(t,t′,t′)⊆P(t,t′,t′+1) (2)

and

 P(t+1,t′,t′)⊆P(t,t′,t′). (3)

We define for any and ,

 mi(t)=P(t,t+i,t+i)∖P(t,t+i−1,t+i−1)

and

 qi(t)=P(t,t+i,t+i+1)∖P(t,t+i,t+i).

Also, we define

 P(t,t−1,t−1)=∅.

Furthermore, we describe each value in the algorithm definition for ease of presentation as follows:

 mi=mi(t)
 m′i=mi(t−1)
 m′′i=mi(t−2)
 qi=qi(t)
 q′i=qi(t−1)

and

 q′′i=qi(t−2).

 R=1+√174

and

 α=−3+√172.

uses the internal variable for holding the name of a packet which transmits at a time . null holds at first for any integer . uses the two constants tmp1 and tmp2 if at time , cannot decide which packet to transmit at in Cases 1.2.3.4 and 2.2.2.3. On the other hand, once the name of a packet is set to at time , certainly transmits the packet at .

### 3.2 Algorithm

CompareWithPartialOPT ()

Initialize: For any integer time , null.
Consider the transmission subphase at a time . If the buffer stores no packets, do nothing. Otherwise, do one of the following three cases and then transmit the packet whose name is set to .
Case 1 (null):
Case 1.1 (): .
Case 1.2 ():
Case 1.2.1 (): and .
Case 1.2.2 (): and .
Case 1.2.3 ():
Case 1.2.3.1 ( and ): and .
Case 1.2.3.2 ( and ): and .
Case 1.2.3.3 ( and ): and .
Case 1.2.3.4 ( and ): and tmp1.
Case 2 (tmp1):
Case 2.1 (): and .
Case 2.2 ():
Case 2.2.1 (): and .
Case 2.2.2 ():
Case 2.2.2.1 (): .
Case 2.2.2.2 ( and ): and .
Case 2.2.2.3 (Otherwise): and tmp2.
Case 3 (tmp2):
Case 3.1 (): and .
Case 3.2 ():
Case 3.2.1 (): and .
Case 3.2.2 ( and ): .
Case 3.2.3 ( and ): and .

### 3.3 Overview of the Analysis

Consider a given input . Let be the time at which transmits the last packet. We partition the time sequence into sequences to evaluate the competitive ratio of , in which depends on and if , then , , and for any , . The size of each depends on which case executes at each time. Specifically, it is defined as follows: Suppose that and then

• If Case 1.1 is executed at , then .

• If Case 1.2.1, 1.2.2, 1.2.3.1, 1.2.3.2 or 1.2.3.3 is executed at , then .

• If Case 1.2.3.4 is executed at and Case 2.1, 2.2.1 or 2.2.2.2 at , then .

• If Cases 1.2.3.4 and 2.2.2.1 are executed at and , respectively, then .

• If Cases 1.2.3.4 and 2.2.2.3 are executed at and , respectively, and Case 3.1, 3.2.1 or 3.2.3 is executed at , then .

• If Cases 1.2.3.4 and 2.2.2.3 are executed at and , respectively, and Case 3.2.2 is executed at , then .

For a time , a packet whose release time is and deadline is is called a -packet. On the other hand, we also partition the time sequence into time sequences , in which is the time at which transmits the last packet. We will compare the total value of packets transmitted by during the time with that by during the time . is defined as follows: Suppose that . Then, we define , in which if transmits a -packet at time and transmits at time , then and otherwise, . Moreover, if transmits a -packet and transmits at time , then . Otherwise, .

We give the lemma about .

###### Lemma 3.1

A time is contained in some .

• We prove this lemma by contradiction and assume that a time is not contained in any . By the assumption of a given input, transmits a packet at . If transmits a packet at , then is contained in some and is contained in either or by the definition of . Thus, does not store any packet at and does not transmit a packet. That is, no packets arrive at . A packet transmitted by at is a -packet. If not, can transmit at . Hence, transmits at time . By the definition of , executes Case 1.2.3.2, 1.2.3.3, 2.2.2.2 or 3.2.3 and transmits at , which is the last time of . Therefore, is contained in by the definition of , which contradicts the above assumption.

For any , let () denote the total value of packets transmitted by () during (). By definition,

 VCP(σ)=k∑i=1Vi.

By Lemma 3.1,

 VOPT(σ)≤k∑i=1V′i.

Since

 VOPT(σ)VCP(σ)≤∑ki=1V′i∑ki=1Vi≤maxi∈[1,k]{V′iVi},

we have using Lemma 3.7,

 V′iVi≤R.

Therefore, we have the following theorem:

###### Theorem 3.2

The competitive ratio of is at most .

### 3.4 Analysis

To show Lemma 3.7, we first prove the following lemmas. Let denote the total value of packets in . That is, .

###### Lemma 3.3

For integer times and , suppose that and a packet that transmits at is not a -packet. Then, .

• Suppose that . First, we consider does not transmit a -packet at time . Then, by definition,

 T′i=(t,t′). (4)

Furthermore, all the -packet, which arrive at , are stored in ’s buffer at time . Hence, since we discussed the 2-bounded instance in this paper, all the packets in ’s buffer at are stored in ’s buffer. Thus, by the optimality of from Eq. (4),

 V′i≤V(t,t′,t′).

Next, we consider the case in which transmits a -packet at . First, let us consider the case in which does not transmit at . By definition,

 T′i=(t,t′). (5)

At time , ’s buffer may store but ’s buffer does not. However, it does not affect a packet which transmits at whether is stored in ’s buffer because does not transmit at . Hence, by the optimality of from Eq. (5),

 V′i≤V(t,t′,t′).

Second, we discuss the case in which transmits at . By definition,

 T′i=(t+1,t′).

Therefore,

 V′i≤V(t+1,t′,t′)≤V(t,t′,t′),

in which the second inequality follows from Eq. (3).

###### Lemma 3.4

For integer times and , suppose that and a packet that transmits at is a -packet. Then, .

• Suppose that . We have in a similar way to the proof of Lemma 3.3, either or . Thus,

 V′i≤V(t+1,t′,t′)≤V(t,t′,t′).

Hence, by Eq. (2),

 V′i≤V(t,t′,t′+1).

Second, we consider the case in which transmits a -packet at which transmits at . If transmits a -packet at and transmits at , then . Otherwise, . In the either case, we have in a similar way to the proof of Lemma 3.3,

 V′i≤V(t,t′+1,t′+1).

Since transmits a packet at time which arrives at time , packets arriving at does not matter to . Thus,

 P(t,t′+1,t′+1)=P(t,t′,t′+1),

 V′i≤V(t,t′,t′+1).

###### Lemma 3.5

Let be an integer time. If executes Case 2.2.2.1 at time , then transmits and at times and , respectively.

• Suppose that Case 2.2.2.1 is executed at a time . Then, note that by the condition of Case 2.2.2.1. First, let us consider the case in which . By the definition of , . However, is neither nor by the definition of . Also, obtains a higher profit by in instead of in . That is, . Thus, , which contradicts the optimality of .

In the following, we consider the case in which . contains one packet which transmits at time . Also, contains , which is not in . transmits at or after . Furthermore, because by the condition of Case 2.2.2. In a similar way to the proofs of Lemmas 3.3 and 3.4, we can show that packets in ’s buffer at is included in ones in ’s buffer at . Therefore, transmits and at or after and transmits and at and .

###### Lemma 3.6

Let be an integer time. If executes Case 3.2.2 at time , then transmits , and at times , and , respectively.

• We can show the proof of this lemma in a similar way to the proof of Lemma 3.5. Suppose that Case 2.2.2.3 is executed at a time and Case 3.2.2 is executed at . Note that by the condition of Case 2.2.2.3 and by the condition of Case 3.2.2. If , then can transmit during time instead of concerning , which contradicts the optimality of .

Thus, . contains one packet transmitted by at time . Also, contains , which is not in , and transmits at or after . Moreover, since by the condition of Case 2.2.2, . Therefore, transmits and at or after and transmits , and during time .

We are ready to prove Lemma 3.7.

###### Lemma 3.7

.

• Suppose that executes Case 1 at a time and is contained in . Note that if executes Case 1.2.3.4 at , then executes Case 2 at time . Moreover, if executes Case 2.2.2.3 at , then executes Case 3 at time . For ease of presentation, and denote and , respectively.

Before proceeding to the proof, we give some inequalities used often later. When executes Case 1.2.3.4 at , by the condition of Case 1.2.3.4,

 v(m0)

and

 v(q1)>(R−1)(v(m0)+v(m1)). (7)

When executes Case 2.2 at ,

 v(m2)>(R−1)(v(m0)+v(m1))+Rv(q1). (8)

When executes Case 3.2 at ,

 v(m3)>(R−1)(v(m0)+v(m1)+v(m2))+Rv(q1). (9)

When executes Case 2.2.2.3 at ,

 v(m0)>(R−1)(v(q2)+v(m1)+v(m2)) = (R−1)(v(q1)+v(m1)+v(m2)) (by the % condition of Case~{}2.2.2.3) > (R−1)(v(q1)+v(m1))+(R−1)((R−1)(v(m0)+v(m1))+Rv(q1)) (by Eq.~{}(???)) = (R2−1)v(q1)+(R2−R)v(m1)+(R2−2R+1)v(m0) > (R2−1)(R−1)(v(m0+v(m1))+(R2−R)v(m1)+(R2−2R+1)v(m0) (by Eq.~{}(???)) = (R3−3R+2)v(m0)+(R3−2R+1)v(m1).

By rearranging this inequality, we have

 v(m0)>R3−2R+1−R3+3R−1v(m1). (10)

Now we discuss the profit ratio for the execution of each case. When executes Case 1.1, transmits at and . On the other hand, by Lemma 3.3. Thus, .

When Case 1.2.1 or 1.2.2 is executed, transmits both and and . By Lemma 3.3, . Thus, .

We consider Case 1.2.3.1. transmits and at times and , respectively, by definition. Thus,

 Vj=v(q1)+v(m0).

Since by the definition of , by Lemma 3.3,

 V′j≤V(t,t+1,t+1)=v(m0)+v(m1).

Hence,

 V′jVj≤v(m0)+v(m1)v(q1)+v(m0)≤v(m1)+v(m1)αv(m1)+v(m1)=2α+1=R,

in which the second inequality follows from and , which is the condition of Case 1.2.3.1, and the last equality follows from the definitions of and .

Let us consider Case 1.2.3.2. Since transmits and at and , respectively, by definition,

 Vj=v(m0)+v(m1).

and by definition. If does not transmit at , we have using Lemma 3.3,

 V′j≤V(t,t+1,t+1)=v(m0)+v(m1).

Thus, . If transmits at , we have using Lemma 3.4,

 V′j≤V(t,t+1,t+2)=v(q1)+v(m0)+v(m1).

By these inequalities,

 V′jVj≤v(q1)+v(m0)+v(m1)v(m0)+v(m1)<αv(m0)+v(m0)+v(m0)v(m0)+v(m0)=α+22=R,

in which the second inequality follows from and , which is the execution condition of Case 1.2.3.2, and the last equality is immediately from the definitions of and .

We consider Case 1.2.3.3. Since transmits and at and , respectively,

 Vj=v(m0)+v(m1).

In a similar way to the proof of Case 1.2.3.2, if does not transmit at , it follows from Lemma 3.3 that

 V′j≤V(t,t+1,t+1)=v(m0)+v(m1).

Thus, . If transmits at time , we have by Lemma 3.4,

 V′j≤V(t,t+1,t+2)=v(q1)+v(m0)+v(m1).

By the condition of Case 1.2.3.3,

 V′jVj≤v