1 Introduction

Currently, wireless communication witnesses a noticeable and continuous development to fulfil the growing demands of network users for high-speed multimedia services with a satisfactory quality of service (QoS). Power and frequency are considered as the most precious resources in wireless communication networks and they are subjected to strict laws to control their allocation and usage among service providers. Several techniques were proposed in the literature to enhance the efficiency of power and frequency usage such as cognitive radio (CR), bidirectional relaying, buffer-aided relaying, and power allocation schemes [1].

In underlay CR networks, the secondary user (SU) and the primary user (PU) can access the same spectrum simultaneously as long as the secondary network (SN) interference on the primary network (PN) does not exceed a certain interference threshold [2]. However, since the PN and SN transmit using the same spectrum simultaneously, both the PU and SU will suffer from an interfering signals. Most of the researches in the literature focused only on enhancing the SN overall transmission rate and neglected the PN rate and the PN interference on the SN in their studies [3, 4]. Recently, it was shown that it is more efficient and practical that an operator splits its terminal users to PUs and SUs such that a joint power scheduling could be achieved using a central processing unit [5].

Beside the CR networks, bidirectional relaying represents an efficient solution for two-way wireless cooperative networks that use half-duplex relay nodes (RNs). In such networks, the two-way communication is conducted between terminal users without the need for high complexity full-duplex RNs.

To further enhance the performance of cooperative relay networks, physical layer buffers were proposed to be used in such network layouts. The physical layer buffering with a considerably large buffer size is found to be able to double the diversity order of the network and, additionally, add a significant coding gain [6]. Unlink the conventional unbuffered relaying schemes, data transmission in buffer-aided relaying networks is not restricted to two consecutive time slots for conducting a successful end-to-end (e2e) packet transmission. Instead, information packets could be stored at a relays buffer of a certain maximum size for an arbitrary number of time slots until the best channel conditions on the relay-destination link are met [7, 8]. With this buffering property, the power allocation design problem can be divided into two separated problems: one at the source-relay link and other at the relay-destination link. This way of modelling noticeably reduces the complexity of the target optimized functions as was shown in [9].

The time division broadcast (TDBC) and multiple access broadcast (MABC) protocols are among the common bidirectional relaying protocols that use half-duplex RNs in controlling the data flow between transceivers in conventional bidirectional decode-and-forward (DF) relaying networks [9]. In TDBC protocol, data transmission takes place in three time slots. In the first time slot, user one sends its message signal to relay. In the second time slot, user 2 sends its message signal to relay. While in the third time slot, the relay combines the received decoded signals, modulates the resultant, and then broadcasts the signal to both users [10]. On the other hand, the MABC protocol reduces the number of time slots to two only. In the first time slot, user 1 and user 2 use some multiple-access scheme and send their messages to relay node. While in the second time slot, the relay node combines the received decoded signals, modulates the resultant, and then broadcasts the signal to both users [11]. These fixed pre-established relaying protocols do not fully utilize the best channel conditions as at a certain time slot, the selected link is not necessarily the best link in the network.

In [12], the authors proposed a bidirectional relaying protocol for buffer-aided DF relay networks. They derived the decision function for adaptive link selection with infinite buffer size. Infinite buffer size introduces serious delay and may result in a message loss. To overcome infinite buffer size imperfections, an optimal adaptive mode selection scheme with fixed transmission power and limited buffer size was proposed in [13]. To further enhance the network performance, a new bidirectional relaying scheme which considers the problem of adaptive link selection and power optimization was proposed in [14]. In [15], the authors proposed a bidirectional relaying protocol that does not only consider the instantaneous channel-state-information (CSI) of all possible links for adaptive mode selection but also takes the states of the queues at the buffers, i.e., the number of stored packets in each buffer into consideration.

All of the previous bidirectional buffer-aided relaying protocols were derived using complex optimization problems and only considered the case of single-relay scheme within the network. Beside that, the average packet delay introduced by the physical layer buffering was not controlled in the previous protocols which may cause message lost especially for relatively large buffer sizes. Additionally, ignoring the rate of the PN during the selection of the best transmission mode and optimization of transmission power of the SN represents a major drawback in the previous schemes proposed in the literature. However, by dividing the terminal users of an operator company into cognitive and non-cognitive users and applying the appropriate global transmission power scheduling scheme similar to the one proposed in this work, the utilization of the spectrum assigned to the operator company could be enhanced by a factor of two as will be shown in this work. This motivated us to propose a sub-optimal bidirectional relaying protocol that avoids the complexity of deriving an optimal adaptive mode selection scheme at each time slot and considers the two-way interference between the PN and SN during the mode selection and power optimization operations.

To the best knowledge of authors, delay-constrained bidirectional buffer-aided DF relaying protocols that maximizes the normalized sum of PN and SN rate have not been presented and investigated yet. In addition, optimal closed-form transmission power expressions that allocate a total power budget among PN and SN such that the normalized sum rate for each possible transmission mode is maximized have not been presented before. The contributions of this work can be summarized in the following points

  • A delay-constrained low complexity bidirectional relaying protocol for cognitive buffer-aided DF relay network is proposed and investigated.

  • Optimal/sub-optimal antenna transmission power allocation problems that allocate a total power budget among the PN and SN to maximize the normalized sum rate per time slot are derived.

  • The impact of maximum buffer size, number of relays, delay constraint and interference threshold on the overall network performance is evaluated under different scenarios.

