# An Introduction of a Modular Framework for Securing 5G Networks and Beyond
## 4 An Integrated Security Solution  
The inclusion of security features in the suggested security framework is covered in this section. The proposed NSS framework covers security for network services in 5G-enabled D2D communications from the point at which a UE requests access to the network via wireless access to the point at which it is allowed to share the service with another UE. The goal of the NSS framework is to defend against the dangers described in [2] by protecting the entities participating in communication and the data being communicated over communication channels in various security domains and scenarios. The NAC, SLS and DDS levels of the solution are as follows:  
* NAC provides primary authentication and is concerned with the security of the 5G access network. It safeguards the entities, the wireless data connection and the correspondence between the UE, SN and HN.
* SLS offers secondary authentication and authorisation and is concerned with UE service authorisation. It safeguards information, entities and communication between the UE, HN and SP in several domains.
* DDS addresses the security of D2D communication, enabling data sharing in both network-assisted and non-network-assisted communication and offers authentication and authorisation between two UEs that are close to one another. Data, entities and communication between two UEs and across networks are all protected.  
An integrated security framework can be created by including some solutions into this safe framework. Each level of the security model is made up of security protocols in the following linked work. In order to provide security with the NAC, 3 GPP standardised 5G-AKA and EAP-AKA [6, 10]. The authors [11, 12, 13] proposed protocols that deal with security at the service level of 5G networks. In [26], the authors proposed investigating D2D communication security and proposed two security protocols that offer security covering many D2D scenarios.  
These security framework's underlying protocols address security on the network, service and D2D levels of communications. As illustrated in Figure 5, these security levels are connected by the protocol interfaces, and the protocols are encapsulated while addressing the security requirements from one level to another. These protocols employ or share some security contexts in order to provide an integrated security solution; nevertheless, this should not compromise security on another level or domain. Additionally, Figure 6 shows a hierarchy of keys, and explains how keys are generated and shared in various contexts.  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Protocols** & **Total Communication** & **Number of Messages** \\  & **Cost (Bits) (\(n\))** & **(\(m\))** \\ \hline \hline
5G Protocols & & \\ \hline SAP-AKA & 3136 & 9 \\ \hline NS-FId & 5472 & 10 \\ \hline DOSS & 4096 & 8 \\ \hline
5G-AKA & 5898 & 10 \\ \hline
5G D2D Protocols & & \\ \hline DDSec & 7904 & 7 \\ \hline DDACap & 5760 & 5 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Communicational Cost of the Protocols based on Simulation Modelling.  
Figure 5: Interface of the Security Protocols.  
Figure 6: Key Hierarchy and Derivation.