Low-Power Wide-Area Networks: Comparison of LoRaWAN and NB-IoT Performance

Low-power wide-area networks (LPWANs) have become an important enabler for the Internet of Things (IoT) connectivity. Application domains, such as smart cities, smart agriculture, intelligent logistics, and transportation, require communication technologies that combine long transmission ranges and energy efficiency. Recent and future trends make the long-range wide-area network (LoRaWAN) and narrowband-IoT (NB-IoT) the most prospective drivers of the IoT business. In this article, after discussing the main features of the two technologies, we carry out a fair quantitative comparison between the two, investigating different performance indicators, in order to guide designers in the selection of the most appropriate technology, depending on the application requirements.


I. INTRODUCTION
T HE PROLIFERATION of embedded systems, wireless technologies, and Internet has enabled the Internet of Things (IoT) to bridge the gap between the virtual and the physical world by empowering the monitoring and the control of natural and artificial systems, as well as physical quantities in countless scenarios. A great variety of communication technologies has gradually emerged, reflecting a large diversity of applications and requirements. Some of these are prevalent in a specific application domain, such as Bluetooth low energy in personal area networks [1] and Zigbee in home automation systems [2]. Others, such as Wi-Fi, Low-power wide-area network (LPWAN) [3], and cellular systems, such as the 3rd generation partnership project (3GPP), long-term evolution for machines (LTE-M), and narrowband-IoT (NB-IoT), have a much broader scope. Notably, this landscape is constantly and rapidly evolving, with new technologies being regularly Manuscript  proposed, and with existing ones being updated and modified. This facilitates their further proliferation into new application domains.
In this article, we focus on the two LPWAN technologies that are dominating the market, currently supporting the highest number of IoT connections [4], namely, long-range wide-area network (LoRaWAN) and NB-IoT. In particular, we present their main characteristics and compare their performance in terms of a variety of key performance indicators (KPIs), which concern both the physical (PHY) and the medium access control (MAC) layers.
Both technologies feature enormous potential to support the development of many different IoT applications. Preliminary analyses and comparisons between the two have been carried out during the last years. To give an example, Sinha et al. [5] analyzed the advantages and disadvantages of choosing one technology over the other according to different indicators, such as battery lifetime, capacity, and reliability. Coverage comparison between different LPWAN technologies is carried out in [6], where the authors point out that NB-IoT provides the best coverage probability, even though end devices (EDs) experience a link loss which on average is 3 dB higher than LoRaWAN. In [7], it is shown that NB-IoT provides uplink and downlink connectivity with less than 5% failure rate, whereas LoRaWAN struggles to provide sufficient indoor coverage. The qualitative analysis of the different KPIs and the results of the energy consumption measurements are reported in [8].
A coverage analysis in a real-life scenario has been carried out in [9], where NB-IoT is shown to outperform LoRaWAN, thanks to directional antennas, thus providing a better coverage to EDs. The propagation models and the coverage have been investigated in [10], based on the data of an extensive empirical city-wide measurement campaign. In addition to a discussion on the capability of each technology to support links of tens of kilometers, this article provides some insight into the characteristics of commercial infrastructure deployments by NB-IoT and LoRaWAN operators. The comparative field trials measuring the performance of LoRaWAN and NB-IoT in several propagation-challenging scenarios are reported by Lombardo et al. [11]. The results on the coverage provided by three LPWAN technologies, including NB-IoT and LoRaWAN, in a city, are reported and discussed as a part of [12].
In [13], the MAC protocols of several IoT technologies are investigated, specifically in the smart city domain. The survey [14] suggests that LoRaWAN is more advantageous This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ in terms of energy efficiency and cost, whereas NB-IoT offers more benefits in terms of reliability and resilience to interference and latency. A comparison between several LPWAN technologies is carried out in [15], which classifies them according to different performance metrics, indicating LoRaWAN as the best solution with respect to energy efficiency and NB-IoT as the best one for high data rate services.
Performance comparisons of wireless technologies for specific application domains are carried out in [16], where smart grid use cases are taken into account, and in [17], where smart water metering is considered. The results of these studies reveal that NB-IoT provides better scalability compared to LoRaWAN and, thus, it is able to support a huge number of devices with a low packet error rate.
However, most of the cited works provide only qualitative comparisons and focus on one aspect of the two technologies (e.g., energy consumption, scalability, or coverage). Another critical aspect is the different setups considered for the two technologies (e.g., with respect to the infrastructure density or antenna characteristics). In this article, instead, we offer a more systematic, accurate, and comprehensive analysis and comparison of the performance of two technologies by: 1) employing novel simulators accounting many important aspects of the PHY layer and the link layer (LL) of the two technologies; 2) addressing within one single study a number of relevant metrics under a number of variables for identical scenario; 3) highlighting the PHY and LL features and mechanisms causing the observed trends and results. More precisely, for the purpose of our investigation, we developed two simulators, one for NB-IoT and one for LoRaWAN, both fed with the same input scenarios and parameters. The NB-IoT simulator has been specifically realized for this research activity, whereas the LoRaWAN simulator was developed previously and described in [18], where its validation is reported.
The remainder of this article is organized as follows. Section II overviews the key points of the LoRaWAN technology, whereas Section III details the NB-IoT technology. Note that in these sections, for the sake of conciseness, we focus on the PHY and LL layers procedures that are relevant to our studies and do not attempt to provide a complete description of each technology. Finally, Sections IV and V compare the two solutions and Section VI concludes this article, summarizing the main results.