The rest of this paper is organized as follows. Section 2 describes the system and channel models. Problem formulation is described in Sect. 3. Section 4 proposes and describes the bidirectional relaying protocol. Optimal/sub-optimal antenna transmission power allocation schemes are described in Sect. 5. Section 6 provides some simulation results and performance evaluation. Section 7 provides the conclusions of this work.

2 System and Channel Models

In this work, we consider a CR network that consists of a PN with one PU source \(({\mathcal {S}}_p)\) and one PU destination \(({\mathcal {U}}_p)\), and a SN with a pair of SU transceiver nodes \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\), and N cognitive bidirectional half-duplex DF relays \([{\mathcal {R}}_i]_{i=1}^{N}\). Each relay is provided with two buffers to store the received information packets from \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) and denoted by \(B_1({\mathcal {R}}_i)\) and \(B_2({\mathcal {R}}_i)\), respectively. \(B_m({\mathcal {R}}_i)\) has a maximum size of \(L_m\), where \(L_m\) is the maximum number of information packets received from terminal \({\mathcal {U}}_m, m=1, 2\) that can be stored before an overflow occurs. We denote the instantaneous number of stored information packets at the mth buffer of the ith relay by \(\Psi _m({\mathcal {R}}_i)\), where \(0 \le \Psi _m({\mathcal {R}}_i) \le L_m\). Figure 1 shows the system model used in this paper. As illustrated in this Figure, the solid and dotted lines represent the desired and interfering signals in each possible transmission mode, respectively.

Fig. 1
figure 1

System model for cognitive radio network with buffer-aided DF half duplex bidirectional relays

Without loss of generality, the direct \({\mathcal {U}}_1-{\mathcal {U}}_2\) link is not considered in this model as it is assumed to be suffering from sever fading and shadowing effects. In addition, the PUs and SUs are assumed to access the spectrum simultaneously. In order to maintain a certain QoS level to the PU, the average received interference power due to SUs should not exceed a certain interference threshold denoted by \(I_{th}\) [11]. We define \({P_{T}}\) as the total available power budget assigned for the whole network at any arbitrary time slot and it is defined as \(P_T=P_{{\mathcal {S}}_p}+P_{{\mathcal {U}}_m}\), where (\(m=1\) or 2) or \(P_T=P_{{\mathcal {S}}_p}+P_{{\mathcal {R}}_i}\) if the \({\mathcal {U}}_m-{\mathcal {R}}_i\) or \({\mathcal {R}}_i-{\mathcal {U}}_m\) link is selected, respectively.

All channel coefficients are assumed to be independent and identically distributed (i.i.d.) slowly varying Rayleigh fading random variables such that they remain unchanged during one time slot. We denote \(h_{x,y}\) as the channel coefficient between terminals x and y. Channel gains of bidirectional links are assumed to be symmetric which means, at a certain time instant t, channel coefficient in \({\mathcal {U}}_m-{\mathcal {R}}_i\) link is identical to that in \({\mathcal {R}}_i-{\mathcal {U}}_m\) inverse link.Footnote 1 Each receiving terminal is assumed to experience an additive white Gaussian noise (AWGN) at its input with constant variance \(N_o\). Transmitted signals from \({\mathcal {U}}_1\), \({\mathcal {U}}_2\), \({\mathcal {R}}_i\), and \({\mathcal {S}}_p\) are denoted by \(X_{{\mathcal {U}}_1}\), \(X_{{\mathcal {U}}_2}\), \(X_{{\mathcal {R}}_i}\), and \(X_{{\mathcal {S}}_p}\) respectively. To avoid the need for heavy and fast back-haul links, a central processing unit that performs relay selection and power allocation operations is assumed to exist in the network with a full CSI acknowledgementFootnote 2.

3 Problem Formulation

In buffer-aided half-duplex bidirectional relaying scheme, there are mainly five possible transmission modes occur in the SN at any arbitrary time slot denoted by \({\mathcal {M}}_i, i=1,\ldots , 5\) as shown in Fig. 2. The PN is assumed to be transmitting information packets at every time slot during network operation. The received signals at the \({ith}\) relay at modes \({\mathcal {M}}_1\) and \({\mathcal {M}}_2\) are, respectively given by

$$\begin{aligned} {y_{{\mathcal {R}}_i}}^{\left( {\mathcal {M}}_1\right) }&= \underbrace{{h_{{\mathcal {U}}_1,{\mathcal {R}}_i}}{X_{{\mathcal {U}}_1}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {S}}_p,{\mathcal {R}}_i}}{X_{{\mathcal {S}}_p}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {R}}_i}}_{\text {AWGN}}, \end{aligned}$$
(1)
$$\begin{aligned} {y_{{\mathcal {R}}_i}}^{\left( {\mathcal {M}}_2\right) }&= \underbrace{{h_{{\mathcal {U}}_2,{\mathcal {R}}_i}}{X_{{\mathcal {U}}_2}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {S}}_p,{\mathcal {R}}_i}}{X_{{\mathcal {S}}_p}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {R}}_i}}_{\text {AWGN}} , \end{aligned}$$
(2)

