Delay-Aware Wireless Network Coding in Adversarial Traffic

11/19/2019 ∙ by Yu-Pin Hsu, et al. ∙ 0

We analyze a wireless line network employing wireless network coding, i.e., the reverse carpooling setting. The two end nodes exchange their packets through relays. While a packet at a relay might not find its coding pair upon arrival, a transmission cost can be reduced by waiting for coding with a packet from the other side. To strike a balance between the reduced transmission cost and the cost incurred by the packet delay, a scheduling algorithm for determining either to transmit an uncoded packet or to wait for coding is needed. Because of highly uncertain traffic injections, a scheduling algorithm with no assumption of the traffic is not only critical but also practical. In this paper, we propose a randomized online scheduling algorithm for a relay in arbitrary traffic, which can be non-stationary or even adversarial. The expected total cost (including a transmission cost and a delay cost) incurred by the proposed algorithms is (asymptotically) at most e/(e-1)   1.58 times the minimum total cost achieved by an optimal offline scheduling algorithm. In particular, the proposed algorithm is universal in the sense that that ratio is independent of the traffic. With the universality, the proposed algorithm can be implemented at each relay distributedly in a multi-relay network; meanwhile, it can ensure the same ratio for each relay. The proposed algorithm is also validated in stationary stochastic traffic via computer simulations. Moreover, we link our delay-aware coding problem with the classic ski-rental problem. The proposed algorithm turns out to generalize the classic ski-rental online algorithm from several perspectives.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

Fig. 1: Relay networks with wireless network coding: (a) single-relay network; (b) multi-relay network.

There has been a dramatic proliferation of research on wireless network coding. The wireless network coding can substantially reduce the number of transmissions by exploiting the broadcast nature of wireless medium, resulting in power saving. Illustrated in Fig. 1-(a), two end nodes and exchange their packets, and , respectively, through a relay. The conventional communication technique (without network coding) requires four transmissions (two for each packet). Leveraging the wireless network coding, only three transmissions are required; precisely, nodes and send packets and to the relay, and the relay broadcasts the linear combination (over XOR) to both end nodes. Each end node can recover its desired packet by subtracting the packet it transmitted previously from the received packet . In general, the wireless network coding can save up to 50% of transmissions as long as the number of relays in a line network in Fig. 1-(b) (as also called the reverse carpooling [16]) is large.

To benefit from the wireless network coding, a relay has to create sufficient coded packets; however, a coded packet at the relay can be created only when packets from both sides are available. Precisely, a relay in Fig. 1-(b) maintains two queues and storing packets from both sides, respectively. If both queues are non-empty, then the relay can construct coded packets by combining packets from both queues. However, what should the relay do if only one queue is non-empty? Should the relay wait for coding in the future or just transmit uncoded packets from the non-empty queue? To fully realize the advantage of the wireless network coding would incur packet delays, whereas always transmitting uncoded packets to minimize the delays causes a larger number of transmissions. Therefore, a scheduling algorithm for determining when to code is crucial.

The scheduling problem for a single-relay network as in Fig. 1-(a) under stationary stochastic traffic has been investigated leveraging stochastic control techniques, like Lyapunov theory (e.g., [3]

) or Markov decision processes (e.g.,

[7]). All the prior solutions fail to generalize to non-stationary or adversarial (worst-case) traffic. In particular, they cannot be implemented at each relay distributedly in a multi-relay network with provable performance guarantees. However, non-stationary or adversarial traffic has gained increasing importance in recent years. On one hand, external traffic injections at nodes or can arbitrarily generated by their sources, following no particular probabilistic assumption. On the other hand, the relay cannot expect the scheduling algorithms employed by nodes and to follow a stationary probabilistic distribution. In particular, [1] claimed that the adversarial traffic is a better traffic model. Because of those practical issues, the research on the adversarial traffic has attracted much attention in recent years (e.g., [14]). Although network coding design for adversarial channels has been an active area (e.g., [18]), little attention was given to the adversarial traffic in network-coding-enabled networks. To fill the gap, this paper aims to develop a universal scheduling algorithm for arbitrary traffic with a provable performance guarantee.

