A Synthetic Fusion Rule Based on FLDA and PCA for Iris Recognition Using 1D Log-Gabor Filter

Iris recognition is one of themost useful methods to identify or verify people in biometric recognition systems. Iris patterns contain many features that distinguish people from each other. In this paper, a novel iris recognitionmethod is proposed based on the fusion of Fisher Linear DiscriminateAnalysis (FLDA)with embedding Principal ComponentAnalysis (PCA)method. In this work, firstly we use 1D Log-Gabor to elicit the iris features from an approximation part. Secondly, we obtain an appropriate degree of clarity for the iris with fusion of FLDA/PCA to eliminate the optical reflections on the iris image. Experiments of our proposed algorithm are performed on the CASIA V1 database. The results of our proposed approach show a good performance with recognition rate up to 99.99%.

Introduction
Recognition systems have become a role of the large and effective, especially after the progress that has occurred in the area of information technology. The biometric identification methods allow recognizing or verifying the identity of people with a higher degree of reliability [1]. The texture of the iris is remarkable for its ability to obtain systems with a very low error rate [2]. It was used for the first time in environments of high safety such as installations at high-risk nuclear power plants. However, this high level of performance can only be achieved at the cost of heavy restrictions imposed on the person in the course of acquisition [3,4]. The prospects are to relax these constraints in order to make the systems more user-friendly, but the resulting image quality is strongly degraded due to blur and lighting variations. It has been shown that the use of particular information (shape of the eyelid, the inner corner of the eye, eyelashes. . .), in addition to the classic texture of the iris makes important improvements in this degraded context [5]. Figure 1 shows some examples of different contrast enhancement levels such as imadjust, clahe, and msr. For illustration, we have chosen one image from CASIA iris database V1.
The biometric authentication decision is based on a comparison between two irises. The texture must be transformed into a dimensionless coordinate system to handle variability such as pupil dilation. In the rubber sheet model introduced by Daugman [3], the two nonconcentric borders of iris and the texture were represented by a rectangle. The parametric contours of the iris region were used to unroll the texture of the iris to produce the normalized image. Finally, the identification of the pixels included in the iris image made it possible to generate a segmentation mask, which was used to remove artifacts from the normalized image at the mapping step.
Most of the approaches for iris segmentation look for contours from a gradient active contouring technique [6,7]. In 1936, for the first time, Frank Bruch [8] proposed the idea of using the texture information of iris. Dr. Leonard Flom et al. [9] proposed the idea of a difference between the iris patterns of two different people. For the first time, in 1987, the same authors proposed using iris identification methods to identify the people in biometric security systems. In 1991, Daugman, an ophthalmologist, proposed a mathematical model for people identification through iris patterns [10]. In 1994, Daugman introduced the complete method for iris recognition [11]. Daugman's iris identification method is one of the most successful methods and is mostly used in iris identification systems [12]. Iris recognition systems are more successful for the people identification on border controls and highly sensitive areas. UAE is one of the top successful countries to use this biometric security system [10], as more than 3 billion comparisons are made each day with the no false acceptance being observed according to the officials of Ministry of Interior. Iris recognition methods are also adopted by other agencies to identify people like Daugman whose system was used to identify an Afghan photographed in 2002. The iris identification systems show the probability of correctness close to 100% in identifying the women [13]. Wildes et al. [14] constructed the iris texture with Laplacian pyramid with 4-level different resolutions. They used normalized correlation scheme to determine the similarity between the input images and model image. Lim et al. [15] proposed a new method for iris texture information extraction by decomposing the image into four levels with 2D Haar wavelet transformation. They quantized the high frequency to form 87-bit code. Bae et al. [16] used independent component analysis to derive iris signals and projected them onto a bank of basis vectors. They also used quantization method for the resultant coefficient as feature. Sepehr et al. [17] used the real term of 1D Gabor filter and reduced the dimensionality of the extracted features by 2D-PCA. Wen-Shiung et al. [18] presented a biometric iris recognition using 2D-LDA embedding with 2D-PCA and Euclidean distance to recognize the iris pattern by comparing the iris features with the iris features enrolled in the database. Fusion based techniques such as data-level fusion, features-level fusion, and features extraction-level fusion are also actively used in recognition and tracking algorithms [19]. Effective fusion of RGB and infrared modalities is very important for exploiting the correlation between the heterogeneous modalities [20,21]. Lan et al. [22] proposed a joint sparse representation algorithm for feature-level fusion. In this method, featurelevel fusion is performed on reliable features by ignoring the detected unreliable features.
In this paper, a new PCA and Fisher LDA fusion based iris recognition by using 1D log-Gabor filter algorithm is developed.
(1) In our proposed method, to find an optimal transformation, we use FLDA method that utilizes the conventional Fisher criterion to minimize the withinclass distance and maximize the between-class distance. Then feature vectors are formed by applying PCA on the approximation band.
(2) The eigenvectors of the covariance matrices computed by FLDA and PCA methods are fused into a single covariance matrix. The resultant fused matrix is then used to compute the eigenvectors for data projection.
(3) We integrate the pixels' data multiplied by filters and coefficients over their support domain. Then the image texture information is extracted and encoded to mark the corrupted bits in the template by its associated noise mask of feature template.
Remaining sections in this paper are organized as follows: related work is briefly discussed regarding iris biometric systems based on hamming distance with feature encoding schemes adopted by different researchers in Section 2. Detailed description of iris recognition system components with preprocessing, that is, image acquisition, segmentation and normalization, feature extraction and encoding, and matching with proposed Iris detection method are discussed in Section 3. Experimental results and discussion are presented in Section 4. Finally, conclusion is made in Section 5.

