Skip to content

Registration & Connection Deep Dive

All Callflows / Registration and connection sequence diagrams from Level ∞

Scope of the diagrams

These sequence diagrams and their surrounding explanations and caveats are reproduced from the existing lessons. They include simplified and conditional examples, not every specification branch. Read the original explanations for applicability, omitted steps, implementation-dependent details, TS and clause references, and any qualifications marked as requiring verification.

SUPI / SUCI / 5G-GUTI — How the 5GC Identifies a UE

Diagram 1 — Who turns the SUCI back into the SUPI? — the SIDF

Original explanation, assumptions and specification references

The AMF does not de-conceal the SUCI. The home network's SIDF (Subscription Identifier De-concealing Function) does, and the SIDF is positioned as a service provided by the UDM (TS 33.501 Clause 6.12.2).

sequenceDiagram
    participant UE
    participant gNB
    participant AMF as AMF (SEAF)
    participant AUSF
    participant UDM as UDM (SIDF / ARPF)
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Registration Request, SUCI)
    gNB->>AMF: Initial UE Message (NAS-PDU: Registration Request)
    AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>POST /nausf-auth/v1/ue-authentications (SUCI, SN name)
    AUSF->>UDM: Nudm_UEAuthentication_Get<br/>POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data
    Note over UDM: SIDF restores SUCI → SUPI
    UDM-->>AUSF: Nudm_UEAuthentication_Get response<br/>HTTP 200 OK (authentication vector + SUPI)
    AUSF-->>AMF: Nausf_UEAuthentication_Authenticate response<br/>HTTP 201 Created (5G-AKA challenge)
    AMF->>gNB: Downlink NAS Transport (NAS-PDU: Authentication Request)
    gNB->>UE: DLInformationTransfer (NAS: Authentication Request)
    UE->>gNB: ULInformationTransfer (NAS: Authentication Response)
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: Authentication Response)
    AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>PUT /nausf-auth/v1/ue-authentications/{authCtxId}/5g-aka-confirmation (RES*)
    Note over AUSF,AMF: The SUPI reaches the AMF<br/>only after successful authentication
    AUSF-->>AMF: Nausf_UEAuthentication_Authenticate response<br/>HTTP 200 OK (authentication success + SUPI)

Successful 5G-AKA example (TS 33.501 Clause 6.1.3.2, TS 29.509 Clause 5.2.2.2.2, TS 29.503 Clause 6.3.3.2.4.2, TS 38.331 Clause 5.3.3 / Clause 5.7.1 / Clause 5.7.2, TS 38.413 Clause 8.6.1–Clause 8.6.3).

  • Why the AMF does not de-conceal — Distributing the HN private key to AMFs in visited networks (the VPLMN when roaming) would widen the key's exposure too much. Keeping the private key inside the HPLMN's UDM/SIDF means that, when the UE registers with a SUCI, the SUPI is not given even to the visited network until authentication succeeds.
  • When the SUPI reaches the AMF — When the UE registers with a SUCI, the AUSF provides the SUPI to the SEAF (AMF) after successful authentication (5G AKA: TS 33.501 Clause 6.1.3.2 / EAP-AKA': Clause 6.1.3.1). When the UE registers with a 5G-GUTI and the new AMF can retrieve the context from the old AMF, the new AMF receives it via the old AMF (TS 23.502 Clause 4.2.2.2.2).

Diagram 2 — Call Flow (initial registration: no 5G-GUTI → SUCI)

Original explanation, assumptions and specification references

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant AUSF
    participant UDM as UDM (SIDF)
    Note over UE: no valid 5G-GUTI
    UE->>gNB: RRCSetupRequest (ue-Identity = random value)
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Registration Request)
    gNB->>AMF: Initial UE Message (NAS-PDU)
    Note over AMF: 5GS mobile identity = SUCI
    AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>POST /nausf-auth/v1/ue-authentications (SUCI)
    AUSF->>UDM: Nudm_UEAuthentication_Get<br/>POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data
    Note over UDM: SIDF: SUCI → SUPI
    UDM-->>AUSF: Nudm_UEAuthentication_Get response<br/>HTTP 200 OK (AV + SUPI)
    AUSF-->>AMF: Nausf_UEAuthentication_Authenticate response<br/>HTTP 201 Created (authentication challenge)
    AMF->>gNB: Downlink NAS Transport (NAS-PDU: Authentication Request)
    gNB->>UE: DLInformationTransfer (NAS: Authentication Request)
    UE->>gNB: ULInformationTransfer (NAS: Authentication Response)
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: Authentication Response)
    AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>PUT /nausf-auth/v1/ue-authentications/{authCtxId}/5g-aka-confirmation (RES*)
    AUSF-->>AMF: Nausf_UEAuthentication_Authenticate response<br/>HTTP 200 OK (authentication success + SUPI)
    AMF->>gNB: Downlink NAS Transport (NAS-PDU: Security Mode Command)
    gNB->>UE: DLInformationTransfer (NAS: Security Mode Command)
    UE->>gNB: ULInformationTransfer (NAS: Security Mode Complete)
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: Security Mode Complete)
    Note over AMF: UDM registration and subscription data retrieval with the SUPI
    AMF->>gNB: Initial Context Setup Request (NAS-PDU: Registration Accept, 5G-GUTI)
    gNB->>UE: DLInformationTransfer (NAS: Registration Accept, 5G-GUTI)
    gNB-->>AMF: Initial Context Setup Response
    UE->>gNB: ULInformationTransfer (NAS: Registration Complete)
    gNB->>AMF: Uplink NAS Transport (NAS-PDU: Registration Complete)
    Note over AMF: Start T3550 on Registration Accept, stop it on Registration Complete
    Note over UE,AMF: from now on the UE uses the 5G-GUTI / 5G-S-TMSI