where \(X_{{\mathcal {U}}_1}\) and \(X_{{\mathcal {U}}_2}\) are the transmitted message signals from \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) with powers \(P_{{\mathcal {U}}_1}\) and \(P_{{\mathcal {U}}_1}\), respectively, \(n_{{\mathcal {R}}_i}\) is the AWGN at the input of the \({ith}\) relay with power \(N_o\). The information packet received from \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) are stored at buffer \(B_1({\mathcal {R}}_i)\) and \(B_2({\mathcal {R}}_i)\), respectively. At a certain time slot, when the relay is chosen to transmit to user terminals \({\mathcal {U}}_2\) and \({\mathcal {U}}_2\), the received signals at \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) are respectively given by

$$\begin{aligned} y_{{\mathcal {U}}_1}^{\left( {\mathcal {M}}_3, {\mathcal {M}}_5\right) }&= \underbrace{{h_{{\mathcal {U}}_1,{\mathcal {R}}_i}}{X_{{\mathcal {R}}_i}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {S}}_p,{\mathcal {U}}_1}}{X_{{\mathcal {S}}_p}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {U}}_1}}_{\text {AWGN}} , \end{aligned}$$
(3)
$$\begin{aligned} y_{{\mathcal {U}}_2}^{\left( {\mathcal {M}}_4, {\mathcal {M}}_5\right) }&= \underbrace{{h_{{\mathcal {U}}_2,{\mathcal {R}}_i}}{X_{{\mathcal {R}}_i}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {S}}_p,{\mathcal {U}}_2}}{X_{{\mathcal {S}}_p}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {U}}_2}}_{\text {AWGN}}. \end{aligned}$$
(4)

Mode \({\mathcal {M}}_5\) is called a broadcasting mode since \({\mathcal {R}}_i\) combines two signals from \(B_1{({\mathcal {R}}_i)}\) and \(B_2{({\mathcal {R}}_i})\) and broadcasts the resultant to \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) with transmission power \(P_{{\mathcal {R}}_i}\). Each terminal receiver is assumed to have some self-interference cancellation strategy. The received signal at \({\mathcal {U}}_p\) depends on the selected transmission mode of the SN and is given by

$$\begin{aligned} y_{{\mathcal {D}}_p}^{\left( {\mathcal {M}}_1\right) }&= \underbrace{{h_{{\mathcal {S}}_p,{\mathcal {D}}_p}}{X_{{\mathcal {S}}_p}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {U}}_1,{\mathcal {D}}_p}}{X_{{{\mathcal {U}}_1,{\mathcal {D}}_p}}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {D}}_p}}_{\text {AWGN}}, \end{aligned}$$
(5a)
$$\begin{aligned} y_{{\mathcal {D}}_p}^{\left( {\mathcal {M}}_2\right) }&= \underbrace{{h_{{\mathcal {S}}_p,{\mathcal {D}}_p}}{X_{{\mathcal {S}}_p}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {U}}_2,{\mathcal {D}}_p}}{X_{{{\mathcal {U}}_2,{\mathcal {D}}_p}}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {D}}_p}}_{\text {AWGN}}, \end{aligned}$$
(5b)
$$\begin{aligned} y_{{\mathcal {D}}_p}^{\left( {\mathcal {M}}_3,{\mathcal {M}}_4,{\mathcal {M}}_5\right) }&= \underbrace{{h_{{\mathcal {S}}_p,{\mathcal {D}}_p}}{X_{{\mathcal {S}}_p}}}_{\text {Desired Signal}}+\underbrace{{h_{{\mathcal {R}}_i,{\mathcal {D}}_p}}{X_{{{\mathcal {R}}_i,{\mathcal {D}}_p}}}}_{\text {Interfering Signal}}+\underbrace{n_{{\mathcal {D}}_p}}_{\text {AWGN}}. \end{aligned}$$
(5c)
Fig. 2
figure 2

Possible transmission modes

The normalized rates at modes \({\mathcal {M}}_1\) to \({\mathcal {M}}_5\) are, respectively given by

