**3.4. IoT architecture**

A reference model has not yet been suggested for the IoT architecture, although there are an ever-increasing number of proposed architectures for this new trend such as the ones described in [20–24]. Among the most common architectures of IoT we find the 5 layers model described in [25]. The first layer of this model is named the *objects layer/perception layer* and represents the physical objects, for example, sensors, actuators, etc. of the IoT that serve to collect information using standardized plug-and-play mechanisms to serve the heterogeneous devices [25]. The second layer is the *object abstraction layer*, which transfers the collected data from the objects layer to the service management layer using various technologies such as RFID, 3G, 4G, Wi-Fi, Bluetooth, and handles data management processes and cloud computing [25]. The third layer is the *service management layer*, which is the middleware layer that processes the received data, delivers the processed data and services to the interested applications over the network, and makes decisions [25]. The fourth layer is the *application layer* and is the one responsible for providing the requested smart services to the customers or connected applications that meet their needs in the various domains such as healthcare, transportation, and industrial automation [25]. The fifth layer is the *business layer*, which supports decision-making processes based on big data processing and analysis, manages all the underlying four layers of the IoT architecture, and enhances the services provided to the users and maintains their privacy [25].

In Ref. [10] we proposed and developed a flexible middleware solution architecture that has five layers and is compatible with the IoT architecture discussed above. We developed the proposed architecture more and applied it to e-health in [26]. The FlexRFID middleware in [10] serves getting data from the heterogeneous automatic identification devices and sensors, processing them, applying the business rules specified by the connected applications, and disseminating the processed data to the interested applications. Our middleware, that is, FlexRFID was tested with multiple application domains, such as smart library management [27], supply chain management [28], and healthcare scenarios [29].
