# Anti-Jamming Low-Latency Channel Hopping Protocol for Cognitive Radio Networks
## 4 Proposed Solution
### The Proposed ALL Protocol
The channel assignment to the adjustment slots of each \(T\) frame is determined based on Equation (1), which means that the probability that SU \(a\) assigns channels 1 and 2 to the adjustment slot is \(\frac{(1-O_{a1})}{((1-O_{a1})+(1-O_{a2}))}=25\%\) and \(\frac{(1-O_{a2})}{((1-O_{a2})+(1-O_{a2}))}=75\%\), respectively. When a sender SU \(a\) is in a slot belonging to a \(T\) frame and, at the same time, receiver SU \(b\) is in a slot belonging to an \(R\) frame, we call SUs \(a\) and \(b\)\(TR\)_overlapped_. Because each available channel is being used at least once in a \(T\) frame, every \(2N_{c}\) slots and the channel utilized by an \(R\) frame remains unchanged, two SUs are guaranteed to have a rendezvous when they are \(TR\) overlapped for more than \(2N_{c}\) slots. To facilitate the rendezvous guarantee, each SU \(a\) running ALL divides \(R\) frames into _fixed \(R\) frames_ and _unfixed \(R\) frames_. An SU first determines the fixed \(R\) frame symbol of each column based on its ID, which also determines the position of the fixed \(R\) frame in each sub-column. Specifically, each SU \(a\) determines the fixed \(R\) frame symbol of the corresponding column in \(M_{a}\) according to the value of each digit of \(ID_{a}\). The fixed \(R\) frame symbol of the \((n+1)\)th column in \(M_{a}\), denoted as \(FR_{a}^{n+1}\), is calculated as \(FR_{a}^{n+1}=ID_{a}^{n}\). When the ELP symbol in \(M_{a}^{n}\) is equal to \(FR_{a}^{n}\), the frame corresponding to the symbol is set as the fixed \(R\) frame. For example, suppose that SU \(a\) uses the ELP sequence \((0,0,3,1,2,1,3,2)\) to build \(M_{a}\), \(ID_{a}\)=\((00)_{4}\), \(e_{a}^{1}=e_{a}^{2}=(0,0,3,1,2,1,3,2)\). Since \(FR_{a}^{2}=FR_{a}^{3}=0\), the position of the fixed \(R\) frame in the second and the third columns of \(M_{a}\) are both at the frames corresponding to symbol 0 in each sub-column, that is, frames 0 and 1. Each SU \(a\) has \(NR_{a}-1\) unfixed \(R\) frame symbols in each sub-column. The set of all the unfixed \(R\) frame symbols in \(M_{a}\) are represented by \(uFR_{a}\). The set of all unfixed \(R\) frame symbols in \(M_{a}^{\prime\prime}\) is represented by \(uFR_{a}^{n}\), while the \(x\)th unfixed \(R\) frame symbol is represented by \(uFR_{a}^{n,x}\). Different SUs may be out of synchronization, that is, the time at which each SU starts the channel hopping sequence may be different. When a sender allocates its unfixed \(R\) symbols, the time difference with the receiver must be considered. Suppose that sender SU \(a\) connects to network \(\theta\) time slots prior to its receiver, SU \(b\). In such a scenario, when SU \(a\) switches to the channel located in the \(a\)th column of \(M_{a}\), SU \(b\) switches to the \(\beta\)th  
Figure 2: The hopping matrix structure of SU \(a\) is presented in two parts: (**a**) the allocation of T and R frames and slots, and (**b**) the channel allocation for frames 4 and 6 of Sub_column 0 and frame 7 of Sub_column 1 in \(M_{a}^{3}\). column of \(M_{b}\), where \(\beta=(\theta+\alpha)\bmod(|ID_{a}|+1)\). In each corresponding column of two SUs, the \(\gamma\)th frame of SU \(a\) overlaps \(2N_{c}\) slots with the \(\delta\)th frame of SU \(b\), where  
\[\delta= \begin{cases}(\gamma+\frac{\frac{\theta}{|ID_{a}|}}{4N_{c}})\bmod(2(n_{e }+1)),&\text{if }0\leq\beta\left(\bmod 4N_{c}\right)\leq\ 2N_{c}\\ (\gamma+\frac{|ID_{a}|+1}{4N_{c}}+1)\bmod(2(n_{e}+1)),&\text{otherwise}.\end{cases} \]  
SU \(a\) determines the unfixed \(R\) frame symbol of \(M_{a}\) in a column-by-column manner. The unfixed \(R\) symbols for the second column of \(M_{a}\) are the \(NR_{a}-1\) (mod \((n_{e}+1)\)) symbols next to \(FR_{2}^{2}\). The unfixed \(R\) symbols for the third column of \(M_{a}\) are the \(NR_{a}-1\) (mod \((n_{e}+1)\)) symbols next to the last unfixed \(R\) symbol in the previous column of \(M_{a}\). The unfixed \(R\) symbols for the other columns of \(M_{a}\) can be obtained by analogy. The algorithm of the ALL protocol is shown in Algorithm 1.