$$\begin{aligned} \text {R}_{{\mathcal {U}}_1,{\mathcal {R}}_i}^{\left( {\mathcal {M}}_1\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {U}}_1,{\mathcal {R}}_i}|^2P_{{\mathcal {U}}_1}}{|h_{{\mathcal {S}}_p,{\mathcal {R}}_i}|^2P_{{\mathcal {S}}_p}+N_0}\right) , \end{aligned}$$
(6)
$$\begin{aligned} \text {R}_{{\mathcal {U}}_2,{\mathcal {R}}_i}^{\left( {\mathcal {M}}_2\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {U}}_2,{\mathcal {R}}_i}|^2P_{{\mathcal {U}}_2}}{|h_{{\mathcal {S}}_p,{\mathcal {R}}_i}|^2P_{{\mathcal {S}}_p}+N_0}\right) , \end{aligned}$$
(7)
$$\begin{aligned} \text {R}_{{\mathcal {R}}_i,{\mathcal {U}}_1}^{\left( {\mathcal {M}}_3, {\mathcal {M}}_5\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {U}}_1,{\mathcal {R}}_i}|^2P_{{\mathcal {R}}_i}}{|h_{{\mathcal {S}}_p,{\mathcal {U}}_1}|^2P_{{\mathcal {S}}_p}+N_0}\right) , \end{aligned}$$
(8)
$$\begin{aligned} \text {R}_{{\mathcal {R}}_i,{\mathcal {U}}_2}^{\left( {\mathcal {M}}_4, {\mathcal {M}}_5\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {U}}_2,{\mathcal {R}}_i}|^2P_{{\mathcal {R}}_i}}{|h_{{\mathcal {S}}_p,{\mathcal {U}}_2}|^2P_{{\mathcal {S}}_p}+N_0}\right) , \end{aligned}$$
(9)

while the PN rates for the modes \({\mathcal {M}}_1\) to \({\mathcal {M}}_5\)

$$\begin{aligned} \text {R}_{{\mathcal {S}}_p,{\mathcal {D}}_p}^{\left( {\mathcal {M}}_1\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_{{\mathcal {S}}_p}}{|h_{{\mathcal {U}}_1,{\mathcal {D}}_p}|^2P_{{\mathcal {U}}_1}+N_0}\right) . \end{aligned}$$
(10a)
$$\begin{aligned} \text {R}_{{\mathcal {S}}_p,{\mathcal {D}}_p}^{\left( {\mathcal {M}}_2\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_{{\mathcal {S}}_p}}{|h_{{\mathcal {U}}_2,{\mathcal {D}}_p}|^2P_{{\mathcal {U}}_2}+N_0}\right) . \end{aligned}$$
(10b)
$$\begin{aligned} \text {R}_{{\mathcal {S}}_p,{\mathcal {D}}_p}^{\left( {\mathcal {M}}_3,{\mathcal {M}}_4,{\mathcal {M}}_5\right) }&= \log _2\left( 1+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_{{\mathcal {S}}_p}}{|h_{{\mathcal {R}}_i,{\mathcal {D}}_p}|^2P_{{\mathcal {R}}_i}+N_0}\right) . \end{aligned}$$
(10c)

The problem in our hand is first to select the index of the best relay \({i}^*\) and the corresponding transmission mode for the SN and then allocate a total power budget between both the PN and SN such that the normalized sum rate is maximized. The bidirectional transmission mode protocol should maximize the normalized sum rate and bound the average packet delay of the SN by a predefined number of time slots \(\mu\). The transmission power optimization problems at modes \({\mathcal {M}}_1\) to \({\mathcal {M}}_4\) is given by

$$\begin{aligned} \begin{aligned}&\underset{P_{{\mathcal {S}}_p},P_{J}^{\left( {\mathcal {M}}_i\right) }}{\text {maximize}} \,\,\,\,\,\,\,\,\text {R}_{{\mathcal {S}}_p,{\mathcal {D}}_p}+\text {R}_{J,K}^{({\mathcal {M}}_i)} \\&\text {subject to} \,\,\,\,\,\,\,\, 0\le P_{{\mathcal {S}}_p}+P_{J}^{\left( {\mathcal {M}}_i\right) } \le P_T \\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, |h_{J,{\mathcal {D}}_p}|^2P_{J}^{\left( {\mathcal {M}}_i\right) }\le I_{th}. \end{aligned} \end{aligned}$$
(11)

For mode \({\mathcal {M}}_1\), \((J,K)\equiv ({\mathcal {U}}_1,{\mathcal {R}}^*)\), for mode \({\mathcal {M}}_2\), \((J,K)\equiv ({\mathcal {U}}_2,{\mathcal {R}}^*)\), for mode \({\mathcal {M}}_3\), \((J,K)\equiv ({\mathcal {R}}^*,{\mathcal {U}}_1)\), and for mode \({\mathcal {M}}_4\), \((J,K)\equiv ({\mathcal {R}}^*,{\mathcal {U}}_2)\). For mode \({\mathcal {M}}_5\), the optimization problem is given by

$$\begin{aligned} \begin{aligned}&\underset{P_{{\mathcal {S}}_p},P_{{\mathcal {R}}_i}^{\left( {\mathcal {M}}_5\right) }}{\text {maximize}} \,\,\,\,\,\,\,\,\text {R}_{{\mathcal {S}}_p,{\mathcal {D}}_p}+\text {R}_{{\mathcal {R}}_i,{\mathcal {U}}_1}^{({\mathcal {M}}_5)}+\text {R}_{{\mathcal {R}}_i,{\mathcal {U}}_2}^{({\mathcal {M}}_5)} \\&\text {subject to} \,\,\,\,\,\,\,\, 0\le P_{{\mathcal {S}}_p}+P_{{\mathcal {R}}_i}^{\left( {\mathcal {M}}_5\right) } \le P_T \\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, |h_{{\mathcal {R}}_i,{\mathcal {D}}_p}|^2P_{{\mathcal {R}}_i}^{\left( {\mathcal {M}}_5\right) }\le I_{th}, \end{aligned} \end{aligned}$$
(12)