This example uses 5G-AKA and Initial Context Setup; details such as AS security are omitted (TS 23.502 Clause 4.2.2.2.2, TS 38.413 Clause 8.3.1 / Clause 8.6.2 / Clause 8.6.3, TS 38.331 Clause 5.7.1 / Clause 5.7.2).

Diagram 3 — Call Flow (re-registration: existing 5G-GUTI → context retrieval from the old AMF)

Original explanation, assumptions and specification references

When the UE moves to an area managed by a different AMF, the new AMF identifies the old AMF from the GUAMI in the 5G-GUTI and retrieves the UE context (TS 23.502 Clause 4.2.2.2.2).

sequenceDiagram
    participant UE
    participant gNB
    participant NewAMF as New AMF
    participant OldAMF as Old AMF
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Registration Request, 5G-GUTI)
    gNB->>NewAMF: Initial UE Message (NAS-PDU: Registration Request)
    Note over NewAMF: identify the old AMF from the GUAMI in the 5G-GUTI
    opt Old AMF identified
        NewAMF->>OldAMF: Namf_Communication_UEContextTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/transfer
        alt Context retrieved
            OldAMF-->>NewAMF: Namf_Communication_UEContextTransfer response<br/>HTTP 200 OK (SUPI, security context, etc.)
        else Example of context not found
            OldAMF-->>NewAMF: Namf_Communication_UEContextTransfer response<br/>HTTP 404 Not Found
        end
    end
    alt context retrieved
        Note over NewAMF: may re-run UE authentication even after retrieval<br/>(TS 23.502 Clause 4.2.2.2.2, operator policy dependent)
    else old AMF cannot be identified / no context / integrity check failure
        Note over NewAMF: A transfer attempt, if made, failed
        NewAMF->>gNB: Downlink NAS Transport (NAS-PDU: Identity Request)
        gNB->>UE: DLInformationTransfer (NAS: Identity Request)
        UE->>gNB: ULInformationTransfer (NAS: Identity Response, SUCI)
        gNB->>NewAMF: Uplink NAS Transport (NAS-PDU: Identity Response)
        Note over NewAMF: then proceeds to authentication as in initial registration
    end

The UE Context Transfer URI and response are specified in TS 29.518 Clause 5.2.2.2.1.1.

Signal Flow (main messages involving identifiers)

# Message From → To Main identifier IEs Meaning
1 RRCSetupRequest UE→gNB ue-Identity (ng-5G-S-TMSI-Part1 or random value) Presents part of the 5G-S-TMSI if the UE has one (TS 38.331 Clause 6.2.2)
2 RRCSetupComplete UE→gNB ng-5G-S-TMSI-Part2, registeredAMF, etc. Clues for the gNB's AMF selection (next chapter)
3 Registration Request UE→AMF 5GS mobile identity (SUCI or 5G-GUTI) TS 24.501 Clause 8.2.6; IE in Clause 9.11.3.4
4 Initial UE Message gNB→AMF NAS-PDU, 5G-S-TMSI (optional) TS 38.413 Clause 8.6.1
5 Namf_Communication_UEContextTransfer New AMF→Old AMF 5G-GUTI (UE identification) Retrieves the SUPI, security context, etc. from the old AMF (TS 23.502 Clause 4.2.2.2.2)
6 Identity Request / Response AMF⇔UE Requested identity type (SUCI, etc.) When the AMF cannot identify the UE (TS 24.501 Clause 5.4.3)
7 Nausf / Nudm UEAuthentication AMF→AUSF→UDM SUCI (or SUPI) The SIDF restores the SUPI
8 Registration Accept AMF→UE 5G-GUTI Allocation of a new temporary ID (TS 24.501 Clause 8.2.7)
9 Registration Complete UE→AMF — Acknowledges receipt of the 5G-GUTI; the AMF stops T3550 (TS 24.501 Clause 5.5.1.2.4)

Which identifier does the UE include?

In principle, the UE includes a valid 5G-GUTI (or, when moving from EPS, a 5G-GUTI mapped from the 4G GUTI) in the 5GS mobile identity of the Registration Request, and a SUCI if it has none. The PEI may be used for emergency registration; for the order of precedence see TS 24.501 Clause 5.5.1.2.2 (initial) / Clause 5.5.1.3.2 (mobility/periodic). The identifier in the Registration Request is a clue as to whether the UE still holds its previous registration state. Note, however, that a mapped 5G-GUTI points to the old MME, not an old AMF.

GUAMI / AMF Region / AMF Set / AMF Pointer — How AMFs Are Identified and Selected

Diagram 1 — 1. NG Setup — the AMF announces its "address" to the gNB

Original explanation, assumptions and specification references

In the NG Setup procedure (TS 38.413 Clause 8.7.1), in which the gNB and the AMF establish N2, the AMF notifies the gNB of the GUAMIs it serves.

sequenceDiagram
    participant gNB
    participant AMF
    gNB->>AMF: NG Setup Request (Global RAN Node ID, Supported TA List, Default Paging DRX, etc.)
    AMF-->>gNB: NG Setup Response (AMF Name, Served GUAMI List, Relative AMF Capacity, PLMN Support List)
    Note over gNB: keeps a GUAMI ⇔ AMF (TNL association) table<br/>and each AMF's relative capacity
    AMF-->>gNB: AMF Configuration Update (changes to Served GUAMI List / Relative AMF Capacity)
    gNB-->>AMF: AMF Configuration Update Acknowledge
