## 3 NB-IoT Architecture
It communicates with the IoT evolved packet core or EPC using the S1-lite interface and transmits non-access stratum or NAS messages to it;
* The **IoT EPC** is a mediatory interface to the NAS. From this point, the collected data are forwarded to the IoT platform;
* The **IoT platform** gathers all of the data from the connected IoT access points and dispatches the data to their respective application servers;
* The **application server** is the final point where the data are aggregated. The received data are further processed according to the client's needs [38]. NB-IoT also includes a control plane that uses the Service Capability Exposure Function (SCEF) to transmit both IP and non-IP data from the NB-IoT node to the LTE network. The security and authentication mechanisms are enabled with the use of the SCEF component. NB-IoT's specifications are linked to the 3 rd Generation Partnership Project (3 GPP), so the integration into the 5G ecosystem is considered. Some authentication mechanisms of 5G networks such as 5G-AKA and EAP-AKA need to be implemented by NB-IoT devices that use the 3 GPP specifications [22]. In addition to Long-Term Evolution (LTE) networks, NB-IoT can be deployed on Global System for Mobile Communications (GSM) or Universal Mobile Telecommunications System (UMTS) networks. There are multiple scenarios for the application of NB-IoT nowadays, such as automation processes in intelligent factories, intelligent mining, high-speed railways, and so on. NB-IoT deployments are also possible using open-source LTE architectures such as OAI and Amari. A survey of the current telecom equipment producers shows that the current equipment does not use the C-SGN architecture of 3 GPP, which stands for the Cellular Serving Gateway Node, so NB-IoT still uses the existing Evolved Packet Core (EPC) equipment architecture [38]. Figure 6 shows how 3 GPP optimizes the architecture for NB-IoT to adopt a simplified network architecture, whereby the Evolved Packet System (EPS) is standardized by the 3 GPP. It comprises Long Term Evolution (LTE) and Evolved Packet Core (EPC) networks, and two optimization procedures for the cellular IoT (CIoT): the user plane CIoT EPS and the control plane CIoT EPS. These specifications optimize the functions of NB-IoT in Mobility Management Entity (MME), Serving Gateway (SGW), and Packet Data Network GW (PGW) modules of EPC separately to form a new network element. As mentioned already, the manufacturer's types of equipment in the existing community NB-IoT platforms do not adopt the CSGN but adopt the EPC equipment architecture [38]. The Home Subscriber Server (HSS) component of the EPC stores and updates the user equipment subscription information, where different security keys for the identity and encryption of the traffic are generated. HSS has the role of identifying and addressing end devices and contains the mobile phone numbers or the International Mobile Subscriber Identity (IMSI). It also processes the authentication between MME and ED and subscribes to Quality of Service (QoS) information for each end device, such as the bit rate and traffic class allowance [31]. The communication principles in NB-IoT are defined via the user plane CIoT EPS and the control plane CIoT EPS to send data to an application in the network. With control plane CIoT EPS optimization for uplink communication, device data are sent to MME through eNodeB (CIoT RAN). According to the type of data, there are two ways to transmit from MME. IP data packets are transferred to PGW via SGW. Then, the PGW finally transmits data to CIoT services or application servers. In the case of the non-IP data packets, the transfer is to the SCEF, which represents new nodes that are conceived specifically for machine-type data. From there, data are sent to CIoT services. In the downlink, the data are sent following the same path but in the reverse direction. With the user plane CIoT EPS optimization, the data are transmitted over radio bearers to the application server via PGWand passing by SGW.