II. LORAWAN TECHNOLOGY: MAIN FEATURES AND CHARACTERISTICS
The LoRaWAN MAC protocol is specifically designed to allow minimum energy budget and long range coverage. It is built on top of the LoRa modulation technique, adopted at the PHY layer, which operates in license-free industrial scientific medical (ISM) bands [19]. In Europe, it mainly runs in the 863-870-MHz band, even though some studies suggest the further migration possibility to 2.4-GHz bands [20]. In general, regulations on the LoRaWAN deployment vary according to the region in which this technology operates [21].
Together, LoRaWAN and LoRa enable long communication ranges (2-5 km in urban areas and up to 15 km in suburban areas [22]- [24]), although with a limited data rate. The experimental studies have even shown the possibility of opportunistic reception of LoRaWAN transmissions over more than 70-km ground-to-ground [10] and over impressive 825-km air-to-ground [25] links. These results have raised the discussion on whether LoRa can be used for Earth-to-Space communication [26].

A. LoRa
LoRa is a proprietary PHY technology developed by Cycleo, later acquired by Semtech, that is based on the chirp spread spectrum (CSS) modulation. Specifically, the transmitter generates sine-wave chirp signals, which consist of short-time sinusoids whose frequency linearly varies with time starting from a value that depends on the modulation symbol to be transmitted. The signal bandwidth is much larger than strictly necessary for the supported data rate, which entails LoRa belonging to the class of spread spectrum modulations. This brings robustness against channel impairments, such as interference, frequency selectivity, and Doppler effect.
The main characteristics of LoRa depend on several parameters.
1) The spreading factor (SF) is related to the duration of a chirp, which increases when setting a higher SFs [10]. In the 863-870-MHz band, LoRa employs six quasiorthogonal SFs (numbered 7-12). A larger SF results in a reduction in data rate but also in an increase in the energy of the received chirp, thus allowing for a larger communication range.
2) The frequency-sweep interval (BW), which represents the frequency interval within which a chirp varies its frequency.
3) The coding rate (CR), which specifies which Hamming code is used to increase the receiver sensitivity. CR is related to the number of redundancy bits added to data bits to build a codeword, ranging from 1 (1 parity-check bit is added every 4 data bits for error detection) to 4 (4 parity-check bits are added every 4 data bits for error correction). It results that the actual CR is 4/(4 + CR). The LoRa frame contains a preamble (for detection and synchronization purposes), a header, and the payload, with a maximum size between 51 and 222 bytes (to be compatible with LoRaWAN), depending on the SF used. The PHY-layer bit rate R b varies according to BW, SF, and CR as It ranges between 22 bit/s (BW = 7.8 kHz [27] and SF = 12) and 27 kbit/s (BW = 500 kHz and SF = 7). Consequently, the choice of BW, SF, and CR impacts the Time on Air (ToA) that is the time needed to transmit a frame, which is computed as [27] ToA where where 1) B represents the MAC payload size in bytes; 2) H = 0 when the physical layer header is enabled and H = 1 when the physical layer header is not enabled; 3) L preamble and L payload are the lengths of the preamble and the PHY payload, respectively, expressed in symbols. 1 To decode a frame, first, a receiver has to detect the preamble consisting of successive up-chirps (typically four or six sine-wave chirp with linearly increasing frequency) and two and a quarter downchirps (i.e., a sine-wave chirp with a linearly decreasing frequency). This allows to achieve synchronization with the modulated chirps and to detect the beginning of the received frame. The decoding consists of multiplying each received chirp by a pure downchirp. The resulting signal is a sine wave with a fixed frequency, which correspond to the starting frequency of the modulated chirp, hence, ultimately, to the modulation symbol to be recovered. Note that the capture effect allows receiving the target frame even under interference from a signal with the same SF, given that the interfering signal is substantially weaker than the target one.