IE (NG Setup Response) Relation to the GUAMI
AMF Name Name of the AMF
Served GUAMI List List of GUAMIs served by this AMF. Each item contains a GUAMI and, optionally, a Backup AMF Name
Relative AMF Capacity Relative capacity of the AMF (0–255; IE defined under TS 38.413 Clause 9.3.1, sub-clause to be confirmed). Used for the distribution ratio of new UEs
PLMN Support List Supported PLMNs and S-NSSAIs

The messages are defined in TS 38.413 Clause 9.2.6.1 (NG Setup Request) / Clause 9.2.6.2 (NG Setup Response), and changes are notified with AMF Configuration Update (Clause 8.7.3).

Diagram 2 — 3. AMF failure and removal — GUAMI switchover

Original explanation, assumptions and specification references

When an AMF is removed in a planned way, that AMF can notify the gNB of an Unavailable GUAMI List with AMF Status Indication (TS 38.413 Clause 8.7.6). AMFs in the same AMF Set have access to the same UE context data (TS 23.501 Clause 3.1 / Clause 5.21.2.1). On a sudden failure the AMF itself may be unable to send the indication; how NG-RAN detects the failure and whether configured recovery procedures are executed depend on TS 23.501 AMF Management (under Clause 5.21.2; sub-clause to be confirmed) and on the implementation. For subsequent signaling of UEs with that GUAMI, the gNB is expected to select the AMF indicated by the Backup AMF Name notified in the NG Setup Response / AMF Configuration Update (or in the Unavailable GUAMI Item of the AMF Status Indication), or another AMF in the same AMF Set (TS 38.413 Clause 8.7.6; TS 23.501 Clause 5.21.2.2 / Clause 5.21.2.3, sub-clauses to be confirmed. The exact selection method is NG-RAN implementation dependent).

sequenceDiagram
    participant UE
    participant gNB
    participant AMF1 as AMF-1 (to be removed)
    participant AMF2 as AMF-2 (same Set / backup)
    AMF1->>gNB: AMF Status Indication (Unavailable GUAMI List = GUAMI-1)
    Note over gNB: records GUAMI-1 as unavailable
    UE->>gNB: RRCSetupRequest (5G-S-TMSI Part1)
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (5G-S-TMSI Part2, NAS: Service Request)
    gNB->>AMF2: Initial UE Message (5G-S-TMSI, NAS-PDU: Service Request)
    Note over AMF2: AMFs in the same Set have access to the same UE context data<br/>(recovery procedure depends on deployment and configuration)

The 5G-S-TMSI does not contain the complete GUAMI (TS 23.003 Clause 2.10.1). In this example the gNB selects the destination using available configuration and identifiers (TS 38.331 Clause 5.3.3, TS 38.413 Clause 8.6.1).

This is why the AMF Set matters as the unit of redundancy.

AMF Reallocation — Rerouting Registration to the Appropriate AMF

Diagram 1 — Procedure — Direct AMF Reroute

Original explanation, assumptions and specification references

The Initial AMF forwards the NAS request directly to the Target AMF. If a security association has already been established between the UE and Initial AMF, this direct path is used rather than rerouting via the RAN (TS 23.502 Clause 4.2.2.2.3 steps 6–7(A)).

sequenceDiagram
    participant RAN as NG-RAN
    participant I as Initial AMF
    participant NSSF
    participant NRF
    participant T as Target AMF
    alt From CM-IDLE
        RAN->>I: Initial UE Message (NAS-PDU: Registration Request)
    else From CM-CONNECTED
        RAN->>I: Uplink NAS Transport (NAS-PDU: Registration Request)
    end
    Note over I: Obtain needed identity / subscription data and decide on reallocation
    opt Slice selection is required
        I->>NSSF: Nnssf_NSSelection_Get<br/>GET /nnssf-nsselection/v2/network-slice-information
        NSSF-->>I: Nnssf_NSSelection_Get response<br/>HTTP 200 OK (Allowed NSSAI, AMF Set, etc.)
    end
    opt Target AMF discovery is required
        I->>NRF: Nnrf_NFDiscovery_Request<br/>GET /nnrf-disc/v1/nf-instances
        NRF-->>I: Nnrf_NFDiscovery_Request response<br/>HTTP 200 OK (candidate AMF addresses / capabilities, etc.)
    end
    I->>T: Namf_Communication_N1MessageNotify<br/>POST {n1NotifyCallbackUri} (Registration Request, AN information, available SUPI / MM Context, etc.)
    T-->>I: Namf_Communication_N1MessageNotify response<br/>HTTP 204 No Content
    Note over T: Continue Registration using transferred information
    Note over RAN,T: The first subsequent N2 message updates the UE's termination<br/>Its type depends on the subsequent procedure

The notification uses the callback URI registered with the NRF (TS 29.518 Clause 5.2.2.3.5.2); selection and discovery are specified in TS 29.531 Clause 5.2.2.2.2 and TS 29.510 Clause 5.3.2.2.

