## 4 The Architecture of IoT
This ecosystem mainly consists of the following components:  
* Embedded operating systems that work in real-time, the sources for energy-harvesting, and micro-electro-mechanical systems (MEMs), which are referred to as sensors;
* Sensor communication systems, which are the wireless personal area networks with 0 cm to 100 m outreach, comprising non-IP channels for communication in low-speed and low-power modes;
* Local area networks or the IP-based types of communication, such as 802.11 WiFi. These networks enable fast radio communication, often in peer-to-peer or star topologies;
* As mentioned above, the main difference between M2M and IoT is the data aggregation with the aggregators, routers, and gateways. These are usually embedded systems providers, chipset and module vendors, radio technology manufacturers (cellular and wireless), the providers of middleware and frameworks for fog computing, and so on. The wide area network (WAN) is also a constituent part of the IoT ecosystem. The WAN is provided by the manufacturers of cellular and satellite networks, along with LPWANs, which use typical Internet protocols and are aimed at IoT-constrained devices, such as the MQ Telemetry Transport (MQTT), Constrained Application Protocol (CoAP), and even Hypertext Transfer Protocol (HTTP):  
* The cloud component is an infrastructure providing a platform-as-a-service that enables database management, streaming, and data analytics, as well as a software-as-a-service and the needed services for machine learning. Additionally, as the information is handed to the cloud, the management of enormous data volumes and value extraction become inseparable parts of the IoT ecosystem. The data in IoT are treated as big data, meaning that an operational IoT platform requires complex practices for dealing with data. As the data volume increases, the need for security grows. Every component of IoT is touched by the need to provide security (the sensors, the CPU and hardware, the systems of radio communication, and the protocols). For each layer of the IoT architecture, there is a need to ensure the security, authenticity, and integrity [36]. There are some architecture models proposed for IoT that define the whole IoT ecosystem. The most general model consists of three main layers:  
* The **data storage layer** that supplies the data collected from the end devices in various fields, such as the ones used in research institutions, industry, healthcare centers, and so on. Only authorized people can access the data, even remotely. This means that the data can be secured by the usage limitations as private or public;
* The **network layer** acts as the mediatory layer to transform and forward the data. The cloud component is used on this layer as the data transformation point. Several network types such as Bluetooth, WiFi, ZigBee, and others are used for the transformation of the data in the Cloud. The security of this layer is provided by firewalls as the middleware of the network;
* The **user access layer** is the upper layer made up of the list of end-users and devices. Home and industry hubs and personal devices are some examples. The hubs are the receiving points of the signals from the sensors, which also send signals to the sensors about the processing of the data. The data processing is done on both the data storage and user access layers [2]. As can be seen in the figure, there are various projected architectures. The main three-layered architecture is already explained above. A simplified yet all-inclusive layered design is the most preferred, as IoT applications need to connect billions of heterogeneous devices via the web. A more detailed representation (Figure 8) of the most recently proposed 5-layer model is given below:  
1. **The first layer is the layer of the objects or devices or the layer of object perception**. This is the physical basement of sensors and actuators gathering data. Some of the functions performed here include querying the location, humidity, temperature, motion, vibration, and acceleration.