oses, and the SM message in case of SM signaling. The NAS-SM messages control the session management functions between the UE and the SMF. The session management message is created and processed in the NAS-SM layer of UE and the SMF (see Fig. 1.71). The content of the NAS-SM message is transparent to the AMF. The NAS-MM layer creates a NAS-MM message, including security header, indicat- ing NAS transport of SM signaling, as well as additional information for the receiving NAS mobility management (NAS-MM) entity to determine how and where to forward the SM signaling message. The receiving NAS-MM layer performs integrity check and interpreta- tion of NAS message content. Fig. 1.71 further depicts the NAS-MM layer, which is a NAS protocol for mobility management; support of registration management; connection NAS-SM NAS-SM Relay NAS-MM NAS-MM Relay NG-AP NG-AP 5G-AN 5G-AN protocol protocol layer layer 5G-AN Figure 1.71 Control-plane protocol stack between the UE and the AMF/SMF [3]. 5G Network Architecture 151 management and user-plane connection activation and deactivation functions. It is also responsible for ciphering and integrity protection of NAS signaling. The UE and AMF support NAS signaling connection setup function, which is used to estab- lish a NAS signaling connection for a UE in CM-IDLE state. It will be explained in the next chapter that two connection management states are used to reflect the NAS signaling connectivity between the UE and the AMF, that is, CM-IDLE and CM-CONNECTED The CM state for 3GPP access and non-3GPP access are independent of each other, that is, one can be in CM-IDLE state while the other is in CM-CONNECTED state [3]. A UE must register with the network to be authorized to use network services, to assist mobility tracking, and to be reachable. The registration procedure is used when the UE needs to perform initial registration with the 5GS; location update upon entering a new tracking area outside of the UE's registration area in CM-CONNECTED and CM-IDLE modes; when the UE perfo