In the following two sections, we propose a low complexity delay-constrained bidirectional relaying protocol and an optimal/sub-optimal transmission power allocation schemes.

4 Bidirectional Relaying Protocol

In this section, we introduce the proposed bidirectional relaying protocol that controls the two-way data flow between terminals \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\) in the SN. The proposed protocol is not restricted to a predefined scheduling for data exchange, instead, it selects the best transmission mode from a set of five possible modes. Mode selection is achieved according to the instantaneous channel coefficients, buffers states, and average information packet delay. Figure 3 shows a descriptive flowchart of the proposed bidirectional relaying protocol. From the flowchart, \(D_1\) and \(D_2\) represent the number of time slots since the oldest information packet has been buffered at \(B_1({\mathcal {R}}_i)\) and \(B_2({\mathcal {R}}_i)\) of the selected relay, respectively. The operation of this protocol can be summarized by the following points

  • First, the index of the relay related to the best link (found from 13 bellow), m and \(\mu\) is inserted to the algorithm. Where, m represents the position of the best link (\(m=1 \rightarrow {\mathcal {U}}_1-{\mathcal {R}}\) and \(m=2 \rightarrow {\mathcal {U}}_2-{\mathcal {R}})\), and \(\mu\) represents the value of maximum allowable delay per packet which is application dependent (\(\mu =3 \rightarrow\) conventional relaying and \(\mu \ge 3 \rightarrow\) buffer-aided relaying )

  • Transmission mode \({\mathcal {M}}_1\) is selected if \(m=1\) and it is the only valid transmission mode for that link \(\left( \psi _1({\mathcal {R}}^*)\ne L_1 \text {and} \psi _2({\mathcal {R}}^*)=0\right)\), or the oldest buffered information packet at \(B_1({\mathcal {R}}^*)\) has been waiting for less than \(\mu\) time slot while \(B_2({\mathcal {R}}^*)=0\) or \(\psi _1({\mathcal {R}}^*)=0\) and delay condition at \(B_2({\mathcal {R}}^*)\) is not violated. Mode \({\mathcal {M}}_2\) is selected in a similar manner with exchanging the notations of the previous indexing between 1 and 2.

  • Transmission mode \({\mathcal {M}}_3\) is selected when \(m=1\) and it is the only valid transmission mode for that link \(\left( \psi _1({\mathcal {R}}^*)= L_1 \text {and } \psi _2({\mathcal {R}}^*)\ne 0\right)\), or delay condition at \(B_1({\mathcal {R}}^*)\) was violated. Mode \({\mathcal {M}}_4\) is selected in a similar manner with exchanging the notations of the previous indexing between 1 and 2.

  • The broadcast mode \({\mathcal {M}}_5\) is selected when there is available buffered data at both \(B_1({\mathcal {R}}^*)\) and \(B_2({\mathcal {R}}^*)\)

Fig. 3
figure 3

Flowchart for the proposed bidirectional relaying protocol

The index of the best relay \({i}^*\) is found using the following relay selection scheme

$$\begin{aligned} \begin{aligned}&{i}^*=\arg \max _{{\mathcal {R}}_i}\left\{ \min \left\{ f_{{\mathcal {U}}_1,{\mathcal {R}}_i}, f_{{\mathcal {R}}_i,{\mathcal {U}}_1} \right\} \right. , \left. \min \left\{ f_{{\mathcal {U}}_2,{\mathcal {R}}_i}, f_{{\mathcal {R}}_i,{\mathcal {U}}_2} \right\} \right\} ,\\&\text {where,}\\&f_{{\mathcal {U}}_1,{\mathcal {R}}_i}=\frac{|h_{{\mathcal {U}}_1,{\mathcal {R}}_i}|^2P_T}{|h_{{\mathcal {S}}_p,{\mathcal {R}}_i}|^2P_T+2N_0}+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_T}{|h_{{\mathcal {U}}_1,{\mathcal {D}}_p}|^2P_T+2N_0},\\&f_{{\mathcal {R}}_i,{\mathcal {U}}_1}=\frac{|h_{{\mathcal {U}}_1,{\mathcal {R}}_i}|^2P_T}{|h_{{\mathcal {S}}_p,{\mathcal {U}}_1}|^2P_T+2N_0}+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_T}{|h_{{\mathcal {R}}_i,{\mathcal {D}}_p}|^2P_T+2N_0},\\&f_{{\mathcal {U}}_2,{\mathcal {R}}_i}=\frac{|h_{{\mathcal {U}}_2,{\mathcal {R}}_i}|^2P_T}{|h_{{\mathcal {S}}_p,{\mathcal {R}}_i}|^2P_T+2N_0}+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_T}{|h_{{\mathcal {U}}_2,{\mathcal {D}}_p}|^2P_T+2N_0},\\&f_{{\mathcal {R}}_i,{\mathcal {U}}_2}=\frac{|h_{{\mathcal {U}}_2,{\mathcal {R}}_i}|^2P_T}{|h_{{\mathcal {S}}_p,{\mathcal {U}}_2}|^2P_T+2N_0}+\frac{|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_T}{|h_{{\mathcal {R}}_i,{\mathcal {D}}_p}|^2P_T+2N_0}.\\ \end{aligned} \end{aligned}$$
(13)