Moreover, note that the ski-rental problem [10] is a classic problem in an adversarial setting, where for each day a skier decides either to buy a ski or to continue renting a ski without knowing the skier’s last vacation, e.g., the day when the snow melts. The ski-rental setting has been exploited in several works (e.g., [12]) for managing delays under some uncertainties. This paper shows that the proposed scheduling algorithm can solve generalized ski-rental scenarios.

I-a Contributions

Our main contribution lies in designing and analyzing scheduling for delay-aware wireless network coding in adversarial traffic. The objective is to minimize a total cost, including a transmission cost and a delay cost, for each relay. To reach the goal, we show that our problem can be cast into a linear program. Leveraging

primal-dual techniques [2] for the linear program, we propose a randomized online scheduling algorithm for each relay in a multi-relay network. In particular, the proposed algorithm can guarantee that the worst-case ratio between the expected total cost incurred by the proposed online algorithm and that incurred by an optimal offline algorithm is (asymptotically) . In addition to the theoretical worst-case analysis, the average-case analysis is conducted via computer simulations. Moreover, it turns out that the proposed algorithm can generalize the classic ski-rental algorithm to several scenarios.

I-B Related works

Scheduling design for network-coding-enabled networks has been extensively explored from various perspectives. Most of scheduling works (with network coding) focused on maximizing throughput (perhaps with some constraints like power consumption); for example, the works appeared in [16, 23, 17, 25, 15, 6, 4, 11, 5, 9]: while [16, 23, 17, 25] considered deterministic optimization problems, [15, 6, 4, 11, 5, 9] considered dynamic control problems. The work [15] studied single-hop networks. While [6] analyzed multi-hop networks with intra-session network coding, [4, 11] analyzed those with inter-session network coding. The work [5] developed a dynamic network coding scheme. A distributed scheduling algorithm in network-coding-enabled networks was proposed in [9]. In addition to the throughput-optimal design, [20, 13] considered some utility optimization problems when network coding is enabled. Moreover, many works investigated delay-optimal design for single-hop networks (with random network coding), e.g., [22, 21, 19].

The most relevant works on the trade-off between delays and power consumption (with wireless network coding) in relay networks are [3, 7]. While [3] proposed a scheduling algorithm using Lyapunov techniques, [7] showed the optimality of a threshold-type scheduling algorithm using Markov decision processes. All those prior solutions were based on stochastic models with some stationary assumptions but cannot apply to non-stationary settings, especially in multi-relay networks. In contrast, we explores the trade-off in non-stationary settings. Our solution not only solves the delay-aware coding problem in the adversarial traffic, but also generalizes the classic ski-rental scheduling algorithm in [2].

Ii System overview

Ii-a Network model

Consider a wireless line network in Fig. 1-(b). The two end nodes and send and packets, respectively, to each other through shared relays. Divide time into slots and index them by . Suppose that a perfect schedule (i.e., MAC protocol) of wireless links is given, e.g., CSMA, TDMA, or FDMA (as also assumed in [16, 3, 17, 7]); therefore, during each slot, each relay can transmit some packets under a transmission constraint without any interference.

Consider a relay in Fig. 1-(b) maintaining two queues and for storing packets from both sides, respectively. At the beginning of each slot , there are new packets arriving at queue and new packets arriving at queue . By we define an arrival pattern for the relay. The arrival pattern depends on the number of packets transmitted (in the previous slot) by its neighboring nodes. The arrival pattern is arbitrary, which can be non-stationary or even adversarial.

Let and be the number of packets at queues and , respectively, immediately after the packet arrivals in slot . If and , then the relay idles in slot . If and , then the relay transmits some XOR-coded packets (under the transmission constraint) by combining packets from both queues. After transmitting the coded packets, if only one queue is non-empty and the relay can transmit more packets in that slot, then the relay has two options: to transmit some uncoded packets from the non-empty queue or to idle with the hope of receiving matching packets in the next slot. While always to transmit minimizes the delays, to idle provides coding for saving the number of transmissions.

Let be the relay’s decision on the number of packets (including both uncoded and coded packets) transmitted in slot . We assume that the broadcast channel from the relay to its neighboring nodes is noiseless. This simple model facilitates to explore the delays for coding in the arbitrary arrival pattern. In fact, our design can extend to adversarial ON-OFF channels (see Remark 23 later). Under the noiseless assumption, the queueing dynamics is

