# Research on Hybrid Relay Protocol Design and Cross-Layer Performance Based on NOMA
## 3 Cross-Layer Performance Analysis of Two-Hop Relay System Based on NOMA
### Cross-Layer Performance Analysis  
For the wireless channels, \(CW_{\text{min}}\) is the minimum competition window value, \(\tau\) is the transmission probability, \(p\) is the packet loss probability, \(m\) is the number of retreat stages, and \(N\) is the number of competing stations. Where \(\tau\) and \(p\) form a closed expression, which can be obtained by solving nonlinear equations [22], then  
\[\left\{ \begin{array}{l}\tau=\frac{2(1-2p)}{(1-2p)(CW_{\text{min}}+1)+pCW_{ \text{min}}\left[1-(2p)^{n}\right]}\\ p=1-(1-\tau)^{n-1}-(n-1)\tau(1-\tau)^{n-2}\end{array} \right.. \tag{22}\]  
Figure 2: Timeslot diagram of two-hop transmission scheme based on NOMA. The successful transmission of data packets is divided into OMA transmission and NOMA transmission. \(P_{s}^{\text{OMA}}\) is the probability that only one station competes to the channel, and \(P_{s}^{NOMA}\) is the probability that two stations compete to the channel at the same time. Then, the probability of successful transmission \(P_{s}\), the probability of transmission with at least one site \(P_{tr}\), and the probability of collision during transmission \(P_{c}\) are as follows:  
\[\left\{ \begin{array}{l}P_{tr}=1-(1-\tau)^{n},\\ P_{s}^{\text{OMA}}=\frac{n\tau(1-\tau)^{n-1}}{P_{tr}},\\ P_{s}^{\text{NNOMA}}=\frac{n(n-1)\tau^{2}(1-\tau)^{n-2}}{2P_{s}},\\ P_{s}=P_{s}^{OMA}+P_{s}^{\text{NOMA}},\\ P_{c}=P_{tr}(1-P_{s}).\end{array} \right. \tag{23}\]  
At the MAC layer, the dynamic relationship between transmit power and the number of competing stations is considered [23]. Assume that the minimum received signal power at which a listening station can detect a packet is \(P_{\text{th}}\). Then, the reserved radius of the channel is  
\[d_{\text{resv}}=\left(\frac{P_{\text{S}}}{P_{\text{th}}}\right)^{\frac{1}{2}} \tag{24}\]  
Other stations within a radius around the receiving station compete with the source for channel access. Assuming that other stations are distributed in density a, \(\lceil x\rceil\) means to round up \(x\), then the average number of competing stations \(n\) of the source station is  
\[n-1=\left\lceil\rho\pi d_{\text{resv}}^{2}\right\rceil=\left\lceil\rho\pi\left( \frac{P_{\text{S}}}{P_{\text{th}}}\right)^{\frac{2}{2}}\right\rceil. \tag{25}\]  
Therefore, the number of competing stations increases as the transmitting power increases. The total idle time of the system channel \(\overline{T_{e}}\) is  
\[\overline{T_{e}}=(1-P_{tr})\sigma_{\text{w}}. \tag{26}\]  
The total time of packet collision \(\overline{T_{c}}\) is  
\[\overline{T_{c}}=P_{tr}(1-P_{s})T_{c}, \tag{27}\]  
where \(T_{c}=T_{\text{H}}+T_{\text{D}}+T_{\text{DIFS}}+\delta\) is the duration of the conflict. \(\sigma_{\text{w}}\) is the duration of the free slot. The probability \(P_{s}^{\text{OMA}\prime}\) of successful transmission by OMA, the probability \(P_{s}^{\text{D}_{1}}\) of successful transmission by NOMA but only user D\({}_{1}\) receiving the data packet, and the probability \(P_{s}^{\text{D}_{1},\text{D}_{2}}\) of successful transmission by NOMA and both user D\({}_{1}\) and user D\({}_{2}\) receiving the data packet is as follows:  
\[\left\{ \begin{array}{l}P_{s}^{\text{OMA}\prime}=P_{tr}.P_{s}^{\text{OMA}} \big{(}1-P_{\text{out}}^{\text{OMA}}\big{)},\\ P_{s}^{\text{D}_{1}}=P_{tr}.P_{s}^{\text{NNOMA}}.P_{tr}\big{(}\gamma_{\text{R}, x_{1}}>\gamma_{\text{th}_{1}},\gamma_{\text{D}_{1},x_{1}}>\gamma_{\text{th}_{1}} \big{)}\\ \times\big{(}1-P_{tr}\big{(}\gamma_{\text{R},x_{2}}>\gamma_{\text{th}_{2}}, \gamma_{\text{D}_{2},x_{1}}>\gamma_{\text{th}_{1}},\gamma_{\text{D}_{2},x_{2}} >\gamma_{\text{th}_{2}}\big{)}\big{)}\\ P_{s}^{\text{D}_{1},\text{D}_{2}}=P_{tr}.P_{s}^{\text{NNOMA}}.P_{tr}\big{(} \gamma_{\text{R},x_{1}}>\gamma_{\text{th}_{1}},\gamma_{\text{R},x_{2}}>\gamma _{\text{th}_{2}}\big{)}\\ \times P_{r}\big{(}\gamma_{\text{D}_{2},x_{1}}>\gamma_{\text{th}_{1}},\gamma_{ \text{D}_{2},x_{2}}>\gamma_{\text{th}_{2}},\gamma_{\text{D}_{1},x_{1}}>\gamma _{\text{th}_{1}}\big{)},\end{array} \right.