NGAP Message Trace
3 minute read
This page reconstructs the complete NGAP exchange between the gNB (CU-CP) and the AMF from a real packet capture on a running OCUDU gNB. Every NGAP frame in the trace appears in capture order; the diagram is generated directly from the pcap, so each arrow corresponds to exactly one wire-level NGAP message.
Click any message arrow or label to open the detail panel on the right - it shows what the message carries, the procedure it triggers, the relevant 3GPP TS 38.413 section and OCUDU source file, and the actual ASN.1 decode of the captured frame.
A more freeform interactive view of the same trace lives at Trace Studio, where you can scrub through the capture, filter by protocol, and switch between three view modes.
Full NGAP Trace
sequenceDiagram
autonumber
participant CU as ngap_impl (CU-CP)
participant AMF as AMF
Note over CU,AMF: NG Setup at boot (t = 0.000 s)
CU->>AMF: NGSetupRequest
AMF->>CU: NGSetupResponse
Note over CU,AMF: RRC attach + NAS authentication (t = 59.696 s)
CU->>AMF: InitialUEMessage
AMF->>CU: DownlinkNASTransport #1
CU->>AMF: UplinkNASTransport #1
AMF->>CU: DownlinkNASTransport #2
CU->>AMF: UplinkNASTransport #2
AMF->>CU: DownlinkNASTransport #3
Note over CU,AMF: UE Context setup + capability exchange (t = 60.251 s)
CU->>AMF: UplinkNASTransport #3
AMF->>CU: InitialContextSetupRequest
CU->>AMF: InitialContextSetupResponse
CU->>AMF: UERadioCapabilityInfoIndication
Note over CU,AMF: PDU Session Setup (t = 60.760 s)
CU->>AMF: UplinkNASTransport #4
AMF->>CU: PDUSessionResourceSetupRequest #1
CU->>AMF: UplinkNASTransport #5
AMF->>CU: PDUSessionResourceSetupRequest #2
CU->>AMF: PDUSessionResourceSetupResponse #1
CU->>AMF: PDUSessionResourceSetupResponse #2
Note over CU,AMF: Mid-session NAS (t = 76.654 s)
CU->>AMF: UplinkNASTransport #6
AMF->>CU: PDUSessionResourceSetupRequest #3
CU->>AMF: PDUSessionResourceSetupResponse #3
Note over CU,AMF: Deregistration + release (t = 77.206 s)
CU->>AMF: UplinkNASTransport #7
AMF->>CU: PDUSessionResourceReleaseCommand
CU->>AMF: PDUSessionResourceReleaseResponse
CU->>AMF: UplinkNASTransport #8
CU->>AMF: UplinkNASTransport #9
AMF->>CU: DownlinkNASTransport #4
AMF->>CU: UEContextReleaseCommand
CU->>AMF: UEContextReleaseCompleteReading the trace
- Two ID allocations. When the UE first appears, the gNB
allocates a
RAN_UE_NGAP_IDinInitialUEMessage(frame 3) and the AMF allocates anAMF_UE_NGAP_IDin the nextDownlinkNASTransport(frame 4). These identifiers stay paired for the lifetime of the UE context. - NG Setup is once at boot. NG Setup (frames 1-2) is the only NGAP exchange that has nothing to do with any UE - it establishes the gNB↔AMF SCTP association and exchanges PLMN/TA support. After that, every NGAP frame in this trace is UE-associated.
- The CU-CP is mostly a NAS relay. Every NAS PDU between UE and AMF transits the CU-CP, which simply unwraps the F1AP envelope and re-wraps it into NGAP. The CU does not interpret NAS - that lives at the AMF.
- Two PDU sessions, three independent timelines. Session 1 is set up at frame 14, used during the user-plane window, and modified again at frame 21. Session 2 is set up at frame 16 and released first at frame 24 when the UE deregisters. The two sessions are independent NGAP procedures that share the same UE context.
- Release is AMF-initiated. Unlike F1AP (where release commands
go from CU to DU), NGAP
UEContextReleaseCommandarrives from the AMF (frame 28). The gNB acknowledges withUEContextReleaseComplete(frame 29) and the trace ends.
For the F1AP side of the same UE attach - including the per-RRC relay through the DU and over the air to the UE - see the F1AP Message Trace.