Basic Procedures¶
All Callflows / Sequence diagrams from Level 2
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.
Initial Registration¶
Diagram 1 — Procedure — Call Flow¶
Original explanation, assumptions and specification references
This is the heart of this page. The main steps of Initial Registration, conforming to 3GPP TS 23.502 Clause 4.2.2.2.2 (General Registration), are shown in a Mermaid sequenceDiagram.
Prerequisite: NG Setup must be done
Before accepting a UE, the N2 (NG-C) between the gNB and the AMF must be established via NG Setup (TS 38.413). If it is not established, Registration will not proceed (see Trouble Shooting).
{supiOrSuci}, {ueId}, {supi}, and {authCtxId} identify the subscriber or authentication context. HTTP responses illustrate successful variants (TS 29.503 Clause 5.2.2.2.3 / Clause 5.2.2.3 / Clause 5.3.2.2 / Clause 6.3.3.2.4.2, TS 29.509 Clause 5.2.2.2.2, TS 29.507 Clause 4.2.2).
sequenceDiagram
participant UE
participant RAN as (R)AN / gNB
participant AMF
participant AUSF
participant UDM
participant PCF
UE->>RAN: RRCSetupRequest<br/>(RRC)
RAN->>UE: RRCSetup<br/>(RRC)
UE->>RAN: RRCSetupComplete<br/>(RRC#59; NAS: Registration Request)
Note right of RAN: TS 24.501 Clause 5.5.1
RAN->>AMF: Initial UE Message<br/>(NGAP#59; NAS-PDU: Registration Request)
Note right of RAN: Perform AMF selection
opt New registration / 5G-GUTI unknown or invalid
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Identity Request)
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Identity Response, SUCI)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Response)
end
AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP POST /nausf-auth/v1/ue-authentications)
AUSF->>UDM: Nudm_UEAuthentication_Get<br/>(HTTP POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data)
UDM-->>AUSF: 200 OK<br/>(HTTP#59; HE AV: RAND, AUTN, XRES*, KAUSF)
Note right of AUSF: AUSF derives HXRES*/KSEAF (TS 33.501 Clause 6.1.3.2)
AUSF-->>AMF: 201 Created<br/>(HTTP#59; RAND, AUTN, HXRES*)
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request, RAND, AUTN)
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Response, RES*)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Response)
AMF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP PUT /nausf-auth/v1/ue-authentications/{authCtxId}/5g-aka-confirmation#59; RES*)
AUSF-->>AMF: 200 OK<br/>(HTTP#59; authResult: SUCCESS, KSEAF)
Note over UE,AUSF: 5G-AKA / TS 33.501 Clause 6.1
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Security Mode Command)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Security Mode Command)
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Security Mode Complete)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Security Mode Complete)
Note over UE,AMF: NAS security established / TS 24.501 Clause 5.4.2
AMF->>UDM: Nudm_UECM_Registration<br/>(HTTP PUT /nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access)
UDM-->>AMF: 201 Created<br/>(HTTP)
AMF->>UDM: Nudm_SDM_Get<br/>(HTTP GET /nudm-sdm/v2/{supi}/am-data)
UDM-->>AMF: 200 OK<br/>(HTTP#59; Access and Mobility Subscription Data)
AMF->>UDM: Nudm_SDM_Subscribe<br/>(HTTP POST /nudm-sdm/v2/{ueId}/sdm-subscriptions)
UDM-->>AMF: 201 Created<br/>(HTTP)
opt Conditional (configuration/situation dependent)
AMF->>PCF: Npcf_AMPolicyControl_Create<br/>(HTTP POST /npcf-am-policy-control/v1/policies)
PCF-->>AMF: 201 Created<br/>(HTTP#59; AM Policy)
end
AMF->>RAN: Initial Context Setup Request<br/>(NGAP#59; NAS-PDU: Registration Accept, security key)
RAN->>UE: SecurityModeCommand<br/>(RRC#59; AS security)
UE->>RAN: SecurityModeComplete<br/>(RRC)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Registration Accept, 5G-GUTI, allowed NSSAI)
RAN-->>AMF: Initial Context Setup Response<br/>(NGAP)
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Registration Complete)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Registration Complete)
Note over UE,AMF: Registration complete / 5GMM-REGISTEREDStep-by-step explanation (related transmissions are grouped)¶
- UE→(R)AN: establish an RRC connection (radio-side outline) and carry the Registration Request (NAS).
- (R)AN→AMF: the gNB puts the NAS onto an Initial UE Message (NGAP) and sends it. At the same time it performs AMF selection (choosing an appropriate AMF).
- (Only for new registration / when the GUTI is unknown or invalid) AMF→UE Identity Request / UE→AMF Identity Response (SUCI). When the 5G-GUTI is valid, this identity request may be omitted (it varies with conditions = situation dependent).
- Authentication (5G-AKA): retrieve the authentication vector via AMF→AUSF Nausf_UEAuthentication_Authenticate and AUSF→UDM Nudm_UEAuthentication_Get. Perform challenge/response via AMF→UE Authentication Request (RAND, AUTN) and UE→AMF Authentication Response (RES*). When the 5G-GUTI is valid and the security context can be reused, authentication can sometimes be omitted (omission depends on conditions = situation dependent).
- Security establishment: AMF→UE Security Mode Command / UE→AMF Security Mode Complete. This encrypts and integrity-protects the subsequent NAS.
- UDM coordination: AMF→UDM Nudm_UECM_Registration (records with the UDM which AMF this UE is registered to), Nudm_SDM_Get (retrieves subscriber data), Nudm_SDM_Subscribe (subscribes to notifications of data changes).
- (Optional/conditional) AMF→PCF Npcf_AMPolicyControl_Create to retrieve AM policy (configuration/situation dependent).
- Accept: The AMF places Registration Accept in the NAS-PDU of Initial Context Setup Request (NGAP). The RAN establishes AS security, delivers the NAS in DLInformationTransfer, and returns Initial Context Setup Response.
- Complete: UE→AMF Registration Complete (NAS). This is a confirmation that the procedure has completed; the UE's transition to 5GMM-REGISTERED occurs at the moment the Registration Accept is received (TS 24.501 Clause 5.5.1.2.4).
Conditional branches are situation/implementation dependent
Of the above, the Identity request (step 3), whether authentication can be omitted (step 4), and PCF coordination (step 7) may be omitted or changed depending on the presence of a 5G-GUTI/security context, the configuration, and operator policy. Because 3GPP TS 23.502 Clause 4.2.2.2.2 contains many optional/conditional steps, the specific omission conditions must be checked against the spec individually (some of the detailed branching conditions are to be confirmed).
Reference: TS 23.502 Clause 4.2.2.2.2 (the overall General Registration procedure), TS 24.501 Clause 5.5.1 (the NAS-side Registration procedure).
Registration Reject / Retry¶
Diagram 1 — Procedure — Registration Reject / Retry¶
Original explanation, assumptions and specification references
In this example, a UE performing initial PLMN registration for normal services receives a Reject containing a valid, non-zero and non-deactivated T3346 value. A retry is not guaranteed to succeed (TS 24.501 Clause 5.5.1.2.5).
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant AMF
UE->>RAN: RRCSetupRequest<br/>(RRC)
RAN->>UE: RRCSetup<br/>(RRC)
UE->>RAN: RRCSetupComplete<br/>(RRC#59; NAS: Registration Request)
RAN->>AMF: Initial UE Message<br/>(NGAP#59; NAS-PDU: Registration Request)
Note over AMF: Reject registration using general NAS congestion control
AMF-->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Registration Reject, cause 22, T3346 value)
RAN-->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Registration Reject)
Note over UE: Abort registration and enter<br/>5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION
alt Reject is integrity protected
Note over UE: Start T3346 with the received value
else Not integrity protected
Note over UE: Start T3346 with a random value from the specified range
end
Note over UE: Wait before a normal registration retry
opt Retry is permitted and the RRC connection is still retained
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Registration Request)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Registration Request)
endStep-by-step explanation¶
- Request initial registration: NG-RAN forwards the UE's NAS request to the AMF.
- The AMF returns the rejection reason: General NAS congestion control uses 5GMM cause 22 and a T3346 value. Distinguish an explicit Reject from no response.
- The UE aborts the registration attempt: Under this cause's conditions, it sets the update status to
5U2 NOT UPDATED, resets the registration attempt counter and enters5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION. - Determine the wait from the protection status: For a Reject without integrity protection, the UE does not simply use the received timer value. It stops any running T3346 before starting the new one.
- Retry when required: When T3346 expires or is stopped, the UE restarts initial registration if registration is still needed. Emergency and priority services follow separate conditions and are excluded here.
Reference: TS 24.501 Clause 5.5.1.2.5. See TS 24.501 Clause 5.1.3.2 for state definitions and Clause 5.2.2.3.3 for retry behavior in ATTEMPTING-REGISTRATION.
Not every Reject means waiting for T3346
This diagram covers specific conditions for cause 22. Check abnormal-case rules for a zero, deactivated or missing T3346 value. Other causes change PLMN/TA selection, registration information and retry conditions. Do not assume a fixed duration; check the received IE and protection status (TS 24.501 Clause 5.5.1.2.5 / Clause 5.5.1.2.7).
Authentication — Primary Authentication (5G-AKA / EAP-AKA')¶
Diagram 1 — (A) 5G-AKA Call Flow¶
Original explanation, assumptions and specification references
{supiOrSuci} identifies the subscriber and {authCtxId} the AUSF authentication context. HTTP responses illustrate successful variants (TS 29.503 Clause 6.3.3.2.4.2, TS 29.509 Clause 5.2.2.2.2 / Clause 5.2.2.2.3).
sequenceDiagram
participant UE as UE / USIM
participant RAN as NG-RAN
participant SEAF as AMF / SEAF
participant AUSF
participant UDM as UDM (ARPF / SIDF)
Note over UE,SEAF: Auth trigger (SUCI or SUPI already determined)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP POST /nausf-auth/v1/ue-authentications#59; SUCI/SUPI, SN-name)
Note right of SEAF: TS 33.501 Clause 6.1.2
AUSF->>UDM: Nudm_UEAuthentication_Get<br/>(HTTP POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data#59; SN-name)
Note right of UDM: If SUCI, SIDF de-conceals to SUPI<br/>TS 33.501 Clause 6.12.2
Note right of UDM: ARPF selects scheme=5G-AKA and<br/>generates HE AV(RAND,AUTN,XRES*,KAUSF)<br/>TS 33.501 Clause 6.1.3.2
UDM-->>AUSF: 200 OK<br/>(HTTP#59; 5G HE AV: RAND, AUTN, XRES*, KAUSF#59; SUPI)
Note right of AUSF: AUSF derives HXRES* from XRES* and<br/>KSEAF from KAUSF → into SE AV
AUSF-->>SEAF: 201 Created<br/>(HTTP#59; 5G SE AV: RAND, AUTN, HXRES*)
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request, RAND, AUTN, ngKSI, ABBA)
Note right of UE: USIM verifies AUTN(MAC/SQN)→<br/>computes RES→ME(UE) generates RES*
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Response, RES*)
RAN->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Response)
Note right of SEAF: SEAF computes HRES* from RES* and<br/>verifies against HXRES* (first-stage check)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP PUT /nausf-auth/v1/ue-authentications/{authCtxId}/5g-aka-confirmation#59; RES*)
Note right of AUSF: AUSF verifies RES* against XRES* (final decision)<br/>TS 33.501 Clause 6.1.3.2
AUSF-->>SEAF: 200 OK<br/>(HTTP#59; authResult: SUCCESS, KSEAF)
Note over UE,AUSF: Success→KSEAF established→on to KAMF derivationStep-by-step explanation (related transmissions are grouped)¶
- SEAF→AUSF: Starts authentication with Nausf_UEAuthentication_Authenticate. Passes the SUCI (first time) or the SUPI (when the GUTI is known) and the SN-name (Serving Network name).
- AUSF→UDM: Issues Nudm_UEAuthentication_Get.
- (Inside UDM) SUCI de-concealment: If it arrived as a SUCI, the SIDF de-conceals it to SUPI using the home private key (TS 33.501 Clause 6.12.2).
- (Inside UDM) AV generation: The ARPF selects the scheme (5G-AKA) and generates the 5G HE AV = RAND, AUTN, XRES*, KAUSF (TS 33.501 Clause 6.1.3.2).
- UDM→AUSF: Returns the HE AV and the SUPI.
- (Inside AUSF) Derivation: The AUSF computes XRES*→HXRES* and KAUSF→KSEAF, and builds the 5G SE AV = RAND, AUTN, HXRES* (it holds KSEAF at this point and hands it over after success).
- AUSF→SEAF: Passes the SE AV (RAND, AUTN, HXRES*).
- SEAF→UE: Authentication Request (NAS). In addition to RAND and AUTN, it includes ngKSI (the key set identifier) and ABBA (the backward-compatibility protection parameter).
- (Inside USIM) Verification and computation: The USIM verifies the MAC and SQN of AUTN (confirming the network's legitimacy). If OK, it computes RES and generates RES*.
- UE→SEAF: Authentication Response (NAS: RES*).
- (Inside SEAF) First-stage check: The SEAF computes RES*→HRES* and verifies it against HXRES*. Even on a mismatch, it sends RES* to the AUSF and waits for the response before following the rejection or identification branch (TS 33.501 Clause 6.1.3.2.2).
- SEAF→AUSF: Sends RES* and requests the final verification.
- (Inside AUSF) Final check: The AUSF verifies RES* against XRES* (TS 33.501 Clause 6.1.3.2).
- AUSF→SEAF: On success, returns KSEAF. From here the SEAF derives KAMF and proceeds to establishing subsequent NAS security.
Why the two-stage check of RES* and HXRES*?
The SEAF's HRES*/HXRES* check and the AUSF's RES*/XRES* check are separate verification points. A SEAF mismatch does not skip confirmation with the AUSF. If either check fails, the identity-dependent rejection or identification branch applies; see Authentication Failure / Resync (TS 33.501 Clause 6.1.3.2.2).
Diagram 2 — (B) EAP-AKA' Call Flow¶
Original explanation, assumptions and specification references
EAP-AKA' runs AKA' on top of the EAP (Extensible Authentication Protocol) framework. The AUSF behaves as the EAP server and the UE as the EAP peer, while the AMF(SEAF) merely relays the EAP messages over NAS (passthrough) (TS 33.501 Clause 6.1.3.1; EAP-AKA' itself is defined in RFC 9048, which obsoletes RFC 5448, and the RFC referenced by TS 33.501 is Release dependent, to be confirmed).
sequenceDiagram
participant UE as UE / USIM (EAP peer)
participant RAN as NG-RAN
participant SEAF as AMF / SEAF (passthrough)
participant AUSF as AUSF (EAP server)
participant UDM as UDM (ARPF / SIDF)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP POST /nausf-auth/v1/ue-authentications#59; SUCI/SUPI, SN-name)
AUSF->>UDM: Nudm_UEAuthentication_Get<br/>(HTTP POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data#59; SN-name)
Note right of UDM: SIDF de-conceals SUCI / ARPF selects scheme=EAP-AKA'<br/>generates AV(RAND,AUTN,XRES,CK',IK')<br/>TS 33.501 Clause 6.1.3.1
UDM-->>AUSF: 200 OK<br/>(HTTP#59; EAP-AKA' AV, SUPI)
AUSF-->>SEAF: 201 Created<br/>(HTTP#59; EAP-Request/AKA'-Challenge)
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request / EAP)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request / EAP-Request/AKA'-Challenge)
Note right of UE: USIM verifies AUTN→computes RES→computes MAC
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Response / EAP-Response/AKA'-Challenge)
RAN->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Response / EAP)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP POST /nausf-auth/v1/ue-authentications/{authCtxId}/eap-session#59; EAP-Response/AKA'-Challenge)
Note right of AUSF: AUSF verifies RES against XRES and the MAC<br/>on success, derives KAUSF→KSEAF
AUSF-->>SEAF: 200 OK<br/>(HTTP#59; EAP-Success, KSEAF)
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Result / EAP-Success)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Result / EAP-Success)
Note over UE,AUSF: Success→KSEAF establishedStep-by-step explanation (related transmissions are grouped)¶
1-2. SEAF→AUSF→UDM is the same entry point as 5G-AKA (Nausf → Nudm_UEAuthentication_Get). 3. (Inside UDM) The SIDF de-conceals the SUCI, the ARPF selects scheme=EAP-AKA' and generates the AV for EAP-AKA' (RAND, AUTN, XRES, CK', IK') (TS 33.501 Clause 6.1.3.1). 4. UDM→AUSF: Returns the AV and the SUPI. 5. AUSF→SEAF→UE: The EAP-Request/AKA'-Challenge (RAND, AUTN, MAC), which the SEAF encapsulates in NAS (Authentication Request) and sends to the UE. 6. (Inside USIM) AUTN verification → RES computation → response MAC computation. 7. UE→SEAF→AUSF: The EAP-Response/AKA'-Challenge (RES, MAC) is carried over NAS to the AUSF. 8. (Inside AUSF) Verifies RES against XRES and the MAC. On success, derives KAUSF→KSEAF. 9. AUSF→SEAF→UE: Notifies EAP-Success (carried as Authentication Result in NAS). KSEAF is passed to the SEAF in the Nausf response.
The biggest difference between 5G-AKA and EAP-AKA'
- 5G-AKA: Handles RES*/XRES* with 3GPP-specific messages. The HRES*/HXRES* first-stage check is at the SEAF.
- EAP-AKA': Uses the IETF EAP framework, with round trips of EAP-Request/Response/Success. The SEAF passes EAP through (verification is consolidated at the AUSF). EAP-AKA' is defined in RFC 9048 (obsoletes RFC 5448; the RFC referenced by TS 33.501 is Release dependent, to be confirmed). In both, the underlying AKA (K, RAND, AUTN, SQN) is the same, and the UDM is the one that selects the scheme.
Authentication Failure / Resync¶
Diagram 1 — Procedure — MAC Failure¶
Original explanation, assumptions and specification references
This diagram shows the branch where the network chooses to identify the UE again to investigate an incorrect 5G-GUTI-to-SUPI mapping. MAC failure alone does not prove a K/OPc mismatch (TS 24.501 Clause 5.4.1.3.7 c).
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant AMF as AMF / SEAF
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request, RAND, AUTN, ngKSI, ABBA)
Note over UE: AUTN MAC verification fails
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Failure, cause 20)
RAN-->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Failure)
Note over UE,AMF: UE starts T3520#59; network stops T3560
opt Network chooses re-identification after the first failure
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Identity Request, SUCI)
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Identity Response, SUCI)
RAN-->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Response)
alt Incorrect 5G-GUTI-to-SUPI mapping
Note over AMF: Obtain authentication data for the correct identity (outline)
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request)
else Mapping was correct
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Reject)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Reject)
end
endStep-by-step explanation¶
- The UE verifies the network: If the MAC in AUTN is invalid, the UE sends
Authentication Failurewith 5GMM cause 20. - Switch timers: The UE starts T3520, and the network stops T3560 upon receiving the Failure. No fixed durations or retransmission counts are assumed here.
- The network may check the identity: An Identity procedure can retrieve SUCI again and check the 5G-GUTI mapping. This is not mandatory in every case; terminating authentication is another option.
- Proceed to another authentication attempt or rejection: The illustrated branch uses a new challenge if the mapping was wrong, or rejects authentication if it was correct. Subsequent failures, T3520 expiry and emergency services follow separate conditions in TS 24.501 Clause 5.4.1.3.7.
Diagram 2 — Procedure — SQN Resynchronization¶
Original explanation, assumptions and specification references
This is the resynchronization branch. Sending AUTS does not guarantee recovery: home-network verification and a new authentication attempt are required (TS 33.501 Clause 6.1.3.3.1 / Clause 6.1.3.3.2).
{supiOrSuci} identifies the subscriber. The HTTP responses illustrate successful variants (TS 29.509 Clause 5.2.2.2.2 / Clause 6.1.6.2.2, TS 29.503 Clause 6.3.3.2.4.2).
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant SEAF as AMF / SEAF
participant AUSF
participant UDM as UDM / ARPF
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request, RAND, AUTN)
Note over UE: SQN is outside the acceptable range
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Failure, cause 21, AUTS)
RAN-->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Failure)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP POST /nausf-auth/v1/ue-authentications#59; resynchronizationInfo: RAND, AUTS)
AUSF->>UDM: Nudm_UEAuthentication_Get<br/>(HTTP POST /nudm-ueau/v1/{supiOrSuci}/security-information/generate-auth-data#59; resynchronizationInfo)
Note over UDM: Verify AUTS and perform resynchronization
UDM-->>AUSF: 200 OK<br/>(HTTP#59; new Authentication Vector)
AUSF-->>SEAF: 201 Created<br/>(HTTP#59; new authentication data)
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request)
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Response, RES*)
RAN-->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Response)
Note over UE,UDM: Continue with normal SEAF / AUSF verificationStep-by-step explanation¶
- The UE returns AUTS: If the USIM detects a synchronization failure, the UE includes 5GMM cause 21 and AUTS (TS 24.501 Clause 5.4.1.3.6 d).
- Correlate with the preceding RAND: The SEAF sends its last RAND and the received AUTS to the AUSF, which forwards them to the UDM/ARPF. This is not a procedure for reacting to an unsolicited synchronization failure unrelated to a request.
- Resynchronize in the home network: The UDM/ARPF processes the resynchronization information and generates a new AV. This diagram assumes resynchronization succeeds.
- Send a new challenge: The SEAF waits for the AUSF response or a timeout while awaiting it. The diagram follows the response-received path, using new authentication data for the next attempt. SEAF/AUSF verification is still required after the Response; receiving AUTS alone does not establish authentication success.
Reference: TS 33.501 Clause 6.1.3.3.2. Subscriber-data investigation methods and SQN management implementations are product-dependent.
Diagram 3 — Procedure — RES* Verification Failure¶
Original explanation, assumptions and specification references
Distinguish HRES/HXRES verification at the SEAF from RES/XRES verification at the AUSF. Even if the SEAF finds a mismatch, it sends RES to the AUSF and processes failure after receiving the response*. The diagram follows the AUSF-response-received path. The specification also defines proceeding to Reject or Identification when the expected response is not obtained (TS 33.501 Clause 6.1.3.2.2).
The example shows failure returned by the AUSF; {authCtxId} identifies the authentication context (TS 29.509 Clause 5.2.2.2.2).
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant SEAF as AMF / SEAF
participant AUSF
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Authentication Response, RES*)
RAN->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Response)
Note over SEAF: Compare HRES* with HXRES*
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate<br/>(HTTP PUT /nausf-auth/v1/ue-authentications/{authCtxId}/5g-aka-confirmation#59; RES*)
Note over AUSF: Compare RES* with XRES*
AUSF-->>SEAF: 200 OK<br/>(HTTP#59; authResult: FAILURE)
Note over SEAF: Verification failed at SEAF or AUSF
alt Initial NAS used SUCI
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Reject)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Reject)
else Initial NAS used 5G-GUTI
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Identity Request, SUCI)
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Identity Response, SUCI)
RAN-->>SEAF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Identity Response)
opt Additional authentication attempt
SEAF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Authentication Request)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Authentication Request)
end
endStep-by-step explanation¶
- Receive the UE's Response: This differs from a UE returning Authentication Failure.
- Check both the SEAF and AUSF: A local SEAF mismatch is not a reason to omit the AUSF verification exchange.
- Check which identity was used: The rejection/re-identification branch depends on whether the UE was identified by SUCI or through a 5G-GUTI.
- Check the post-Reject state separately: Registration state, identity handling and USIM treatment depend on conditions including NAS integrity protection. Do not assume either immediate retry or USIM invalidation in every case (TS 24.501 Clause 5.4.1.3.5).
Security — NAS/AS Security (Key Hierarchy, SMC, NEA/NIA)¶
Diagram 1 — (A) NAS Security Mode Command / Complete¶
Original explanation, assumptions and specification references
The AMF leads, and with the selected NAS algorithms (NEA/NIA) enables NAS integrity protection first, followed by ciphering. Basis: TS 33.501 Clause 6.7.2 / TS 24.501 (the NAS SMC messages).
sequenceDiagram
participant UE
participant gNB
participant AMF as AMF / SEAF
Note over UE,AMF: Authentication succeeded → AMF derives KAMF → derives KNASint/KNASenc
Note right of AMF: AMF selects NEA/NIA from the<br/>UE security capability (TS 33.501 Clause 6.7.2)
AMF->>gNB: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Security Mode Command)
gNB->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Security Mode Command,<br/> selected NEA/NIA, ngKSI, ABBA, replayed UE security capability)
Note right of AMF: This message is 【integrity-protected only】<br/>(MAC-I added with KNASint, no ciphering)
Note right of UE: UE derives the same KNASint/KNASenc,<br/>verifies MAC-I and checks the resent UE sec capability matches
UE->>gNB: ULInformationTransfer<br/>(RRC#59; NAS: Security Mode Complete, IMEISV etc. as needed)
gNB->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Security Mode Complete)
Note right of UE: This reply is 【integrity-protected + ciphered】
Note over UE,AMF: Subsequent NAS has ciphering + integrity protection activeStep-by-step (related transmissions are grouped)¶
- AMF→UE: Security Mode Command(NAS) — The AMF sends the selected NEA/NIA, the ngKSI (which key set), the ABBA, and the replay (resend) of the UE security capability.
- This message itself is sent integrity-protected only (MAC-I added with KNASint) and is not ciphered. So the content (selected algorithms, etc.) can be read in the clear by the UE and by observers (TS 33.501 Clause 6.7.2).
- (Inside the UE) verification — The UE also derives the same KNASint/KNASenc itself and verifies the MAC-I. It further checks whether the replayed UE security capability matches its own declared values (detection of a downgrade / bidding-down attack).
- UE→AMF: Security Mode Complete(NAS) — If verification is OK, it returns a reply. From this reply, both integrity protection and ciphering are active. Subsequent NAS messages (Registration Accept, etc.) are ciphered and their content becomes invisible.
From where ciphering becomes active
The NAS SMC itself is integrity-protected only. Ciphering starts, for UL (uplink), from Security Mode Complete, and for DL (downlink), from the message after Security Mode Command (TS 33.501 Clause 6.7.2). This behavior is consistent with the notes in Registration's Packet Analysis.
The roles of ABBA and ngKSI
- ABBA (Anti-Bidding down Between Architectures) — A parameter that prevents an attack (bidding down) that deliberately downgrades to a weaker scheme between generations/architectures. It is tied to KAMF derivation (TS 33.501).
- ngKSI — The identifier of the security context (key set) in use. It aligns the UE's and the network's recognition of the key set.
Diagram 2 — (B) AS Security Mode Command / Complete¶
Original explanation, assumptions and specification references
After NAS protection is established, the AMF derives KgNB and hands it to the gNB over N2. The gNB derives the RRC/UP keys from KgNB and enables radio-segment protection with the AS SMC (RRC message). Basis: TS 33.501 Clause 6.7.4 / TS 38.331 (RRC).
sequenceDiagram
participant UE
participant gNB
participant AMF
Note over AMF: AMF derives KgNB from KAMF
AMF->>gNB: Initial Context Setup Request<br/>(NGAP#59; KgNB and UE security capability)
Note right of gNB: gNB derives<br/>KRRCint/KRRCenc/KUPint/KUPenc from KgNB<br/>and selects NEA/NIA for AS
gNB->>UE: SecurityModeCommand<br/>(RRC#59; selected AS algorithms, MAC-I)
Note right of gNB: Integrity protection becomes active first (RRC)
Note right of UE: UE derives the same KgNB-derived keys<br/>and verifies MAC-I
UE->>gNB: SecurityModeComplete<br/>(RRC)
gNB-->>AMF: Initial Context Setup Response<br/>(NGAP)
Note over UE,gNB: Subsequent RRC/UP protection active (enforced at the PDCP layer)Step-by-step (related transmissions are grouped)¶
- AMF→gNB (N2/NGAP) — The AMF conveys KgNB and the UE security capability to the gNB in an NGAP message such as Initial Context Setup (N2).
- (Inside the gNB) key derivation and algorithm selection — The gNB derives KRRCint/KRRCenc/KUPint/KUPenc from KgNB and selects the NEA/NIA for AS.
- gNB→UE: SecurityModeCommand (RRC) — Contains the selected AS algorithms and MAC-I. Integrity protection becomes active first (TS 33.501 Clause 6.7.4 / TS 38.331 Clause 5.3.4).
- UE→gNB: SecurityModeComplete (RRC) — The UE derives the same KgNB-derived keys, verifies the MAC-I, and replies; the gNB returns Initial Context Setup Response. Subsequent RRC / UP protection is active (the actual protection is enforced at the PDCP layer, TS 38.323 Clause 5.8 / Clause 5.9).
Order: NAS SMC first, AS SMC after
NAS SMC (A) always runs first. Only once NAS is protected (i.e., KAMF is established and KgNB can be safely derived from it) can KgNB be handed to the gNB and AS SMC (B) be performed. This order is never reversed (TS 33.501 Clause 6.7).
PDU Session Establishment¶
Diagram 1 — Procedure — Call Flow¶
Original explanation, assumptions and specification references
This is the heart of this page. The main steps, compliant with 3GPP TS 23.502 Clause 4.3.2.2.1 (UE-requested PDU Session Establishment), are shown as a Mermaid sequenceDiagram.
Precondition: registration, authentication, and NAS security are already established
The UE is already 5GMM-REGISTERED (Registration), and NAS security is also established (Authentication). The SM NAS is carried over this protected NAS. It is also assumed that N2 between the gNB and the AMF is already NG-Setup.
{supi}, {ueContextId}, and {smContextRef} identify the subscriber and contexts. HTTP responses illustrate successful variants (TS 29.503 Clause 5.2.2.2.5, TS 29.502 Clause 5.2.2.2–Clause 5.2.2.3, TS 29.518 Clause 5.2.2.3.1, TS 29.512 Clause 4.2.2).
sequenceDiagram
participant UE
participant RAN as (R)AN / gNB
participant AMF
participant SMF
participant UDM
participant PCF
participant UPF
UE->>RAN: ULInformationTransfer<br/>(RRC#59; UL NAS Transport: DNN, S-NSSAI, PDU Session ID#59; payload: PDU Session Establishment Request)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport)
Note right of UE: SM message nested in NAS<br/>TS 24.501 Clause 6.4.1
Note right of AMF: The AMF doesn't interpret the SM NAS#59; it does SMF selection
AMF->>SMF: Nsmf_PDUSession_CreateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts#59; SUPI, PDU Session ID, DNN, S-NSSAI, SM NAS)
Note right of AMF: TS 23.502 Clause 4.3.2.2.1
SMF->>UDM: Nudm_SDM_Get<br/>(HTTP GET /nudm-sdm/v2/{supi}/sm-data)
UDM-->>SMF: 200 OK<br/>(HTTP#59; Session Management subscription data)
SMF-->>AMF: 201 Created<br/>(HTTP#59; SM context)
opt SM Policy Association (PCF interaction, optional/conditional)
SMF->>PCF: Npcf_SMPolicyControl_Create<br/>(HTTP POST /npcf-smpolicycontrol/v1/sm-policies)
PCF-->>SMF: 201 Created<br/>(HTTP#59; PCC rules / authorized QoS)
end
Note over SMF: UE IP address assignment / UPF selection
SMF->>UPF: PFCP Session Establishment Request<br/>(PFCP#59; PDR/FAR/QER, instruction to assign UPF-side N3 TEID)
UPF-->>SMF: PFCP Session Establishment Response<br/>(PFCP#59; UPF-side N3 TEID / UPF IP)
Note right of UPF: TS 29.244 (PFCP)
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; N1 + N2 SM)
AMF-->>SMF: 200 OK<br/>(HTTP)
Note right of SMF: N2 SM info carries QoS Flow (QFI/5QI) and UPF-side N3 info
AMF->>RAN: PDU Session Resource Setup Request<br/>(NGAP#59; NAS-PDU: DL NAS Transport / PDU Session Establishment Accept)
RAN->>UE: RRCReconfiguration<br/>(RRC#59; DRB, dedicatedNAS: DL NAS Transport / PDU Session Establishment Accept)
UE-->>RAN: RRCReconfigurationComplete<br/>(RRC)
Note over RAN,UE: Deliver N1 Accept to the UE / QoS Flow↔DRB mapping
RAN->>AMF: PDU Session Resource Setup Response<br/>(NGAP#59; gNB-side N3 TEID / gNB IP)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; gNB-side N3 info)
SMF-->>AMF: 204 No Content<br/>(HTTP)
SMF->>UPF: PFCP Session Modification Request<br/>(PFCP#59; apply gNB-side N3 TEID to the FAR)
UPF-->>SMF: PFCP Session Modification Response<br/>(PFCP)
Note over UE,UPF: N3 (GTP-U) user plane connective → data communication possibleStep-by-step explanation (related transmissions are grouped)¶
- UE→AMF: The PDU Session Establishment Request (5GSM) is carried via RRC and NGAP as the payload of UL NAS Transport (5GMM). DNN and S-NSSAI are in the outer UL NAS Transport; PDU Session Type is in the inner request (TS 24.501 Clause 8.2.10 / Clause 8.3.1).
- AMF→SMF: The AMF does not interpret the contents of the SM NAS; via SMF selection it picks an appropriate SMF and hands over the SM NAS as-is with Nsmf_PDUSession_CreateSMContext. 3-4. SMF→UDM: It fetches session-management subscription data (allowed DNN/S-NSSAI, default QoS, etc.) with Nudm_SDM_Get.
- SMF→AMF: The CreateSMContext response (confirming context creation).
- (optional/conditional) SMF↔PCF: It establishes an SM Policy Association with Npcf_SMPolicyControl_Create and fetches PCC rules / authorized QoS (in a dynamic-PCC configuration; if absent, it continues with the SMF's default QoS = configuration-dependent).
- (inside the SMF) UE IP address assignment and UPF selection (which UPF to use).
- SMF→UPF: With PFCP Session Establishment Request, it sets forwarding rules on the UPF (PDR = Packet Detection Rule / FAR = Forwarding Action Rule / QER = QoS Enforcement Rule, etc.). In this example the UPF-side N3 TEID is assigned.
- SMF→AMF→gNB: With Namf_Communication_N1N2MessageTransfer (provided by the AMF, consumed by the SMF), the SMF hands the AMF both the N1 (PDU Session Establishment Accept) and the N2 SM info (QoS Flow = QFI/5QI, UPF-side N3 info) together. The AMF forwards this to the gNB as a PDU Session Resource Setup Request (NGAP).
- gNB↔UE: The gNB sets up AN-specific resources (DRB) with RRCReconfiguration, performs the QoS Flow↔DRB mapping, and delivers DL NAS Transport / N1 Accept in dedicatedNAS to the UE.
- gNB→AMF→SMF: With the N2 Resource Setup Response, it returns the gNB-side N3 TEID to the SMF (via Nsmf_PDUSession_UpdateSMContext).
- SMF→UPF: With PFCP Session Modification Request, it applies the gNB-side N3 TEID to the FAR (finalizing the downlink destination).
- User-plane connectivity: Now the uplink and downlink N3 (GTP-U) tunnels are both in place, and data communication over UE↔gNB↔UPF↔DN becomes possible.
The relationship between control-plane establishment and U-Plane establishment
Control-plane establishment (the SMF creates a context and returns an Accept to the UE) and user-plane establishment (completion of the TEID exchange for the N3 tunnel) are two different things. Even after the Accept is returned, downlink real data does not flow until the gNB-side N3 TEID is applied to the UPF (step 12). The two-stage N4 process of "Establishment (uplink preparation)" → "Modification (downlink TEID application)" is the key to U-Plane establishment.
Message names and ordering are partly implementation/version-dependent
The Nsmf operation names (CreateSMContext / UpdateSMContext), the two-stage N4 Establishment→Modification, and the flow of bundling the N1 Accept into the N2 Resource Setup follow TS 23.502 Clause 4.3.2.2.1. However, the fine message ordering, optional steps, and some IEs differ across versions and vendor implementations, and some are to be confirmed.
References: TS 23.502 Clause 4.3.2.2.1 (UE-requested PDU Session Establishment), TS 24.501 Clause 6.4.1 (NAS-side PDU session establishment).
PDU Session Reject — Rejection and Subsequent Behavior¶
Diagram 1 — Procedure — PDU Session Reject¶
Original explanation, assumptions and specification references
The UE specifies a DNN, and the selected SMF rejects the request before creating an N4 Session. This example is limited to non-roaming normal services, with cause 26 "insufficient resources" and a non-zero, non-deactivated Back-off timer value (TS 24.501 Clause 6.4.1.4.1 / Clause 6.4.1.4.2).
Assuming the SMF detects congestion for the requested DNN, this example illustrates HTTP 503 / DNN_CONGESTION on SBI and 5GSM cause 26 in N1. They belong to different layers: the example does not imply a fixed mapping from cause 26 to 503. The Release 18 OpenAPI for TS 29.502 Clause 5.2.2.2.1 / Clause 6.1.3.2.3.1 permits a 503 multipart response with SmContextCreateError and a binary N1 SM part; Clause 6.1.7.3 defines DNN_CONGESTION. Actual SBI errors depend on the failure and implementation.
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant AMF
participant SMF
UE->>RAN: ULInformationTransfer<br/>(RRC#59; UL NAS Transport: DNN, S-NSSAI#59; payload: PDU Session Establishment Request)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport)
Note over UE: Manage establishment with T3580
AMF->>SMF: Nsmf_PDUSession_CreateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts)
Note over SMF: Reject due to insufficient resources<br/>No N4 Session created in this example
SMF-->>AMF: 503 Service Unavailable<br/>(HTTP multipart#59; SmContextCreateError: error cause DNN_CONGESTION, n1SmMsg#59; binaryDataN1SmMessage: PDU Session Establishment Reject)
AMF-->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: DL NAS Transport / Reject, 5GSM cause 26, Back-off timer value)
RAN-->>UE: DLInformationTransfer<br/>(RRC#59; DL NAS Transport / PDU Session Establishment Reject)
Note over UE: Stop T3580 and release PTI<br/>PDU Session not established
Note over UE: Start T3396 for the target DNN<br/>Restrict normal retries
opt Retry becomes permitted, e.g. T3396 expires, and connectivity is needed
UE->>RAN: ULInformationTransfer<br/>(RRC#59; UL NAS Transport / PDU Session Establishment Request)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport)
endStep-by-step explanation¶
- Forward the 5GSM request: RRC and NGAP carry the request to the AMF, which POSTs it to the SMF. DNN and S-NSSAI are in the outer UL NAS Transport (TS 23.502 Clause 4.3.2.2.1, TS 24.501 Clause 8.2.10).
- The SMF generates the Reject: In this example's 503 multipart response,
n1SmMsgin the JSON references a binary N1 SM part containing the cause 26 Reject. Check the HTTP status and 5GSM cause independently. No N4 Session exists here, so no deletion of a nonexistent PFCP Session is shown. - The UE ends the establishment attempt: On receiving the Reject, it stops T3580, releases the allocated PTI and determines that this PDU Session was not established (TS 24.501 Clause 6.4.1.4.1).
- Restrict requests for the target DNN: Here the UE starts T3396 with the received value, restricting normal re-establishment requests and other applicable requests for that DNN. This timer does not indiscriminately stop all UE communication (TS 24.501 Clause 6.4.1.4.2).
- Treat a retry as a separate attempt: Backoff expiry does not guarantee resource availability. Follow the next request and response separately.
Keep different rejection paths separate
Distinguish a NAS Transport notification that the AMF cannot forward a 5GSM request from an SMF-generated 5GSM Reject. If failure occurs after resources such as N4 have been created, check cleanup of those resources separately. SBI response structure and detailed ordering depend on the failure point (TS 24.501 Clause 5.4.5 / Clause 6.4.1.4; TS 23.502 Clause 4.3.2.2.1).
Secondary Authentication — PDU Session Authentication by DN-AAA¶
Diagram 1 — Procedure — Secondary Authentication during Establishment¶
Original explanation, assumptions and specification references
The UE is already registered with NAS security established and supplies a DN-specific identity in its request. The example does not reuse an earlier authentication/authorization result and uses the UPF path. Establishing an N4 Session for AAA traffic is distinct from completing a PDU Session for user data (TS 23.502 Clause 4.3.2.3; TS 33.501 Clause 11.1.2).
{ueContextId} and {smContextRef} identify contexts. HTTP responses illustrate successful variants (TS 29.502 Clause 5.2.2.2–Clause 5.2.2.3, TS 29.518 Clause 5.2.2.3.1).
The DN-specific identity is not necessarily an EAP-Response/Identity packet. Here RADIUS EAP-Start leads the DN-AAA to send an initial EAP-Request/Identity. The User-Name value and its relationship to the DN identity depend on implementation and configuration; RFC 3579 Clause 2.1 recommends including Calling-Station-Id in User-Name for EAP-Start. EAP packets are carried in EAP-Message attributes, with Message-Authenticator on applicable RADIUS packets (RFC 3579 Clause 3.1–Clause 3.2).
sequenceDiagram
participant UE
participant RAN as NG-RAN
participant AMF
participant SMF
participant UPF
participant AAA as DN-AAA
UE->>RAN: ULInformationTransfer<br/>(RRC#59; UL NAS Transport: DNN#59; payload: PDU Session Establishment Request / SM PDU DN Request Container)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport)
AMF->>SMF: Nsmf_PDUSession_CreateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts)
SMF-->>AMF: 201 Created<br/>(HTTP#59; SM context)
Note over SMF: Select secondary authentication from subscription data and local policy
opt No N4 Session is available for AAA forwarding
SMF->>UPF: PFCP Session Establishment Request<br/>(PFCP#59; AAA forwarding path)
UPF-->>SMF: PFCP Session Establishment Response<br/>(PFCP)
end
SMF->>UPF: G-PDU<br/>(GTP-U#59; RADIUS Access-Request: User-Name, EAP-Message / EAP-Start)
UPF->>AAA: Access-Request<br/>(RADIUS#59; User-Name, EAP-Message / EAP-Start)
loop First Identity, then exchanges required by the EAP method
AAA->>UPF: Access-Challenge<br/>(RADIUS#59; EAP-Message: EAP-Request/Identity or method Request)
UPF->>SMF: G-PDU<br/>(GTP-U#59; RADIUS Access-Challenge / EAP-Request)
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; Authentication Command / EAP-Request)
AMF-->>SMF: 200 OK<br/>(HTTP)
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: DL NAS Transport / Authentication Command)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; DL NAS Transport / PDU Session Authentication Command / EAP-Request/Identity or method Request)
UE->>RAN: ULInformationTransfer<br/>(RRC#59; UL NAS Transport / PDU Session Authentication Complete / EAP-Response/Identity or method Response)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; N1 SM)
SMF-->>AMF: 204 No Content<br/>(HTTP)
SMF->>UPF: G-PDU<br/>(GTP-U#59; RADIUS Access-Request / EAP-Response)
UPF->>AAA: Access-Request<br/>(RADIUS#59; EAP-Message: EAP-Response/Identity or method Response, State if present)
end
alt DN authentication and authorization succeed
AAA-->>UPF: Access-Accept<br/>(RADIUS#59; EAP-Success / authorization information)
UPF-->>SMF: G-PDU<br/>(GTP-U#59; RADIUS Access-Accept)
Note over SMF,UPF: Continue PDU Session establishment<br/>Further N4 / N2 configuration, etc. (outline)
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; N1 Accept / EAP-Success, N2 SM)
AMF-->>SMF: 200 OK<br/>(HTTP)
AMF->>RAN: PDU Session Resource Setup Request<br/>(NGAP#59; NAS-PDU: DL NAS Transport / PDU Session Establishment Accept)
RAN->>UE: RRCReconfiguration<br/>(RRC#59; dedicatedNAS: DL NAS Transport / PDU Session Establishment Accept)
UE-->>RAN: RRCReconfigurationComplete<br/>(RRC)
RAN-->>AMF: PDU Session Resource Setup Response<br/>(NGAP)
Note over AMF,SMF: N2 result and subsequent N4 update continue in establishment
else DN authentication fails
AAA-->>UPF: Access-Reject<br/>(RADIUS#59; EAP-Failure)
UPF-->>SMF: G-PDU<br/>(GTP-U#59; RADIUS Access-Reject)
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; N1 Reject / EAP-Failure)
AMF-->>SMF: 200 OK<br/>(HTTP)
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: DL NAS Transport / PDU Session Establishment Reject)
RAN->>UE: DLInformationTransfer<br/>(RRC#59; DL NAS Transport / PDU Session Establishment Reject)
endStep-by-step explanation¶
- Decide whether secondary authentication is needed: The SMF checks subscription data and local policy. It is not performed for every DNN and PDU Session on every occasion.
- Supply the DN-specific identity: In this example, DNN is carried in the outer UL NAS Transport, while DN information is in the SM PDU DN Request Container within the inner PDU Session Establishment Request (TS 24.501 Clause 5.4.5.2.2; TS 33.501 Clause 11.1.2 step 4). If the request does not supply a DN-specific identity, an additional EAP Request/Identity and Response/Identity exchange is available (TS 33.501 Clause 11.1.2).
- Prepare the AAA communication path: If an existing N4 Session cannot be used, prepare the required path. The UPF does not independently decide the DN-AAA authentication result.
- Carry EAP over NAS SM: Following EAP-Start,
PDU Session Authentication Commandcarries the initial Request/Identity andPDU Session Authentication Completethe corresponding Response/Identity. Later method Requests and Responses use the same NAS messages. If Access-Challenge contains State, return it in the next Access-Request (RFC 2865 Clause 5.24). - Apply the result to establishment: During establishment, success is delivered in Establishment Accept and failure in Establishment Reject, including the EAP result.
Authentication Completereturns the current EAP response; it is not a declaration of authentication success (TS 24.501 Clause 6.3.1.1). - Check establishment through completion: EAP-Success alone does not prove that N2/N4 and radio-resource configuration are complete. See PDU Session Establishment for the remaining successful-path processing.
Direct SMF-to-DN-AAA access
When the DN-AAA is inside the 5GC and directly reachable, a procedure without the UPF is also specified. N4 Session establishment for AAA forwarding is then omitted. Do not make the illustrated UPF path a mandatory condition for every deployment (TS 23.502 Clause 4.3.2.3).
Result messages differ during and after establishment
This diagram covers establishment. For successful re-authentication after establishment, the result uses PDU Session Authentication Result; on failure, EAP-Failure is carried in PDU Session Release Command. Also distinguish these from primary authentication's Authentication Request/Response (TS 24.501 Clause 6.3.1.1).
PDU Session Modification / Release¶
Diagram 1 — (A) PDU Session Modification (centered on Network-requested)¶
Original explanation, assumptions and specification references
{ueContextId} and {smContextRef} identify contexts; {smPolicyNotifyUri} is the callback URI registered by the SMF. The HTTP responses show one successful variant (TS 29.518 Clause 5.2.2.3.1, TS 29.502 Clause 5.2.2.3, TS 29.512 Clause 4.2.3.2).
sequenceDiagram
participant UE
participant gNB
participant AMF
participant SMF
participant UPF
participant PCF
Note over PCF,SMF: Trigger: PCF policy change<br/>(for the UE-originated case, see the diff note)
PCF->>SMF: Npcf_SMPolicyControl_UpdateNotify<br/>(HTTP POST {smPolicyNotifyUri}/update#59; PCC rule change)
SMF-->>PCF: 204 No Content<br/>(HTTP)
Note over SMF: SMF decides the change<br/>(add/change/delete QoS Flow)
opt Optional and conditional: N4 update before N2/N1 (around step 2 — to be confirmed)
SMF->>UPF: PFCP Session Modification Request<br/>(PFCP)
UPF-->>SMF: PFCP Session Modification Response<br/>(PFCP)
end
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; N1 + N2 SM)
AMF-->>SMF: 200 OK<br/>(HTTP)
AMF->>gNB: PDU Session Resource Modify Request<br/>(NGAP#59; NAS-PDU: DL NAS Transport / Modification Command)
gNB->>UE: RRCReconfiguration<br/>(RRC#59; dedicatedNAS: DL NAS Transport / Modification Command)
UE-->>gNB: RRCReconfigurationComplete<br/>(RRC)
gNB-->>AMF: PDU Session Resource Modify Response<br/>(NGAP)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; N2 SM)
SMF-->>AMF: 204 No Content<br/>(HTTP)
SMF->>UPF: PFCP Session Modification Request<br/>(PFCP#59; PDR/FAR/QER)
UPF-->>SMF: PFCP Session Modification Response<br/>(PFCP)
UE->>gNB: ULInformationTransfer<br/>(RRC#59; UL NAS Transport / Modification Complete)
gNB->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport / Modification Complete)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; N1 SM)
SMF-->>AMF: 204 No Content<br/>(HTTP)
Note over SMF,UPF: Additional N4 update as needed (around step 12 — to be confirmed)Step-by-step (Modification) — a representative example following TS 23.502 Clause 4.3.3.2 (UE or network requested PDU Session Modification). Step numbers differ by version and are to be confirmed.
- Trigger: The PCF notifies the SMF of a PCC rule change using Npcf_SMPolicyControl_UpdateNotify; the SMF acknowledges with HTTP 204. In the UE-originated case, the UE sends a PDU Session Modification Request(5GSM) (the diff is below).
- SMF decision: The SMF decides the addition/change/deletion of QoS Flows. Updating N4 already at this stage is optional and conditional (the conditions in the spec and the step number are to be confirmed; whether to pre-configure first is implementation-dependent).
- N1N2 delivery: SMF → AMF via Namf_Communication_N1N2MessageTransfer (N1 = Modification Command, with N2 SM information enclosed).
- N2 enforcement: AMF → gNB via PDU Session Resource Modify Request (NGAP) with the N1 Modification Command enclosed; the gNB carries NAS in RRCReconfiguration dedicatedNAS and returns the Modify Response after the RRC response.
- Reflect to the SMF: AMF → SMF via Nsmf_PDUSession_UpdateSMContext (N2 SM information).
- N4 enforcement: SMF → UPF updates PDR/FAR/QER via N4 Session Modification(PFCP) (after receiving the N2 response; around step 8, to be confirmed).
- NAS completion: The UE's Modification Complete reaches the SMF via the gNB and AMF (Nsmf_PDUSession_UpdateSMContext). If needed, the SMF updates N4 again (around step 12, to be confirmed).
- The UE state stays ACTIVE (only the QoS is updated).
Diff from the UE-originated case: The UE first sends a PDU Session Modification Request(5GSM) to the SMF via the AMF (Nsmf_PDUSession_UpdateSMContext), and the SMF decides whether it can be accepted (checking with the PCF if necessary). The SMF may return the N1/N2 SM information in the UpdateSMContext response instead of N1N2MessageTransfer (to be confirmed). Thereafter it proceeds the same as from step 4 above. If the SMF cannot authorize the request, it returns a Modification Reject (the 5GSM cause value for the reason is to be confirmed). The same PCF-initiated flow is also covered in PCF / SM Policy Association / PCC Rule.
Diagram 2 — (B) PDU Session Release¶
Original explanation, assumptions and specification references
This is an SMF-initiated example. URI identifiers and selected HTTP success responses follow the example above.
sequenceDiagram
participant UE
participant gNB
participant AMF
participant SMF
participant UPF
participant PCF
Note over UE,PCF: Trigger: SMF-initiated release
SMF->>UPF: PFCP Session Deletion Request<br/>(PFCP)
UPF-->>SMF: PFCP Session Deletion Response<br/>(PFCP)
SMF->>AMF: Namf_Communication_N1N2MessageTransfer<br/>(HTTP POST /namf-comm/v1/ue-contexts/{ueContextId}/n1-n2-messages#59; N1 + N2 SM)
AMF-->>SMF: 200 OK<br/>(HTTP)
AMF->>gNB: PDU Session Resource Release Command<br/>(NGAP#59; NAS-PDU: DL NAS Transport / Release Command)
gNB->>UE: RRCReconfiguration<br/>(RRC#59; DRB release)
UE-->>gNB: RRCReconfigurationComplete<br/>(RRC)
gNB->>UE: DLInformationTransfer<br/>(RRC#59; DL NAS Transport / Release Command)
gNB-->>AMF: PDU Session Resource Release Response<br/>(NGAP)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; N2 SM)
SMF-->>AMF: 204 No Content<br/>(HTTP)
UE->>gNB: ULInformationTransfer<br/>(RRC#59; UL NAS Transport / Release Complete)
gNB->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: UL NAS Transport / Release Complete)
AMF->>SMF: Nsmf_PDUSession_UpdateSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify#59; N1 SM)
SMF-->>AMF: 204 No Content<br/>(HTTP)
Note over SMF,PCF: Terminate SM Policy Association if applicable
Note over SMF: Stop charging and return IP address<br/>Release Nsmf contextStep-by-step (Release)
- Trigger: The UE sends a PDU Session Release Request(5GSM), or it is NW-originated (a decision by the SMF/PCF/AMF, triggered by policy, charging, faults, deregistration, etc.).
- N4 deletion: SMF → UPF via N4 Session Deletion(PFCP) → the UPF releases the session, TEID, and forwarding rules.
- N1N2 delivery: SMF → AMF via N1N2MessageTransfer (N1 = Release Command, with N2 SM information enclosed).
- N2 release: AMF → gNB via PDU Session Resource Release Command (NGAP); the gNB releases the DRB through RRCReconfiguration and returns Release Response.
- NAS completion: The Release Command reaches the UE in the NGAP NAS-PDU and RRC DLInformationTransfer; the Complete travels via ULInformationTransfer and Uplink NAS Transport to the AMF and then the SMF.
- Post-processing: The SMF notifies the PCF/charging of the release (Npcf_SMPolicyControl_Delete — to be confirmed), returns the allocated IP, and releases the Nsmf context.
- The session state goes from ACTIVE → deleted (equivalent to INACTIVE).
Ordering and optional steps are implementation-dependent
The message ordering above, the presence of optional steps, the number of N4 updates/deletions, the relative order of N2 and N1, and so on vary by release and vendor implementation (to be confirmed). The diagram is one example of a representative flow.
Deregistration — Registration and Session Cleanup¶
Diagram 1 — Procedure — UE-initiated Deregistration¶
Original explanation, assumptions and specification references
This example uses a valid NAS security context. PDU Session release is performed for each session on the target access (TS 23.502 Clause 4.2.2.3.2).
{smContextRef} identifies the SM context. HTTP 204 is one successful ReleaseSMContext response (TS 29.502 Clause 5.2.2.4).
sequenceDiagram
participant UE
participant AMF
participant SMF
participant UPF
participant UDM
participant PCF
participant RAN as NG-RAN
UE->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Deregistration Request (UE originating), Access Type, Switch-off)
RAN->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Deregistration Request (UE originating))
opt PDU Sessions exist on the target access
AMF->>SMF: Nsmf_PDUSession_ReleaseSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/release)
SMF->>UPF: PFCP Session Deletion Request<br/>(PFCP)
UPF-->>SMF: PFCP Session Deletion Response<br/>(PFCP)
SMF-->>AMF: 204 No Content<br/>(HTTP)
opt Dynamic PCC is used
Note over SMF,PCF: Terminate SM Policy Association (outline)
end
opt UDM cleanup conditions are met
Note over SMF,UDM: Remove subscription and SMF registration (outline)
end
end
opt No registration on another access and PCF associations exist
Note over AMF,PCF: Terminate AM / UE Policy Associations (outline)
end
alt Not switch-off
AMF-->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Deregistration Accept (UE originating))
RAN-->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Deregistration Accept (UE originating))
else Switch-off
Note over UE,AMF: No Deregistration Accept is sent
end
opt An N2 signalling connection remains
AMF->>RAN: UE Context Release Command<br/>(NGAP)
RAN->>UE: RRCRelease<br/>(RRC)
RAN-->>AMF: UE Context Release Complete<br/>(NGAP)
endStep-by-step explanation¶
- Specify the target: The UE indicates the access to deregister using Access Type. The Switch-off indication helps explain cases where no Accept is returned.
- Release sessions: The AMF requests release from the SMF, which deletes the PFCP Session at the UPF. This stage is absent when there is no PDU Session.
- Clean up associations: Terminate the SM Policy Association used for dynamic PCC. The SMF unsubscribes from UDM data subject to conditions such as this being the last PDU Session for the relevant DNN and S-NSSAI, and deregisters its SMF registration. AM/UE Policy termination at the AMF also depends on registration over other accesses.
- Return an Accept only when required: A missing Accept during switch-off is not a response failure.
- Release remaining signalling connections: If an N2 connection remains, perform NGAP UE Context Release and radio RRCRelease.
References: TS 23.502 Clause 4.2.2.3.2 / Clause 4.2.6; formal PFCP message names are specified in TS 29.244 Clause 7.5.6 / Clause 7.5.7.
Not an unconditional deletion of all sessions and registrations
Cleanup depends on the target access and any remaining access. When Secondary RAT usage reporting is required, a branch performs the Accept and connection release earlier. Do not apply the illustrated serial order to every case (TS 23.502 Clause 4.2.2.3.2).
Diagram 2 — Procedure — Network-initiated Deregistration¶
Original explanation, assumptions and specification references
The AMF itself initiates explicit deregistration, and the UE is CM-CONNECTED. Cases with a PDU Session associated with emergency services are excluded (TS 23.502 Clause 4.2.2.3.3).
sequenceDiagram
participant UE
participant AMF
participant SMF
participant UPF
participant RAN as NG-RAN
AMF->>RAN: Downlink NAS Transport<br/>(NGAP#59; NAS-PDU: Deregistration Request (UE terminated))
RAN->>UE: DLInformationTransfer<br/>(RRC#59; NAS: Deregistration Request (UE terminated), Access Type, re-registration required)
Note over UE,AMF: Accept can follow reception of Request<br/>Shown before session release in this example
UE-->>RAN: ULInformationTransfer<br/>(RRC#59; NAS: Deregistration Accept (UE terminated))
RAN-->>AMF: Uplink NAS Transport<br/>(NGAP#59; NAS-PDU: Deregistration Accept (UE terminated))
opt PDU Sessions exist on the target access
AMF->>SMF: Nsmf_PDUSession_ReleaseSMContext<br/>(HTTP POST /nsmf-pdusession/v1/sm-contexts/{smContextRef}/release)
SMF->>UPF: PFCP Session Deletion Request<br/>(PFCP)
UPF-->>SMF: PFCP Session Deletion Response<br/>(PFCP)
SMF-->>AMF: 204 No Content<br/>(HTTP)
Note over AMF,SMF: UDM / PCF cleanup is conditional
end
AMF->>RAN: UE Context Release Command<br/>(NGAP)
RAN->>UE: RRCRelease<br/>(RRC)
RAN-->>AMF: UE Context Release Complete<br/>(NGAP)
opt Re-registration is required
Note over UE,AMF: Re-registration starts as a separate procedure
endStep-by-step explanation¶
- The network sends the Request: The direction is reversed compared with UE-initiated deregistration. Check whether re-registration is required.
- The UE returns the Accept: The UE can return it after receiving the Request. Its ordering relative to SMF/UPF release completion is not fixed.
- Perform network-side cleanup: Apply conditional processing to the target PDU Sessions, UDM subscriptions and registrations, and PCF associations.
- Release the connection and follow the instruction: Subsequent UE behavior depends on whether re-registration is required. Deregistration does not always mean immediate re-registration.
UDM-initiated, idle and implicit cases
The UDM can request deregistration using Nudm_UECM_DeregistrationNotification, which the AMF acknowledges. Explicit deregistration of a CM-IDLE UE requires Paging to reach it. Implicit deregistration, however, omits the UE-facing Request/Accept exchange. Do not treat all these cases as the assumptions of the diagram above (TS 23.502 Clause 4.2.2.3.3).