for all and . For example, if , , and , then the relay transmits three XOR-coded packets combining from queues  and , and transmits one uncoded packets from queue .

A scheduling algorithm for the relay specifies decision for each slot . A scheduling algorithm is called an offline scheduling algorithm if arrival pattern is given as a prior. In contrast, a scheduling algorithm is called an online scheduling algorithm is arrival pattern  (along with the numbers and of packets) is unavailable; instead, it knows the present arrivals and only, for each slot .

Ii-B Problem formulation

To capture the trade-off between the delays and the number of transmissions, we define a holding cost and a transmission cost as follows. Suppose that holding a packet at the end of a slot incurs a cost of one unit. Moreover, suppose that each packet transmission takes a constant cost of units, where we assume that transmitting a coded packet incurs the same transmission cost as transmitting an uncoded packet. See Remark 5 for non-consistent costs for transmitting coded and uncoded packets.

Given arrival pattern , we define a total cost under scheduling algorithm by

(1)

where the first term reflects the cost of transmitting packets in slot  and the other terms reflects the cost of delaying all remaining packets for one slot. Since we consider the finite numbers and , the minimum achievable total cost is finite.

We aim to develop an online scheduling algorithm such that the total cost is minimized for all possible arrival patterns . However, without knowing arrival pattern  (along with the total numbers and of packets) in advance, an online scheduling algorithm is unlikely to achieve the minimum total cost (obtained by an optimal offline scheduling algorithm). We characterize our online scheduling algorithm in terms of the competitiveness against an optimal offline scheduling algorithm, defined as follows.

Definition 1.

For arrival pattern , let be the minimum total cost for all possible (offline) scheduling algorithms . Then, an online scheduling algorithm  is called -competitive if

for all possible arrival patterns , where is called the competitive ratio of the online scheduling algorithm .

Remark 2.

-competitive online scheduling algorithm guarantees that the resulting total cost is at most  times the minimum total cost, regardless of arrival patterns . Thus, while the scheduling algorithm can be implemented at each relay in the multi-relay network in a distributed way, it guarantees the competitive ratio  for each relay.

We aim to design and analyze an online scheduling algorithm for minimizing the competitive ratio.

Iii One-sided adversarial traffic

We start with a fixed number of packets waiting for coding; in particular, this section focuses on the following setting:

  1. queue has all (with ) packets initially, i.e., and for all ;

  2. queue is injected by an arbitrary traffic with a total of packets;

  3. the relay can transmit any number of packets in each slot.

The setting is referred to as the one-sided adversarial traffic. With the first and second assumptions, we can focus on a fixed number of packets at queue waiting for coding, while capturing the key feature of the adversarial arrival pattern at queue . In fact, the first assumption is practical as well for bursty traffic at queue . Section IV will also generalize to two-sided adversarial traffic. Note that, under the first assumption, the relay never delays the packets at queue for minimizing the total cost. The third assumption is made for delivering a clear insight into our innovation. Lemma 14 will analyze the maximum number of transmissions required by the proposed online scheduling algorithm; moreover, Section IV-E will extend to a transmission constraint.

This paper approaches the scheduling problem by primal-dual techniques [2] for a linear program. While showing that the offline scheduling problem for this setting can be solved by a linear program in Section III-A, we propose a primal-dual formulation. The primal-dual formulation will be exploited later in Section III-B for designing and analyzing our online scheduling algorithm.

Iii-a Primal-dual formulation

This section casts the offline scheduling problem (under the one-sided adversarial traffic) into a linear program. To that end, we introduce some variables:

  • : the number of packets at queue transmitted without coding in slot 1.

  • : the number of packets at queue at the end slot of .

Given arrival pattern and scheduling algorithm , the total cost in Eq. (1) under the one-sided adversarial traffic can be expressed by

where the first term is the cost of transmitting all packets at queue , the second term is the cost of transmitting uncoded packets at queue  (i.e., transmitting coded packets at queue  is free), and the last term is the cost incurred by holding packets at queue . By removing the constant , we have the following scheduling problem:

