# Anti-Jamming Low-Latency Channel Hopping Protocol for Cognitive Radio Networks
## 5 Simulation  
We have utilized NS-3 (version 3.17) to execute the ALL, OLAA_R, and OLAA_T protocols and validate their effectiveness. The simulation is conducted in a square environment with a length of 1 km for each side. A two-state Markov chain is used to model the PU activity of each channel. Each PU switches between idle and busy states where the interval between two consecutive activation points and the interval of idle time are both exponentially distributed with a mean of two time slots. There are also 8 PUs, 30 SUs, and 21 malicious attackers in the network. The number of channels being used in the network equals the number of PUs. The MAC protocol used in the simulation is IEEE 802.11 CSMA/CA. The transmission range of SUs and attackers is set to 250 m. Table 3 presents the essential simulation parameters used in the experiments. Figure 4 depicts the three different topologies, namely mesh, star, and bottleneck, which are utilized to simulate diverse traffic loads. For the mesh topology, the SUs are distributed randomly in the network, and each SU randomly selects one of its neighbors as the receiver. In the star topology, a central node is located at the center of the network, and all other nodes are randomly distributed in the network and send their packets to the central node. In the bottleneck topology, certain nodes are designated as bottleneck nodes with more incoming traffic than outgoing traffic, such as nodes A and B, shown in Figure 4c. Other nodes in the network transmit their packets to the bottleneck node they are connected with on the right. The network was also populated with three types of malicious attackers that were randomly distributed, with each type accounting for one-third of the total number of attackers. Each point in the following figures is the average of 100 simulation runs. In the simulations, a common ELP sequence of order three (0, 0, 3, 1, 2, 1, 3, 2) is used by each SU to construct the channel hopping matrix for every node that employs the ALL and OLAA_T protocols. This implies that, for SU \(a\) running ALL, the maximum \(NR_{a}\) is equal to three. In the simulations, the length of ID for SUs running OLAA is set to 24 bits. The simulation time is set to \((24+1)\times k_{a}\times 2\times(3+1)\times 4N_{c}=800\times(k_{a}\times N_{c})\) time slots, which is the time span of a cycle in the OLAA_T protocol and 6.25 cycles in the ALL protocol. As rendezvous is guaranteed in \(NR_{a}-1\) cycles, such a simulation time is long enough for SUs running ALL to have a rendezvous with their receivers. The metrics we observed include the accumulated throughput of all the SUs in the network during the simulation time and the average time to rendezvous (ATTR) between all transmission pairs. \begin{table}
\begin{tabular}{l l} \hline
**Parameter** & **Value** \\ \hline Area size & 1000 \(\times\) 1000 m \\ Number of PUs & 8 \\ PUs Idle ratio & 50\% \\ Number of SUs & 30 \\ Transmission range of SU/jammers & 250 m \\ Packet size & 512 bytes \\ Simulation runs & 100 \\ Simulation times & \(800\times k_{a}\times N_{c}\) slots \\ \hline \end{tabular}
\end{table} 
Table 3: Simulation Parameters. The performance of the proposed protocol is observed from the following three aspects. (A) Impact of the number of channels: In this experiment, we change the number of channels in the network. For each SU running ALL, the size of \(M_{a}\) is changed as varied \(k_{a}\), and the simulation time is changed accordingly to provide a guaranteed rendezvous. The 21 malicious attackers are randomly distributed in the network in this experiment. The simulation results of mesh, bottleneck, and star topologies for synchronous and asynchronous networks are shown in Figures 5-7 and Figures 8-10, respectively. As the number of channels increases, the chance of SUs having a rendezvous is reduced, and thus, the ATTR values in all three topologies gradually decrease.