Walk through how a 5G UE sets up a connection from registration to a working data path, and what NGAP's role is.
NGAP signals between the gNB and the AMF to set the UE up. First the gNB registers itself with the core (NGSetupRequest); then the UE registers (InitialUEMessage carrying a NAS Registration Request); IDs and security are established; finally a PDU session is set up, which builds the GTP-U user-plane tunnel so user data can flow.
* Register the tower, register the phone, then build the data pipe. *
The setup sequence (control plane first, then user plane):
- gNB announces itself: before any UE attaches, the base station sends an NGSetupRequest to the core, advertising its identity and capabilities — supported PLMNs (operator networks), Tracking Areas, and network slices.
- UE registration begins: the UE's first NAS message (e.g. Registration Request) is carried up to the gNB over the radio protocols, and the gNB forwards it to the AMF inside an InitialUEMessage.
- Identifiers are assigned: the gNB allocates a RAN-UE-NGAP-ID, then the AMF adds an AMF-UE-NGAP-ID. This pair uniquely identifies the UE on the NG interface and is reused for the whole connection.
- Security & context: messages like DownlinkNASTransport and InitialContextSetupRequest set up security mechanisms, UE context, and initial QoS parameters.
- PDU session / data path: the AMF/SMF send the gNB a PDUSessionResourceSetupRequest carrying the user-plane parameters — PDU-Session-ID, QoS info (QFIs), and tunnel endpoints (TEIDs + IP addresses). The gNB replies with the matching downlink-tunnel info, and the user-plane data path over GTP-U is then fully established.
NGAP's central role: the NG Application Protocol runs between the gNB and the 5G core over the open NG interface (split into NG-C for signalling and NG-U for user data). It carries the NAS messages from the RAN into the core and orchestrates both the signalling connection and the data-path setup. Throughout, a consistent set of identifiers is reused — UE-IDs, PDU-Session-IDs, QoS flows (QFIs), and TEIDs — to keep everything tied to the right UE and session.
Tip: Think "register the tower, register the phone, then build the pipe." Control-plane signalling (NGAP/NAS) comes first to authenticate and set up context; only then does the GTP-U user-plane tunnel get built so packets can actually reach the internet.