Problem 3.

Under the one-sided adversarial traffic, develop a scheduling algorithm for the packets at queue  such that the cost is minimized.

Remark 4.

Problem 3 can be linked with the classic ski-rental problem. We can think of each packet at queue  as a skier and think of a slot when a packet arrives at queue  as the time when a skier has to leave. Moreover, buying a ski takes dollars while renting a ski for a day takes one dollar. With the transformation, Problem 3 considers a group of skiers (i.e., the packets at queue ) with potentially different last vacation days (i.e., the arriving slots at queue ). Those skiers cooperatively make buying or renting decision in each slot for minimizing the buying cost plus renting cost (i.e., ).

Remark 5.

If transmitting a coded packet incurs a cost of units and transmitting an uncoded packet incurs a different cost of units with , then the total cost in Eq. (1) becomes

where the term is the extra cost for transmitting the coded packets. Then, we can replace cost in Problem 3 with . Note that . If were higher than , then transmitting a coded packet by combining two packets would not save any cost from transmitting two uncoded packets. The rest of the paper focuses on the constant cost without loss of generality.

Next, we propose the following integer program for optimally solving Problem 3 in the offline fashion:

Integer program:

(2a)
s.t. (2c)

where is the total number of packets arriving at queue  until slot . The constraint in Eq. (2c) is because for each slot the number of packets at queue is at least , where packets at queue are transmitted without coding in slot and at most packets at queue are transmitted with coding by slot . A solution to integer program (2) can optimally solve Problem 3 if arrival pattern is given in advance: transmitting uncoded packets in slot 1 and other packets always wait for coding.

Next, by relaxing the integrality constraint in Eq. (2c) to real numbers, we obtain the following linear program.

Linear program (primal program):

(3a)
s.t. (3c)

The next lemma shows that the relaxation has no integrality gap; as such, the offline scheduling problem can be solved in polynomial time.

Lemma 6.

The relaxation from integer program (2) to linear program (3) has no integrality gap.

Proof.

See Appendix A. ∎

We refer to linear program (3) as a primal program and express its dual program as follows.

Dual program:

(4a)
s.t. (4c)

The primal-dual formulation will be employed for developing an online scheduling algorithm.

Iii-B Primal-dual algorithm

This section proposes a primal-dual algorithm in Alg. 1 for obtaining a feasible solution to primal program (3) and dual program (4). The primal-dual algorithm does not have arrival pattern as a prior; instead, it can obtain the present arrivals and only, for each slot . Section III-D will propose a randomized online scheduling algorithm by exploiting the solution from the primal-dual algorithm. The underlying idea is that the intermediate solution for in primal program (3

) produced by the primal-dual algorithm in each slot can suggest the probability of transmitting an uncoded packet in that slot. In contrast, the solution to dual program (

4) produced by the primal-dual algorithm is used to analyze the primal objective value in Eq. (3a) computed by the algorithm.

/* Initialize all variables at the beginning of slot as follows: */
1 , , for all ;
for all ;
  // Auxiliary variables.
;
  // is a constant.
/* For each new slot , the variables are updated as follows: */
2 for  to  do
3       if   then
4             ;
5             ;
6             ;
7            
8       end if
9      
10 end for
11;
12 ;
Algorithm 1 Primal-dual algorithm for solving primal program (3) and dual program (4).

Alg. 1 initializes all variables (in Lines 1 and 1) at the beginning of slot 1. Obtaining the present arrivals and at the beginning of each new slot , Alg. 1 updates all variables for slot . For updating the value of , Alg. 1 introduces a set of auxiliary variables (initialized in Line 1). The underlying idea is that the value of can suggest the probability of transmitting the -th (counted from the head of queue ) packet at queue without coding. Precisely, for each slot , Line 1 increases the value of for those packets potentially staying at queue :

  • A total of packets arrives at queue by slot , yielding at most coded packets at queue until . As such, Line 1 considers , for until , because only the -th packet until the -th packet might wait at queue in slot , but other packets have been transmitted with coding by slot .

  • Moreover, if the value of is greater than or equal to one (i.e., the condition in Line 1 fails), then the -th packet has been transmitted without coding by slot . Thus, Line 1 updates only those ’s satisfying the condition in Line 1.