The goal behind selecting the maximum of minimum \(f_{x,y}\)’s of a certain two-way link rather than the ultimate maximum is that the maximum link may be related to an invalid transmission. As an example, if \(f_{{\mathcal {U}}_1,{\mathcal {R}}_i}\) is the is happened to be the ultimate maximum at a certain time instant, and it appears that in the same time \(\Psi _1({\mathcal {R}}_i)=L_1\). Hence, such a link cannot be utilized for transmission from \({\mathcal {U}}_1\) to \({\mathcal {R}}_i\). Accordingly, the proposed max-min paradigm is a general measure of link quality for the considered model. Additionally, the proposed protocol does not require the derivation of complicated optimal mode selection problems. Instead, a set of conditions are examined and a transmission mode is selected accordingly.

5 Transmission Power Allocation Schemes

In this section, optimal and sub-optimal transmission power allocation schemes are proposed for each possible transmission mode. The convex optimization theory is used in the derivation of optimal transmission power at modes \({\mathcal {M}}_1\) through \({\mathcal {M}}_4\) [19]. By substituting \(P_{{\mathcal {S}}_p}=P_T-P_{J}^{\left( {\mathcal {M}}_i\right) }\), changing the peak power condition into in (11) to \(P_{J}^{\left( {\mathcal {M}}_i\right) }\le P_T\), and using the Lagrangian multiplier method, the Lagrangian function of the optimization problem given in (11) is defined by

$$\begin{aligned} \mathcal {L}\left( P_{J}^{\left( {\mathcal {M}}_i\right) }, \lambda _1, \lambda _2\right) =R_{{\mathcal {S}}_p,\mathcal{D}_p}+R_{J,K}^{({\mathcal {M}}_i)}-\lambda _1\left( P_{J}^{\left( {\mathcal {M}}_i\right) }-P_{T}\right) -\lambda _2\left( |h_{J,{\mathcal {D}}_p}|^2P_{J}^{\left( {\mathcal {M}}_i\right) }- I_{th} \right) , \end{aligned}$$
(14)

where \(\lambda _1\) and \(\lambda _2\) are the Lagrangian multipliers related to peak source transmission power and interference constraints, respectively, and (JK) is as defined in (11). Upon deriving \(\mathcal {L}\left( P_{J}^{\left( {\mathcal {M}}_i\right) }, \lambda _1, \lambda _2\right)\) with respect to \(P_{J}^{\left( {\mathcal {M}}_i\right) }\) and equating the result to zero, we end up with a quartic equation given by

$$\begin{aligned}&{\left( P_{J}^{\left( {\mathcal {M}}_i\right) }\right) }^4+a{\left( P_{J}^{\left( {\mathcal {M}}_i\right) }\right) }^3+b{\left( P_{J}^{\left( {\mathcal {M}}_i\right) }\right) }^2+c\left( P_{J}^{\left( {\mathcal {M}}_i\right) }\right) +d=0,\end{aligned}$$
(15a)

where

$$\begin{aligned}&a=\left[ \frac{h_2N_0+N_2|h_{J,{\mathcal {D}}_p}|^2}{h_1h_2|h_{J,{\mathcal {D}}_p}|^2}+\frac{N_1|h_{J,K}|^2}{h_1|h_{{\mathcal {S}}_p,K}|^2}\right] , \end{aligned}$$
(15b)
$$\begin{aligned}&b=\left[ \frac{N_0N_2}{h_2|h_{J,{\mathcal {D}}_p}|^2}-\frac{N_1|h_{J,K}|^2\left( h_2N_0+N_2|h_{J,{\mathcal {D}}_p}|^2\right) }{\lambda h_1h_2|h_{{\mathcal {S}}_p,K}|^2|h_{J,{\mathcal {D}}_p}|^2}-\frac{N_1|h_{J,K}|^2}{\lambda h_2|h_{J,{\mathcal {D}}_p}|^2}-\frac{N_3}{\lambda h_1|h_{{\mathcal {S}}_p,K}|^2}\right] , \end{aligned}$$
(15c)
$$\begin{aligned}&c=\left[ \frac{\left( h_2N_0+N_2|h_{J,{\mathcal {D}}_p}|^2\right) \left( |h_{J,K}|^2N_1-N_3-\lambda N_1^2\right) -\lambda N_0N_1N_2|h_{J,K}|^2}{\lambda h_1h_2|h_{{\mathcal {S}}_p,K}|^2|h_{J,{\mathcal {D}}_p}|^2} \right] , \end{aligned}$$
(15d)
$$\begin{aligned}&d=\left[ \frac{N_0N_2\left( N_1|h_{J,K}|^2-\lambda N_1^2-N_3\right) }{\lambda h_1h_2|h_{{\mathcal {S}}_p,K}|^2|h_{J,{\mathcal {D}}_p}|^2}\right] , \end{aligned}$$
(15e)

