ments, the core network provides the stored UE capability to gNB. During handover and dual connec- tivity establishment, the source node provides the UE capability to the target node during the preparation phase. The stored UE capability can be released and updated with a new NAS registration procedure. Figure 3.4.13 shows parts of an example message flow for UE capability handling and storage in the CN. 0. A UE is in RRC IDLE state. 1. The UE goes into CONNECTED state using the Connection Establishment procedure, for example at NAS registration. 0.UE in RRC IDLE 1. Connection Setup procedure 2. Security Mode procedure 3. UE Capability Enquiry procedure 4. NGAP: UE RADIO CAPABILITY INFO INDICATION 5. AMF stores UE RAN capability 6. Connection Release cprocedure 7. UE in RRC IDLE 8. Connection Setup procedure 9. NGAP: INITIAL CONTEXT SETUP REQUEST [UE capability] Figure 3.4.13 UE AS capability enquiry, network storage, and retrieval. 3.4 NR Protocol Stack 2. AS security is configured. 3. The gNB retrieves the UE RAN capability from the UE using the UE Capability Enquiry procedure. 4. The gNB forwards the retrieved UE RAN capability to the AMF using the NGAP UE RADIO CAPABILITY INFO INDICATION message. 5. The AMF stores the UE RAN capability as part of the UE context stored in the AMF as a transparent container. 6. The UE RRC connection is subsequently released. The UE context in the gNB is released. 7. The UE goes to RRC IDLE state. 8. The UE starts a new RRC Connection Establishment procedure. 9. The AMF includes the stored UE RAN capability in the NGAP INITIAL CONTEXT SETUP REQUEST message sent to the gNB. The gNB can use this for RRC connection without having to retrieve it from the UE again. 3.4.5.2.6 RRC INACTIVE State As discussed above, when a UE is in the INACTIVE state, the network and the UE store the previously used configurations. Additionally, the network provides to the UE a context RAN ID called I-RNTI. Figure 3.4.14 shows the message flow for a UE moving to CONNECTED from INACTIVE that also involve