Step-by-step explanation

  1. Receive the registration request: The entry point is Initial UE Message from CM-IDLE, or Uplink NAS Transport for registration while CM-CONNECTED.
  2. Determine the target: Use available subscription and slice information. NRF discovery can be omitted under conditions such as addresses being locally available.
  3. Transfer the request and context directly: Namf_Communication_N1MessageNotify carries not only the NAS request but also AN access information, available SUPI/MM Context and other applicable information. Unavailable information is not assumed to be included.
  4. The Target AMF continues registration: This is not merely an instruction for the UE to start registration again from scratch. The specification also defines preferential use of a 5G security context received from the Initial AMF.
  5. Update the NG-RAN termination: The Target AMF's first N2 message supplies the Initial AMF name and Target AMF-side UE NGAP ID, among other information. The complete exchange through Registration Accept/Complete is omitted.

Reference: TS 23.502 Clause 4.2.2.2.3 steps 1, 6, 7(A) and 8.

Diagram 2 — Procedure — Reroute via NG-RAN

Original explanation, assumptions and specification references

This path applies when the UE registers from CM-IDLE without an established security association with the Initial AMF, and the specification's RAN-assisted rerouting conditions are met. Do not fold cases such as receiving a candidate AMF list from the NSSF into the same branch (TS 23.502 Clause 4.2.2.2.3 step 7(B)).

sequenceDiagram
    participant RAN as NG-RAN
    participant I as Initial AMF
    participant T as Target AMF
    RAN->>I: Initial UE Message (Registration Request)
    Note over I: Choose RAN-assisted rerouting based on slice information, etc.
    I-->>RAN: REROUTE NAS REQUEST<br/>(AMF Set ID, Registration Request, Allowed NSSAI, etc.)
    Note over RAN: Select Target AMF using supplied information
    RAN->>T: INITIAL UE MESSAGE<br/>(rerouted Registration Request, etc.)
    Note over T: Continue Registration

Step-by-step explanation

  1. Receive Initial UE Message: This path covers entry from CM-IDLE.
  2. The Initial AMF asks the RAN to reroute: The formal NGAP procedure is Reroute NAS Request. The request includes information such as AMF Set ID needed to select the next AMF.
  3. NG-RAN forwards to the Target AMF: If supported, NG-RAN reroutes Initial UE Message according to the specified AMF Set and other supplied information. Transfer of Allowed NSSAI and related information is also conditional (TS 38.413 Clause 8.6.5).
  4. The Target AMF continues registration: The RAN-assisted path does not transfer the Initial AMF's security context to the Target AMF, so it is not equivalent to direct forwarding.

The paths are not freely interchangeable

Step 7(B) cannot be used for a registration request received in CM-CONNECTED. An established security association with the Initial AMF also requires direct forwarding. RAN-assisted rerouting is not an unconditional fallback whenever N14 is unreachable (TS 23.502 Clause 4.2.2.2.3 steps 6–8).

NG Setup Procedure — What the gNB and AMF Exchange When Establishing N2

Diagram 1 — Call Flow

Original explanation, assumptions and specification references

sequenceDiagram
    participant gNB
    participant AMF
    gNB->>AMF: SCTP INIT
    AMF-->>gNB: SCTP INIT ACK
    gNB->>AMF: SCTP COOKIE ECHO
    AMF-->>gNB: SCTP COOKIE ACK
    Note over gNB,AMF: SCTP Association ESTABLISHED (N2 not yet established)
    gNB->>AMF: NG Setup Request<br/>(Global RAN Node ID, RAN Node Name, Supported TA List, Default Paging DRX)
    Note over AMF: checks PLMN etc. against its own configuration
    alt success
        AMF-->>gNB: NG Setup Response<br/>(AMF Name, Served GUAMI List, Relative AMF Capacity, PLMN Support List)
        Note over gNB,AMF: N2 Ready → UE-associated NGAP can flow
    else failure
        AMF-->>gNB: NG Setup Failure<br/>(Cause, Time to Wait)
        Note over gNB: if Time to Wait is present, wait at least that long before retrying
    end

NG Setup Request — gNB → AMF (TS 38.413 Clause 9.2.6.1)

The gNB tells the AMF "who I am and what I serve."

IE Mandatory/optional Meaning
Global RAN Node ID Mandatory Identifier of the gNB (PLMN + gNB ID). ng-eNB / N3IWF etc. are also distinguished here
RAN Node Name Optional Human-readable name. Handy for trace analysis
Supported TA List Mandatory The TAs served, and the PLMNs and S-NSSAIs per TA
Default Paging DRX Mandatory Paging cycle used when no UE-specific value is given
UE Retention Information Optional Used to agree on whether to re-exchange configuration while retaining UE contexts

This is an excerpt of the main IEs and not exhaustive (optional IEs are added depending on the Release).

Global RAN Node ID
Global RAN Node ID (CHOICE)
├─ Global gNB ID
│   ├─ PLMN Identity
│   └─ gNB ID        ← 22–32 bits (length chosen by the operator)
├─ Global ng-eNB ID
└─ Global N3IWF ID   (TNGF / TWIF / W-AGF etc. added depending on the Release)

The operator chooses the gNB ID length in the range 22–32 bits, and it forms the upper part of the NR Cell Identity (36 bits) (TS 38.413 Clause 9.3.1.6, TS 38.300 Clause 8.2; both clause numbers to be confirmed). It is the most important IE for identifying "which gNB this NG Setup came from" in a trace.

Supported TA List — the most important IE in this chapter
Supported TA List
└─ Supported TA Item (per TA)
    ├─ TAC
    └─ Broadcast PLMN List
        └─ Broadcast PLMN Item (per PLMN)
            ├─ PLMN Identity
            └─ TAI Slice Support List
                ├─ S-NSSAI #1  (SST, SD)
                └─ S-NSSAI #2