where

$$\begin{aligned}&\nonumber \\&{~~~~h_1=|h_{J,K}|^2-|h_{{\mathcal {S}}_p,K}|^2} \qquad \& \qquad {N_1=|h_{{\mathcal {S}}_p,K}|^2P_T+N_0},\nonumber \\&\quad {h_2=|h_{J,{\mathcal {U}}_p}|^2-|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2} \qquad \& \qquad {N_1=|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2P_T+N_0},\nonumber \\&{~~~~N_3=|h_{{\mathcal {S}}_p,{\mathcal {D}}_p}|^2 \left( |h_{J,{\mathcal {D}}_p}|^2P_T+N_0 \right) } \qquad \& \qquad {\lambda =ln2 \left( \lambda _1|h_{J,{\mathcal {D}}_p}|^2+\lambda _2 \right) }. \end{aligned}$$
(15f)

We propose to use the quartic formula to find the roots of (15a) as follows

$$\begin{aligned} (P_{J}^*)^{\left( {\mathcal {M}}_i\right) }&= \left[ -\frac{b}{4a}\pm S \pm \frac{1}{2}\sqrt{-4S^2-2p+\frac{q}{s}}\right] ^+,\end{aligned}$$
(16a)

where

$$\begin{aligned} p&= \frac{8ac-3b^2}{8a^2}\qquad \& \qquad q=\frac{b^3-4abc+8a^2d}{8a^3}, \end{aligned}$$
(16b)
$$\begin{aligned} S&= \frac{1}{2}\sqrt{-\frac{2}{3}p+\frac{1}{3}a\left( Q+\frac{\delta _o}{Q}\right) }, \end{aligned}$$
(16c)
$$\begin{aligned} Q&= \root 3 \of {\frac{\delta _1+\sqrt{\delta _1^2-4\delta _o^3}}{2}}, \end{aligned}$$
(16d)
$$\begin{aligned} \delta _o&= c^2-3bd+12ae, \end{aligned}$$
(16e)
$$\begin{aligned} \delta _1&= 3c^3-9bcd+27b^2e+27ad^2-72ace, \end{aligned}$$
(16f)

where \(\left[ \zeta \right] ^+=\max (\zeta ,0).\) The value of PN optimal transmission power for those modes is then given by

$$\begin{aligned} P_{{\mathcal {S}}_p}^*=P_T-(P_{J}^*)^{\left( {\mathcal {M}}_i\right) }. \end{aligned}$$
(17)

The value of Lagrangian multipliers \(\lambda _1\) and \(\lambda _2\) are chosen such that they maximize the Lagrangian function \(\mathcal {L}\left( \lambda _1, \lambda _2\right)\) given in (14).

One efficient method to find \(\lambda _1\) and \(\lambda _2\) is called sub-gradient update method and it is given by [20]

$$\begin{aligned} \begin{aligned}&\lambda _1^{(m+1)}=\left[ \lambda _1^{(m)}+\mu ^{(m)}\left( (P_{J}^*)^{\left( {\mathcal {M}}_i\right) }- P_T \right) \right] +,\\&\lambda _2^{(m+1)}=\left[ \lambda _2^{(m)}+\mu ^{(m)}\left( |h_{J,{\mathcal {D}}_p}|^2(P_{J}^*)^{\left( {\mathcal {M}}_i\right) }- I_{th} \right) \right] +, \end{aligned} \end{aligned}$$
(18)

where m is the iteration index and \(\mu ^{(m)}\) is a sequence of scalar step sizes. It was found that due to the convexity of the target function, the sub-gradient method converges to the optimal values as long as \(\mu ^{(m)}\) is chosen to be sufficiently small.

For mode \({\mathcal {M}}_5\), at which the selected relay, denoted by \({\mathcal {R}}^*\) broadcasts a combined signal to \({\mathcal {U}}_1\) and \({\mathcal {U}}_2\), using convex optimization problem ends up with a 6th order equation of \(P_{{\mathcal {R}}_i}^{\left( {\mathcal {M}}_5\right) }\) which requires the use of some numerical algorithms to find it is roots. However, in this paper, we propose to use a genetic algorithm to solve the optimization problem in (12). The proposed algorithm is shown at Algorithm 1.

figure d

In this algorithm, \(h_{x,y}\) represents the all possible channel coefficients of the PN and SN during a certain time slot. Due to the convexity of the target optimized function, the proposed algorithm is said to converge to a global maxima point which is equivalent to the optimal solution, especially for high \(n_p\).