The constant used in Line 1 is specified in Line 1 for satisfying the dual constraint in Eq. (4c). Then, Line 1 sets the value of to be that of , counting for all packets at queue .

Moreover, Alg. 1 introduces another set of auxiliary variables for all , and updates the value of to be that of (in Line 1) in slot for satisfying the constraint in Eq. (3c). Again, the value of is set to be that of in Line 1, counting for all packets at queue . In addition, the value of is updated to be one in Line 1 for maximizing the dual objective value in Eq. (4a) subject to the constraints in Eq. (4c).

Iii-C Analysis of Alg. 1

Since the values of all variables can be updated by Alg. 1 in each slot, the following proofs use , , , , , , , , to represent the corresponding values at the beginning (before update) of slot ; use , , , , , , , , to represent the corresponding values at the end (after update) of slot . Note that , , , , , , , , is the solution produced by Alg. 1. In fact, Alg. 1 will not update any variable after slot (see Remark 9 later).

The next lemma establishes the primal feasibility of Alg. 1.

Lemma 7.

Alg. 1 produces a feasible solution to primal program (3).

Proof.

See Appendix B. ∎

The next lemma establishes the dual feasibility of Alg. 1. For proving the lemma, we define the increment (under Alg. 1) of the value of in slot by . From [2], we can obtain that for all ; moreover, if , then for . That is, forms a geometric sequence, with the initial value of and the ratio of .

Lemma 8.

Alg. 1 produces a feasible solution to dual program (4).

Proof.

First, the dual constraint in Eq. (4c) holds obviously according to Lines 1 and 1. Second, we will show that the value of in Eq. (4c) computed by Alg. 1 is less than or equal to . Note that Line 1 updates the value of to be one if the condition in Line 1 holds. Thus, it suffices to show that the condition in Line 1 fails at the end of slot , i.e., the value of is zero for all .

If in slot , then we can obtain

where (a) is because the sequence is the geometric sequence with the initial value of and the ratio of . Thus, the value of for all is zero since the condition in Line 1 fails. ∎

Remark 9.

According to the proof of Lemma 8, Alg. 1 no longer updates the values of all variables after slot .

The next theorem analyzes the primal objective value in Eq. (3a) computed by Alg. 1.

Theorem 10.

Let be the minimum objective value in linear program (3). Then, the primal objective value in Eq. (3a) computed by Alg. 1 is bounded above by

for all possible arrival patterns .

Proof.

Let be the increment (under Alg. 1) of the primal objective value in Eq. (3a) in slot and let be that of the dual objective value in Eq. (4a) in slot . Appendix C establishes that

for all . Let and be the primal and dual objective values, respectively, computed by Alg. 1. Then, and ; therefore, the result follows since

where the last inequality is due to the weak duality [2]. ∎

Iii-D Randomized online scheduling algorithm

/* Initialize all variables at the beginning of slot as follows: */
1 ;
;
  // is a constant.
2 Pick a uniformly random number ;
/* For each new slot , perform as follows: */
3 Transmit coded packets;
/* After transmitting the coded packets, if queue  is non-empty, then continute as follows: */
4 for  to  do
5       if   then
6             ;
7            
8       end if
9      
10 end for
11 ;
12 ;
13 while 1 do
14       if   then
15             Transmit an uncoded packet from queue ;
16             ;
17            
18       else  //
19             break;
20            
21       end if
22      
23 end while
Algorithm 2 Randomized online scheduling algorithm for the one-sided adversarial traffic model.

Leveraging Alg. 1, this section proposes a randomized online scheduling algorithm in Alg. 2. For each slot , Alg. 2 transmits coded packets (in Line 2) by combing the packets left at queue  and the new arriving packets at queue . Then, to decide whether to transmit uncoded packets for each slot, Lines 2 - 2 and 2 update the values of and in the same way as Alg. 1 does. In addition, Alg. 2 uses another variable (in Line 2) to record the value of at the beginning (before update in Line 2) of each slot. Let be the value of at the end of slot .

At the beginning of slot , Line 2 chooses a random number

