## 3 The Proposed Intelligent Mixed Approach
### The Mixed Frequency Hopping Spread Spectrum and Smart Clustering Algorithm  
#### 3.2.1 The Proposed Frequency Hopping Spread Spectrum Approach  
As the first \(j\) NB-IoT nodes join the network, they send interest messages to the BS. The BS records the Received Signal Strength Indicators (RSSI) of all the \(j\) nodes and sorts them in ascending order. The lowest RSSI value which represents the NB-IoT node with the lowest level of access to the BS while the NB-IoT node with the highest RSSI represents the node with the highest access to the BS. The RSSIs of the \(j\) first deployed nodes in their order of arrival form the initial seed of a lagged Fibonacci generator (LFG) series that is used to generate the pseudo-random number sequence. The generated sequence is then used for frequency channel hopping access. Given a number of \(T\) of all nodes within the network, the number of elements of the initial seed \(j\) is selected as per the following considerations:  
* A random number generator's period is the number of new random values that it generates before returning to the start of the sequence. * The period of the pseudo-random number generated is equal to the number of NB-IoT nodes \(T\). * Maximizing the period ensures that the random numbers generated for each node are from a different period of the LFG. * The value \(j\) is selected to provide an optimal balance between the random number generation period and the amount of memory used. This is because the higher the period \(T\), the higher the consumption of the already constrained memory space of the NB-IoT nodes. The proposed algorithm uses a multiplicative LFG (MLFG). For an NB-IoT node with \(m-\)bits word-length processor, an MLFG is defined as follows  
\[MLFG[j,k,N;\{x_{0},x_{1},...,x_{j-1}\}], \tag{1}\]  
where  
* \(N=2^{m}\),
* \(j\) and \(k\) are the lag offsets of the past samples in such a way that \(j>k>0\),
* \(\{x_{0},x_{1},...,x_{j-1}\}\) is the initial seed, and
* the trinomial \(x^{j}+x^{k}+1\) which is irreducible and primitive over the Galois Field \(GF(2)\). For a number of NB-IoT nodes \(T\), an initial seed size of \(j\) is chosen such as \(T=(2^{j}-1)\times 2^{m-3}\). This will ensure that the maximum period of the MLFG is equal to the number of NB-IoT nodes \(T\). The MLFG pseudo-random values \(x_{n}\) are computed by the different nodes as follows  
\[x_{n}=(x_{n-k}\times x_{n-j})\text{ }Mod\text{ }N. \tag{2}\]  
The \(j\) seed elements on the other hand are selected by the BS upon reception of the interest messages from all the NB-IoT nodes during the initial deployment based on the computed and sorted RSSI values of the received interest messages. The received RSSI values are computed as follows,
* Through the analysis of the RSSI, it is found that the RSSI value decreases as the distance from the NB-IoT node to the BS increases. Based on this consideration, the free space model (FSM) is used as the RSSI-Based Ranging Model. The FSM is expressed as follows, \[PL=20\times log(d)+20\times log(f)-27.55,\] (3) where \(PL\), \(d\) and \(f\) represent the path loss of the signal energy, the distance between the NB-IoT node and the BS and the transmission frequency being used respectively. * Furthermore, it is also found that the path loss decreases as the antenna height increases. Based on this consideration, a two-way ground model is proposed as follows, \[PL=40\times log(d)-20\times log(h_{n})-20\times log(h_{BS}),\] (4) where \(h_{n}\) is the transmitting NB-IoT device height and \(h_{BS}\) is the effective height of the Base Station. * In this study, a two-way ground level model is considered with an average LTE BS effective height of 27.81 m [50] and an average NB-IoT elevation level \(h_{n}\) of 7.8 m for most NB-IoT urban applications scenarios [51]. * Considering the NB-IoT antenna gain \(g_{a}\) of 6 dBi [52], and a transmit power \(P_{TX}\), the \(RSSI\) value can be computed as \[ \begin{cases}RSSI_{dBm}=P_{TX(dB)}+g_{a(dB)}-PL_{dB}\\ RSSI_{dBm}=P_{TX(dB)}+6-PL_{dB}\end{cases}