6 Simulation Results

In this section, we provide numerical simulation results of the proposed bidirectional relaying protocol and validate the derived expressions of transmission power allocation schemes. We also study the effect of different network parameters on the overall performance. Monte-Carlo simulation program is run for 1,000,000 iterations. We assume that all receiving nodes are subject to constant power spectral density \(N_0\). It is also assumed that \(L_1=L_2=L\).

To evaluate the proposed bidirectional relaying protocol, it is practical to compare the normalized rates per user of the proposed bidirectional relaying protocol with that of the unidirectional normalized rates. The unidirectional relaying is achieved using max-link relay selection scheme as in the previous section with a similar simulation parameters. Such a comparison metric is valid due to the fact that the unidirectional max-link relaying scheme represents a lower bound for normalized rate for any other bidirectional relaying scheme. This is due to the fact that, in unidirectional buffer-aided relaying it takes a n average of two time slots to achieve a complete e2e packet transmission. In the other hand, for any bidirectional buffer-aided relaying protocol, it takes an average of one and half time slot to achieve a complete e2e packet transmission.

Figure 4 shows the achievable normalized PN, SN, and sum rates per user versus maximum power budget for both unidirectional and bidirectional relaying schemes.

Fig. 4
figure 4

Achievable normalized PN, SN, and sum rates per user versus maximum power budget for both unidirectional and bidirectional relaying schemes with \(I_{th}=10\) dB, \(L=L_1=L_2=50\), \(\mu =200\), and \(N=4\)

It can be seen from this figure that the proposed bidirectional relaying protocol achieves normalized rates that are significantly higher than that of the unidirectional case. Additionally, it is clear that the delay is bounded in the proposed bidirectional relaying protocol while for unidirectional max-link protocol, the delay ranges between one and infinity. The superiority of bidirectional relaying rates compared to those of unidirectional relaying is due to the fact that the unidirectional relaying takes an average of two time slot to achieve one complete e2e transmission, while for bidirectional relaying, only 1.5 time slot is required to achieve a complete e2e transmission.

To evaluate the performance of the proposed GA scheme, Fig. 5 shows the achievable normalized PN, SN, and sum rates per user versus maximum power budget \(P_T\) of the optimal and the proposed scenarios.

Fig. 5
figure 5

Achievable normalized PN, SN, and sum rates per user versus maximum power budget \(P_T\) for both optimal and proposed schemes with \(I_{th}=10\) dB, \(L=50\), \(\mu =200\), and \(N=4\)

We mean by optimal solution that for the broadcast mode \({\mathcal {M}}_5\), the sum rate is optimized using an exhaustive search rather than a GA. It can be seen that at \(P_T=7\) dB, there is only a 0.25 bps/Hz degradation in the performance of the proposed scheme compared to the optimal one. Additionally, it is obvious that the SN rate starts to decay to zero after passing \(I_{th}\) value in order to maintain the PN interference threshold constraint.

Fig. 6
figure 6

Achievable PN, SN, and sum rates per user versus maximum power budget \(P_T\) for conventional and buffer-aided relaying with \(I_{th}=10\) dB, \(\mu =200\), and \(N=4\)

Figure 6 shows the achievable normalized rate for the PN, SN and their sum rates versus different maximum buffer sizes. It can be seen from this figure that a rate increment of around 0.7 bps/Hz is achieved in the SN rate at \(P_T=10\). Additionally, it can be seen from that the physical layer buffering on the SN relay nodes decreases the normalized rate of the PN. This is due to the fact that the buffering guarantees a better channel gains for SN links and since the power allocation follows a water-filling strategy, more power is pumped in these links which enhances the SN performance on the expense of PN performance.

Fig. 7
figure 7

Achievable PN, SN, and sum rates per user versus maximum allowable delay \(\mu\) with \(P_T=10\) dB, \(I_{th}=10\) dB, \(L=50\), and \(N=4\)

Finally, Fig. 7 shows the achievable PN, SN, and sum rates per user versus maximum allowable delay \(\mu\), where \(\mu\) is the maximum number of time slots the oldest buffered information packet can be stored.

It can be seen from this figure that a better rate is achieved as \(\mu\) increases with a rate floor appears after \(\mu =40\) (time slots). The rate floor occurs since for high values of \(\mu\), the probability that a packet will be stored for longer time slots that \(\mu\) goes to zero and hence further increase in \(\mu\) will not affect the rate any more. However, increasing \(\mu\) means that some information packets will be delayed for a considerably long time which is not efficient for real-time communication systems.

7 Conclusion

In this paper, a low complexity protocol which efficiently achieves bidirectional relaying and utilizes the freedom acquired by physical layer buffering was proposed. The presented protocol controls the information packet delay of SN buffered data. Optimal transmission power expressions which allocate a total power budget \(P_T\) among PN and SN and maximize that normalized sum rate were provided. It was found that applying buffering at SN relays enhances the SN performance significantly while degrading the PN performance slightly. Additionally, for higher delay bound, sum rate was shown to be enhanced with the cost of increasing information packet delay in the SN.