# Anti-Jamming Low-Latency Channel Hopping Protocol for Cognitive Radio Networks
## 4 Proposed Solution
### The Proposed ALL Protocol  
In most existing channel hopping algorithms, the ID of each SU is set to its 48-bit MAC address. The initial 24 bits of a MAC address denote the manufacturer or vendor number, whereas the remaining 24 bits signify a distinctive serial number assigned to the specific network interface controller by the manufacturer. To increase the dissimilarity of IDs among different SUs, an SU \(a\) set the last few bits of the MAC address as its ID (denoted as \(ID_{a}\)). Recall that an SU uses \((n_{e}+1)\)-ary ID in the ALL protocol. To obtain the appropriate length for ID in a distributed manner, each SU uses the existing 3B algorithm [36] to find  
Figure 1: Different ELP patterns. the number of nodes \(N_{u}\) in the network and then broadcasts \(N_{u}\) to synchronize with other SUs. The ID length of SU \(a\) can be obtained by Equation (2). \[|ID_{a}|=\lfloor log_{n_{e}+1}N_{u}\rfloor \tag{2}\]  
The channel hopping matrix \(M_{a}\) is composed of \(|ID_{a}|+1\) columns. The first column is composed of a repetitive pattern of frames, specifically \(TTRR\), wherein \(T\) denotes a \(T\) frame, and \(R\) denotes an \(R\) frame. Each of the other \(|ID_{a}|\) columns consists of \(k_{a}\) sub-columns. The sequence of \(T\) and \(R\) frames in every column is established using an ELP pattern that is chosen according to the corresponding digit of \(ID_{a}\). Let \(e_{a}^{n}=ID_{a}^{n},1\leq n\leq|ID_{a}|+1\) be the ELP pattern of the \(n\)th column of \(M_{a}\). Every sub-column is comprised of \(2(n_{e}+1)\) frames. A frame in each sub-column sequentially corresponds to a symbol in the ELP pattern. Through the use of the OLAA_T protocol, SU \(a\) establishes the quantity of \(T\) and \(R\) frames (represented by \(NT_{a}\) and \(NR_{a}\), respectively) in each sub-column according to its traffic load. In each \(T\) frame, \(2N_{c}\) default slots and \(2N_{c}\) adjustment slots are arranged alternately. The channel assignment is also achieved by applying OLAA_T. Specifically, \(N_{c}\) channels will be randomly and non-repeatedly assigned to the first-half of default slots as well as the second-half ones (channels that are unavailable are substituted with available channels in a random manner). The usage probability of each channel is calculated according to Equation (1). The channel allocation in the adjustment slots is based on the usage probability. Consisting of \(4N_{c}\) slots, each \(R\) frame within a given sub-column is assigned to the same channel. Distinct channels are assigned to \(R\) frames in separate sub-columns of a single column. To demonstrate the channel hopping matrix generation and channel allocation for each frame, consider the example of SU \(a\) (\(ID_{a}=00_{4}\)) utilizing the ELP sequence (0, 0, 3, 1, 2, 1, 3, 2) to create a channel hopping matrix with \(C=C_{a}=1,2\). It is assumed that channel 1 has a PU occupancy of 80% and channel 2 has a PU occupancy of 40%. Additionally, it is assumed that SU \(a\) has a balanced amount of incoming and outgoing traffic. Because \(ID_{a}=(00)_{4}\), \(e_{a}^{0}=e_{a}^{1}=(0,0,3,1,2,1,3,2)\) while \(NT_{a}=NR_{a}\) since SU \(a\) has balanced traffic, as shown in Figure 2a. The channel assignment of frames 4 and 6 of sub-column 0 and frame 7 of sub-column 1 in \(M_{a}^{3}\) can be found in Figure 2b. In frame 4 of sub-column 0, the sequence generated by a random arrangement of elements in \(C\) by SU \(a\) are (1, 2) and (2, 1), respectively, and thus the default slots of the first- and second-half of the frame will be assigned channels (1, 2) and (2, 1), respectively. SU \(a\) assigns channels in \(C\) to the \(R\) frame of each sub-column randomly and without duplication. In this example, SU \(a\) assigns channel 1 and channel 2 to sub-column 0 and sub-column 1, respectively.