B. LoRaWAN
On top of LoRa, the LoRa Alliance has developed an open standard called LoRaWAN [28] that imposes some limitations to the LoRa modulation discussed above. LoRaWAN networks are based on single-hop transmissions, leading to a star-of-stars topology. The EDs transmit their frames directly to all the gateways (GWs) they are able to reach. The GWs relay the received messages to a central network server (NS) through an IP-based network (e.g., Cellular, Wi-Fi, or Ethernet based). As a result, the complexity of the network is concentrated at the NS, which is in charge of discarding duplicated frames (i.e., the identical data frames received from different GWs) and selecting the GW to be used for sending the acknowledgment (ACK) (if requested) or other downlink traffic. Specifically, uplink transmissions can be confirmed or unconfirmed. In the former case, the transmitting ED waits for an ACK frame from the NS (through the GW) after its transmission, and it can keep sending the same message if no ACK is received; in the latter case, no ACK is transmitted, so the ED is not informed whether its uplink frame has been received or not. The application-level downlink messages and the control commands are sent similarly to ACK.
In addition, the NS is in charge of controlling ED transmission parameters via the adaptive data rate (ADR) algorithm, which is specifically designed to increase the battery life of the ED while maximizing the network capacity whenever possible. The ADR algorithm exploits data about the uplink radio channel status collected by the NS to define the optimal data rate and transmit power to be used by each ED. One of the most widespread implementations of ADR, used by the Things Network or ChirpStack, to mention some of the most famous NS architectures, is based on the algorithm recommended by Semtech [29]. The performance of such algorithm has been evaluated in [30]. Note that the efficiency of the algorithm strongly depends on channel conditions, so it is intended for stationary EDs. For more dynamic scenarios, the so-called blind ADR mechanism discussed in [31] can be employed.
As far as the channel access is concerned, LoRaWAN is based on ALOHA; thus, whenever an ED has a frame to send, it does. More specifically, LoRaWAN defines three operating classes of EDs, named A, B, and C. Class A devices are always in sleep mode unless they have something to transmit. Each uplink transmission is followed by two downlink receive windows after two fixed RX_DELAY intervals (the standard defines, by default, 1-s delay between the uplink communication and the first receive window and 2-s delay between the uplink communication and the second receive window). The second window can increase robustness in the downlink and it is disabled when the ED receives downlink traffic in the first window to save energy. Since a class A ED spends most of the time sleeping, this class features the lowest power consumption, therefore, it is intended for sensor nodes, which are usually battery powered. Classes B and C provide additional possibilities to reach the device in downlink, even though this causes higher energy consumption.
An essential parameter in LPWANs and networks operating in unlicensed bands without using listen-before-talk is the maximum allowed duty cycle (DC). It corresponds to the percentage of time during which an ED can occupy a channel (or a particular band). In the default EU868 MHz band, it is set to 1%.
Finally, according to the standard, network operators have some flexibility in allocating the channels within the frequency bands regulated by [21]. However the three default channels must be implemented in every ED [21]. Those channels represent the minimum set that all network GWs should always be listening on. Furthermore, at least 13 other channels can be optionally enabled. Table I offers a summary of the key parameters.