Related Works
Many researchers have used different segmentation, analyzation, and characterization techniques in their iris detection methods. For the segmentation of the iris, two methods were commonly used: the integrodifferential operator [23] and the Hough transform [24][25][26][27][28]. For the characterization of the iris, the most useful methods are the Gabor wavelet transform applied by Daugman, the Gabor filter [24], the Laplacian pyramid [25], and orientable pyramid transform method [26]. We have studied various well-known algorithms for iris recognition [17,18,27,[29][30][31][32][33][34][35] and propose a new method for iris detection based on the fusion of FLDA/PCA. We also employ 1D Log-Gabor filter and used hamming distance for comparison between two iris templates. We have compared the results of our proposed iris recognition approach with state-of-the art algorithms.

Proposed Method.
In this paper, we use a statistical method to account eyelashes [6]; we apply the feature extraction algorithm based on fusion of the FLDA and PCA on original image patches to compute the projection matrices.
Based on these matrices' information, the iris images can be analyzed to lower dimension. The recognition is done with the help of an iris matcher with 1D Log-Gabor filter features based on the hamming distance to uniquely identify iris. Figure 2 shows flow diagram of iris biometric system, which is described in detail in the following subsection. In our experiments, for the purpose of illustration, we use CASIA V1 database [36]. All images in this database are grayscale and the value of each pixel is a single sample.

Image Acquisition.
The acquisition of an iris image is considered one of the most important parts in biometric systems. In the eye image, an iris is a dark object located behind the cornea, which is a highly reflective mirror. It is a very difficult object to make a photograph with all these characteristics. Once the image of the iris is acquired, an iris system can be composed of several modules comprising iris recognition: segmentation, normalization, and finally correction of light and contrast enhancement. For the illustration purpose, we use images from CASIA iris v1 database.

Iris Segmentation.
The image of the eye which is acquired does not only include the information of the iris. It is necessary to segment and isolate this information of the image from the rest. Segmentation process is based on isolating the iris from the white area of the eye and the eyelids, as well as detecting the pupil inside the disc of the iris. Generally, the iris and pupil are approximated by circles and eyelids by ellipses. We applied the Hough transform [25,37,38] which is a technique that can be used to isolate objects of simple geometric shapes in the image. In general, we limit ourselves to the lines, circles, or ellipses present in the image. Figure 3 shows the segmentation results of the iris image. One of the great advantages of the Hough transform is that it is tolerant to occlusions in the desired objects and remains relatively unaffected by noise. Figure 4 shows general diagram of an iris segmentation system.

Iris Normalization.
The iris is a disc pierced inside the pupil. The two circles that constitute the borders of the iris with the white area of the eye and the borders of the pupil with the iris are not perfectly concentric. In addition, with the contractions and dilations of the iris and the variation of the acquisition distances between people and the lens, the size of the disk of the iris is not always constant. To allow a comparison of two irises, it is therefore necessary to normalize the iris detected at a fixed size. For this, it is a question of transforming the region of the iris characterized by parametric outlines in a band of invariant size. Daugman [3] proposed using the rubber sheet transformation to make the transition from a Cartesian system to a pseudopolar system normalization of the disk of the iris whose pictorial meaning could be seen as an attempt to extend the disk of the iris like rubber sheet. The process can be explained as follows.
Each pixel of the iris in the Cartesian domain is assigned by a correspondent bit in the pseudopolar domain according to the distance of the pixel from the centers of the circles and the angle. More precisely, the transformation is done as follows: where ( ) represents the abscissa of the point of the detected boundary of the pupil segment that passes through and ( ) represents the ordinate of this same point and the center of the pupil that makes an angle with a chosen direction. Then ( ) and ( ) represent the coordinates of the points obtained by the same principle but on the contour of the iris. The normalized image is rectangular of constant with the size of 80 ×512 pixels. The width of the image represents the variation on the angular axis, while the height represents the variations on the radial axis. Figure 5 shows illustration of the iris normalization module.

Iris Enhancement.
In this step, homomorphic filter is used for iris image enhancement. To apply this filter, first, we reduced the contribution of illumination using the illumination-reflectance model [39]. By using this technique, an image ( , ) can be expressed as the product of the amount of illumination reflected by the objects in the scene and the illumination component as follows: where ( , ) and ( , ) are the reflectance component and the illumination component, respectively.
Homomorphic filtering is used to enhance the reflectance and reduce the contribution (only high frequencies) of illumination retaining. However, the two components should be independent. In order to separate them, we applied the logarithm transform on (3) as follows: ( , ) = log ( ( , )) = ln ( ( , )) + ln ( ( , )) (4) Then, the Fourier transform R is applied: Equation (5) can be written as where ( , V) and ( , V) represent the Fourier transforms of ln( ( , )) and ln( ( , )), respectively. In the frequency domain, ( , V) represents the high passed by means of a filter function ( , V) [40]. The filtered version ( , V) can be calculated as follows: Then we take the inverse Fourier transform of (8): By applying the exponential operation on ( , ), we obtained the filtered image ( , ): Finally, we calculated the high pass filter as follows: where 0 is the cutoff distance from the center and n defines the order of the filter. ( , V) is given by where is the number of rows and is the number of columns of the original image. Figure 6 shows the homomorphic filtering process.
Algorithm 1 and Figure 7 show the procedure of iris preprocessing.

Feature Extraction and Encoding
3.1. FLDA/PCA. In previous works, many feature extraction algorithms have been proposed; in this section, we describe our FLDA/PCA fusion based iris feature extraction scheme.
FLDA utilizes the conventional Fisher criterion and minimizing the within-class distance and maximizing the between-class distance to find an optimal transformation, accepting that there are C training classes; N = 64 × 256. The within-class matrix and the between-class matrix are calculated in order as where describes number of samples class of and means image of class .
is selected in the nonsingular optimal projection as the matrix that maximizes the ratio of the between-class scatter matrix of projection samples; the determinant of the within-class scatter matrix of the projection samples is defined as Hence, by trace of , it can be calculated as For finding the optimal transformation W, we should maximized trace ( ) and minimize ( ) which is represented as ( ). The result can be calculated as follows: To solve this equation, we apply the PCA to the matrix −1 . The recognition rates are achieved with eigenmethod for dimensionality reduction and simple classifiers are used in the reduced features space by applying specific linear methods [41]. The training of iris detector by PCA is presented as the following steps: (1) Define the mean of the input eyes images.

1D
Log-Gabor. The purpose of this step is to extract a characteristic and discriminating representation of the iris and to produce a template for verification in the pattern comparison step. In general, the main existing methods in the literature use the 1D Log-Gabor filter [27,42,43], the 2D Gabor filter [3,6,44,45], the wavelet transform [46][47][48], or the discretionary cosine transform [49]. A comparative study of the different extraction filters of iris characteristics reported in the literatures has been proposed to identify their impact on iris recognition. This study showed that the Log-Gabor filter provides the best recognition performance. Log-Gabor filter is used to create the templates based on information of iris pattern in feature encoding step [50]. Difference between the pixel-intensity levels represents the difference between two iris mages and error that occurred while comparing lighting. To overcome this issue, Daugman [11] used normalization method and extracted features from iris image by convolution with 1D Log-Gabor filter. 1D Log-Gabor filter can be calculated as follows: In this method, pixels data multiplied by filters and coefficients are generated by integrating them over their support domain. The image texture information is extracted and encoded to mark the corrupted bits in the template by its associated noise mask of feature template.

Matching.
Iris recognition involves mapping between two iris codes. A dissimilarity score is calculated to characterize the degree of resemblance or not between two iris code. The matching algorithm consists of score which is calculated by means of the hamming distance by (22). This distance is expressed by the XOR operator noted ⊕ and the logical operator AND noted ∩. This similarity score represents the number of unmasked bits different between the two iris codes normalized by the number of unmasked bits common to both iris codes.
where and are two codes computed from two iris images by the method previously described and and represent their associated masks. Literally, the hamming distance calculates the number of different and valid bits for both iris images between and , which contain 20 * 480 = 9600 template bits and 20 * 480 = 9600 mask bits, respectively. The total number of comparisons is represented by ‖ ∩ ‖. The lower the hamming distance is, the more similar the two codes are. A distance 0 corresponds to a perfect match between the two images, whereas two images of different people will have a hamming distance close to 0.5.

Dataset.
To evaluate the performance, we tested the proposed schemes on the CASIA iris image database (version 1.0) including 756 images of 108 people. For each person, 7 images were acquired in two separate sessions. Totally, 756 * 755/2 = 285390 pairs of comparisons for each algorithm, 2268 for intraclass comparisons, and 283122 for interclass comparisons, which contain 9600 template bits and also for mask bits, respectively. The resolution of CASIAv1 images is 320 * 280.
The experimental results are evaluated based on parameters such as False Acceptance Rate (FAR), False Rejection Rate (FRR), Equal Error Rate (EER), Receiver Operating Curve (ROC), and different downsampling factors and different patches (FLDA/PCA).The error rate can be minimized by selecting the threshold value on the intersection of FAR and FRR. The system obtains the recognition performance of about EER =0.01. Figure 8 shows comparisons of Receiver Operating Curve (ROC) and recognition rate for the experiment.

Intraclass
Comparisons. In our work, 2268 intraclass comparisons of iris templates were successfully performed and their hamming distance distribution is shown in Figure 9  successfully and the histogram of distribution is shown in Figure 10.

Intraclass and Interclass
Comparisons. Among all the results of intraclass comparisons and interclass comparisons, very few values were seen to overlap. Their combined hamming distance distribution for 756 * 755/2 = 285390 pairs of comparisons for each algorithm is shown in Figure 11.     Figure 12 show the result of the original image with different downsampling factors and different patches.
Here, we use 756 iris images of the set as high-resolution reference images. Then we sampled the images of the iris using a bicubic interpolation by a factor of 2n (e.g., the images are resized to 1/(2n) of the original size), and we use all the sampled iris images. Then we follow the downsampled approach of the techniques and sampled the images due to the lack of the database with low-resolution images and corresponding high-resolution reference images. Then we compare our results with bilinear and bicubic interpolation and also for three different contrast enhancement algorithms (imadjust, clahe, and msr) with the images of the iris.
We measure the performance of the algorithm by calculating the PSNR (in dB), MSE, and SSIM values between the original images and the images of different contrast. We also compare the result for different patch sizes corresponding to 1/2, 1/4, 1/6, and 1/8 of the low-resolution image size. Then we declare the size of the patch proportional to the size of the low-resolution images. Here, the size of the patches is the precious parameter. After calculating the PSNR, MSE,  and SSIM values, we obtain that the FLDA/PCA method performs better than bilinear or bicubic interpolation even at very low resolution [51]. We can therefore conclude that it is more resilient than reducing the resolution of the image.
We also obtain that bilinear and bicubic interpolation have similar performances for the small downsampling factors, but a better performance is obtained at very low resolution. We observe that as the resolution decreases, more artifacts appear in the images. Table 2 shows the comparisons performance of the proposed method in terms of recognition rate, False Acceptance Rate (FAR), and False Rejection Rate (FRR). The recognition rate of 99.99%, where FAR= 0.16 and FRR = 0.00, shows the success of method.

Conclusions
In this paper, we propose a novel iris recognition method by using 1D Log-Gabor filter and a fusion of FLDA/PCA. Our algorithm is duly tested on a CASIA V1 database of grayscale eye images for the verification of its efficiency. This research offers a robust and fast iris recognition technology through implementing FLDA/PCA method in a new optimized manner with time-saving in performing. Our proposed algorithm is superior to bilinear and bicubic interpolation with a recognition rate of 99.99%.

Data Availability
The dataset used and analyzed during the current study is available on "http://www.cbsr.ia.ac.cn" [36], "CASIA Iris Image Database Version 1.0", upon reasonable request.


extfieldsofstudy:
Computer Science
Medicine

text:
On the Evaluation of the NB-IoT Random Access Procedure in Monitoring Infrastructures

NarrowBand IoT (NB-IoT) is emerging as a promising communication technology offering a reliable wireless connection to a large number of devices employed in pervasive monitoring scenarios, such as Smart City, Precision Agriculture, and Industry 4.0. Since most of the NB-IoT transmissions occur in the uplink, the random access channel (that is the primary interface between devices and the base station) may usually become the main bottleneck of the entire system. For this reason, analytical models and simulation tools able to investigate its behavior in different scenarios are of the utmost importance for driving current and future research activities. Unfortunately, scientific literature partially addresses the current open issues by means of simplified and, in many cases, not standard-compliant approaches. To provide a significant step forward in this direction, the contribution of this paper is three-folded. First, it presents a flexible, open-source, and 3GPP-compliant implementation of the NB-IoT random access procedure. Second, it formulates an analytical model capturing both collision and success probabilities associated with the aforementioned procedure. Third, it presents the cross-validation of both the analytical model and the simulation tool, by taking into account reference applications scenarios of sensor networks enabling periodic reporting in monitoring infrastructures. Obtained results prove the remarkable accuracy, demonstrating a well-calibrated instrument, which will be also useful for future research activities.

Introduction
The Internet of Things (IoT) phenomenon is broadening at an astoundingly fast rate [1], which promoted the birth of several novel services in different application domains, including, but not limited to, Industry 4.0 [2], Smart Cities [3], Intelligent Transportation Systems [4], Precision Agriculture [5], healthcare [6] and environmental monitoring [7]. Hence, an increasing number of constrained smart devices are currently joining the worldwide Internet, asking for suitable wireless communication technology, capable of offering both extremely low power consumption and support for densely populated deployments. In general, these low-powered devices individually require low data transfer rates as well, even though a densely populated Machine Type Communication (MTC) deployment might become incredibly bandwidth-hungry. At the same time, devices generally require extremely low power, remaining idle for prolonged periods. Furthermore, reasonably numerous IoT applications involve the reporting of various events and data streaming to a central server in an efficient and robust way (e.g., video surveillance and emergency health services). Besides, either the physical location of devices in such scenarios may not be reached by fixed networks (e.g., basements) or the apparatuses have to be arbitrarily deployed or moved anywhere [8]. Low Power Wide Area networks (LPWANs) are an innovative communication pattern addressing the aforementioned requirements of emerging IoT applications [9]. Essentially, they complement legacy cellular and short-range wireless technologies, offering exclusive features for low complexity devices. At the time of this writing, there are a number of LPWANs, each employing different techniques to meet the Machine-to-Machine (M2M) requirements. In the unlicensed spectrums, LoRa [10] and SigFox [11] are the most common. However, the licensed spectrum is widely known to supply a higher degree of reliability and Quality of Service. Among the licensed LPWANs, NarrowBand IoT (NB-IoT) has been recognized as a promising and effective technology offering wireless connectivity to smart devices. Standardized by the Third Generation Partnership Project (3GPP) starting from Release 13 [12,13], it natively supports the transmission of marginal amounts of data, while requiring low-energy consumption and limited bandwidth usage [14]. Moreover, the adoption of NB-IoT is able to satisfy most of the requirements of all the possible application scenarios, by dynamically adapting to different use cases. Therefore, the application based on the potentially enormous amount and variety of data generated by monitoring sensors is of particular interest. Such monitoring systems provide new services to citizens, companies, and public administrations as well.
In a typical NB-IoT monitoring system, uplink transmissions prevail among the rest of exchanged messages. Here, the random access procedure is the primary relation established between devices and the base station. Built on top of a contention-based mechanism, it brings to performance degradation when a multitude of simultaneous transmissions takes place [15]. In fact, in high traffic conditions, only few devices can successfully complete the procedure. Consequently, analytical models and system-level simulation tools able to investigate the behavior of the aforementioned random access procedure are extremely important for driving current research activities related to the adoption of the NB-IoT technology in smart monitoring infrastructures.
Nevertheless, at the time of this writing, scientific literature only provides splintered answers to these challenging open issues. For instance, analytical models for estimating the random access success probability are presented in [16][17][18][19][20][21][22], but they either do not fit the 3GPP guidelines or overlook several aspects (see Section 2.4 for further details). In addition, to make matters worse, available simulation tools do not completely support the random access procedure evaluation [23,24] and the NB-IoT open-source simulation presented in [25] does not offer a satisfactory implementation of the procedure itself.
Based on these premises, this contribution provides a significant step forward in the current state of the art, by overcoming the evident limitations characterizing the scientific literature and presenting key instruments for the evaluation of the NB-IoT random access procedure. For the first time, to the best of the authors' knowledge, the NB-IoT random access procedure is jointly investigated through analytical models and system-level simulations, paving the way for future standard improvements. Specifically, the contribution of this paper is three-fold.
1. Starting from the platform presented in [25], it puts forward an open-source and 3GPP-compliant implementation of the NB-IoT random access procedure, which handles different coverage classes, global and local transmission attempts counters, backoff times, and transitions from a class to another, as well as other key simulations. 2. It formulates an analytical model describing both collision and success probabilities, given the number of users willing to perform the random access procedure. 3. It deeply cross-validates the analytical model and the simulation tool, by considering realistic NB-IoT deployments enabling periodic reporting in monitoring infrastructures, with different resource configurations.
The rest of this work is organized as follows. Section 2 illustrates the NB-IoT technology, describing in details the Random Access Procedure, and the currently available analytical models and network simulators, as well as several real NB-IoT monitoring systems. Section 3 presents the implemented simulation tool and the conceived analytical model. Section 4 discusses the results obtained through the cross-validation process. Section 5 concludes the paper and draws future research activities.

NarrowBand-Internet of Things
NB-IoT is a cellular radio access technology that requires a smaller bandwidth than Long Term Evolution (LTE), that is, 180 kHz for both downlink and uplink [13]. A single carrier can be configured according to the chosen operation mode, whereas multiple carriers can also be used to supply a higher bandwidth. The three possible operation modes include: • Stand-Alone operation: An operator can replace one GSM carrier of 200 kHz with NB-IoT, leaving a guard interval of 10 kHz on both sides of the spectrum.

•
In-Band operation: One or more NB-IoT carriers are deployed inside a larger LTE channel. • Guard-Band operation: One or more carriers are allocated within the guard-band of LTE bandwidth to NB-IoT.
All three deployment scenarios are transparent to non-NB-IoT devices. Consequently, LTE devices that do not implement NB-IoT functionality simply do not see the NB-IoT channel inside the main LTE bandwidth or in the guard band. At the same time, legacy GSM devices will not see an NB-IoT carrier if used alongside 180 kHz GSM carriers. Such devices will only see noise where NB-IoT is active [26].
At the physical layer, NB-IoT fully inherits from LTE in the downlink. The transmission scheme is based on conventional Orthogonal Frequency Division Multiplexing (OFDM) using normal Cyclic Prefix (CP). An end user operates in the downlink using seven consecutive symbols on 12 subcarriers (also referred to as tones) grouped into a Resource Block (RB), with a subcarrier spacing of 15 kHz [13]. The duration of a slot, subframe, and frame is analogous to LTE, as well. Therefore, in a single NB-IoT carrier, there is only one RB and only one user can receive data at a time using all 12 subcarriers for each subframe. As regards modulation, only Quadrature Phase-Shift Keying (QPSK) is supported.
Instead, the uplink supports not only the standard LTE subcarrier spacing of 15 kHz but also a subcarrier spacing of 3.75 kHz. The elementary NB-IoT radio resource, termed Resource Unit (RU), is the smallest unit to map a transport block [27]. It is assigned to a single user only. Unlike the well-known resource block of LTE, an RU is dynamically defined as shown in Table 1 [28]. Specifically, the uplink supports two different configurations: Single-Tone and Multi-Tone. Single-Tone uses either 3.75 or 15 kHz subcarrier spacing and each subcarrier represents an RU. Consequently, a 180 kHz carrier is divided into either 48 or 12 RUs, respectively, thus resulting in two different RU length values: 32 and 8 ms. In the case of Multi-Tone configuration, the subcarrier spacing is set to 15 kHz only. Nevertheless, 3, 6 or 12 adjacent subcarriers may shape a single RU. Again, depending on the number of tones per RU, its length changes accordingly (as illustrated in Table 1).
The modulation schemes available in the uplink are restricted to Binary Phase-Shift Keying (BPSK) and QPSK.
One of the main objectives defined in NB-IoT study item description [29] is to achieve 20 dB coverage extension compared with legacy General Packet Radio Service (GPRS) while limiting the device maximum transmit power to 23 dBm (200 mW), which is a factor of ten lower than the maximum output power of GPRS devices. Coverage extension is achieved by increasing the number of repetitions at the expense of higher data rates. Moreover, NB-IoT supports up to three coverage classes, namely Normal, Extended, and Extreme, to serve devices experiencing different ranges of path loss. The Extreme class corresponds to incredibly low received power levels. The Normal class refers to considerably higher received power levels. Specifically, the end device is considered in a specific enhanced coverage level if its measured Reference Signal Received Power (RSRP) is less than the RSRP threshold configured for that enhanced coverage class. According to the 3GPP specification [30], the number of coverage classes is configurable by system information. Let n be the number of available coverage classes so that 1 ≤ n ≤ 3. Different coverage classes correspond to operation with different modulation orders, coding rates, repetition factors, and subcarrier spacings, in order to match the data rate for each user to its available link budget. This allows devices having good coverage to operate at higher data rates and with lower latency than devices that have poor coverage. Therefore, the system is designed to meet the throughput and latency requirements for devices in Extreme coverage, while devices in Normal or Extended coverage achieve improved performance.
NB-IoT generally takes advantage of the existing LTE physical channels, revised properly to fit into the narrower bandwidth [31]. In the downlink direction, there are three channels: • Narrowband Physical Downlink Control Channel (NPDCCH) carries scheduling assignments, as well as Hybrid Automatic Repeat reQuest (HARQ) acknowledgments, paging indication, and system information update. It is considered as the core element of the scheduling procedure as it carries Downlink Control Indicators (DCIs), which contain uplink scheduling grants, downlink scheduling assignments, and the type of modulation. • Narrowband Physical Downlink Shared Channel (NPDSCH) carries data from the higher layers as well as paging message, system information messages, and the Random Access Response (RAR) message. It is scheduled by the NPDCCH but is transmitted after a certain time delay (indicated in the NPDCCH too) to allow the low-complexity NB-IoT devices enough time to decode the NPDCCH. • Narrowband Physical Broadcast Channel (NPBCH) is transmitted in the first subframe and carries the Master Information Block -NarrowBand (MIB-NB) over eight consecutive radio frames, repeated 8 times to cope with extreme coverage conditions; the MIB-NB content remains, therefore, unchanged for 640 ms.
On the other hand, for the uplink direction, there are two different channels, specifically: • Narrowband Physical Uplink Shared Channel (NPUSCH) has two formats. Format 1 is used for carrying uplink data and uses the same LTE error correction code. Format 2 is used for signaling HARQ acknowledgment for NPDSCH and uses a repetition code for error correction. • Narrowband Physical Random Access Channel (NPRACH) enables the random access procedure. Thus, it is described in details in the following section. Figure 1 shows a representative time-frequency structure of NB-IoT uplink channels when the subcarrier spacing of the NPUSCH is set to 15 kHz. As regards synchronization signals, Narrowband Primary Synchronization Signal (NPSS) and Narrowband Secondary Synchronization Signal (NSSS) are used by an NB-IoT device to perform cell search, which includes time and frequency synchronization and cell identity detection.

NPRACH and Random Access Procedure
The NPRACH has been completely redesigned [20]. In fact, the traditional LTE PRACH alone occupies a much greater bandwidth than the entire NB-IoT carrier (e.g., 1.05 MHz vs. 180 kHz). Moreover, since the LTE PRACH symbols are based on Zadoff-Chu sequences, the related signal has a non-zero peak-to-average power ratio, that reduces coverage while increasing the energy footprint. Differently, NPRACH only uses the Single-Tone configuration and 3.75 kHz subcarrier spacing, hence occupying between 45 kHz and 180 kHz, according to the number of subcarriers.
The NB-IoT random access preamble is shown in Figure 2. It is mainly characterized by four symbol groups, each of them comprising five OFDM symbols plus the cyclic prefix. In particular, the network configures the preamble format (i.e., the duration of the cyclic prefix), depending on the cell size. A single NPRACH preamble lasts either 5.6 ms or 6.4 ms, when Format 0 or Format 1 is applied, respectively. A pseudo-random frequency hopping algorithm offers as different preambles the number of subcarriers allocated to the NPRACH. Consequently, selecting different subcarriers at the beginning of the transmission ensures hopping schemes which never overlap. In addition, different NPRACH resource configurations can be deployed in a cell, each corresponding to a different coverage class. Each one is described through periodicity, the number of repetitions, starting time, frequency location, and the number of subcarriers, as depicted in Figure 3. Generally, an NPRACH resource is called Random Access Opportunity (RAO). In contrast, LTE PRACH structure is defined by predefined configuration indexes, which are broadcasted by System Information as well. In the time domain, the LTE PRACH occupies one, two or three subframes (i.e., 1, 2 or 3 ms, respectively) and it is periodically scheduled by the base station, while in the frequency domain it needs exactly six LTE RBs. The PRACH always consists of a set of 64 orthogonal sequences. Typically, the PRACH is scheduled every 5 ms and 54 preambles are dedicated to the contention-based access, while the other 10 are reserved for contention-free access.
On the other hand, NB-IoT random access procedure is per se contention based [30] and entails the exchange of four messages, as depicted in Figure 4: 1. The device finds the first available RAO and then transmits a random preamble, chosen among the available ones. Let s be the number of the available subcarriers. Then, the end device starts the RAR window, W. 2. Upon preamble reception, the base station transmits an RAR that explicitly instructs the user on which uplink resources have to be utilized for the transmission of the next message. If this message is not received, the user keeps waiting for it until the expiration of W. 3. Exploiting the scheduled resources, the user transmits its identity and other important information; this message is also known as Msg3. Subsequently, the terminal starts the Contention Resolution Timer. 4. The base station performs the contention resolution and sends back to the devices the identity of the winning users through the Contention Resolution Message. If this message is not received, users keep waiting for it up to the Contention Resolution Timer expiration.
The procedure fails when either the RAR or the Contention Resolution Message is not correctly received by mobile terminals in the proper windows. Henceforward, a worst-case scenario is assumed. Particularly, overlapping preambles always destructively interfere, therefore the base station never detects them. In other words, if two or more devices send the same preamble in a single RAO, each user fails the procedure.
Each collided user may retransmit a preamble after a backoff time b, chosen uniformly and at random within the interval [0, B]. The maximum number of preamble transmission that a single mobile terminal can attempt in a general coverage class c is set to a c . If a user fails the a c th attempt, it considers being in the next higher coverage class, if exists. This behavior is repeated until the maximum number of transmissions that can be tried globally in all classes, i.e., α, is reached.
As a case in point, Figure 5 reports three different users, i.e., A, B and C, starting the first transmission attempt in the Normal, Extended and Extreme class, respectively, based on the assumption that they always collide with other users. Since a 0 = 2, as soon as User A fails the second attempt, it retries the subsequent transmission in the Extended coverage class. Here, both A and B can try up to a 1 = 1 preamble transmission, hence jumping to the Extreme class in the immediately following attempt. On the other hand, User C, whose class is Extreme, is forced to persist in its class. Anyway, even though a 2 = 3, a total amount of α = 4 attempts are foreseen for User C as well.

NB-IoT in Smart Monitoring Infrastructures
NB-IoT appeared as a key technology for offering wireless connectivity to constrained smart devices, while supporting a massive deployment of sensors. By dynamically adapting its features, NB-IoT is able to satisfy most of the requirements of application scenarios distinguished by a high density of terminals, e.g., Smart City, Industry 4.0, and Precision Agriculture. As a matter of fact, several applications based on smart NB-IoT monitoring infrastructures have already been conceived.
Zhang et al. [32] proposed a general information monitoring approach combining NB-IoT and LoRa communication and a solar power supply system. In particular, the LoRa subnode collects sensor information and conducts point-to-point communications with the main node. Then, it processes the received data and sends information to the server through the NB-IoT communication module. Furthermore, the uthors suggested applying their system for grassland and lake information monitoring infrastructures.
The Smart City is the main theme in [33][34][35][36][37][38][39]. Specifically, the study in [33] considers some of the key challenges related to smart cities to study the energy consumption, the latency, and scalability for NB-IoT and eMTC technologies. In addition, it formulates the data transmission delay and the maximum number of devices per cell based on different network configurations, by introducing a network simulator tool based on NS-3. Malarski et al. [34] placed a grid of ultrasonic or infrared sensors at different harbor spots in order to monitor their occupancy. Collected sensor data are then sent to the administration, becoming able to smartly manage spot reservation and release. Based on the measurements taken in a Danish harbor, the authors indeed demonstrated the suitability of the NB-IoT technology as a signal carrier for maritime applications as well, even though water and boat masts partially affect the transmission. A smart parking system is proposed in [35] in order to reduce the deployment cost and improve the user payment experience. In the proposed system, data of sensor nodes installed in parking spaces is transmitted by NB-IoT, whereas charge management, sensor node surveillance, task management, and business intelligence modules are implemented on a cloud server. The system was then actually deployed in two Chinese cities for improving the utilization of existing parking facilities effectively. Chen et al. [36] presented an indoor environment-temperature monitoring system based on NB-IoT sensors and then validated it by means of real experimental results. Pan et al. [37] addressed the issue of urban garbage management by designing a smart garbage bin based on NB-IoT technology. In particular, they employed infrared and odor sensors to provide garbage detection and classification. As a result, the proposed system changes the existing urban sanitation work mode and improves the efficiency of sanitation workers, at the same time promoting the reuse of recyclable resources. Instead, [38] designs an intelligent LED street light control system aiming at saving energy and reducing the maintenance cost and difficulty of the urban street lighting. It consists of a cloud server, a remote monitoring interface, and street light control terminals communicating through NB-IoT. This solution realizes local intelligent control and remote supervision of street lights and, thanks to an energy-saving algorithm, the energy consumption of the street lighting is greatly reduced. Finally, in [39], the authors tried to address the problem of air pollution in a Smart City context. In particular, they developed five types of air pollution detection sensors based on the NB-IoT network in Thailand. Experimental results demonstrate the feasibility of inspecting real-time air quality as a service.
On the other hand, in [40], NB-IoT has been identified as one of the most suitable wireless communication technologies for Smart Agriculture applications because of its key features (low power consumption, long communication range, and relatively easy network implementation). Specifically, NB-IoT sensors collect environmental and soil data, which include ambient temperature, atmospheric humidity, luminance, and soil moisture and temperature, every half an hour and transmit them to the application server. Data are then analyzed by artificial intelligence systems, which impart the corresponding methodologies to actuators to satisfy the specific conditions for crop growths. Similarly, Chang et al. [41] presented a system for monitoring greenhouses of high-cost crop in the suburb. Temperature and humidity data, as well as lighting parameters, are regularly collected from the remote field and then synchronized with servers using NB-IoT. Experimental results further demonstrate the feasibility and stability of data collecting using such a system. Industry 4.0. was targeted by Rohit et al. [42], who proposed a smart solution for identification, assessment, and tracking of industrial assets. After a comprehensive comparative study between the existing communication technologies, NB-IoT is recognized as a key technology for achieving the requirements of the 4.0 paradigm. In the context of the intelligent fishery, the authors of [43] designed a fully-automatic and intelligent monitoring system for dissolved Oxygen of aquaculture water, in order to reduce the mortality of bred animals. NB-IoT modules, along with optical and polarographic sensors, and controllers are used to maintain the oxygen level of the aquaculture water in the typical range.
As for the Smart Grid, Li et al. [44] demonstrated that NB-IoT work well in four typical communication scenarios, after performing a comprehensive investigation on their requirements. The authors claimed that the needs for field trips of personnel for meter reading, manual outage reporting, and most restoration operations, especially for harsh environments that are difficult for people to access, can be easily eliminated through the employment of NB-IoT.
Zhang et al. [45] formalized an architecture using NB-IoT to connect all intelligent things in smart hospitals and introduce edge computing to deal with the requirement of latency in medical processes. Furthermore, the authors designed an infusion monitoring system based on infrared sensors to monitor the real-time drop rate and remaining drug volume during the intravenous infusion.
Popli et al. [46] delivered a comprehensive study of NB-IoT, extensively elaborating resource allocation and energy efficiency techniques. Moreover, the proposed two novel application specific energy efficient approaches for Smart Agriculture and Smart Health. Specifically, in the first scenario, NB-IoT soil moisture sensors deployed in a farm field send data that are then processed using deep learning to meticulously divide the field into different zones. As for Smart Health scenario, a novel approach for adaptively distributing the transmission power required to monitor the patient is proposed, in order to perform power optimization and greatly improve the lifetime and performance of the monitoring systems.

Current Evaluations of the Random Access Procedure
In a typical NB-IoT monitoring system, uplink transmissions prevail among the rest of exchanged messages. Consequently, the random access procedure represents a key relationship between devices and the base station. However, severe performance degradation occurs in the network when a multitude of simultaneous transmissions takes place since the random access procedure is built on top of a contention-based mechanism. Therefore, analytical models and system-level simulation tools able to investigate the behavior of the aforementioned random access procedure are extremely important for smart monitoring infrastructures. Current scientific literature offers some interesting analytical models for estimating the random access success probability. Nevertheless, depending on both the significant effort to provide a tractable analysis framework and the specific focus of each work, available studies still lack various features. In particular, Sun et al. [16] applied a Markov chain to model retransmission number in a steady-state system with a Poisson arrival process. Instead, the authors of [17] derived the success probability under time correlated interference by considering different outage conditions. Nonetheless, both these systems are considerably distant from 3GPP specifications, hence resulting in inadequacy for veridical performance assessment. In [18], the main 3GPP parameters associated with the random access procedure are investigated to determine how they influence the design of network capacity, the average delay, and normalized flow rate. However, the authors wholly neglected multiple coverage classes. The same happens in [19], where the authors tried to optimally trade repetitions and retransmission values to achieve a target successful probability. Besides, Lin et al. [20] and Hwang et al. [21] focused on the preamble transmission to investigate the performance in terms of detection probability, taking into account either the standard preamble design or a new detection and synchronization algorithm, respectively. However, the random access procedure is not considered as a whole, since only the first message is analyzed. Finally, Harwahyu et al. [22] presented a detailed model for the random access procedure, thereafter employed to perform a joint optimization technique to maximize the access success probability. Nevertheless, it still exposes different flaws. Differently from the standard [47], it only considers RAOs of different classes with the same starting time, hence constraining the total number of subcarriers. Besides, it only considers users requests generated according to the Poisson statistics and it has not been validated through reference tools of recognized importance. In addition, the authors extended a multiband multichannel slotted ALOHA framework, where the collision probability is only approximated through the bins and balls problem.
The discussion above demonstrates clearly that simulation tools could be beneficial for addressing several open issues and driving future research activities. Such a simulation platform would be useful to validate the available analytical frameworks and to conduct performance assessments of entirely new studies. Nonetheless, with respect to recent simulation tools, only preliminary developments of NB-IoT are proposed. Foni et al. [23] presented an ns-3 implementation that is largely incomplete, encompassing solely the signaling protocol. In addition, Miao et al. [24] only proposed a link-level simulator, which is not freely available for the research community. Moreover, the NB-IoT open-source simulation presented in [25] does not offer a complete and standard-compliant implementation of the random access procedure.
It is reasonable to conclude that state-of-the-art frameworks aiming to model contention-based access in NB-IoT systems are extremely important. However, from this review, it is evident that a 3GPP-compliant NB-IoT simulation platform is still missing in the current literature. Consequently, this paper addresses this gap. In particular, the contribution of this paper is three-fold. First, starting from the platform presented in [25], it puts forward an open-source and 3GPP-compliant implementation of the NB-IoT random access procedure, which handles different coverage classes, global and local transmission attempts counters, backoff times, and transitions from a class to another, as well as other key simulation. Second, it formulates an analytical model describing both collision and success probabilities, given the number of users willing to perform the random access procedure. Third, it deeply cross-validates the analytical model and the simulation tool, by considering realistic NB-IoT deployments enabling periodic reporting in monitoring infrastructures, with different resource configurations.
As outlined in Figure 6, the starting point is the implementation of a 3GPP-compliant NB-IoT random access procedure within an open-source simulation tool [25]. In summary, it is able to provide the number of users accessing the NPRACH and the performance of the procedure itself, expressed in terms of collision probability and success probability, by taking into account a large number of input parameters. Then, the analytical model receives in input the number of users accessing the NPRACH, obtained through computer simulations for estimating both the collision and the success probabilities of users in an RAO.
Note that the symbols adopted in this document are summarized in Table 2.

Implemented Simulation Tool
The proposed tool extends the simulator presented in [25], which is based on the well-known LTE-Sim [48]. The latter is an open-source event-driven simulator which provides a complete performance verification of LTE networks. It was written in C++, using the object-oriented paradigm in order to ensure modularity, polymorphism, flexibility, and high performance. In general, it includes four main components, each of them modeled by a dedicated class: Simulator creates, handles and ends events; NetworkManager creates and administrates devices; FlowsManager manages applications; and FrameManager schedules frames and subframes. The parameters related to the spectrum, e.g., frequency carrier, available bandwidth, etc., are handled by the BandwidthManager class.
Furthermore, the simulator allows the creation of a specific network scenario as a static function, enabling to model a range of different environments and situations. Every scenario actually creates the aforementioned four basic components, as well as channels, spectrum, cells, devices, Evolved Node-Bs (eNBs), and applications. Then, during the execution of the simulation, the simulator displays several information in real time either on the standard output or on a structured trace file, in order to subsequently and efficiently post-process it.
This simulation platform was later extended for supporting the majority of NB-IoT features. Figure 7 provides an overview of the developed modules for the NB-IoT platform.
Specifically, the BandwidthManager class has been drastically changed for handling different subcarrier spacings and Single-Tone and Multi-Tone transmissions (the latter can be configured for using 3, 6 or 12 tones). Moreover, by modifying the set of frequencies to use, the class natively supports Stand-Alone, In-Band, and Guard-Band operating modes. Multiple carriers can also be enabled by simply defining more channels of 180 kHz each to be used for data transmission. In addition, the FrameManager class has been properly updated for controlling the correct length of RUs duration, based on the actual number of tones and the subcarrier spacing chosen for the simulation. Furthermore, a completely redesigned uplink scheduler is realized by means of the nbUplinkPacketScheduler class. It provides crucial methods for the management of the RUs. Baseline uplink scheduling strategies, i.e., FIFO and Round-Robin, have been developed as well. A simplified Adaptive Modulation and Coding module (i.e., nbAMCmodule class) is used to choose the Transport Block Size (TBS), starting from the selected Modulation and Coding Scheme (MCS) index and number of RUs given by the scheduling strategy, according to 3GPP specification. Nevertheless, the preliminary version of the NB-IoT simulator did not support the standard-compliant random access procedure. At the code level, the EnbNbIoTRandomAccess and UeNbIoTRandomAccess classes handle the random access procedure from the base station and user point of view, respectively. Consequently, these classes have been deeply revised since they were not capable of addressing the multi-class attempts control and transitions between coverage classes (as discussed in Section 2.2). In particular, Figure 8 depicts an overview of the implemented code. With respect to the UeNbIoTRandomAccess class, as soon as the traffic generator creates a packet at the application layer, the UeNbIoTRandomAccess::StartRaProcedure() method initializes the procedure. Then, several attributes and methods enabling coverage class transitions and attempts-checking are called. In particular, the UeNbIoTRandomAccess::SendMessage1() method selects the appropriate NPRACH resources for transmitting preambles in the correct coverage class.
In addition, in the UeNbIoTRandomAccess::ReStartRaProcedure() method there is an attribute that stores the number of failed attempts for the current coverage class, in order to manage the transitions between coverage classes.
On the other hand, the EnbNbIoTRandomAccess class handles the remaining random access procedure features. First, the base station configures NPRACH resources for each coverage class c, according to the chosen configuration parameters. Specifically, the base station actually allocates resources to the NPRACH by periodically calling the EnbNbIoTRandomAccess:: SetRachReservedSubChannels() method. This means that NPRACH resources must not be used by users for NPUSCH transmission, and, at the same time, they are the only ones where users can send preambles. It is worth mentioning that other configuration parameters, e.g., B and W, are handled by the base station as well. The EnbNbIoTRandomAccess::CheckCollisions() method is of paramount importance. Indeed, for each given RAO of all the coverage class, it checks whether any collisions happened (i.e., two or more users selected the same preamble) and it schedules new preamble transmission after a random backoff time b. Then, as explained in Algorithm 1, both attempt counters are incremented and subsequently checked with the chosen values of a c and α, in order to determine a coverage class transition or the procedure failure. Specifically, if the user has any overall attempt left but no more attempts for its class, it switches to the higher class and the number of its attempts for its class is set to zero. If no higher class is available, i.e., the user is already in the Extreme class, the user goes on until it has overall attempts left. Next, a new preamble transmission is solicited. If the counter of the overall attempts hits its maximum, the procedure fails and both attempt counters are set to zero. On the contrary, the exchange of the next messages is conducted until the end of the procedure for the users not experiencing a collision. Specifically, the EnbNbIoTRandomAccess::SendMessage4() method finalizes the whole random access procedure and makes the end user active and able to transmit data.
Each simulation run provides three main output variables: the number of users accessing an RAO, N, as well as the collision and success probabilities, denoted by P N,s and S N,s , respectively. if j ≤ α then 8: if c = n then 9: wait b and go to ?? 10: else 11: if i ≤ a c then 12: wait b and go to ?? 13: else 14: i = 1; c = c + 1 15: wait b and go to ?? 16: end if 17

Formulated Analytical Models
The collision probability and the success probability are analytically derived below, as a function of the actual number of users accessing an RAO, N, and the number of available NPRACH subcarriers, s. Let the Collision Probability, P N,s , be the probability that, in a given RAO, a preamble collision happens. First, if no users access the channel, no collisions will occur. Instead, the probability P k that k among N users choose the same subcarrier follows a binomial distribution. Thus, P k = ( N k )p k (1 − p) N−k , where p is the probability of choosing a specific subcarrier. According to NB-IoT specification, each subcarrier is selected with the same probability, hence p = 1 s . If a preamble is chosen only once, that is k = 1, the probability that only one of the N users chooses the specific subcarrier is equal to: Let N be the number of users not colliding. It is indeed equal to the average number of preambles chosen only once. In fact, given Equation (1), N is computed as the product of P 1 and the number of different preambles, s: As a result, the average number of collided users, that is N, corresponds to the total amount of users, i.e., N, except the users whose preambles not collide, i.e., N, that is: Thus, the Collision Probability can be expressed as follows: Similarly, let the Success Probability be the probability that, in a given RAO, a user successfully completes a preamble transmission. As previously stated, N is the number of users not colliding. Since N = N(1 − 1/s) N−1 , as Equation (2) reports, (1 − 1/s) N−1 clearly represents this success probability. Conversely, the success probability S N,s can be intuitively modeled as: Accordingly, it is worth noting that S 1,s = 1, ∀s > 0, as if a single user accesses an RAO, it will certainly not collide.
It is important to emphasize that no stringent assumption on the traffic model has been made in the formulated analytical model. In fact, the probability of a device attempting a preamble transmission in a given RAO depends on both its traffic arrival distribution and NPRACH structure in time. These aspects can be easily managed by the simulation platform.

Performance Assessment
Cross-validation was conducted to evaluate the accuracy of the implemented simulation platform. According to all the different monitoring systems detailed in Section 2.3, it is reasonable to assume a periodic reporting traffic. Conducted tests consider a 3GPP reference scenario [49], which suitably models highly dense sensor networks. Specifically, transmission requests arrival is modeled according to the uniform distribution in the interval (0, 60) s, which is in line with the requirements of a number of smart monitoring applications. In addition, M = 5000 or M = 10,000 motionless devices are uniformly distributed within a cell with a radius of 1.5 km. Consequently, every second there are, on average, M/60 different mobile terminals that want to transmit a preamble. The base station uses a single NB-IoT carrier of 180 kHz and the uplink is configured in Single-Tone mode with a subcarrier spacing of 15 kHz. The chosen uplink scheduling strategy is First In First Out. The simulation environment is summarized in Table 3.  Note that for Configuration 1 only the Normal class is considered, while Configuration 2 contemplates all three coverage classes. It is worth mentioning that, to increase the statistical significance of reported results, each simulation was repeated 150 times with different seeds.
System performance was evaluated in terms of the number of devices involved in the random access procedure, as well as collision and success probabilities. In addition, the analysis of the percentage error between the estimated success probability, i.e., S N,s , and the simulated success probability, i.e., S N,s , was conducted for each set of simulations. The end-to-end delay was statistically analyzed for additional completeness of the performance evaluation. Finally, to provide further performance insights, the impact of RAO periodicity was investigated with a third resource configuration. Figures 9 and 10 show the number of devices accessing RAOs, N. It is worth emphasizing that each value is reported together with its 95% confidence interval.

Number of Devices Accessing the NPRACH
As expected, greater M values lead to an overall higher number of terminals in the NPRACH. This evidently holds for all the sets of simulations. The average number of sensors accessing RAOs reaches the highest values in Configuration 1 since all terminals belong to the only available coverage class, i.e., Normal. In addition, when M = 10,000, the growth of the number of users performing the preamble transmission stems from the scarce amount of NPRACH resources.
Conversely, the average number of devices accessing RAOs is considerably lower in Configuration 2. In fact, mobile terminals are split among the three available coverage classes. It is important to emphasize that Extended class presents a higher N. This is mainly due both to the low number of different preambles, i.e., s = 12, and to the Normal class users attempting new transmission in this class. For the same reason, the Extreme RAOs should be the most congested; however, the number of different preambles is greater, i.e., s = 24.   Figures 11 and 12 show the success and collision probabilities in each RAO. It is important to note that each plot shows both the 95% confidence intervals of the collision and success probabilities directly derived from network simulations, and the probabilities computed using the presented analytical models. In particular, the average number of users accessing the RAOs (which is a value computed by the tool) is utilized as an input for Equations (4) and (5).

Collision and Success Probabilities
The most noticeable feature is that the probabilities obtained by the analytical framework are remarkably consistent with the values given by the proposed simulation platform. Furthermore, the results are also in line with the comments made in the previous section. In fact, when M = 10,000, the collision probability is always higher than the M = 5000 case. All figures demonstrate that performance is significantly reduced under high traffic load, especially for Configuration 1. In fact, in accordance with what is mentioned above, Configuration 1 shows the least S N,s values. This depends on the fact that the NPRACH configuration is not adequate to the average number of preamble transmissions. As for Configuration 2, Extreme coverage class holds the greatest success probability, since s = 24, as outlined above.

Percentage Error of the Success Probabilities
As regards the cross-validation of the formulated model, the discrepancies between the simulated and the analytical success probabilities were quantified in terms of percentage error. This is reported in Tables 6 and 7, which show its mean value, as well as the 90th and the 10th percentiles. The reported results clearly highlight that the analytical model boasts a good overall accuracy, keeping the mean percentage error always below 6% and the 90th percentile slightly above 10%.
In particular, Configuration 1 outperforms, demonstrating a mean percentage error lower than 3.5%. Nonetheless, in general, the analytical model is more accurate when the first resource configuration is adopted, as also shown in the previous figures. This is mainly due to the fact that in Configuration 2 the average number of devices accessing RAOs is considerably lower. Further analysis could be conducted to demonstrate that the analytical model actually holds higher accuracy when the number of terminals accessing an RAO is relatively large.

End-to-End Delays
Finally, the end-to-end delay was analyzed for all sets of simulations. Figure 13 shows the ECDF of the end-to-end delay experienced by the sensors that successfully complete the random access procedure. The end-to-end delay is the time interval between the time instant when the devices application layer generates a data packet, and the time instant when that data packet is received by the the base station. Consequently, it includes the access delay as well as the delay introduced by scheduling decisions and the physical transmission of the packet. The most noticeable aspect is that different configurations have different trends. In addition, as expected, the end-to-end delay grows with the number of sensors deployed in the cell, M.
Configuration 1 presents both the best and the worst performance in terms of delay, for M = 5000 and M = 10,000, respectively. As a matter of fact, in the first case, there are few user accessing each RAO and a significantly high success probability, as highlighted in the previous sections. Consequently, the end-to-end delay is notably improved, since less preamble retransmission occurs and the uplink scheduler successfully manages the queued terminals. On the contrary, if M = 10,000, the access delay dramatically increase due to the multiple collisions leading to several preamble retransmissions. At the same time, the higher number of successful devices has a negative effect on the waiting time in the scheduling queue as well, hence causing the rise of the end-to-end delay.
Differently, Configuration 2 exhibits an intermediate behavior. This is mainly because longer Backoff times and RAR windows are counterbalanced by the difference in the NPRACH resources structure and higher success probabilities.

Impact of the NPRACH Periodicity
The impact of periodicity is investigated with Configuration 3 since the NPRACH Configurations 1 and 2 do not differ in terms of RAO periodicities. Specifically, the periodicity is doubled compared to the already considered values. The other parameters related to the third NPRACH resource configuration are summarized in Table 8. It is important to note that the only difference with respect to Configuration 1 lies in the periodicity, in order to better identifying its relationship with the number of devices accessing RAOs, as well as the success and collision probabilities. Figure 14 illustrates the number of devices accessing RAOs for both Configuration 3 and Configuration 1.
Greater periodicities values lead to a greater number of terminals in the NPRACH since there are fewer RAOs per unit of time. The average number of sensors accessing RAOs quickly reaches extremely high values when M = 10,000. It is worth noting that the curves do not grow indefinitely because each device can perform the preamble transmission a maximum number of times, i.e., α = 10.
In parallel, Figure 15 shows the success and collision probabilities. The success probability is greatly reduced due to the higher density of terminals in each RAOs. However, it is worth mentioning that, when M = 5000, performance is almost satisfactory, however the amount of available resources is halved with respect to Configuration 1.
This brief analysis highlights the important trade-off between the resources available for NPRACH and the resources available for data transmission, i.e., for the NPUSCH.

Conclusions
NB-IoT is emerging as a promising technology for offering wireless connectivity to constrained smart devices deployed in several pervasive monitoring scenarios, such as Smart City, Precision Agriculture, and Industry 4.0. The random access procedure represents a key relation between devices and the base station, since uplink transmissions prevail among the rest of exchanged messages in a typical NB-IoT monitoring system. Hence, it is of the utmost importance to investigate the behavior of the aforementioned random access procedure.
This paper presents the implementation of an open-source and 3GPP-compliant NB-IoT random access procedure simulation tool and an analytical model describing both collision and success probabilities, given the number of users accessing the random access channel. By taking into account reference applications scenarios based on periodic reporting in monitoring infrastructures, computer simulations showed, as expected, that highly dense sensor networks lead to an overall higher preamble collision probability. Furthermore, cross-validation demonstrated that the formulated analytical model exhibited a considerably low percentage error, proving its remarkable accuracy.
Future activities could involve, on the one hand, the formulation of a complete analytical model to estimate both the number of users performing the random access procedure and an extended analysis of the average end-to-end delay. On the other hand, either entirely new random access mechanisms or major enhancements to the current random access protocol could be implemented in the proposed simulation tool, in order to assess their performance with respect to the standard procedure. Furthermore, the proposed simulation platform could be used for conducting the performance evaluation of different application scenarios, hence embracing the huge extent of Internet of Things use cases.