The gNB declares to the AMF: "In this TA, I can provide these S-NSSAIs of this PLMN."

Why is it a "List"? A Tracking Area is a unit that groups multiple cells and is the building block of the Registration Area (TAI List) (TS 23.501 Clause 5.3.2.3). The TAC is broadcast per cell (strictly, per PLMN-IdentityInfo within SIB1) in SIB1 (TS 38.331 Clause 6.2.2 / Clause 6.3.2, to be confirmed). Because the cells of a single gNB may belong to different TAs, the gNB enumerates and declares each TA its cells belong to.

gNB-1
├─ Cell A ─┐
├─ Cell B ─┴─ TAC 0x000001 ─┐
└─ Cell C ─── TAC 0x000002 ─┴─► Supported TA List
                                 ├─ Supported TA Item (TAC 0x000001)
                                 └─ Supported TA Item (TAC 0x000002)

If this declaration and the TAC broadcast in each cell's SIB1 disagree, the TAs known to the AMF and the TA the UE sees in its serving cell diverge (for the impact on Paging and the Registration Area, see Tracking Area / TAI / Registration Area). The relationship between TAs and cells is covered in detail there as well.

Term Meaning Specified in
TAC (Tracking Area Code) Code identifying a Tracking Area. 24 bits in 5GS TS 23.003 Clause 28.6 (5GS, to be confirmed) / EPS: Clause 19.4.2.3
TAI (Tracking Area Identity) PLMN ID + TAC TS 23.003 Clause 28.6 (5GS, to be confirmed) / EPS: Clause 19.4.2.3
S-NSSAI Network slice identifier. SST (8 bits, mandatory) + SD (24 bits, optional) TS 23.003 Clause 28.4.2, TS 23.501 Clause 5.15.2.1

A Tracking Area is the unit that makes up a UE's Registration Area (TAI List). From this list the AMF learns "which gNB serves which TA," and sends Paging for a UE in CM-IDLE to the gNBs serving the TAs included in that UE's Registration Area (TS 38.413 Clause 8.5 / TS 23.502 Clause 4.2.3.3, to be confirmed).

What does the AMF check?

The rejection condition that is explicitly specified is when the AMF cannot identify any of the PLMNs (including SNPNs from Rel-16 onward) indicated by the gNB (TS 38.413 Clause 8.7.1.4, to be confirmed). Anything else falls under the generic rule "if the AMF cannot accept the setup, it responds with NG Setup Failure" (Clause 8.7.1.3) and depends on the AMF implementation.

flowchart TD
    R["NG Setup Request received"] --> P{"Can the AMF handle any of<br/>the indicated PLMNs?"}
    P -- "No" --> F["NG Setup Failure<br/>(Cause: Unknown PLMN /<br/>Unknown PLMN or SNPN)"]
    P -- "Yes" --> O{"Are TAC / S-NSSAI etc.<br/>consistent with the AMF configuration?"}
    O -- "decision depends on AMF implementation/configuration" --> S["NG Setup Response<br/>or Failure"]

Handling of TAC and slice mismatches is implementation dependent

Whether the AMF rejects NG Setup or accepts it and deals with the issue in later procedures when "the TAC is not in the AMF's service area" or "the S-NSSAIs don't match" is not uniformly specified; it is AMF implementation/configuration dependent. Check the actual behavior in product documentation and traces.

NG Setup Response — AMF → gNB (TS 38.413 Clause 9.2.6.2)

IE Mandatory/optional Meaning
AMF Name Mandatory Name of the AMF
Served GUAMI List Mandatory GUAMIs served by this AMF (optionally with a Backup AMF Name). See the previous chapter
Relative AMF Capacity Mandatory Capacity relative to other AMFs (0–255)
PLMN Support List Mandatory PLMNs handled by the AMF and the Slice Support List (S-NSSAIs) per PLMN
Criticality Diagnostics Optional Diagnostic information when there was a problem with IEs in the received message
UE Retention Information Optional Agreement on UE context retention (pairs with the Request side)

This is an excerpt of the main IEs and not exhaustive (optional IEs are added depending on the Release).

Relative AMF Capacity — not CPU utilization

Relative AMF Capacity is the weight (weight factor) NG-RAN uses when selecting an AMF (TS 23.501 Clause 5.19.3; clause number to be confirmed). New UEs are distributed to the AMFs with probabilities proportional to this value.

AMF-1: Relative AMF Capacity = 255
AMF-2: Relative AMF Capacity = 128
→ new UEs are distributed roughly 2:1 (details of the distribution are gNB implementation dependent)
  • It is not a real-time value of CPU utilization or load. It is a relative value set by the operator according to the AMFs' capacity. It can be changed later with AMF Configuration Update (TS 38.413 Clause 8.7.3).
  • It does not affect existing UEs, because UEs with a 5G-GUTI / 5G-S-TMSI are returned to their previous AMF by the GUAMI.

Treatment of Relative AMF Capacity = 0

An operational practice of setting the value to 0 during maintenance to "stop attracting new UEs" is sometimes mentioned. However, how far the specification requires NG-RAN to exclude such an AMF from selection is to be confirmed, and the actual behavior is gNB implementation dependent. Also, setting it to 0 does not immediately move existing UEs to another AMF. To move existing UEs, combine it with AMF Status Indication (Unavailable GUAMI) and load re-balancing mechanisms (see the previous chapter).

NG Setup Failure — AMF → gNB (TS 38.413 Clause 9.2.6.3)