A. NB-IoT Technology
NB-IoT is designed to provide efficient connectivity in cellular IoT scenarios and attain a long battery life for a massive distribution of machine terminals. It offers a large number of connections per cell and robust coverage, enabling connectivity even underground and indoor environments [32].
NB-IoT was introduced in Release 13 (Rel. 13) of 3GPP specification documents, emerging as an alternative solution to the LPWAN technologies already available on the market (e.g., LoRaWAN). NB-IoT leverages the long-term evolution (LTE) standard numerology, but it is adapted for low-cost machine-type communications (MTC), supporting a massive number of devices per cell. From LTE, it retains the synchronization, radio access, resources definition, and assignment mechanisms. Modifications to regular LTE procedures have been introduced to enhance the link budget and significantly reduce energy consumption, complexity, and costs.
With respect to the spectrum usage, NB-IoT can operate in three different modes: 1) a stand-alone mode; 2) within the guard bands of LTE carriers; or 3) within LTE carriers (in-band mode). As in LTE, NB-IoT evolved Node-Bs (eNBs) employ orthogonal frequency-division multiple access (OFDMA) in the downlink, and user equipments (UEs) (the term used in LTE to denote an ED or a user terminal) use single carrier frequency-division multiple access (SC-FDMA) in the uplink. However, the modulation schemes are limited to binary phase shift keying (BPSK) and quadrature phase shift keying (QPSK) to reduce complexity and ensure a better link budget.
Hybrid automatic repeat request (HARQ) is implemented in both the uplink and the downlink by default, even though this requirement was relaxed in Rel. 14, and half-duplex operations are now allowed. In addition, UEs (cat NB1/NB2) implement power control in the uplink, in order to reduce the power consumption when possible.
Traditionally, in Rel. 13 and Rel. 14, NB-IoT was limited to frequency division duplexing (FDD) operations implying the use of different frequency bands for uplink and downlink transmissions. However, in Rel. 15 (2019), a new option-timedivision duplexing (TDD)-has been introduced, allowing to use the same frequency band both for uplink and downlink. It supports a nominal system bandwidth of 180 kHz [equal to the one of an LTE physical resource block (PRB)] in both uplink and downlink. Note that most of commercial NB-IoT networks are still based on FDD.
In the uplink, the resource grid is composed of multiple subcarrier frequencies with a step (the so-called frequency separation-f) of either 3.75 or 15 kHz [33]. The time slots have a duration of 0.5 and 2 ms in case of f = 15 kHz and f = 3.75 kHz, respectively. On top of this, NB-IoT introduces the notations of resource element (RE), which is the smallest time-frequency resource (i.e., one subcarrier and one time slot), and the resource unit (RU), denoting a combination of a specific number of consecutive subcarriers (i.e., 1, 3, 6, or 12) and a specific number of time slots.
In the downlink, the frequency separation is fixed at 15 kHz, and the concept of PRB is used. A PRB spans over 12 subcarriers and 7 orthogonal frequency-division multiplexing (OFDM) symbols and a pair of PRBs is the smallest schedulable unit, which is referred to as a single subframe (thus having the total duration of 1 ms).
The coverage enhancement (CE) is mainly achieved by introducing repetitions and thus exploiting time diversity. The transmission of control information and data is repeated a number of times. Each replica has a different coding, and multiple replicas can be combined at the receiver to increase the probability of successful reception. Repetitions increase energy and time consumption, so UEs are often subdivided in three coverage classes, characterized by a different number of repetitions and specific configurations that impact on the coverage. In general, the higher the radio signal received power (RSRP), the less repetitions are used by the UE. The coverage classes are named, from higher to lower RSRP, normal (N), robust (R), and extreme (E). Table II offers a summary of the key parameters values.

B. NB-IoT Device Operation Sequence
To better illustrate NB-IoT procedures, hereafter we detail the operations carried out in an FDD network [35].
Once powered up, a UE typically starts the cell search procedure, through which it acquires time and frequency synchronization with a cell, identifies it, and receives from the periodically broadcasted information blocks all the information about the configuration of the network, including, e.g., the radio resource configuration.
Once possessing all the required information, the UE may try to establish the connection to the network. For this, it has to execute the random access (RA) procedure (see Fig. 1) to gain access to a radio channel. Specifically, the UE waits for a scheduled random access channel (RACH) window and it transmits a randomly selected preamble (Msg1 in Fig. 1). A preamble is composed of four groups of symbols and for each of the four groups the carrier is changed. Three different narrowband physical random access channel (NPRACH) preamble formats are currently defined (formats 0 and 1 introduced in Rel. 13 and format 2 added in Rel. 15), featuring different tradeoffs between the on-air time and the maximum communication range. Up to three periodic NPRACH windows can be configured in a single cell, each associated with a CE level and characterized by a different number of preamble symbols repetitions (ranging from 1 to 128 [36]). The selection of the coverage class to be used is made by the UE based on its estimation of the RSRP, the network configuration, and the number of previous unsuccessful RA attempts. The NPRACH transmission is sometimes referred to as Message 1 (Msg1) since this is the first message in the RA procedure. If multiple UEs choose the same preamble, the transmissions will overlap, but, initially, the eNB is not aware of it. Thus, the eNB delivers the scheduling for random access response (RAR) (or Msg2) in the narrowband physical downlink control channel (NPDCCH). The RAR itself is sent using the narrowband physical downlink shared channel (NPDSCH) by the eNB, which allocates the resources and specifies the modulation and coding scheme (MCS) as well as the number of repetitions for the next uplink transmission for each of the received RA preambles. In this phase, the UEs that have chosen the same preamble will receive the same RAR. These UEs will send Msg3, which carries the buffer size report (BSR) and the unique data identifying the device, i.e., the UE Contention Resolution Identity, using narrowband physical uplink shared channel (NPUSCH) resources and then they wait for radio resource control (RRC) connection setup (or Msg4), scheduled again via NPDCCH. Msg4 is therefore used to grant resources for data transmission and solve possible collisions. A similar procedure has to be repeated each time an unconnected UE requires to access the radio resources to transmit the data.