from a continuous uniform distribution between 0 and 1. According to Lines 

2 - 2, if there exists a such that , then the relay transmits an uncoded packet in slot . Note that, if there are multiple ’s such that , then the relay transmits multiple uncoded packets in slot , until the present value of is greater than or equal to (as in Line 2).

Let () be the increment of the value of in slot . The idea behind Alg. 2 is that, with the random value of , the expected number of uncoded packets transmitted in slot  is exactly .

Theorem 11.

The expected competitive ratio of Alg. 2 is

approaching as tends to infinity.

Proof.

We show that the expected cost of transmitting uncoded packets by Alg. 2 is , which is the value of the first term in Eq. (3a) computed by Alg. 1. Moreover, we show that expected number of packets left at queue at the end of slot under Alg. 2 is less than or equal to , which is the value of the second term in Eq. (3a) computed by Alg. 1. Thus, the expected cost incurred by Alg. 2 is less than or equal to the primal objective value in Eq. (3a) computed by Alg. 1. Then, the result immediately follows from Theorem 10. See Appendix D for details. ∎

Remark 12.

Because the classic ski-rental problem is a special case (with and ) of our problem and the minimum (asymptotic) competitive ratio of the ski-rental problem is [10], Alg. 2 also (asymptotically) achieves the minimum competitive ratio.

Remark 13.

We want to emphasize that the competitive ratio in Theorem 11 is independent of arrival patterns . Thus, Alg. 2 can be implemented at each relay in the multiple-relay network; meanwhile, it can ensure the same competitiveness for each relay.

The next lemma investigates the maximum number of uncoded packets per slot required by Alg. 2.

Lemma 14.

Alg. 2 transmits at most three uncoded packets in each slot.

Proof.

Since is the geometric sequence with the initial value of and the ratio of for all , we have

Moreover, because of , , and (from the assumption for the one-sided traffic), we have . Thus, at most three ’s such that , i.e., Alg. 2 transmits at most three uncoded packets in each slot. ∎

Iv Two-sided adversarial traffic

This section relaxes the first assumption (but keeps the second and third assumptions) in the one-sided adversarial traffic by allowing arbitrary traffic at both queues and , and refers to the setting as the two-sided adversarial traffic. Moreover, motivated by an interesting and practical scenario where packets from an end node are delay-tolerant but those from the other end node are delay-sensitive (e.g., real-time traffic), we first consider the case when the packets at queue can wait for coding but those at queue have to be transmitted immediately upon arrival. This model can make us focus on the decision for a queue while capturing the key feature of the two-sided adversarial traffic. Section IV-D will extend our design to the general case when packets at both queues can wait for each other.

We introduce some variables similar to Section III:

  • : indicate if the -th packet at queue is transmitted without coding upon arrival, where if the packet is transmitted without coding; otherwise;

  • : the number of packets at queue  at the end of slot .

We have the following problem similar to Problem 3.

Problem 15.

Under the two-sided adversarial traffic, develop a scheduling algorithm for the packets at queue  such that the cost is minimized.

Remark 16.

Following the argument in Remark 4, Problem 15 considers a group of skiers arriving arbitrarily with potentially different last vacation days. Those skiers cooperatively make buying or renting decision in each slot for minimizing the buying cost plus renting cost.

Section IV-A discusses ideas underlying another primal-dual formulation that will be proposed by Section IV-B for solving Problem 15. With the new primal-dual formulation, Section IV-C proposes a primal-dual algorithm for solving Problem 15 in the online fashion.

Iv-a Ideas underlying the primal-dual formulation

The next example shows that an immediate extension from linear program (3) along with Alg. 1 cannot solve Problem 15 with the competitive ratio in Theorem 10.

Example 17.

Suppose that two packets arrive at queue in slots 1 and 3, respectively, and no packet arrives at queue . Assume transmission cost . In this case, the optimal solution to Problem 15 is and , i.e., both packets at queue are optimally transmitted without coding upon arrival. In particular, the optimal solution satisfies the following linear program (similar to linear program (3)).

Linear program (primal program):

(5a)
s.t. (5d)

The associated dual program can be expressed as

Dual program:

(6a)
s.t. (6c)