IE Mandatory/optional Meaning
Cause Mandatory Reason for failure (TS 38.413 Clause 9.3.1.2; categories Radio Network / Transport / NAS / Protocol / Miscellaneous)
Time to Wait Optional Minimum time the gNB should wait before retrying
Criticality Diagnostics Optional Per-IE diagnostic information

If Time to Wait is included, the gNB must not resend NG Setup to the same AMF until that time has elapsed (TS 38.413 Clause 8.7.1.3). This prevents many gNBs from retrying at once and overwhelming the AMF, for example right after an AMF restart.

Redoing NG Setup can erase UE contexts

NG Setup replaces the existing application-level configuration in both nodes with what is received. In addition, if the NG-RAN node and the AMF do not agree on retaining UE contexts (via the UE Retention Information IE), it erases the existing NGAP UE-related contexts and the related signaling connections, as an NG Reset would (TS 38.413 Clause 8.7.1.1, sub-clause to be confirmed). Be aware that if NG Setup is redone during operation, the N2 contexts of the UEs under that gNB may be lost. The AMF overload state held by the NG-RAN node is also cleared (same clause).

Diagram 2 — From NG Setup to UE Registration

Original explanation, assumptions and specification references

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    gNB->>AMF: SCTP INIT
    AMF-->>gNB: SCTP INIT ACK
    gNB->>AMF: SCTP COOKIE ECHO
    AMF-->>gNB: SCTP COOKIE ACK
    gNB->>AMF: NG Setup Request
    AMF-->>gNB: NG Setup Response
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Registration Request)
    gNB->>AMF: Initial UE Message (NAS-PDU: Registration Request)
    Note over AMF: Step 3: per-UE procedures begin<br/>(Authentication / Security / Registration Accept)

This example shows successful connection establishment (RFC 9260 Clause 5.1, TS 38.331 Clause 5.3.3, TS 38.413 Clause 8.7.1 / Clause 8.6.1).

Before the Initial UE Message, which is the first thing to appear in Registration, SCTP → NG Setup is always already done. The Served GUAMI List and Relative AMF Capacity that the gNB uses to select the AMF for a UE are also information received in this NG Setup.


NG Reset — Resetting UE-associated N2 Contexts

Diagram 1 — Procedure — AMF-initiated NG Reset

Original explanation, assumptions and specification references

The AMF resets UE-associated information on the NG interface in this example. NG Reset uses non-UE-associated signalling (TS 38.413 Clause 8.7.4.1 / Clause 8.7.4.2.1).

sequenceDiagram
    participant AMF
    participant RAN as NG-RAN
    Note over AMF: UE-related transaction information is lost
    AMF->>RAN: NG RESET<br/>(Cause, Reset Type = Reset All)
    Note over RAN: Release target UEs' NG / Uu resources<br/>Delete UE contexts and NGAP IDs
    RAN-->>AMF: NG RESET ACKNOWLEDGE
    Note over AMF,RAN: Configuration exchanged during NG Setup is unchanged

Step-by-step explanation

  1. The AMF specifies the scope: Cause and Reset Type state why and what to reset.
  2. NG-RAN processes the targets: It releases the specified UE-associated NG/Uu resources and contexts.
  3. Return the ACK: It is sent after releasing NG resources and UE NGAP IDs. There is no need to wait for radio-resource release to finish (TS 38.413 Clause 8.7.4.2.1).
  4. Keep the meaning bounded: The ACK acknowledges Reset processing. It does not confirm that all UEs have reconnected or re-registered.

Diagram 2 — Procedure — NG-RAN-initiated Partial Reset

Original explanation, assumptions and specification references

This example resets a subset of UE-associated connections following a failure on the NG-RAN side (TS 38.413 Clause 8.7.4.2.2).

sequenceDiagram
    participant RAN as NG-RAN
    participant AMF
    Note over RAN: Transaction information is lost for some UEs
    RAN->>AMF: NG RESET<br/>(Cause, Part of NG interface, UE connection list)
    Note over AMF: Release listed UEs' NG resources and NGAP IDs
    AMF-->>RAN: NG RESET ACKNOWLEDGE<br/>(UE-associated Logical NG-connection List)
    Note over RAN,AMF: UEs outside the target list are not all reset

Step-by-step explanation

  1. List the target UEs: A partial Reset sends the target AMF UE NGAP IDs and/or RAN UE NGAP IDs.
  2. The AMF releases the relevant resources: It processes the specified UE-associated NG resources and NGAP IDs. Do not reinterpret Reset as unconditional deletion of AMF subscriber data or every PDU Session.
  3. Include the corresponding list in the ACK: The specification requires the targets to be returned in the received order, including unknown UE-associated connections. Empty received Items may be omitted under the specified conditions (TS 38.413 Clause 8.7.4.2.2).
  4. Check cancellation of concurrent procedures: Ongoing procedures for the target UE on the same NG interface are aborted, except another NG Reset. Check subsequent signalling to establish whether communication recovers after Reset (TS 38.413 Clause 8.7.4.2.2).

Tracking Area / TAI / Registration Area — How the 5GC Keeps Track of Where a UE Is

Original explanation, assumptions and specification references

A CM-IDLE UE has no N2/N3 connection, so downlink data cannot be delivered as is. The AMF sends Paging to the gNBs serving the TAs included in the UE's Registration Area (TS 23.502 Clause 4.2.3.3).