IV. COMPARING THE TWO TECHNOLOGIES
In this section, we report the assumptions and the models adopted in the two simulators, one for each technology, which have been realized following the common structure illustrated in Fig. 2.

A. Network Layout and Data Traffic Configuration
We consider a set N of EDs, whose size is N = |N |, randomly and uniformly distributed in a circular area of radius R [km]. The single LoRaWAN GW, as well as the NB-IoT eNB, share the same location in the center of such area. We assume that EDs generate periodically, with period T [s], a frame with a payload of B [bytes]. All these parameters are configurable and the same scenario is fed as an input to the LoRaWAN simulator as well as to the NB-IoT one.

B. Radio Propagation Configuration
The well known Okumura-Hata model [37] is adopted in the simulators of both technologies to take into account the attenuation introduced by the propagation. We address both a urban as well as a rural scenario represents the height of the ED above the ground surface; and d [km] is the transmitter-receiver distance. Finally, the parameter s in (7) represents random channel fluctuations due to shadowing, modeled via a Gaussian random variable, with zero mean and standard deviation σ , that is, s ∼ N (0, σ 2 ).

C. Physical Layer Simulations
For a given position of an IoT node (either ED or UE) in the considered scenario, the signal-to-noise ratio (SNR) experienced in the link is assessed, based on the propagation model and the receiver characteristics (e.g., noise figure). Then, given the transmitter configuration (e.g., BW, SF, and CR for LoRa and BW, f , and MCS for NB-IoT) the signal corrupted by the noise is generated (either LoRa or NB-IoT) and passed to the corresponding receiver, which assesses if the transmitted frame has been correctly received. More precisely, it is as follows.
1) LoRa: The LoRa simulator reproduces the operations carried out by the transmitter (channel coding, interleaving, gray coding, and modulation), the addition of additive white Gaussian noise (AWGN) in the channel and the receiver behavior (demodulation, deinterleaving, and decoding). Thus, given the frame of data bits to be transmitted, the simulator assesses whether the currently transmitted frame has been correctly received or not according to different parameters, such as SF, CR, and BW, and the SNR that characterizes a given link. 2) NB-IoT: For NB-IoT, the success/failure of NPUSCH transmissions is assessed by means of a NB-IoT PHY layer simulator, which is based on the LTE Toolbox [38] provided by MATLAB. In particular, for each frame to be transmitted, the corresponding baseband waveform of the SC-FDMA modulated signal is generated by the simulator and passed through the noisy AWGN channel. At the receiver side, the simulator performs SC-FDMA demodulation and decoding and finally assesses if the frame has been correctly received or not. In case of collision (i.e., overlapping of different transmissions in frequency and time), the capture effect for both technologies is also taken into account. Specifically, the receiver has still a chance to capture the frame, provided that the signalto-interference ratio (SIR) is above a given technology-specific threshold where P R is the received power of the wanted signal, P R i is the power the GW/eNB is receiving from the ith interfering node, and γ is the threshold. More precisely, it is as follows. 1) LoRa: For LoRa, we consider the possibility that a collision may occur between two LoRa frames (whether they are sent in uplink or downlink), even though the two frames do not overlap entirely, since the access to the channel is ALOHA-based. In addition, our simulator is designed to take into account SF quasi-orthogonality, so collisions may happen even between EDs using different SF and a frame has still a chance to be correctly received if the SIR is higher than a given threshold, which depends on the SFs considered [18]. 2) NB-IoT: For NB-IoT, collisions may happen only during the RA procedure, since each UE has its own NPUSCH resources for uplink data. As described in Section III-B, two or more UEs choosing the same NPRACH preamble will collide when sending Msg3. However, one of the UE may still complete its procedure and receive Msg4, given that during Msg3 transmission, its SIR is sufficiently high, which in the simulator has been fixed to γ = −4.6 dB [32].

