# Joint Resource Allocation in Secure OFDMA-Based Networks Taking a Base Station as a Two-Way Relay
## 2 System Model  
In the proposed model, there is one eavesdropper node, and there are normal users marked as \(\psi=\{T_{1},T_{2},...,T_{K}\}\) in one cell who exchange information with corresponding users in another cell. At the same time, there are paired users marked as \(\Gamma=\{(A_{1},B_{1}),(A_{2},B_{2}),...,(A_{M},B_{M})\}\) who exchange information with each other taking the base station as a relay. \(M\) and \(K\) represent the number of paired and normal users, respectively. The OFDMA channel has \(N\) number of subcarriers marked as \(\text{N}=\{1,2,...,N\}\). To avoid interference, each subcarrier pair can only be assigned to one normal user or one paired user in the uplink and downlink. Each normal user or paired user can occupy more than one pair of subcarriers. Here, we give an example to explain the adopted communication protocol as shown in Figure 1. In the first time slot, the paired users \((A_{1},B_{1})\) send information to the base station over the \(i\)-th subcarrier simultaneously, \(i\in\text{N}\); the normal user in the cell transmits information to normal user in another adjacent cell through the base station over the \(i^{\prime}\)-th subcarrier, \(i^{\prime}\in\text{N}\). In the second time slot, the base station amplifies the received signal from the paired user \(A_{1}\) and \(B_{1}\) and forwards it to \(B_{1}\) and \(A_{1}\) over the \(j\)-th subcarrier, \(j\in\text{N}\); the normal user in the cell receives information from the normal user in another adjacent cell through the base station over the \(j^{\prime}\)-th subcarrier, \(j^{\prime}\in\text{N}\). Suppose subcarrier \(i\) and \(j\) are assigned to the \(m\)-th paired users in the first and second time slot, respectively. Since nodes \(A_{1}\) and \(B_{1}\) know their own transmitted symbols, they can subtract the back-propagating self-interference [24]. In the first time slot, the received signal over subcarrier \(i\) at the base station is:  
\[y_{R}^{i}=\sqrt{P_{A_{m}}^{i}}h_{A_{m},R}^{i}x_{A_{m}i}+\sqrt{P_{B_{m}}^{i}}h_ {B_{m},R}^{i}x_{B_{m},i}+n_{R,i}. \tag{1}\]  
where \(i\in\), \(x_{A_{m}i}\) and \(x_{B_{m},i}\) are the transmitted complex Gaussian signal with a mean of zero and a variance of 1 on subcarrier \(i\) from \(A_{m}\) and \(B_{m}\) respectively; \(P_{A_{m}}^{i}\) and \(P_{B_{m}}^{i}\) are the transmit power of \(A_{m}\) and \(B_{m}\) over subcarrier \(i\); \(h_{A_{m},R}^{i}\) and \(h_{B_{m},R}^{i}\) are the channel gain over subcarrier \(i\) from \(A_{m}\) and \(B_{m}\) to the base station, respectively; \(n_{R,i}\) is Additive White Gaussian Noise (AWGN) at the base station over subcarrier \(i\) with a mean of zero and a variance of \(\sigma^{2}\), \(m\in\{1,2,...,M\}\). It is assumed that all the channel state information in the network is perfectly known at the central controller, which can be embedded within the base station or the user [25]. The purpose of perfect channel status information is to provide a performance reference for a real system. The received signal at the eavesdropper over subcarrier \(i\) is:  
\[y_{E}^{i}=\sqrt{P_{A_{m}}^{i}}h_{A_{m},E}^{i}x_{A_{m}i}+\sqrt{P_{B_{m}}^{i}}h_ {B_{m},E}^{i}x_{B_{m},i}+n_{E,i}. \tag{2}\]  
where \(h_{A_{m},E}^{i}\) and \(h_{B_{m},E}^{i}\) are the channel gain over subcarrier \(i\) from \(A_{m}\) and \(B_{m}\) to the eavesdropper, respectively; \(n_{E,i}\) is Additive White Gaussian Noise at the eavesdropper over subcarrier \(i\) with a mean of zero and a variance of \(\sigma^{2}\). In the second time slot, the base station amplifies the received signal and broadcasts the signal on subcarrier \(j\) with amplification factor \(\beta_{m,i}\) and transmit power \(P_{R,(A_{m},B_{m})}^{j}\). \[\beta_{m,i}=\frac{\sqrt{P_{R,(A_{m},B_{m})}^{j}}}{\alpha}=\frac{\sqrt{P_{R,(A _{m},B_{m})}^{j}}}{P_{A_{m}}^{i}{|h_{A_{m},R}^{i}|}^{2}+P_{B_{m}}^{i}{|h_{B_{m },R}^{i}|}^{2}+\sigma^{2}}. \tag{3}\]  
Figure 1: System model.