Applying the idea behind Alg. 1, we would update and update until the dual constraint in Eq. (6c) becomes tight. Given , the constant is . In slot 1, update to be and update to bo one. In slot 2, update to be and update to be one. Because the dual constraint in Eq. (6c) becomes tight in slot 2, we cannot update any variable since slot 3; in particular, we cannot update when the second packet arrives at queue . Thus, the second packet waits forever, yielding an infinite amount of holding costs.

To tackle the issue in the above example, the next example proposes another primal-dual formulation.

Example 18.

Note that an optimal solution for and in linear program (5) also satisfies the following linear program, where we use and to indicate if the first packet and second packet, respectively, stay at queue at the end of slot .

Linear program (primal program):

(7a)
s.t. (7d)

While expressing variable in Eq. (5a) by in Eq. (7a), we substitute the original constraints in Eqs. (5d) and (5d) by the constraints in Eqs. (7d) and (7d). The associated dual program can be expressed as

Dual program:

(8a)
s.t. (8d)

Follow the idea behind Alg. 1 as discussed in Example 17. In slot 1, update to be and update to be one. In slot 2, update to be one and update to be one. In slot 3, update to be and update to be one. In slot 4, update to be one and update to be one. The updating process can achieve the competitive ratio in Theorem 10.

The above example implies that the idea of Alg. 1 can solve Problem 15 with the same competitive ratio, if we can formulate a linear program with constraints for each individual packet (like Eqs. (7d) and (7d)) instead of those for all arriving packets (like Eqs. (5d) and (5d)). In this context, we introduce additional variables: let indicate if the -th packet stays at queue at the end slot , where if it does and otherwise. For each slot , the value of is either zero or one, where implies that the -th packet at queue is transmitted with coding by slot  and implies that the packet is either transmitted without coding by slot  or stays at queue at the end of slot . By the next example, we emphasize that the constraints should be carefully considered.

Example 19.

Suppose that two packets arrive at queue in slots 1 and 2, respectively, and one packet arrives at queue in slot 3. Assume transmission cost . In this case, the optimal solution to Problem 15 is and . Next, given the optimal decision for the packet at queue  (i.e., optimally transmitted with coding), we consider constraints for each packet at queue  as follows:

  • Slot : A packet arrives at queue in slot . Thus, we can obtain .

  • Slot : The other packet arrives at queue in slot . Thus, we can obtain and .

  • Slot : A packet arrives at queue . Since we are given that the packet at queue  optimally codes with a packet at queue , two options are following: (1) , , i.e., the first packet at queue is transmitted with coding, and the second packet either is transmitted without coding or waits in slot ; (2) , .

  • Slot : No packet arrives at both queues. Thus, if and , then , ; otherwise, and .

We calculate the minimum value of subject to the two possible constraints, i.e., forming two different linear programs:

  • Consider the constraints of for , and for : The optimal solution is and , while the minimum objective value is .

  • Consider the constraints of for , and : The optimal solution is and , while the minimum objective value is .

Thus, only the second set of constraints is correct. The idea underlying the correct set of constraints is that the first packet waits for a longer time (for coding) than the second packet does.

Let be the set of indices such that the value of in slot is specified to be greater than or equal to one. Let . Our goal is to identify a correct set of constraints such that the solution to minimize the cost (in Problem 15) subject to the set is an optimal solution to Problem 15. Example 19 suggests that, when a packet arrives at queue in slot , a correct set of constraints in slot  can be obtained by removing the most recent packet in set of the previous slot. The argument will be confirmed in the next section.

Iv-B Primal-dual formulation

With the idea developed in Example 19, we propose an algorithm in Alg. 3 for identifying a correct set of constraints. Line 3 initiates set in slot to be set of the previous slot. When a packet arrives at queue in slot , Line 3 adds the corresponding index to set . Line 3 introduces a variable to indicate the available packets at queue  for coding; precisely, Line 3 sets the value of variable to be the present arrivals at queue . Since Line 3, if (i.e., there is a packet at queue ) and (i.e., there is a packet at queue ), then Line 3 removes index (i.e., the most recent packet in set as in Line 3) from set and Line 3 removes one packet from queue .

