The Internet of things has introduced an important paradigm innovation in the communication among digital devices, as well as in the way that they connect with the physical environment
[1] and interact with human users. IoT architectures integrate and unify all steps of data sensing/actuating from/to devices, transmitting/receiving messages, data storage, processing, analysis and final exploitation through the use of cloud, fog and edge computation, services and applications. Many different technologies are involved in the development of IoT frameworks. However, general functional architectures have been proposed in the literature that are based on a simplified version of the Open Systems Interconnection (OSI) model, but with different approaches. Some works
[1][6] define a typical IoT framework composed of three layers (from the lowest physical level to the higher levels of abstraction): the perception/sensing layer; the network layer; and the application layer. In other works
[7][8][9][10][11][12] the former approach is expanded into five layers of architecture, including: the perception/sensing layer; the transportation/network layer; the middleware/processing layer; the application layer; and the business layer. In
Figure 1, the three-layer and five-layer IoT architectures are depicted.
2.1. Perception/Sensing Layer
The perception or sensing layer is related to the physical level that is made up of devices, such as sensors and actuators, which interact among themselves and with the physical world by sending and receiving data, exploiting wireless networks
[8]. In this context, sensors, actuators and mobile device technologies are involved. There is a wide range of commercial devices that measure many kinds of physical quantities and variables, i.e., sensors for measuring temperature, humidity, pressure, distance and geospatial coordinates, speed, acceleration, voltage, weight, pollutant particles, luminance level, biometrical signals, etc. Actuators are employed to control/move other devices or systems physically or virtually, and they are typically classified into electrical, pneumatic and hydraulic categories
[14]. Several software tools and solutions are used to deploy low-level IoT applications. Those described in the following are based on visual programming languages (VPLs): NetLab is an open source environment for developing embedded systems; Ardublock is an open source visual block programming tool for Arduino systems; and Scratch is a visual programming tool, developed at MIT, for IoT code generation and communication with Arduino-based IoT products
[15].
2.2. Transportation/Network Layer
The transportation or network layer provides the function of data routing and transmission. Network gateways/brokers can be used as mediators for integrating different IoT nodes, allowing them to transmit and receive data to and from different sensors for M2M connectivity. Regarding data transmission, different technologies and protocols are used. Proximity communication protocols include Bluetooth, radio-frequency identification (RFID) tag technology and near-field communication (NFC). Larger coverage networks exploit wireless technologies, such as Wi-Fi, Zigbee, long range wide-area network (LoRaWAN), Sigfox and 5G.
Bluetooth and Bluetooth Low Energy
[16] are low-power wireless communication technologies designed for personal area networks (PANs), which are suitable for low-bandwidth data transmission among mobile devices over a short range of up to 10 m. They are usually employed in smart contexts for connecting personal devices.
RFID exploits radio frequencies for data communication and is usually used to uniquely identify objects, people, vehicles, etc. Communication is established between a reader device and a tag device, which can be passive or active. NFC
[17] is similar to RFID, but it has an even shorter range for communication (up to few centimeters). Unlike RFID, NFC does not implement a reader/tag hierarchy and can be used for two-way communication. It is typically used for mobile payments and access control operations.
Wi-Fi is based on the IEEE 802.11 standard and uses wireless frequencies (operating at 2.4, 5 and 60 GHz bands) to provide high-speed internet connectivity (from 1 Mb/s to 6.75 Gb/s) within a limited distance (up to 100 m)
[18]. It is designed for wireless local area networks (WLAN).
WiMAX (Worldwide Interoperability for Microwave Access) is based on the IEEE 802.16 standard, operating at 2–66 GHz bands and providing data rates from 1.5 Mb/s to 1 Gb/s
[18]. It can support broadband wireless access for up to 50 km for fixed stations and between 5–15 km for mobile stations
[19].
Zigbee is based on the IEEE 802.15.4 standard. It is a low-power and low cost protocol for wireless sensor networks (WSNs). It usually supports star, tree and mesh network topologies. The Zigbee protocol operates at 2.4 GHz and provides a data rate of about 250 kbit/s
[20]. The data transmission range is similar to that of Wi-Fi (from 10 to 100 m).
LoRaWAN is a low-power wide-area network (LPWAN) that is capable of transmitting over long ranges (about 10 km) and also supports multitenancy and multi-domain networks
[14]. It consists of several gateways that can be added when the network size increases and a higher capacity is required.
Narrowband IoT (NB-IoT) is an LPWAN protocol that operates on LTE licensed frequency bands, with a data rate of about 200 Kb/s
[3]. The bandwidth of NB-IoT is about 180 KHz, and this protocol allows the connection of the order of hundreds of thousands of devices
[21]. The NB-IoT technology also optimizes energy consumption, providing power control and power saving modalities
[22].
LTE-M is another LPWAN protocol, operating at a 1.4 MHz bandwidth
[23]. It was introduced with the aim of supporting a massive number of devices, providing 10 year battery life support
[24] and supporting data rates of up to 1 Mbit/s, which is enough to satisfy the higher data rate requirements for devices such as video cameras and wearables
[25]. The features supported in LTE-M include handover management, extended discontinuous reception and the suspension/resumption of radio resource control connection.
Z-Wave is a low-power protocol typically used in wireless home area networks, operating at 868 MHz and 900 MHz frequencies
[7]. Z-Wave devices cannot directly connect to the Internet or other mobile devices. Therefore, the Z-Wave network is based on the use of a controller, which acts as a gateway, in order to manage all connected devices and allow them to interact with other mobile devices via the Internet or local networks
[26].
Sigfox is a narrowband communication system for transmitting data over long ranges (up to 40 km
[27]). Although it employs narrowband signals, Sigfox can be suitable for many kinds of applications, such as geolocation services and control messages.
Finally, 5G is the fifth generation of cellular networks. It is a very low-latency (less than 1 ms) and high-bandwidth (10 Gb/s) protocol
[28], making it a strong enabler for smart cities and allowing the interconnectivity of a large number of IoT devices, as well as being suitable for real-time processing.
The last part of the network layer stack is in charge of suitably formatting data for their presentation. The client/server architecture, represented by the subscription mechanism between IoT devices and brokers, presents different modalities for sending/receiving messages/data, i.e., push and pull. Typically, pull protocols are REST call, web services, FTP and HTTP/HTTPS. On the other hand, the most common push protocols to receive data via data-driven subscriptions are: WebSocket (WS), Constrained Application Protocol (CoAP), Message Queue Telemetry Transport (MQTT), Advanced Message Queuing Protocol (AMQP) and FIWARE NGSI and NGSI-V2
[29]. Furthermore, in order to allow data exchange among multiple devices and applications, distributed publish–subscribe messaging systems should be supported (such as Apache Kafka, RabbitMQ, Orion Broker of FIWARE) for handling multiple data streams in an efficient and scalable way
[13]. In this context, in order to increase fault tolerance when handling data that should not be lost in case of failure, the data persistence of queues is an important feature (e.g., Apache Kafka).
2.3. Middleware/Processing Layer
The middleware or processing layer can serve many different functionalities. For instance, it can act as a data aggregator module, since data may be collected from heterogeneous devices with different protocols that may not have been originally designed to communicate and interact with each other. Therefore, the middleware layer has to enable interoperability among connected devices, performing the necessary programming and/or model abstractions. Interoperability should be ensured at different levels:
- Technical level [30], in order to efficiently achieve and ensure end-to-end connectivity among devices, gateways, brokers, servers, etc.;
- Syntactical level, for managing the variety of protocols and formats;
- Semantic level, for exploiting Semantic Web technologies, such as XML, RDF, OWL Ontology and linked data (LD), to achieve unambiguous data representation and data semantic enrichment, thus improving the expressiveness level of the system [31].
IoT middleware is also typically devoted to providing scalability and reliability, allowing the system to handle a growing number of IoT connections and communication loads at the big data scale as well as supplying stable and fault-tolerant services. Moreover, in order to enable data processing over IoT, database-level data persistence is needed to integrate the data coming with different protocols in a shared model, and this is performed in the middleware layer. Therefore, middleware includes the different data storage modalities and eventually covers other functionalities, such as context identification, information extraction and the reconciliation of collected data. For example, FIWARE provides different generic enablers (Cygnus, QuantumLeap, STH-Comet) to store data coming from the Orion Context Broker.