# Towards Flexible Integration of 5G and IIoT Technologies in Industry 4.0: A Practical Use Case
## 2 Related Work
### Security for IIoT Applications  
The development of IIoT applications involves the deployment of a large number of resource-deprived sensors to gather data on a massive scale, in order to feed ML algorithms that will improve decision-making and smartize manufacturing processes. The use of such limited devices has meant that, when designing IIoT applications, the development of lightweight and feasible communication protocols has been prioritized, leaving security issues in the background. In fact, most IIoT industrial communication protocols used today, such as MQTT, AMQP, and XMPP, rely on implementing Transport Layer Security (TLS) [23] or Datagram Transport Layer Security (DTLS) [24] at the transport layer for building their secure version. The realization of the Industry 4.0 concept, based on massive data gathering and artificial intelligence techniques, will result in improved manufacturing processes and decision making. However, it will also open the door to new security vulnerabilities coming from the Internet and not known to the traditionally isolated industrial environments. The authors of [25; 26; 27] presented the features and challenges of security and privacy for IoT. Although the implementation of secure transport layer channels is essential to build secure communications, it is not enough, and application layer security mechanisms for IoT must also be developed. Such security mechanisms have already been researched and developed for Internet-connected resource-rich devices and communications for years, and are widely used nowadays. However, traditional security mechanisms designed and evaluated for the resource-rich devices are not directly applicable to IoT environments, due to the high resource constraints of the IoT devices. In fact, security mechanisms widely used in the traditional Internet require high computational capabilities and storage capacity, features not available in current IoT devices. For this reason, in addition to using lightweight and feasible application layer industrial protocols, IoT networks require also the development of specific security mechanisms that will take the special characteristics of the targeted environments into account. Regarding the protection of data confidentiality and integrity at the application layer, Object Security for Constrained RESTful Environments [28] (OSCORE) has been proposed. However, this protocol is specifically tailored to the operation of the CoAP [29] protocol and is not easily extensible to other protocols such as MQTT, XMPP, etc. This protocol makes it possible to protect the integrity and confidentiality of CoAP messages even when the communication includes a proxy, which is usual in industrial communication, and, therefore, the DTLS session is terminated at the proxy. Nevertheless, implementing security mechanisms that protect the confidentiality and integrity of the communications is not enough to have a secure IoT application. In fact, while traditional IoT scenarios comprise sensors that gather data and send it to a centralized server, the next-generation IoT, designed for Industry 4.0, envisions the use of smart sensors behaving as small servers. In such scenarios, the clients establish a direct end-to-end (E2E) connection with the sensors in order to get the data. Moreover, these scenarios also allow some kind of configuration of the sensor parameter by the end users. Therefore, in these new applications, it is very important to implement a strong access control process, in order to guarantee that only authorized users establish a connection with the sensors. Besides, due to the dynamic nature of IoT applications, the access control solutions should be as expressive as possible, in order to evaluate not only the permissions of the users but also the local context conditions. Different approaches have been carried out to develop access control mechanisms for the IoT. On the one hand, some traditional solutions have been adapted for the IoT. For example, [PERSON] et al.