D. Protocol-Specific Parameters and Operations 1) LoRaWAN:
We consider EDs already joined to the network using one of the two activation procedures supported by LoRaWAN. Therefore, each ED generates a data frame to be sent in uplink periodically every T seconds. The DC limitations are implemented according to LoRaWAN specification version 1.0.1, which imposes that a device (i.e., ED or GW), after sending a frame of duration ToA seconds, computed with the formula reported in Section II-A, must not use the same seconds. An ED can use a specific SF or the one resulting from the ADR algorithm (in the presented results, we assume EDs using ADR, if not stated otherwise). After selecting an SF, we check whether a transmitted frame has been correctly received according to the procedure described in Section IV-C and we derive the related performance metrics.
The key LoRaWAN parameters used in our simulations are summarized in Table III. 2) NB-IoT: In our simulator, we consider UEs already synchronized to the network, so each UE starts by determining a CE level according to the measured RSRP and its set of operations begins from the RA procedure. Each ED is configured according to the CE level to which it belongs (the configurations used in the simulator are reported in Table IV and Fig. 3) by comparing its RSRP with the RSRP min in Table IV. We also assume timely feedback from the eNB to the UEs during the RACH procedure, in case of Msg2 and Msg4 transmissions, as uplink transmissions can be more challenging than the downlink ones [39]. Therefore, in the simulator, we assume that the time intervals between the end of such messages, as well as the time needed to transmit them (see Section V-A) are fixed, as considered in [40] and [41].
Once the CE level is selected, the UE sends the random NPRACH preamble at the first NPRACH occurrence and the RA procedure is carried out as described in Section III-B, by checking if every single message is correctly received. If not, the procedure fails and the UE must start from the beginning. Each time the RRC connection is setup correctly, an ED    (10) where N RU is the number of RUs needed to send a frame, which depends on the MCS selected, N rep is the number of repetitions of the transmission, defined according to the CE level and, finally, τ RU is the duration of one RU. We assume that after sending uplink data, the UE goes in power saving mode (PSM) until a new frame is generated, so the connection to the network can be released and the UE disconnected from the eNB. The NB-IoT-related parameters used during the simulation are summarized in Table V.

V. NUMERICAL RESULTS
This section presents selected numerical results that were obtained to compare the two technologies.

A. KPI
The comparison has been carried out in terms of block error rate (BLER), network throughput, energy consumption, and latency. Having defined as "block" the MAC level payload, which is the data frame of B bytes passed to the physical layer for modulation and transmission, 2 the BLER is defined as the ratio between the number of erroneously received blocks and the total number of transmitted blocks BLER = number of erroneous blocks number of transmitted blocks .
The network throughput S has been defined as the number of data bits correctly received by the GW/eNB from all EDs/UEs over the duration of the simulation divided by the duration of the simulated time where N received is the number of received frames, and T sim is the duration of the simulation in seconds. Finally, the mean energy consumption E of a single ED/UE has been defined as The current, voltage, and time duration of the different phases used to compute the energy consumption are reported in Table VI and have been taken from the state-of-the-art works [42], [43]. In (13), V represents the voltage, I is the current, and T is the time spent in each state, respectively. More specifically, for LoRaWAN, T TX coincides with the ToA of the frame, T idle coincides with a RECEIVE_WINDOW_DELAYs excluding the reception time, T RX is the time spent in reception, and T sleep coincides with the time interval between the end of the transmission of a frame and the beginning of the next transmission. For NB-IoT, T TX is the sum of the time spent sending MSG1, MSG3, and NPUSCH data, T RX is the time spent receiving MSG2 and MSG4 and downlink control information (DCI), T idle indicates the remaining time spent during the different phases without transmitting/receiving, and, finally, T sleep is the time the UE spends sleeping between the end of the transmission of NPUSCH data and the beginning of the next RA procedure.
For LoRaWAN, the average latency L of a successful transmissions is where ToA UL (SF) is the ToA of the uplink frame, which depends on the chosen SF, P s is the probability of correctly receiving a frame given the two conditions described in Section IV-C, and T is the frame periodicity. It is worth highlighting that in case of no collisions, the minimum latency experienced by an ED coincides with the ToA of the frame. For NB-IoT, the average latency depends on the success of the RA procedure as well as the time needed to send uplink data using NPUSCH resources, which depends on the resources assigned to the UE by the eNB. The minimum latency L min is defined as where T MSGi is the time needed to send the ith MSG, τ MSGi is the time interval between the end of MSG i and the beginning of MSG i + 1, and T NPUSCH is the time needed to send the actual uplink data. Consequently, the average latency L is equal to where P s is the probability of correctly receiving each message needed for the RA procedure, given the two conditions described in Section IV-C, and T NPRACH is the time the UE spends waiting for the next NPRACH occasion (in case the previous RA procedure failed). The results obtained via simulation are based on the configurations reported in Table VII. Each simulation run covers 5 min of simulated time and 10 000 iterations of simulation are carried out for each run. The results are presented assuming a urban scenario, if not otherwise specified.