sequenceDiagram
    participant DN as Internet
    participant UPF
    participant SMF
    participant AMF
    participant gNB
    participant UE
    Note over DN,UPF: Downlink data arrives
    UPF->>SMF: PFCP Session Report Request (Downlink Data Report)
    SMF-->>UPF: PFCP Session Report Response
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 202 Accepted (ATTEMPTING_TO_REACH_UE)
    Note over AMF: UE is CM-IDLE → select gNBs serving TAs in the Registration Area
    AMF->>gNB: Paging (NGAP, TAI List for Paging)
    gNB->>UE: Paging (RRC)
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Service Request)
    gNB->>AMF: Initial UE Message (NAS-PDU: Service Request)
    Note over UE,AMF: CM-CONNECTED → re-establish the User Plane

This example shows PFCP reporting and Service Request forwarding (TS 29.244 Clause 7.5.8–Clause 7.5.9, TS 29.518 Clause 5.2.2.3.1, TS 38.331 Clause 5.3.3, TS 38.413 Clause 8.6.1).

  • NGAP Paging carries the TAI List for Paging (mandatory IE), and the gNB pages over the radio in its own cells belonging to those TAs (TS 38.413 Clause 8.5.1 / Clause 9.2.4.1, to be confirmed).
  • The AMF can decide "which gNBs to send Paging to" because it remembers the gNB⇔TA mapping from the Supported TA List in NG Setup (previous chapter).
  • Paging strategies such as "page the last known cell / TA first and widen the area if there is no response" depend on operator configuration and AMF implementation (TS 23.501 Clause 5.4.3, to be confirmed).

For details, see Paging / Service Request. The CM-IDLE → CM-CONNECTED transition and the Service Request IEs are covered in depth in the next chapter (CM-IDLE / CM-CONNECTED and Service Request).

CM-IDLE / CM-CONNECTED and Service Request — Keeping Registration State and CM State Apart

Diagram 1 — Call Flow (gNB-initiated, user inactivity example)

Original explanation, assumptions and specification references

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant SMF
    participant UPF
    Note over UE,gNB: No data for a while (decision is gNB implementation dependent)
    gNB->>AMF: NGAP UE Context Release Request<br/>(Cause, PDU Session Resource List)
    AMF->>gNB: NGAP UE Context Release Command<br/>(UE NGAP IDs, Cause)
    gNB->>UE: RRCRelease
    gNB->>AMF: NGAP UE Context Release Complete<br/>(User Location Information, Recommended Cells for Paging, etc.)
    Note over gNB,AMF: UE-associated logical NG-connection released<br/>AMF UE NGAP ID / RAN UE NGAP ID become invalid
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (upCnxState = DEACTIVATED)
    SMF->>UPF: PFCP Session Modification Request<br/>(remove AN Tunnel Info, DL FAR to buffer / notify)
    UPF-->>SMF: PFCP Session Modification Response
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 204 No Content
    Note over AMF: UE is CM-IDLE (still RM-REGISTERED)
Step Message Interface What changes Specification
1 UE Context Release Request N2 The gNB requests release. Cause (e.g. user inactivity in the Radio Network group, to be confirmed) and the list of PDU Sessions with an active N3 TS 38.413 Clause 8.3.2
2 UE Context Release Command N2 The AMF orders the release TS 38.413 Clause 8.3.3
3 RRC Release Uu Releases the UE's RRC connection → the UE goes to CM-IDLE (5GMM-IDLE) TS 38.331 (out of scope)
4 UE Context Release Complete N2 Release of the gNB's UE Context and the NGAP IDs is complete. May return location information and recommended information for Paging TS 38.413 Clause 8.3.3
5 Nsmf_PDUSession_UpdateSMContext N11 Notifies the SMF, per PDU Session, of User Plane deactivation (upCnxState = DEACTIVATED) TS 23.502 Clause 4.2.6, TS 29.502 Clause 5.2.2.3.2 (to be confirmed)
6 PFCP Session Modification N4 Removes the AN Tunnel Info (gNB-side F-TEID) from the UPF and switches DL to buffer / notify TS 23.502 Clause 4.2.6, TS 29.244 Clause 7.5.4

When the AMF initiates, step 1 is absent and the AMF starts with the UE Context Release Command. A typical case is the AMF releasing the NAS signalling connection after Registration completes when there is no Follow-on request (TS 24.501 Clause 5.3.1.3, TS 23.502 Clause 4.2.2.2.2; exact location to be confirmed). When to release is a local decision of the AMF.

The Cause in UE Context Release Request and the inactivity timer

"After how many seconds without data to release" (the so-called inactivity timer) is a gNB-side setting / implementation matter whose value 3GPP does not define. Too short and the IDLE ⇔ CONNECTED round trips (a storm of Service Requests) increase; too long and the UE's battery and the gNB's resources are consumed.

Diagram 2 — First half of Network-triggered — up to Paging

