# Random Access Performance of Distributed Sensors Attacked by Unknown Jammers
## 3 RA Performance Analysis
### Access Delay of Random Access Request  
The success of TC consists of both successes of PT and MT. The failure of TC then occurs when the number of preamble retransmissions exceeds \(r_{max}\) or MT fails after the SN receives AI. If TC is declared to be a failure, SNs restarts PT in a new TC with setting the transmitting power at an initial level, i.e., \(m_{r}=1\). Let \(C\) be the number of restarts of TC to an end of successful MT. By assuming that all transmission attempts are independent, the distribution of \(C\) is given by:  
\[\Pr\{C=c\}=\frac{S_{T}}{G}\bigg{(}1-\frac{S_{T}}{G}\bigg{)}^{c},\ \ \ c=0,1,2,\ldots. \tag{23}\]  
Let \(\overline{T}_{\bullet}^{(M)}(r|n_{m},n_{m,t},n_{p,t},n_{I})\) be the probability that MT has failed though PT (i.e., the \(r\)-th retransmission), and receiving AI are successful, given \(n_{m}\), \(n_{m,t}\), \(n_{p,t}\) and \(n_{I}\). \(\overline{T}_{\bullet}^{(M)}(r)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
\(n_{m}=n_{m,t}=n_{p,t}=G\) for all \(t\). Thus, when \(G\geq 2\), it is assumed in the simulation that SNs during PT are interfered by other multiple SNs that are transmitting either MSG or preamble. Additionally, scenarios with a different number of jammers \(n_{J}=1,2,3\) are also tested, respectively. Figures 2-4 compare the success probability \(u_{\bullet}(r)\) of PT under different jamming attacks by the different numbers of jammers when the offered traffic \(G\) is \(1,3\) and \(5\), respectively. In the figures, it is seen that the code jamming is less harmful than the power jamming in terms of the success probability. This is because, referring to (5), the signal power of the code jammer is added to desired signal power from SNs that select the same access code with the jammer, which increases \(u_{\bullet}(r)\) at HS. In power jamming, on the other hand, the whole power is treated as interference. In the same context, it is seen that the performance definitely degrades as the number of power jammers increases in Figures 2-4. In code jamming, however, more jammers can contribute to improving the performance: for example, if the number of code jammers increases to \(1\), \(2\) and \(3\), in Figure 2 (when \(G=1\)), \(u_{\bullet}(0)\) also increases to \(0.38\), \(0.4\) and \(0.41\), respectively. It should be noted that the code jammers do not always contribute to increasing \(u_{\bullet}(r)\): for example, when \(r\geq 3\) in Figure 2, it is seen that the more code jammers provide the lower \(u_{\bullet}(r)\), which is also true for the overall range of tested \(r\) in Figure 4 (when \(G=5\)). Furthermore, code jamming (with one or two jammers) sometimes (when \(0\leq r\leq 4\)) gives better performance than PT without jamming especially when \(G=5\) in Figure 4. Comparing Figures 2-4, it is seen that jamming severely degrades the performance of \(u_{\bullet}(r)\) especially in the light offered load. In the very heavy load, code jamming sometimes increases \(u_{\bullet}(r)\). In terms of \(u_{\bullet}(r)\), power jamming is more harmful than code jamming over a wide range of parameter values. Figure 5 compares the throughput of final MSG transmission \(S_{T}\) for increasing offered traffic \(G\), where code and power jamming attacks with 1-3 jammers are considered, respectively. If the same number of jammers is considered, the throughput with code jamming is smaller than that with power jamming over all \(G\) tested, though code jamming achieves usually better \(u_{\bullet}(r)\) than power jamming in Figures 2-4. This is because MSGs from desired SNs have collided with those from the code jammers using the same code. When \(G=2\), \(21\%\), \(25\%\), \(30\%\), \(36\%\), \(30\%\) and \(40\%\) of throughput are lost due to 1 power jammer, 1 code jammer, 2 power jammers, 3 power jammers, 2 code jammers and 3 code jammers, respectively. When \(G=3\), the amount of throughput loss is not distinguishable between the numbers of power jammers. Moreover, when \(G=4\), the throughput with and without power jamming becomes equal due to the overwhelming interference.