B. Numerical Results
As a first step, we validated the simulator of the LoRa physical layer by comparing its outcomes with the results reported in [44] and [45] for the symbol error rate (i.e., the chirp error rate) as a function of the SNR, SNR = (P/P n ) in an AWGN channel, with P denoting the signal power and P n denoting the noise power. These reference curves are plotted in Fig. 4 with a dashed line style. The same figures of merit have been obtained with our simulator for LoRa signals with BW = 125 kHz. Fig. 4 clearly shows that the resulting symbol error rates, plotted with a solid line style, are coincident with the reference ones for each SF, thus confirming the accuracy of the simulator (further details on the simulation setup and the LoRa performance at the physical layer can be found in [18] and [19]).
The LoRa BLER is plotted in Fig. 5 as a function of the SNR for all SFs and CRs, considering a block size of B = 20 bytes. One can observe that, for a given SF, passing from CR1 (CR2) to CR3 (CR4) allows a gain of about 1.5 dB in terms of SNR. One also observes that as expected, passing from CR1 to CR2 or from CR3 to CR4 does not provide any benefit. In fact, CR1 and CR2 do not provide any bit correction capability, whereas both CR3 and CR4 allow to correct only one bit in a codeword.
The NB-IoT NPUSCH BLER is shown in Fig. 6, considering again a block size of B = 20 bytes, for different numbers  of repetitions. It is clear that by increasing the number of repetitions, a gain in terms of SNR is achieved.
Comparing the two technologies, we can state that NB-IoT is more robust to noise. If we consider, for instance, an application requiring a maximum BLER of 10 −2 , the minimum SNR is in the range {−23, −7} dB for LoRaWAN (depending on SF and CR) and in the range of {−31, −22} dB for NB-IoT (depending on the number of repetitions). Fig. 7 shows the network throughput as a function of the number of EDs in the network. 3 In particular, for LoRaWAN, we consider all EDs using SF = 7, SF = 12, or each of them using the SF resulting from the ADR algorithm, whereas, for NB-IoT, we consider EDs all using MCS Index = 1, 6 or 13. As expected, NB-IoT almost always provides higher throughput w.r.t to LoRaWAN for medium traffic, whereas for very high traffic the two becomes comparable. However, both demonstrate the same trend, since the network throughput increases with the number of EDs until such number becomes too large and collisions worsen the performance. This can also be seen that there is an optimal number of devices, which maximizes the network throughput. Comparing the results for urban and rural scenarios, it can be seen that the throughput for the rural scenario is higher than that of the urban scenario. The main reason is the lower path loss and its lower fluctuation in the rural environment.
For NB-IoT specifically, using a high MCS Index (e.g., MCS Index 6 or 13) provides a higher throughput since fewer resources are needed to send the same frame if compared to a lower MCS Index (MCS Index = 1). On the other hand, for LoRaWAN, enabling ADR turns out to be better w.r.t choosing only SF = 7 or 12, since this allows exploiting the quasiorthogonality of the different SFs. In addition, it is worth noting that the performance of LoRaWAN is further reduced due to the DC limitation, which particularly affects the case with SF = 12.
The energy consumption is shown in Fig. 8 as a function of the number of EDs. It can be clearly seen that NB-IoT devices feature higher energy consumption, which increases further with the increase of the number of EDs active in the network. This happens because more EDs compete for the access to resources and EDs, which fail try again during the next NPRACH occurrences. In addition, lower MCS Indexes make EDs use more resources, resulting in more time spent in transmission.
On the contrary, for LoRaWAN, the energy consumption remains stable regardless of the number of EDs in the network, since, being based on ALOHA, a LoRaWAN ED transmits whenever it has to.
In Fig. 9, the network throughput is presented as a function of the radius R of the circular area over which the EDs are distributed. As before, for LoRaWAN, we consider all EDs using SF = 7, SF = 12, or the SF resulting from the ADR algorithm, whereas, for NB-IoT, we address the possibility of having only CE0 or all three coverage classes.  It can be clearly seen that NB-IoT provides higher throughput if compared to LoRaWAN. In particular, when the area becomes larger, the availability of multiple CEs drastically improves the performance. Meanwhile, the performance obtained by NB-IoT when using only one coverage class appears to be worse even than that of LoRaWAN.
For LoRaWAN, using the ADR turns out to be the best choice, since it offers higher throughput, compared to using SF = 7 and, thanks to the use of the optimal SF, is not as much affected as SF = 12 by DC limitation and collisions, even though using SF = 12 should enable better performance in terms of coverage.
For a fixed area size, the rural scenario allows to get better performance than the urban one, because of the better link quality experienced by EDs.
The energy consumption as a function of the area radius R is shown in Fig. 10. LoRaWAN devices consume much less than NB-IoT ones, whose consumption, especially for large areas and when using all three CE classes, strongly depends  In Fig. 11, the network throughput is shown as a function of the block size B. For LoRaWAN, we consider all EDs using the ADR algorithm, whereas, for NB-IoT, we address EDs using MCS Index = 6, for the urban and the rural scenarios. As a general trend, by increasing the block size, the throughput raises. One can also notice that NB-IoT is able to provide higher throughput w.r.t to LoRaWAN in all cases. We point out that LoRaWAN specifications [21] define a maximum payload for each SF for different regions. However, in this case, we address the same dimensions for NB-IoT and LoRaWAN for a fair comparison.
The related energy consumption as a function of the block size B is reported in Fig. 12. As expected, NB-IoT consumes more energy than LoRaWAN, with slightly better performance in a rural scenario due to the better link quality and, thus, less packet losses. In any case, increasing the block size boosts the energy consumption due to the longer transmission time.  Finally, Fig. 13 shows the latency as a function of the network throughput S. LoRaWAN huge latency for higher throughput is the consequence of the high number of collisions due to the number of EDs transmitting; therefore, when a frame is lost, the network should wait for the next transmission attempt, which happens T seconds after. For NB-IoT instead, if the RA procedure fails due to collisions, it is possible to try again during the next NPRACH occasion, without waiting for the next frame generation.

