# Power Efficient Random Access for Massive NB-IoT Connectivity
## 5 Performance Evaluations
### Simulation Results  
To validate the numerical results we performed the system level simulations. We used Matlab to implement our simulation scenario. Simulations were run 10,000 times. The simulation steps are explained as follow:  
* We consider a single cell, where the active devices that are required to perform RAP are randomly distributed. * A particular device that fails an RAP attempt checks the channel status for a reattempt and selects the CE level state based on channel condition. * The CE level that the device selects consist of newly activated devices. It is considered that new device arrival follows Beta distribution, with \(a=3\) and \(b=4\). * The selected CE level would also have already collided other devices that would perform RAP reattempt along with the device under consideration. Thus, the particular device competes for preamble with new activated devices as well as previously failed devices that happen to select this CE level after RSRP re-measurements. * We first calculate the optimal value of the ACB factor by using the ratio \(M/N\), where \(M\) is number of preambles and \(N\) is total number of devices at the start of every simulation slot. \(N\) comprises of the collided devices and the new arrivals. * The device selects a random number between 0 and 1. The selected number is compared with the ACB factor. If the number is less than the ACB factor then the device does not transmit. * The device selects the preamble for transmission in the specific time slot. We adopt the S-ALOHA transmission algorithm which divides time into consecutive slots. If two devices selects the same preamble in the same time slot then it is considered as collision. The device can only successfully transmit the preamble if it is different from other devices'. * The collided devices again select the new CE level for transmission during the next time slot in PE-RAP and this process is repeated. Figure 7: Average power consumption over varying repetitions per attempt in CE2 for proposed PE-RAP and existing NB-IoT RAP. (**a**) High value of \(q_{2}\); (**b**) Low value of \(q_{2}\); (**c**) Average value of \(q_{2}\). * For the selection of the CE level, the device generates a random number between 0 and 1 during each time slot. The number selected by the device is compared with \(q_{0}\), \(q_{1}\) and \(q_{2}\). Based on the comparison, the CE level is selected. Thus, the choice of CE level for a reattempt would be different for all the devices. All the devices that attempt in one CE level in one slot might reattempt in a different CE level in the next slot. * At the end of the simulation the number of attempts in each state is recorded. The simulation is repeated 10,000 times and results are averaged to obtain power consumption in every CE level. Figure 8 delineates the power consumption for PE-RAP obtained through the aforesaid simulations and it is compared to the results of our numerical analysis. In Figure 8a the number of repetitions in CE0 are varied from 2\(\sim\)16 and the number of repetitions in CE1 and CE2 are fixed to 32 and 64, respectively. Figure 8b depicts the simulation and analytical results for a varying number of repetitions in CE1. The number of repetitions in CE0 and CE2 are fixed to 2 and 64, respectively. Similarly, in Figure 8c number of repetitions in CE2 are varied from 8 and 64, while the number of repetitions in CE0 and CE1 are fixed to 2 and 4, respectively. In Figure 8, as expected, the power consumption increases with the increase in the number of repetitions. It is observed from Figure 8a-c that the analytical results are comparable with the average of measured power consumption over all the simulation runs which validates our analysis. In the proposed PE-RAP, the device after collision can quickly select higher CE levels with more repetitions while reducing the number of failed attempts. More repetitions translate into more time in the each attempt. On the other hand, in existing RAP, more attempts, each with fewer repetitions, could be performed.