Original explanation, assumptions and specification references

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant SMF
    participant UPF
    Note over UPF: DL packet arrives. DL FAR is BUFF + NOCP
    UPF->>SMF: PFCP Session Report Request<br/>(Report Type = DLDR, PDR ID)
    SMF-->>UPF: PFCP Session Report Response
    SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages (PDU Session ID, N2 SM information)
    AMF-->>SMF: Namf_Communication_N1N2MessageTransfer response<br/>HTTP 202 Accepted (ATTEMPTING_TO_REACH_UE)
    AMF->>gNB: Paging (NGAP, UE Paging Identity = 5G-S-TMSI, TAI List for Paging)
    gNB->>UE: Paging (RRC)
    Note over UE: From here the flow is the same as a UE-triggered Service Request<br/>Service type = mobile terminated services
  • When the AMF receives the N1N2MessageTransfer from the SMF and the UE is CM-IDLE, the AMF pages it and first replies that it is "attempting to reach the UE" (TS 23.502 Clause 4.2.3.3, TS 29.518 Clause 5.2.2.3.1; details of the response to be confirmed). If the UE is CM-CONNECTED, no Paging is needed and the AMF goes straight to N2 PDU Session Resource Setup.
  • If the UE does not respond, the AMF notifies the SMF of the N1N2 transfer failure, and the SMF can instruct the UPF how to handle the buffered data (TS 23.502 Clause 4.2.3.3, to be confirmed).
  • A UE in MICO mode is considered unreachable while CM-IDLE (except during an Active Time, if one has been granted) and is not paged (TS 23.501 Clause 5.4.1.3, to be confirmed). It is not true that "a CM-IDLE UE can always be paged."
  • For how the Paging destination (TAI List for Paging) is derived from the Registration Area, see the previous chapter.

Diagram 3 — UE-triggered Service Request and User Plane activation

Original explanation, assumptions and specification references

sequenceDiagram
    participant UE
    participant gNB
    participant AMF
    participant SMF
    participant UPF
    UE->>gNB: RRCSetupRequest
    gNB-->>UE: RRCSetup
    UE->>gNB: RRCSetupComplete (NAS: Service Request)
    gNB->>AMF: NGAP Initial UE Message<br/>(new RAN UE NGAP ID, 5G-S-TMSI, NAS-PDU)
    Note over AMF: Identify the existing UE Context by 5G-S-TMSI<br/>Allocate a new AMF UE NGAP ID<br/>Verify NAS integrity (re-authenticate only if needed)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (upCnxState = ACTIVATING)
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 200 OK (N2 SM information, UPF-side N3 F-TEID, QoS Flows, etc.)
    AMF->>gNB: NGAP Initial Context Setup Request<br/>(Security Key, PDU Session Resource Setup List, NAS: Service Accept)
    gNB->>UE: SecurityModeCommand (RRC, AS security)
    UE-->>gNB: SecurityModeComplete (RRC)
    gNB->>UE: RRCReconfiguration (DRB)
    UE-->>gNB: RRCReconfigurationComplete
    Note over UE,UPF: UL can now flow gNB → UPF
    gNB->>AMF: NGAP Initial Context Setup Response<br/>(gNB-side N3 F-TEID = new TEID)
    AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (N2 SM information)
    SMF->>UPF: PFCP Session Modification Request<br/>(DL FAR = FORW, new gNB F-TEID)
    UPF-->>SMF: PFCP Session Modification Response
    SMF-->>AMF: Nsmf_PDUSession_UpdateSMContext response<br/>HTTP 200 OK (upCnxState = ACTIVATED)
    Note over UE,UPF: DL flows too. Buffered DL data is sent out

See TS 38.331 Clause 5.3.3–Clause 5.3.5 for the RRC messages and TS 29.502 Clause 5.2.2.3 for SBI.

Stage Main messages Points to check Specification
NAS acceptance Service Request (UE → AMF) ngKSI, Service type, 5G-S-TMSI (cleartext IEs). PDU Sessions to activate are indicated in the Uplink data status IE, and the UE-side PDU Session state in the PDU session status IE TS 24.501 Clause 8.2.16, Clause 4.4.6 (to be confirmed)
N2 establishment Initial UE Message (gNB → AMF) New RAN UE NGAP ID, 5G-S-TMSI, User Location Information TS 38.413 Clause 8.6.1
SM activation UpdateSMContext (AMF → SMF) upCnxState = ACTIVATING. The SMF returns N2 SM information (UPF-side N3 F-TEID, etc.) TS 23.502 Clause 4.2.3.2, TS 29.502 Clause 5.2.2.3.2 (to be confirmed)
RAN configuration Initial Context Setup Request / Response Request: Security Key, PDU Session Resource Setup Request List, NAS (Service Accept). Response: gNB-side N3 F-TEID TS 38.413 Clause 8.3.1
UP update UpdateSMContext → PFCP Session Modification Set the DL FAR to FORW and put the new gNB F-TEID in Outer Header Creation TS 23.502 Clause 4.2.3.2, TS 29.244 Clause 7.5.4

Which PDU Sessions does a Service Request wake up?

The information called "List Of PDU Sessions To Be Activated" in TS 23.502 is carried in NAS (TS 24.501) as the Uplink data status IE (Clause 9.11.3.57, to be confirmed). In 5GS, not all PDU Sessions are necessarily activated together; the targets are the PDU Sessions on which the UE wants to send UL and the PDU Sessions for which DL is waiting in the network. In addition, if the UE's and the network's view diverge in the PDU session status IE (Clause 9.11.3.44, to be confirmed), the network may release that PDU Session locally (TS 24.501 Clause 5.6.1.4, to be confirmed). These are non-cleartext IEs, so when a security context exists they are carried ciphered inside the NAS message container.

Where the Service Accept travels

The Service Accept (NAS) typically arrives as a NAS-PDU inside the AMF → gNB N2 request (the Initial Context Setup Request in the figure above) (TS 23.502 Clause 4.2.3.2). It may include PDU session status, PDU session reactivation result, etc. (TS 24.501 Clause 8.2.17 Service accept). The detailed conditions for sending a Service Accept are described differently across Releases and are to be confirmed.