C. Other Differences
In addition to performance-related aspects, the comparison between LoRaWAN and NB-IoT, and the identification of their actual strengths and limitations, should also consider regulatory issues and business models. From the regulatory viewpoint, there is a clear difference between the two technologies. NB-IoT can be deployed over existing 4G systems. Only mobile network operators (MNOs) who have a 4G license can offer NB-IoT services. This is both an advantage and a drawback. The positive side is that for MNOs, deploying the network is just a technical and investment issue. In many countries all over the world, they have already deployed NB-IoT plug-ins, and there is no other issue in exploiting it from the user viewpoint. On the opposite, LoRaWAN operates on a license-exempt ISM band, which is regulated differently from country to country. In Europe, the document providing guidelines for the use of LoRaWAN (and other) technologies is CEPT Recommendation number 70 03. Different national authorities interpret it in various ways. The business model behind the two technologies is totally different. NB-IoT services can only be offered by MNOs. As long as they deploy the network, it is publicly available (upon payment of a subscriber fee). On the opposite, anyone in principle could offer LoRaWAN coverage; private deployments may be useful for particular applications (especially in remote locations, which are not attractive to MNOs). LoRaWAN networks might be available for free in some areas, as it happens, e.g., with the Things Network-a community of open-source LoRaWAN gateway owners.
Other technical aspects that should be considered when comparing the two technologies include the following.
1) NB-IoT offers advanced security protocols compared to LoRaWAN, which is particularly insecure when using the activation by personalization join procedure. 2) Roaming: Sub-GHz ISM bands (normally used by MNOs for NB-IoT wide coverage) are not uniform around the globe, which complicates trans-ocean roaming. NB-IoT terminals supporting multiple bands can handle this. Recently, the intracontinental roaming solutions for LoRaWAN (allowing to roam between networks deployed in the same bands) have been delivered. However, their widespread adoption is still underway. 3) IP Support: NB-IoT supports IP, and many off-theshelf transceivers implement IP-based protocols, such as TCP/UDP, FTP, HTTP, CoAP, and MQTT. This enables seamless integration between NB-IoT and the Internet, whereas LoRaWAN requires some form of adaptation layer (most often handled by the NS) in between. 4) Handover: LoRaWAN networks do not implement any sort of handover mechanism. NB-IoT has to handle it, though this requires additional signalling.

VI. CONCLUSION
In this article, we carried a detailed analysis of LoRaWAN and NB-IoT technologies, accounting for technical aspects, both at PHY and Link layers, and regulatory issues. In conclusion, the two technologies differ in many aspects and both have strengths and weaknesses. Depending on the specific application, the best solution can be identified based on the above reported discussion and numerical results. To summarize, NB-IoT implements a more robust modulation and coding scheme, together with a highly reliable link layer, at the cost of a larger energy consumption. Therefore, NB-IoT is more suitable for applications that are demanding in terms of reliability and network throughput. In addition, it is not limited by any regulation in terms of DC, thus devices can transmit more frequently or bigger data volumes. On the other hand, LoRaWAN is convenient for applications having strict requirements in terms of lifetime (i.e., for battery-constrained use cases) and where the reliability requirements can be relaxed.
At the very same time, our results show that the network configurations (e.g., ADR support for LoRaWAN, or the CE level support and RACH configurations for NB-IoT) affect the performance of the considered technologies quite significantly. Notably, as we have shown in this study, subject to some configurations and scenarios, either of the considered technology may outperform its counterpart. It is important to keep this in mind when considering the communication technology to be used for the particular use case scenario. Also, this motivates the further more in-depth study of the effects the different network parameters have on the technology performance as well as the development of relevant optimizations mechanisms. Unfortunately, this aspect (especially for NB-IoT technology) has got somewhat limited attention so far.