N2 — (R)AN ⇔ AMF (NGAP Reference Point)¶
Learning objectives¶
After reading this page, you will be able to:
- Explain that N2 is the control interface connecting the base station (gNB) and the AMF.
- State N2's protocol stack (NGAP / SCTP / IP) and port (38412).
- Distinguish N2's two kinds of procedures (non-UE associated / UE associated).
- Explain the role of N2 in carrying N1 (NAS) as a NAS-PDU.
- Explain how it corresponds to 4G (EPC) S1-MME (S1AP).
Prerequisites¶
It will go more smoothly if you understand the following first.
- The positioning of NGAP and SCTP → Protocol dictionary
- The NAS that N2 carries → N1
- The NF that terminates N2 → AMF
- The concept of an interface → Interface dictionary
Why — why it is needed¶
The base station (gNB) and the core (AMF) need to reliably exchange a large volume of control messages — registering UEs, securing radio resources, coordinating handovers, and so on. Even when there is not a single UE, they first need a handshake (NG Setup) to say "this base station and the core can work together"; and once a UE connects, instructions such as "create a context for this terminal" and "set up security" are needed.
This "control-dedicated road between the RAN and the core" is N2. Moreover, because control messages cannot tolerate loss or out-of-order delivery, they are carried over a highly reliable transport (SCTP). Without N2, the base station could not coordinate with the core, and the UE could not register at all.
Overview¶
N2 is the control interface connecting (R)AN(gNB) ⇔ AMF. The protocol flowing on top is NGAP (NG Application Protocol), and below it is SCTP over IP.
N2's procedures are broadly divided into two kinds.
| Kind | Description | Examples |
|---|---|---|
| Non-UE associated | Foundational procedures between the base station and the core, not tied to a specific UE | NG Setup, RAN Configuration Update |
| UE associated | Procedures tied to individual UEs | Initial UE Message, Initial Context Setup, Handover, PDU Session Resource, Paging |
In addition, N2 also serves as the transport that carries N1 (NAS) as a NAS-PDU.
Basic Concept — a beginner-friendly explanation¶
Let us liken N2 to a dedicated line connecting a branch office (gNB) and the head office (AMF).
- First, at opening, an activation procedure (NG Setup) is performed to say "connecting the branch and the head office." This is preparation before customers (UEs) arrive, and it is a non-UE associated procedure.
- After activation, each time a customer (UE) visits, per-customer communications (UE associated procedures) flow — "a new customer (Initial UE Message)," "prepare this person's account (Initial Context Setup)."
- Furthermore, this line carries the sealed letter (NAS) that the customer addressed to the head office all the way there. The line has nothing to do with the contents of the letter; it just delivers them reliably.
For reliability, this line uses a mechanism (SCTP) that "always confirms delivery and preserves order."
Protocol / Transport¶
| Item | Content |
|---|---|
| Protocol | NGAP (NG Application Protocol) — TS 38.413 |
| Lower Transport | SCTP (Stream Control Transmission Protocol, RFC 4960) over IP |
| Port | SCTP 38412 |
| Characteristics | Reliability, order guarantee, multi-streaming, multi-homing (SCTP properties). The NGAP procedureCode identifies the procedure kind. Carries the NAS-PDU |
Why SCTP rather than TCP
Because control signaling is vulnerable to loss and out-of-order delivery, SCTP's multi-streaming (avoiding head-of-line blocking) and multi-homing (path redundancy) are well suited. This is the same design philosophy as 4G's S1AP/X2AP.
Architecture¶
This shows how N2 connects the gNB and the AMF, carrying N1 (NAS) while working with surrounding IFs.
flowchart LR
UE(("UE"))
gNB["gNB (base station)"]
AMF["AMF"]
SMF["SMF"]
UPF["UPF"]
UE -. "N1 (NAS) logical" .-> AMF
UE -- "radio" --> gNB
gNB == "N2 (NGAP / SCTP:38412)" ==> AMF
AMF -- "N11" --> SMF
gNB -- "N3 (GTP-U user data)" --> UPF
classDef ctrl fill:#efe,stroke:#3a3,stroke-width:2px;
class gNB,AMF ctrl;
How to read the diagram: the thick line (==>) is N2's control signaling. Inside N2 flow NGAP procedures and, nested as a NAS-PDU, the UE's NAS (N1). Note the control/user separation, where control is on N2 and user data is split off onto a separate path, N3 (toward the UPF).
Procedures that use it¶
N2 is the foundation of coordination between the base station and the core, and it is used in many procedures.
- NG Setup: the first move in establishing N2. The gNB and the AMF exchange capability, PLMN, and TA information and shake hands (non-UE associated).
- Initial UE Message: carries the UE's first NAS (e.g., Registration Request) over N2 to the AMF (the starting point for UE-associated procedures).
- Initial Context Setup: the instruction to establish the UE context and security (AS security).
- UE Context procedures / Handover procedures / PDU Session Resource procedures / Paging: various UE-associated controls.
In Registration it plays a central role: the gNB puts the UE's first NAS in an Initial UE Message and delivers it to the AMF, then establishes the context and security with Initial Context Setup. For the detailed flow, see Registration.
Main Messages¶
These are representative NGAP messages that flow over N2.
| Message | Kind | Purpose |
|---|---|---|
| NG Setup Request / Response | Non-UE associated | Handshake to establish N2 |
| Initial UE Message | UE associated | Transport of the first NAS |
| Downlink / Uplink NAS Transport | UE associated | Round-trip transport of NAS after establishment |
| Initial Context Setup Request / Response | UE associated | UE context and security establishment |
For details of each message, see the Message dictionary.
Packet Analysis (Wireshark)¶
N2 is observed as NGAP, with SCTP below it.
| Purpose | Display Filter |
|---|---|
| Extract NGAP messages | ngap |
| View the lower-layer SCTP | sctp |
| Narrow by the N2 port | sctp.port == 38412 |
| View the NAS inside NGAP too | ngap && nas-5gs |
Decode highlights:
- The NGAP procedureCode lets you identify the message kind (NG Setup, Initial UE Message, etc.).
- In Initial UE Message and NAS Transport,
nas-5gs(N1) is decoded nested inside the NGAP NAS-PDU field. This two-layer structure is key to understanding N2. - Looking at the SCTP chunks (DATA/SACK, etc.), you can observe how the reliable transport works.
Comparison with EPC¶
- In 4G: S1AP flowed over S1-MME, which connected the base station (eNB) and the MME (TS 36.413, with SCTP below). NAS was also carried in the NAS-PDU of S1AP.
- In 5G: NGAP flows over N2, which connects the gNB and the AMF (TS 38.413, with SCTP below). NAS is carried in the NAS-PDU of NGAP.
| 4G (EPC) | 5G (5GC) |
|---|---|
| S1-MME | N2 |
| S1AP (TS 36.413) | NGAP (TS 38.413) |
| SCTP over IP | SCTP over IP (RFC 4960) |
| S1AP carries the NAS-PDU | NGAP carries the NAS-PDU |
3GPP Specification¶
- 3GPP TS 38.413 — NGAP (NG Application Protocol). Individual clause numbers are to be confirmed
- 3GPP TS 23.501 §4 — System architecture and reference points (definition of N2)
- IETF RFC 4960 — SCTP (Stream Control Transmission Protocol)
Summary¶
- N2 is the control interface connecting (R)AN(gNB) ⇔ AMF, and its protocol is NGAP.
- The lower transport is SCTP over IP, and the port is 38412.
- Procedures are divided into non-UE associated (NG Setup, etc.) and UE associated (Initial UE Message, Initial Context Setup, etc.).
- N2 also carries N1 (NAS) as a NAS-PDU.
- It corresponds to 4G's S1-MME (S1AP, TS 36.413), and in 5G it became NGAP (TS 38.413).
Next Step¶
- N1 — the NAS that N2 transports (the logical path of UE⇔AMF)
- AMF — the NF that terminates N2
- Registration — the procedure where N2 plays a central role
- Message dictionary / Interface dictionary — to check terminology