# Analysis and Design of Rateless Two-way Relay Networks Based on a Multiply-and-Forward Scheme
## 2 System Model  
Consider a time-division TWRN, as shown in Figure 1, where two source nodes A and B communicate with each other through a relay node R. Note that all nodes work on half-duplex mode, in which they cannot transmit and receive signals simultaneously. Let \(\mathbf{s}_{\rm A}\) and \(\mathbf{s}_{\rm B}\) denote the source bit vectors of length \(k\), respectively. In this paper, we employ SLT codes for rateless coding and the corresponding output bits are represented as \(\mathbf{c}_{\rm A}\) and \(\mathbf{c}_{\rm B}\). We refer readers to [24] and references therein for details about SLT encoding and decoding algorithms. Using BPSK(Binary Phase Shift Keying) modulation, the encoded bits transmitted from the source nodes to the relay node are modulated as  
\[\mathbf{x}_{\rm A}=1-2\mathbf{c}_{\rm A} \tag{1}\]  
and  
\[\mathbf{x}_{\rm B}=1-2\mathbf{c}_{\rm B} \tag{2}\]  
Let the distance between source node \(i\) and relay node R denoted by \(d_{i,{\rm R}}\), \(i\in\{\rm A,B\}\). Thus, the large-scale path loss is denoted by \(d_{i,{\rm R}^{-\eta}}^{-\eta}\), where \(\eta\) represents the path loss exponent. Assume the channels are Rayleigh-distributed, reciprocal and time-invariant during one round of message exchange between nodes A and B. More importantly, assume channel state information is perfectly known to all receivers of nodes A, B and R, therefore, we will not consider any phase rotation that could cause the change of symbol signs during the transmission, for the simplicity of analysis. Denote  
Figure 1: System model of a two-way relay network. coefficients of each channel by \(g_{\text{A,R}}\) and \(g_{\text{B,R}}\), respectively, that follow the same Rayleigh distribution, i.e.,  
\[f(g)=\frac{g}{\sigma_{\text{R}}^{2}}\exp\left(-\frac{g^{2}}{2\sigma_{\text{R}}^ {2}}\right),\ g\geq 0 \tag{3}\]  
where \(\sigma_{\text{R}}^{2}\) represents a crucial parameter in the Rayleigh density and we denote the density by Rayleigh(\(\sigma_{\text{R}}^{2}\)). in this paper. The fading coefficients \(h_{\text{A,R}}\) and \(h_{\text{B,R}}\) are therefore denoted by  
\[h_{i,\text{R}}=g_{i,\text{R}}d_{i,\text{R}}^{-\eta} \tag{4}\]  
with \(h_{i,\text{R}}^{2}\) following the exponential distribution  
\[f\left(h_{i,\text{R}}^{2}\right)=\frac{d_{i,\text{R}}^{2\eta}}{2\sigma_{\text{ R}}^{2}}e^{-\frac{\frac{d_{i,\text{R}}^{2\eta}}{2\sigma_{\text{R}}^{2}}}h_{i, \text{R}}^{2}} \tag{5}\]  
where \(i\in\{\text{A,B}\}\). Assume all nodes transmit signals with the same power of \(P\) and Gaussian noise at each node follows the same density with mean zero and variance \(\sigma_{\text{n}}^{2}\), denoted by \(\mathcal{N}\left(0,\sigma_{\text{n}}^{2}\right)\). Using the definition of transmit power and noise, here we can define the transmit signal-to-noise ratio (SNR) as \(\gamma=P/\sigma_{\text{n}}^{2}\), for all nodes in a TWRN. In the TRWN that we will discuss in the following sections, it takes three stages to exchange messages between two source nodes:  
a)   node A sends modulated symbols \(\mathbf{x}_{\text{A}}\) to node R and the received signal vector is given by  
\[\mathbf{y}_{\text{AR}}=h_{\text{A,R}}\sqrt{P}\mathbf{x}_{\text{A}}+\mathbf{n} _{\text{AR}}\] (6) b)   node B sends modulated symbols \(\mathbf{x}_{\text{B}}\) to node R and the received signal vector is given by  
\[\mathbf{y}_{\text{BR}}=h_{\text{B,R}}\sqrt{P}\mathbf{x}_{\text{B}}+\mathbf{n} _{\text{BR}}\] (7) c)   node R processes the signals received from A and B and broadcasts to nodes A and B with the signal  
\[\mathbf{x}_{\text{R}}=\rho R(\mathbf{y}_{\text{AR}},\mathbf{y}_{\text{BR}}) \tag{8}\]  
where \(\rho\) is a factor to ensure power normalization and function \(R(\cdot,\cdot)\) represents the processing of received signals at node R, such as DF and AF.