/* Initialize set at the beginning of slot as follows: */
1 for all ;
/* For each slot , perform as follows: */
2 ;
3 forall -th packet arriving at queue in slot  do
4       ;
5      
6 end forall
7;
8 while  and  do
9       ;
10       ;
11       ;
12      
13 end while
Algorithm 3 Identifying a correct set of constraints

We formulate a linear program subject to the set produced by Alg. 3 as follows.

Linear program (primal program):

(9a)
s.t. (9b)

The next theorem establishes that linear program (9) can optimally solve Problem 15.

Theorem 20.

The solution to linear program (9) is an optimal solution to Problem 15.

Proof.

See Appendix E. ∎

The dual program of primal program (9) is following.

Dual program:

(10a)
s.t. (10c)

Iv-C Primal-dual algorithm

Note that Alg. 3 can learn a correct set of constraints for each slot in the online fashion. Leveraging the online feature, we develop a primal-dual algorithm in Alg. 4 for solving Problem 15 in the online fashion. For each slot , Alg. 4 updates those ’s in the set in Lines 4 - 4. The updating process is similar to that in Alg. 1.

/* Initialize all variables at the beginning of slot as follows: */
1 , , for all and ;
2 ;
3 for all ;
/* For each new slot , the variables are updated as follows: */
4 ;
5 forall -th packet arriving at queue in slot  do
6       ;
7      
8 end forall
9;
10 while  and  do
11       ;
12       ;
13       ;
14      
15 end while
16forall  do
17       if   then
18             ;
19             ;
20             ;
21            
22       end if
23      
24 end forall
Algorithm 4 Primal-dual algorithm for solving primal program (9) and dual program (10)

Using the same arguments as those in the proofs of Lemmas 7 and 8, the next lemma establishes the feasibility of the solution produced by Alg. 4.

Lemma 21.

Alg. 4 produces a feasible solution to primal program (9) and dual program (10).

Similar to Theorem 10, the next theorem shows that Alg. 4 can achieve the same competitive ratio as Alg. 1 does.

Theorem 22.

Let be the minimum objective value in linear program (9). Then, the primal objective value in Eq. (9a) computed by Alg. 4 is bounded above by

for all possible arrival patterns .

Proof.

See Appendix F. ∎

Then, similar to Alg. 2, we can transform the solution produced by Alg. 4 to a randomized online scheduling algorithm for managing the delay-award coding decision at queue . In particular, the scheduling algorithm can also achieve the same expected competitive ratio as that in Theorem 11, approaching when cost is large enough.

Iv-D Scheduling both queues

This section extends Alg. 4 to the case when both queues and can wait for each other. In this context, we propose a waiting-coding queueing system consisting of a waiting queue and a coding queue at the relay. While queue  stores those packets that can wait for coding, queue  stores those packets that can find coding pairs at the waiting queue immediately upon arrival.

Precisely, let and be the number of packets at queue  and queue , respectively, at the end of slot . If the packets at queue  belong to queue , then the (i.e., the number of packets arriving at the original queue ) new arriving packets enter queue  at the beginning of slot , and

  1. if , then the new arriving packets enter queue  at the beginning of slot ;

  2. if , then only out of the new arriving packets enter queue  at the beginning of slot , but the remaining packets enter queue  at the beginning of slot .

In contrast, if the packets at queue  belong to queue , then the waiting-coding queueing system operates in the opposite way. In other words, while packets entering queue  are transmitted (with coding) immediately upon arrival, packets entering queue  need scheduling decisions. With the transformation, the waiting-coding queueing system becomes the previously discussed queueing model where only packets at queue  can wait for coding. Thus, the randomized online scheduling algorithm associated with Alg. 4 can apply to the waiting-coding queueing system with the expected competitive ratio in Theorem 11. Furthermore, Section V will demonstrate the superiority of the proposed scheduling algorithm and the proposed waiting-coding queueing system via computer simulations.

Iv-E A transmission constraint

Recall that Alg. 4 might transmit more than one packet in a slot (but less than three uncoded packets, as shown in Lemma 14). This Section considers a transmit constraint: the relay can transmit at most one packet in each slot. According to Section IV-D, we can focus on scheduling packets at queue