## 2 System Model
In the sensing phase, the source performs spectrum sensing to detect jamming signals infected by the jammer. In the data transmission phase, the source transmits the data to the destination without any help from the relay. Figure 2b illustrates the time frame structure of the relay-assisted transmission mode. For this mode, the frame is divided into three phases: sensing, data transmission from the source to the destination \((S-R)\), and data forwarding from the relay to the destination \((R-D)\). Unlike direct transmission, after the sensing phase, the source will transmit the data to the relay and then, the relay will forward the data to the destination. \(\tau_{s}\) represents the sensing time of the source. \(\tau_{SD},\tau_{SR}\), and \(\tau_{RD}\) represent the data transmission times of the links: \(S\) to \(D\), \(S\) to \(R\), and \(R\) to \(D\), respectively. Note that the duration of sensing phase in relay-assisted transmission mode is the same as direct transmission mode meanwhile the duration \(\tau_{SR}=\tau_{RD}=\frac{1}{2}\tau_{SD}\). For the direct transmission mode, the received signal of the destination at the end of a time slot can be expressed as follows  
\[y_{D}=\sqrt{P_{S}}h_{SD}x_{s}+n_{D}. \tag{3}\]  
where \(P_{S}\) is the transmission power at the source; \(x_{s}\) represents the signal transmitted from the source, \(n_{D}\) is white Gaussian noise (AWGN) with zero- mean and variance \(\sigma^{2}\) at the destination. For the relay-assisted transmission mode, the received signals of the relay after the S-R phase can be expressed as follows  
\[y_{R}=\sqrt{P_{S}}h_{SR}x_{s}+n_{R}. \tag{4}\]  
Figure 2: Frame structure. where \(n_{R}\) denotes the white Gaussian noise with zero- mean and variance \(\sigma^{2}\) at the relay. This paper adopts an amplify-and-forward (AF) relaying protocol to forward data to the destination. Hence, the relay amplifies the signal by using a scale factor, \(\beta_{r}\), which can be calculated as follows:  
\[\beta_{r}=\frac{\sqrt{P_{R}}}{\sqrt{P_{S}|h_{SR}|^{2}+\sigma^{2}+\sigma_{J}^{2}}}. \tag{5}\]  
where \(P_{R}\) represents the transmission power at the relay. In phase 2, the received signal at the destination is given by  
\[ \begin{array}{l}y_{D}=\beta_{r}h_{RD}y_{R}+n_{D}\\ =\beta_{r}h_{RD}\left(\sqrt{P_{S}}h_{SR}x_{s}+n_{R}+n_{I}\right)+n_{D}\\ =\beta_{r}h_{RD}\sqrt{P_{S}}h_{SR}x_{s}+\beta_{r}h_{RD}\left(n_{R}+n_{I}\right) +n_{D}.\end{array}  \tag{6}\]  
where \(n_{J}\) denotes jamming noise with zero-mean and variance \(\sigma_{J}^{2}\). Note that in the case that the jammer does not attack, the \(n_{J}\) will be zero. As a result, the signal-to-interference-plus-noise ratio (SINR) at \(D\) is denoted as \(\varphi_{0},~{}\varphi_{1}\), and \(\varphi_{2}\) for the direct transmission without jamming, relay-assisted transmission with jamming and relay-assisted transmission without jamming, respectively, obtained as follows:  
\[\varphi_{0}=\frac{P_{S}|h_{SD}|^{2}}{\sigma^{2}}, \tag{7}\]  
\[ \begin{array}{l}\varphi_{1}=\frac{P_{S}P_{R}|h_{SR}|^{2}|h_{RD}|^{2}}{\left( P_{S}|h_{SR}|^{2}+\sigma^{2}\right)\left(\frac{P_{R}|h_{RD}|^{2}\left( \sigma^{2}+\sigma_{J}^{2}\right)}{P_{S}|h_{SR}|^{2}+\sigma^{2}}+\sigma^{2} \right)}\\ =\frac{P_{S}P_{R}|h_{SR}|^{2}|h_{RD}|^{2}}{\left(P_{S}|h_{RD}|^{2}+\sigma^{2} \right)\left(P_{S}|h_{SR}|^{2}+\sigma^{2}\right)\sigma^{2}},\end{array}  \tag{8}\]  
\[ \begin{array}{l}\varphi_{2}=\frac{P_{S}P_{R}|h_{SR}|^{2}|h_{RD}|^{2}}{\left( P_{S}|h_{SR}|^{2}+\sigma^{2}\right)\left(\frac{P_{R}|h_{RD}|^{2}\sigma^{2}}{P_{S}|h_{SR }|^{2}+\sigma^{2}}+\sigma^{2}\right)}\\ =\frac{P_{S}P_{R}|h_{SR}|^{2}|h_{RD}|^{2}}{\left(P_{S}|h_{RD}|^{2}+P_{S}|h_{SR}| ^{2}+\sigma^{2}\right)\sigma^{2}}\end{array}  \tag{9}\]  
According to the transmission mode, the average throughput can be calculated as  
\[R=\left\{