## 3 Network Architecture Description
### Forwarding Layer  
The Forwarding Layer is composed of two different entities: LoRaWAN-NB-IoT Gateways and NB-IoT eNodeBs. Herein, only LoRaWAN-NB-IoT Gateways can be described because eNodeBs are directly designed, set up and maintained by the telco providers, while LoRaWAN-NB-IoT Gateways can be designed and implemented in the same vein of the components of the network Sensor Nodes Layer.  
Figure 4 shows both the LoRaWAN-NB-IoT Gateway block scheme and its hardware implementation. It is in charge of demodulating incoming LoRaWAN packets and of forwarding the associated data and metadata to the Cloud Layer by resorting to the MQTT protocol over NB-IoT. Indeed, such devices are equipped with both a LoRaWAN concentrator and an NB-IoT module: the former deals with the LoRaWAN signals, while the latter copes with NB-IoT communication.  
The concentrator (i.e., the RAK831 produced by RAKWireless) is a device that features a LoRa modem and two LoRa transceivers: the former is a Semtech SX1301, while the latter ones are two Semtech SX1257. Thus, the concentrator is capable of simultaneously receiving up to eight LoRaWAN packets on as many different channels as possible. This hardware setup allows for a very high sensitivity spanning from \(-126\,\mathrm{dBm}\) down to \(-137\,\mathrm{dBm}\) in function of the transmission parameters (i.e., the bandwidth and the Spreading Factor). The concentrator is driven by a Raspberry Pi 3 model B+ by exploiting the Serial Peripheral Interface (SPI) bus. The Raspberry Pi is also in charge of coping with data forwarding towards the Cloud Layer by relying on an Internet connection. Normally, it is ensured by making use of either Wi-Fi or Ethernet ports that the Raspberry Pi is provided with, but LoRaWAN-NB-IoT Gateways accomplish such tasks by exploiting an NB-IoT module instead. In particular, the same NB-IoT module of the NB-IoT Nodes (i.e., the SIM7000E) is chosen, and it is driven by the Raspberry Pi via the Universal Asynchronous Receiver-Transmitter (UART) peripheral. The choice of providing the gateways with Internet connectivity via NB-IoT, rather than Wi-Fi or Ethernet, fosters the gateways installation within harsh or critic environments. Indeed, therein, the chance of a standard Internet connection availability is often low. By contrast, by relying on a cellular technology, a pervasive coverage can be ensured. However, standard cellular facilities (e.g., 4G) have non-negligible drawbacks: high running costs and high power consumption. Fortunately, NB-IoT solution counteracts such shortcomings, thus entailing from the one hand the limitation of running costs (which is strongly dependent on the subscribed data plan) and from the other hand a notable power consumption reduction that potentially allows for the adoption of batteries or renewable sources of energy for powering the gateway. Finally, for  
Figure 4: LoRaWAN-NB-IoT Gateway: (**a**) block scheme; (**b**) hardware implementation.  
what concerns the gateway software components, two units are run. All of the gateway routines dealing with the radiofrequency interfaces are implemented within a multi-thread C program. It exchanges data through a local socket with a Python script that connects to the eNodeBs, resorting the the MQTT protocol via NB-IoT. Thus, data coming from LoRaWAN Nodes are forwarded to the Cloud Layer.