Authentication — Primary Authentication (5G-AKA / EAP-AKA')¶
Learning objectives¶
After reading this page, you will be able to:
- Explain the Why (why authentication is needed) as the foundation for preventing impersonation, ensuring legitimate charging, and protecting communication.
- Explain the essence of 5G-AKA / EAP-AKA' as mutual authentication (the network verifies the UE, and the UE verifies the network).
- Explain the differences between the two schemes 5G-AKA and EAP-AKA' (message structure, round trips, presence or absence of the EAP framework).
- Follow the call flow of each scheme in the order the players appear: UE(USIM) / SEAF(AMF) / AUSF / UDM(ARPF).
- Explain where and by whom (UDM/SIDF) the de-concealment of SUCI → SUPI is performed.
- Follow each step of authentication vector (AV) generation → RES*/XRES* and HRES*/HXRES* verification → KAUSF/KSEAF derivation.
- Distinguish the three major failures — MAC failure / Synch failure (SQN out of sync) / RES* mismatch — and explain AUTS resynchronization.
Prerequisites¶
It will go more smoothly if you first understand the following. If you haven't yet, start from the curriculum.
- The big picture of Registration (authentication was outlined as part of the registration procedure) → Initial Registration
- SUCI / SUPI (the real name SUPI, and the SUCI that conceals it) → Registration Basic Concept
- NAS / N1 (the layer that carries control messages between UE and AMF) → N1
- The roles of the NFs involved in authentication → AMF / AUSF / UDM
What you'll learn in this chapter¶
This chapter focuses on primary authentication itself. That is, for the two schemes 5G-AKA and EAP-AKA', it precisely covers the details of the message round trips, each step of key derivation, and failures and resynchronization.
- For an overview of authentication and its place within the whole of registration, see the Registration chapter;
- For the full picture of the key hierarchy, see the AUSF key hierarchy (to avoid duplication, this chapter concentrates on key derivation within the procedure).
Note that secondary authentication (Secondary Authentication — per-PDU-session authentication with an external DN) is out of scope for this chapter (see Next Step).
Why — why authentication is needed¶
Let's start from the Why (why it is needed). If the network accepted terminals unconditionally, the following problems would arise.
- Impersonation — Someone impersonates another's subscription to hijack communication and charging.
- Charging fraud — You cannot determine who used the service, so you cannot charge correctly.
- No foundation for communication protection — You cannot establish the shared key used for encryption and integrity protection.
Authentication is the procedure of using cryptographic techniques to confirm "is this terminal really the genuine subscriber?" and, at the same time, agreeing on the key that protects subsequent communication. It is important that 5G authentication is not one-way but mutual authentication.
- Network → UE: Confirms whether the UE is a legitimate subscriber (verification of the response RES*).
- UE → Network: Confirms whether the entity it connects to is not a fake base station (a spoofing network) (verification of AUTN).
Analogy: a bank cash card
5G authentication is similar to an ATM transaction at a bank. ・Cash card = USIM (proof that you are the legitimate owner) ・PIN = shared secret key K (a secret only the owner knows) ・Verifying the ATM's legitimacy = the part where the UE verifies the network (AUTN verification). So that you don't enter your PIN into a fake ATM (a fake base station), the UE side also checks the counterpart. A one-sided check is not enough; it is precisely because both parties verify each other (mutual authentication) that the transaction (communication) can be conducted safely.
Overview¶
Primary authentication is built on the following relationship among three parties.
- AMF(SEAF) — The starting point of authentication. Closest to the UE, it triggers authentication and exchanges challenge/response with the UE. The SEAF (Security Anchor Function) is co-located in the AMF.
- AUSF — The server of authentication. Standing between the UDM and the AMF, it verifies the response and derives the anchor key KSEAF.
- UDM(ARPF/SIDF) — The source of authentication information. The ARPF, which holds the permanent key K, generates the authentication vector (AV), and the SIDF de-conceals SUCI → SUPI.
flowchart LR
UE([UE / USIM]) -->|"1. Auth trigger (SUCI)"| AMF["AMF / SEAF"]
AMF -->|"2. Auth request (N12)"| AUSF[AUSF]
AUSF -->|"3. AV request (N13)"| UDM["UDM (ARPF / SIDF)"]
UDM -->|"4. SUCI de-concealment + AV generation"| AUSF
AUSF -->|"5. RAND/AUTN"| AMF
AMF -->|"6. challenge/response"| UE
Basic Concept — a beginner-friendly explanation¶
The core of primary authentication is AKA = Authentication and Key Agreement. As the name says, it performs "authentication (identity verification)" and "key agreement (establishment of a shared key)" at the same time.
1. The shared secret key K and challenge-response¶
- Shared secret key K — A long-term key held only by the USIM (UE side) and the network-side ARPF (which logically belongs to the UDM). It never travels over the air.
- Challenge-response — A scheme in which the network sends a random number RAND (the question) and the UE returns the answer RES* computed using K. Because you cannot produce the correct answer without knowing K, this serves as identity verification.
2. Mutual authentication (bidirectional verification)¶
- The network verifies the UE (verifies RES* against XRES*).
- The UE verifies the network (the USIM verifies AUTN = Authentication Token). AUTN contains the MAC (tamper detection) and the SQN (sequence number), and cannot be produced by anything other than a legitimate network.
3. Key agreement (KAUSF → KSEAF)¶
When authentication succeeds, the same key is derived on both sides from the same AKA computation. This key is derived down the chain of upper keys KAUSF → KSEAF → KAMF → … and is used for the encryption and integrity protection of NAS/AS (for the full picture of the hierarchy, see the AUSF key hierarchy).
4. SUCI / SUPI / SIDF (who de-conceals the real name)¶
- SUPI — The subscriber's real name (equivalent to IMSI). It must not be carried in the clear over the air.
- SUCI — SUPI encrypted with the home network public key to conceal it. It may be carried over the air.
- SIDF (Subscription Identifier De-concealing Function) — The function that de-conceals SUCI back to SUPI using the home network private key. It belongs to the UDM, and only the SIDF is allowed to handle the private key (TS 33.501 §6.12.2).
Why de-concealment is on the home (UDM/SIDF) side
De-concealing SUCI requires the home network's private key. Distributing this private key to the visited AMF or the AUSF would raise the risk of leakage. Therefore, de-concealment is done only by the SIDF inside the home UDM, and the AMF/AUSF receive the real name SUPI "from the UDM when it becomes necessary," keeping the private key from ever leaving.
Architecture¶
These are the functional elements involved in primary authentication and the interfaces that connect them. The point that the SIDF handles SUCI de-concealment and the point that the ARPF generates the AV are the leading roles of this chapter.
flowchart LR
subgraph UEside["UE"]
USIM["USIM
(holds K)"]
end
subgraph Serving["Serving / Visited network"]
SEAF["AMF / SEAF"]
end
subgraph Home["Home network"]
AUSF["AUSF
(derives KAUSF/KSEAF)"]
UDM["UDM"]
ARPF["ARPF
(holds K, generates AV)"]
SIDF["SIDF
(de-conceals SUCI→SUPI)"]
end
USIM -- "N1 (NAS)" --> SEAF
SEAF -- "N12 (Nausf)" --> AUSF
AUSF -- "N13 (Nudm)" --> UDM
UDM --- ARPF
UDM --- SIDF
- USIM — Holds the shared key K. A tamper-resistant card that performs AUTN verification and RES computation.
- AMF / SEAF — The starting point of authentication. It exchanges challenge/response with the UE over NAS, performs the HRES* check, and receives KSEAF.
- AUSF — Response verification and KAUSF/KSEAF derivation. Relays between the UDM and the AMF.
- UDM / ARPF / SIDF — The ARPF generates the AV, and the SIDF de-conceals SUCI. The source of authentication information.
The detailed key hierarchy diagram is consolidated in the AUSF key hierarchy to avoid duplication. This chapter concentrates on "which key is born at which step within the procedure."
Network Function¶
| NF | Role in this procedure | Information held/obtained | Main APIs used here | Impact on failure |
|---|---|---|---|---|
| UE / USIM | AUTN verification (verifying the network's legitimacy), computing RES/RES* using K | K, OPc, SQN (UE-side counter) | (NAS: Authentication Request/Response) | Cannot respond to authentication, cannot register |
| AMF / SEAF | Starting point of authentication, NAS round trips, HRES* check, KSEAF receipt, ABBA assignment | ngKSI, ABBA, RAND/AUTN (relayed), KSEAF | Nausf_UEAuthentication_Authenticate (consumes) | Cannot start/complete authentication, registration does not proceed |
| AUSF | RES* vs. XRES* verification, KAUSF/KSEAF derivation, execution of the scheme (5G-AKA/EAP) | KAUSF, KSEAF, XRES* (temporary) | Nausf_UEAuthentication (provides) / Nudm_UEAuthentication_Get (consumes) | Authentication does not succeed, cannot register |
| UDM(ARPF/SIDF) | SIDF de-conceals SUCI, ARPF generates AV, selection of the authentication scheme | K, OPc, SQN (network side), HN private key, SUPI | Nudm_UEAuthentication_Get (provides) | AV generation/SUCI de-concealment impossible, authentication totally fails |
Interface / Protocol¶
These are the interfaces and protocols used in this procedure.
| Interface | Protocol | Transport | Use in this procedure |
|---|---|---|---|
| N1 | NAS (5GMM) | (Tunneled over NGAP/N2) | Authentication Request/Response/Failure/Result between UE⇔AMF |
| N12 | SBI (HTTP/2, TLS, JSON) | TCP/TLS | AMF(SEAF)⇔AUSF (Nausf_UEAuthentication) |
| N13 | SBI (HTTP/2, TLS, JSON) | TCP/TLS | AUSF⇔UDM (Nudm_UEAuthentication_Get, SUCI de-concealment / AV retrieval) |
For protocol details, see the Protocol Dictionary, and for a list of interfaces, see the Interface Dictionary. For individual pages, see N12 (AMF⇔AUSF) / N13 (AUSF⇔UDM).
Procedure — Call Flow¶
This is the heart of this page. There are two schemes for primary authentication, and the UDM selects which one to use (based on the SUCI/SUPI and the subscriber data; TS 33.501 §6.1.2). The AMF(SEAF) does not specify the scheme to the Nausf and follows the UDM's decision.
The UDM performs the scheme selection
The AMF only requests "please authenticate," and it is the UDM(ARPF) that decides which of 5G-AKA and EAP-AKA' to use. In the response of Nudm_UEAuthentication_Get, the UDM returns the selected scheme to the AUSF together with the generated AV (TS 33.501 §6.1.2 / §6.1.3).
(A) 5G-AKA Call Flow¶
sequenceDiagram
autonumber
participant UE as UE / USIM
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
(SUCI or SUPI, SN-name)
Note right of SEAF: TS 33.501 §6.1.2
AUSF->>UDM: Nudm_UEAuthentication_Get
(SUCI or SUPI, SN-name)
Note right of UDM: If SUCI, SIDF de-conceals to SUPI
TS 33.501 §6.12.2
Note right of UDM: ARPF selects scheme=5G-AKA and
generates HE AV(RAND,AUTN,XRES*,KAUSF)
TS 33.501 §6.1.3.2
UDM-->>AUSF: 5G HE AV (RAND, AUTN, XRES*, KAUSF) + SUPI
Note right of AUSF: AUSF derives HXRES* from XRES* and
KSEAF from KAUSF → into SE AV
AUSF-->>SEAF: 5G SE AV (RAND, AUTN, HXRES*)
SEAF->>UE: Authentication Request (NAS: RAND, AUTN, ngKSI, ABBA)
Note right of UE: USIM verifies AUTN(MAC/SQN)→
computes RES→ME(UE) generates RES*
UE->>SEAF: Authentication Response (NAS: RES*)
Note right of SEAF: SEAF computes HRES* from RES* and
verifies against HXRES* (first-stage check)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate (RES*)
Note right of AUSF: AUSF verifies RES* against XRES* (final decision)
TS 33.501 §6.1.3.2
AUSF-->>SEAF: Authentication result (success) + KSEAF
Note over UE,AUSF: Success→KSEAF established→on to KAMF derivation
Step-by-step explanation (numbers correspond to the diagram above)¶
- 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 §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 §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*. If they differ here, the SEAF can reject (a front-end check to reduce round trips).
- SEAF→AUSF: Sends RES* and requests the final verification.
- (Inside AUSF) Final check: The AUSF verifies RES* against XRES* (TS 33.501 §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 is a first-stage check to "quickly reject at the visited network," while the AUSF's RES*/XRES* check is "the final decision by the home network." Having a two-stage structure lets clearly invalid responses be discarded early at the visited network, while the final authority over success or failure remains with the home network (AUSF) (TS 33.501 §6.1.3.2).
(B) EAP-AKA' Call Flow¶
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 §6.1.3.1 / RFC 5448).
sequenceDiagram
autonumber
participant UE as UE / USIM (EAP peer)
participant SEAF as AMF / SEAF (passthrough)
participant AUSF as AUSF (EAP server)
participant UDM as UDM (ARPF / SIDF)
SEAF->>AUSF: Nausf_UEAuthentication_Authenticate (SUCI/SUPI, SN-name)
AUSF->>UDM: Nudm_UEAuthentication_Get (SUCI/SUPI, SN-name)
Note right of UDM: SIDF de-conceals SUCI / ARPF selects scheme=EAP-AKA'
generates AV(RAND,AUTN,XRES,CK',IK')
TS 33.501 §6.1.3.1
UDM-->>AUSF: EAP-AKA' AV + SUPI
AUSF-->>SEAF: EAP-Request/AKA'-Challenge (RAND, AUTN, MAC)
SEAF->>UE: Authentication Request (EAP encapsulated in NAS)
Note right of UE: USIM verifies AUTN→computes RES→computes MAC
UE->>SEAF: Authentication Response (EAP in NAS)
SEAF->>AUSF: EAP-Response/AKA'-Challenge (RES, MAC)
Note right of AUSF: AUSF verifies RES against XRES and the MAC
on success, derives KAUSF→KSEAF
AUSF-->>SEAF: EAP-Success + KSEAF
SEAF->>UE: Authentication Result (NAS: EAP-Success)
Note over UE,AUSF: Success→KSEAF established
Step-by-step explanation (numbers correspond to the diagram above)¶
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 §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). Conformant to RFC 5448. In both, the underlying AKA (K, RAND, AUTN, SQN) is the same, and the UDM is the one that selects the scheme.
Signal Flow¶
The main messages / service operations are organized in a table.
| Message / Operation | Protocol | From→To | Purpose | Main IEs | Result |
|---|---|---|---|---|---|
| Nausf_UEAuthentication_Authenticate (request) | SBI (HTTP/2) | AMF(SEAF)→AUSF | Start authentication | SUCI/SUPI, SN-name | AUSF begins authentication processing |
| Nudm_UEAuthentication_Get | SBI (HTTP/2) | AUSF→UDM | AV retrieval / SUCI de-concealment | SUCI/SUPI, SN-name | UDM de-conceals SUPI (SIDF) / generates AV (ARPF) |
| (response) 5G HE AV / EAP-AKA' AV | SBI (HTTP/2) | UDM→AUSF | Provides the authentication vector | RAND, AUTN, XRES*/XRES, KAUSF/CK'IK', SUPI | AUSF obtains the material for verification/derivation |
| Authentication Request | NAS (5GMM) | AMF→UE | Authentication challenge | RAND, AUTN, ngKSI, ABBA (EAP message when EAP) | UE verifies AUTN / computes RES |
| Authentication Response | NAS (5GMM) | UE→AMF | Authentication response | RES* (EAP-Response when EAP) | SEAF/AUSF verify the response |
| Nausf_UEAuthentication_Authenticate (RES*) | SBI (HTTP/2) | AMF(SEAF)→AUSF | Request final verification | RES* | AUSF performs the final check against XRES* |
| (response) Authentication result + KSEAF | SBI (HTTP/2) | AUSF→AMF(SEAF) | Result notification / key handover | Authentication result, KSEAF | SEAF obtains KSEAF → derives KAMF |
| Authentication Result | NAS (5GMM) | AMF→UE | EAP-Success notification, etc. | EAP-Success | UE recognizes authentication success |
| Authentication Reject | NAS (5GMM) | AMF→UE | Authentication rejection | (none) | UE treats it as authentication failure |
| Authentication Failure | NAS (5GMM) | UE→AMF | Notification of UE-side verification failure | 5GMM cause, Auth failure param (AUTS) | Branches to resynchronization/rejection |
Main IE terms: RAND (random challenge) / AUTN (network→UE authentication token) / RES* (UE→network response) / XRES* (the correct answer the network expects) / HXRES* (hash of XRES*, for the SEAF check) / KSEAF (anchor key) / KAUSF (key held by AUSF) / ABBA (backward-compatibility protection) / SUCI (concealed ID) / SUPI (real name) / AUTS (SQN resynchronization token). For details, see the Message Dictionary.
State Machine¶
This is the state transition of primary authentication as seen from the USIM/UE (basis: TS 33.501 §6.1 / TS 24.501 §5.4.1).
stateDiagram-v2
[*] --> Idle: Before authentication
Idle --> AwaitChallenge: SEAF starts auth (obtains AV via Nausf/Nudm)
AwaitChallenge --> VerifyingAUTN: Authentication Request received (RAND,AUTN)
VerifyingAUTN --> ComputingRES: AUTN verification OK
VerifyingAUTN --> MACFailure: MAC mismatch
VerifyingAUTN --> SynchFailure: SQN out of range
ComputingRES --> Success: RES*/XRES* match
ComputingRES --> ResMismatch: RES*/XRES* mismatch
MACFailure --> [*]: Authentication Failure(cause=MAC failure)→Reject
SynchFailure --> Resync: Authentication Failure(cause=Synch failure, AUTS)
Resync --> AwaitChallenge: Network resyncs SQN with AUTS→new AV
ResMismatch --> [*]: Authentication Reject
Success --> [*]: KSEAF established→on to NAS security
- VerifyingAUTN — The transient state where the USIM verifies the MAC and SQN of AUTN. It branches into two kinds of failure here.
- MAC failure — The MAC of AUTN does not match, i.e., suspicion of a key mismatch / fake network. The UE moves toward rejection as authentication failure.
- Synch failure — The MAC matches but the SQN is out of range (the counters on the network side and the UE side have drifted apart). The UE returns AUTS to request resynchronization.
- ResMismatch — On the network side, RES*/XRES* do not match, resulting in an Authentication Reject.
Packet Analysis (Wireshark)¶
Because primary authentication is a NAS message, capture it with nas-5gs. The point that NAS is carried nested inside NGAP (N2) is the same as in Registration's Packet Analysis.
Main display filters¶
| Filter | Meaning |
|---|---|
nas-5gs |
5GS NAS messages in general |
ngap |
NGAP (the envelope that carries NAS) |
nas-5gs.mm.message_type |
Identify by NAS 5GMM message type (Authentication Request/Response/Result/Reject/Failure) — specific values to be confirmed |
The hex values of message type are to be confirmed
The specific values of nas-5gs.mm.message_type for Authentication Request/Response, etc., are based on the 3GPP allocation (around TS 24.501 §9.7), but the display may differ depending on the Wireshark version / dissector implementation. Treat the numbers as to be confirmed, and on a real device it is more reliable to check them in the GUI's protocol hierarchy view.
Points to note when decoding (main IEs)¶
- RAND / AUTN (inside Authentication Request) — The challenge random number and the network's authentication token.
- RES* (inside Authentication Response) — The UE's response.
- ngKSI / ABBA (inside Authentication Request) — The key set identifier and the backward-compatibility protection parameter.
- Authentication failure parameter (AUTS) (inside Authentication Failure) — The resynchronization token at Synch failure.
- In the case of EAP-AKA', you see an EAP message encapsulated in NAS.
View the N12/N13 SBI in a separate segment
Because Nausf(N12)/Nudm(N13) are HTTP/2 over TLS, capture them in the SBI segment separately from the NAS segment. Due to TLS, normally you cannot see the contents without the decryption keys (implementation-dependent). Real pcaps depend on the implementation/configuration of the radio and the core.
Configuration¶
These are the structural-level essentials of the configuration needed to make primary authentication work. Specific values and vendor-specific details (Cisco, etc.) are implementation-dependent, and no fictitious values are written here.
UE/USIM side¶
- Writing of K (the subscriber's permanent key) and OPc (a value derived from the operator key). If these do not match the network side, you get a MAC failure.
- Configuration of SUPI/IMSI, the home network public key (for SUCI generation), and the Protection Scheme.
UDM/UDR side (e.g., Open5GS / free5GC)¶
- Registration of the subscriber (SUPI/IMSI) and provisioning of the authentication information (K, OPc) (must match the USIM side).
- Management of the SQN (sequence number) counter. Drift causes Synch failure.
- Configuration of the home network private key (used by the SIDF for SUCI de-concealment) and the Protection Scheme.
- Configuration of the authentication scheme the ARPF selects (5G-AKA / EAP-AKA').
Specific and vendor-specific values are implementation-dependent
Configuration key names, hierarchy, and required items differ across Open5GS / free5GC / commercial vendors. The above are the structural-level essentials; check the actual values in each implementation's documentation (implementation-dependent).
Trouble Shooting¶
Here is the triage of typical authentication failures. For details on Cause values, see the Cause Dictionary.
| Symptom | Assumed cause | Points to check | Related logs/packets | Direction of remedy |
|---|---|---|---|---|
| (a) MAC failure | Key mismatch on the UE side (K/OPc discrepancy), suspicion of a fake network | Match of K/OPc between USIM and UDM, Protection settings | Authentication Failure(cause=MAC failure)(NAS), UDM/AUSF logs | Re-provision K/OPc, confirm the values match on both sides |
| (b) Synch failure | SQN out of sync (counter drift between network side and UE side) | UDM-side SQN, the AUTS the UE returns | Authentication Failure(cause=Synch failure, AUTS)(NAS) | The network resyncs SQN with AUTS → re-challenges with a new AV (TS 33.102/TS 33.501) |
| (c) RES* mismatch | The UE's response does not match the expected value XRES* | AUSF's XRES* check result, SEAF's HRES* check | Authentication Reject(NAS), AUSF logs | Confirm consistency of key/computation scheme, check subscriber data |
| (d) SUCI de-concealment failure | Home private key / SIDF config inconsistency, Protection Scheme discrepancy | UDM's HN private key, UE's HN public key, Scheme match | Response error of Nudm_UEAuthentication_Get, UDM logs | Align the HN key pair/Scheme, check the SUCI generation/de-concealment configuration |
How to tell Synch failure and MAC failure apart
Both are notified by the UE→network Authentication Failure, but the cause value differs. MAC failure is a mismatch of the key itself (not fixed by resynchronization), while Synch failure means the key matches but merely the SQN has drifted (recoverable by resynchronizing with AUTS). Distinguish them by the cause and by the presence or absence of AUTS.
Comparison with EPC¶
Let's contrast 4G (EPC) EPS-AKA with 5G authentication.
| Aspect | 4G / EPC (EPS-AKA) | 5G / 5GC (5G-AKA / EAP-AKA') |
|---|---|---|
| Handling of the permanent ID | IMSI could be carried in the clear | Concealed with SUCI (SIDF de-conceals at home) |
| Authentication NF composition | MME + HSS(AuC) | Separated into SEAF(AMF) + AUSF + UDM(ARPF/SIDF) |
| Authentication scheme | EPS-AKA (single) | Two schemes, 5G-AKA and EAP-AKA' (the UDM selects) |
| Who makes the final check | MME (closer to visited) | AUSF (home) makes the final decision (+ SEAF's first-stage check) |
| Anchor key | KASME | KSEAF (→KAMF→…) |
| Mutual authentication | Yes (AUTN verification) | Yes (AUTN verification; common to both generations) |
| Backward-compatibility protection | — | Introduced the ABBA parameter |
Note the commonalities too
The underlying AKA (shared key K, RAND challenge, network authentication via AUTN, SQN) is common to 4G/5G. It is easier to understand if you grasp 5G as an evolved version that adds on top: "concealment of the real name (SUCI/SIDF)," "separation of authentication NFs," "final decision at home," "the addition of EAP-AKA'," and "ABBA."
Release differences¶
Uncertain items are marked to be confirmed and not asserted.
- Rel-15 — The primary authentication of 5G-AKA / EAP-AKA', SUCI/SUPI and SIDF, KAUSF/KSEAF, and ABBA were established (the basis of TS 33.501).
- Rel-16 — The generation in which extensions to security functions progressed (the extent to which they are woven into the authentication procedure itself is to be confirmed).
- Rel-17 / Rel-18 (5G-Advanced) — Feature extensions continue (concrete differences to the primary authentication procedure are to be confirmed).
Release differences are to be confirmed
Which changes were introduced into the primary authentication procedure itself in each release must be checked individually against the version diffs of TS 33.501. The above is an overview, and the specific items are to be confirmed.
3GPP Specification¶
| Spec | Section | Content |
|---|---|---|
| TS 33.501 | §6.1 | Primary authentication in general (initiation of authentication, scheme selection) |
| TS 33.501 | §6.1.3.1 | EAP-AKA' procedure |
| TS 33.501 | §6.1.3.2 | 5G-AKA procedure (RES*/XRES*/HXRES*, KSEAF derivation) |
| TS 33.501 | §6.12.2 | De-concealment of SUCI (SIDF) |
| TS 24.501 | §5.4.1 | NAS-side Authentication procedure (Authentication Request/Response/Failure/Result/Reject) |
| TS 29.509 | — | Nausf (the AUSF's service API, UEAuthentication) |
| TS 29.503 | — | Nudm (the UDM's service API, UEAuthentication_Get) |
| TS 33.102 | — | The basis of AKA and the prototype of SQN resynchronization (AUTS) |
| RFC 5448 | — | EAP-AKA' (IETF, the definition of EAP-AKA') |
Handling of section numbers
TS 33.501 §6.1 / §6.1.3.1 / §6.1.3.2 are referenced as the backbone of this chapter. The §6.12.2 for SUCI de-concealment, TS 24.501 §5.4.1, and the individual section numbers of each SBI spec (29.509/29.503) may differ by edition, and some are marked to be confirmed.
FAQ¶
Q1. Which is used, 5G-AKA or EAP-AKA'?
The UDM selects based on the subscriber data and the SUCI/SUPI (TS 33.501 §6.1.2). The AMF does not specify the scheme. In many 3GPP accesses, 5G-AKA is used, but EAP-AKA' may be selected by operator policy or subscriber configuration (the specific selection conditions are implementation/configuration-dependent).
Q2. What is Synch failure?
It is the state where the SQN (sequence number) counters of the UE and the network have drifted apart. When the key matches (MAC is OK) but the SQN is out of range, the UE returns an Authentication Failure(cause=Synch failure) containing AUTS. The network resynchronizes the SQN with AUTS and re-challenges with a new AV (TS 33.102 / TS 33.501).
Q3. Who de-conceals the SUCI?
The SIDF (Subscription Identifier De-concealing Function) inside the UDM. Only the SIDF is allowed to handle the home network's private key; the AMF/AUSF do not de-conceal. The de-concealed SUPI is returned to the AUSF/AMF (TS 33.501 §6.12.2).
Q4. Does authentication always run on every Registration?
Not necessarily. When a valid 5G-GUTI and a security context can be reused, primary authentication may be skipped (the conditions depend on operator policy = situation/implementation-dependent). For details, see Registration's Q3.
Q5. Where is KSEAF used?
KSEAF is the anchor key; the SEAF(AMF) receives it and derives KAMF, from which the NAS protection keys (KNASenc/KNASint) and the AS-side keys (KgNB…) are derived. For the whole key hierarchy, see the AUSF key hierarchy.
Summary¶
- Primary authentication is mutual authentication (bidirectional verification of network→UE and UE→network), performing authentication and key agreement at the same time (AKA).
- The three-party relationship is AMF(SEAF)=starting point / AUSF=server, final check, KSEAF derivation / UDM(ARPF=AV generation, SIDF=SUCI de-concealment)=source.
- There are two schemes, 5G-AKA and EAP-AKA', and the selector is the UDM.
- 5G-AKA uses RES*/XRES* + the SEAF's HRES*/HXRES* first-stage check, while EAP-AKA' uses the EAP framework with the SEAF passing through.
- SUCI→SUPI de-concealment is performed by the home UDM/SIDF, which keeps the private key from leaving.
- The three major failure patterns: MAC failure (key mismatch) / Synch failure (SQN → AUTS resynchronization) / RES* mismatch (Reject).
- The basis is TS 33.501 §6.1 (§6.1.3.1 EAP-AKA' / §6.1.3.2 5G-AKA) / TS 24.501 §5.4.1.
Practice — comprehension check and exercises¶
Comprehension check¶
Q1. Which function de-conceals SUCI to SUPI? (answer)
The SIDF inside the UDM. Only the SIDF is allowed to handle the home network's private key; the AMF/AUSF do not de-conceal.
Q2. Where is the authentication vector (AV) generated? (answer)
The ARPF that belongs to the UDM (holds the permanent key K). It generates RAND, AUTN, XRES*, and KAUSF (in the case of 5G-AKA).
Q3. In 5G-AKA, who finally verifies RES*/XRES* and decides success or failure? (answer)
The AUSF (home). The SEAF performs the HRES*/HXRES* first-stage check, but the final decision is the AUSF's (TS 33.501 §6.1.3.2).
Q4. What token does the UE return at a Synch failure? (answer)
AUTS. With it, the network resynchronizes the SQN and re-challenges with a new AV.
Q5. What is the role of the SEAF(AMF) in EAP-AKA'? (answer)
Passthrough (transparent relay) of the EAP messages. The verification is consolidated at the AUSF (the EAP server).
Exercises¶
Question: Reorder the following main 5G-AKA steps into the correct order.
A. AUSF verifies RES* against XRES* (final decision)
B. SEAF → AUSF: Nausf_UEAuthentication_Authenticate (start authentication)
C. USIM verifies AUTN and computes RES/RES*
D. AUSF → UDM: Nudm_UEAuthentication_Get
E. SEAF verifies HRES* against HXRES* (first-stage check)
F. UDM (SIDF de-conceals SUCI, ARPF generates AV) → AUSF: HE AV(RAND,AUTN,XRES*,KAUSF)
G. SEAF → UE: Authentication Request(RAND,AUTN,ngKSI,ABBA)
H. AUSF derives XRES*→HXRES*, KAUSF→KSEAF and sends the SE AV to the SEAF
Answer
B → D → F → H → G → C → E → A
- B: Start authentication (SEAF→AUSF)
- D: AV request (AUSF→UDM)
- F: SUCI de-concealment + AV generation (UDM→AUSF)
- H: AUSF derives HXRES*/KSEAF → sends the SE AV to the SEAF
- G: Authentication Request (SEAF→UE)
- C: USIM verifies AUTN, computes RES*
- E: The SEAF's first-stage check (HRES*/HXRES*)
- A: The AUSF's final check (RES*/XRES*) → hands over KSEAF on success
Next Step¶
Here are the next steps for deepening your understanding.
- Security chapter (details of NAS security and the key hierarchy KSEAF/KAMF)
- PDU Session chapter (includes Secondary Authentication)
- Related NFs: AUSF (has the key hierarchy diagram) / UDM (ARPF/SIDF) / AMF (co-located SEAF)
- The big picture of the procedure: Initial Registration (the place of authentication)
- Dictionaries: Message Dictionary / Cause Dictionary / Protocol Dictionary / NF Dictionary / Interface Dictionary