← Book home
Part 2 · Authentication and Access Security
5

The 5G Authentication Framework

One framework, two methods, and the home network’s final word

“Authentication is the moment a network decides to spend money on you. Everything before it is a stranger knocking.” — WHY THIS IS THE MOST EXECUTED SECURITY PROCEDURE ON EARTH

Several billion times a day, somewhere between a phone and a vault of secret keys, the 5G authentication framework runs. It must work on a beach in a foreign country, inside a factory with private credentials, over Wi-Fi, and on a satellite link — and it must never let a fake network or a fake subscriber through. This chapter explains the framework’s architecture; Chapter 6 then walks the full 5G-AKA message flow byte by byte.

🎯 Learning objectives
📘 Standards reference box — Chapter 5
SpecificationTitleRelease / version verified
TS 33.5015G security — authentication clausesRel-18, v18.11.0 (2026-04)
RFC 5448 / RFC 9048EAP-AKA′ (IETF)current
TS 33.1023G AKA foundationsRel-17/18 edition
TS 33.535AKMARel-18 edition
TS 35.205-208 / 35.231-233MILENAGE / TUAK algorithm setscurrent

Checked June 2026 — verify against the latest 3GPP version.

5.1 One Framework, Every Access

4G had separate authentication stories for LTE access and non-3GPP (Wi-Fi) access. 5G unified them: one framework, one anchor key, every access type — NR, LTE connected to 5GC, untrusted Wi-Fi via N3IWF, trusted non-3GPP, wireline. The result of any successful authentication is the same object: KSEAF, the anchor key held by the serving network’s SEAF, from which all subsequent keys grow (Chapter 7).

FIGURE 5.1The Unified Authentication Framework — All Roads to One Anchor
NR (gNB)3GPP access LTE → 5GCng-eNB Untrusted Wi-Fivia N3IWF (IPsec) Trusted non-3GPPTNGF WirelineW-AGF (5G-RG) ONE AUTHENTICATION RUN 5G-AKA or EAP-AKA′ UE ↔ SEAF ↔ AUSF ↔ UDM same roles, same result K_SEAF the anchor key → entire key tree (Ch 7) unified = one security level everywhere: Wi-Fi attach is no longer the weak side door it was in 4G
Purpose: the framework’s core promise. Whatever the radio (or wire), authentication converges on the same roles and the same anchor key.

5.2 The Four Roles

Every authentication involves four parties — memorize their one-line jobs:

RoleLives inJob in one line
UE (USIM)subscriber deviceproves possession of K; verifies the network via AUTN
SEAFAMF, serving networkruns the serving side; receives and anchors K_SEAF
AUSFhome networkhome-side server: verifies the final proof, issues K_SEAF, records the verdict
UDM/ARPFhome networkpicks the method, generates the vector from K, de-conceals SUCI (SIDF)
FIGURE 5.2Authentication Roles — Who Does What, Who Sees What
SERVING NETWORK HOME NETWORK 📱 UE / USIM holds K (USIM) verifies AUTN before answering anything computes RES / RES* ✓ authenticates the network too SEAF (in AMF) relays the challenge checks HXRES* (5G-AKA) receives K_SEAF ✗ never sees K ✗ never sees XRES* (only its hash) AUSF home-side server verifies RES* — the final word ✓ derives + delivers K_SEAF keeps K_AUSF reports result to UDM UDM / ARPF SIDF: SUCI → SUPI chooses the method per subscription ARPF: holds K 🔑 runs MILENAGE/TUAK → authentication vector N12 / Nausf
Purpose: the cast and their secrets. Note what the serving network is structurally denied: K stays home, and even the expected response only reaches it as a hash.

5.3 5G-AKA in Brief

5G-AKA is the native method — 3G AKA’s grandchild, upgraded with home control. The shape (full flow in Chapter 6): UDM builds a vector from K; the challenge (RAND, AUTN) travels via AUSF and SEAF to the UE; the USIM verifies AUTN and answers; the SEAF pre-checks a hash of the response, but the AUSF in the home network performs the authoritative check.

FIGURE 5.35G-AKA — the High-Level Flow
UE SEAF AUSF UDM/ARPF ① SUCI ② auth request ③ get vector ④ ARPF runs f1–f5 on K→ 5G HE AV ⑤ vector (XRES*) ⑥ RAND, AUTN, HXRES* ⑦ challenge: RAND + AUTN ⑧ RES* ⑨ SEAF: hash pre-check ⑩ AUSF: REAL check — final word
Purpose: shape before detail. Two verification points — a fast local hash check, then the authoritative home check. Chapter 6 expands every arrow.

5.4 EAP-AKA′ in Brief

EAP-AKA′ (RFC 9048) wraps the same AKA cryptography in the EAP (Extensible Authentication Protocol) framework. The architectural difference is trust placement: in EAP, the AUSF is the EAP server and the only verifier — the SEAF is a pass-through authenticator with no pre-check at all. Same USIM, same K, same vector math; different protocol envelope and slightly different key derivation (CK′/IK′, with the serving network name bound inside the vector derivation itself).

FIGURE 5.4EAP-AKA′ — the High-Level Flow
UE (EAP peer) SEAF — pass-through AUSF — EAP server ① EAP-Request / AKA′-Challenge (RAND, AUTN, KDF=SN name) USIM verifies AUTN ✓computes RES, CK′/IK′ ② EAP-Response / AKA′-Challenge (RES) ③ ONLY verification — at the AUSF ④ EAP-Success · K_SEAF delivered to SEAF alongside SEAF forwards EAP transparently — it cannot judge the exchange, only receive the resulting anchor key
Purpose: the EAP shape. One verifier, full home control by construction — the visited network is a courier.

Choosing between them

FIGURE 5.55G-AKA vs EAP-AKA′ — Side by Side
5G-AKA verification:SEAF hash pre-check + AUSF final SEAF role:active — checks HXRES* envelope:native NAS messages SN binding:in K_AUSF / K_SEAF derivation typical use:public PLMNs (dominant choice) support:mandatory for UE & serving PLMN 3GPP home:TS 33.501 clause 6 EAP-AKA′ verification:AUSF only (EAP server) SEAF role:pass-through authenticator envelope:EAP inside NAS / IKEv2 / … SN binding:inside vector (CK′/IK′ KDF) typical use:SNPN, non-3GPP, flexibility support:mandatory too — UDM decides per sub IETF home:RFC 9048 (+ TS 33.501 Annex F)
Purpose: the decision card. Same cryptography, different trust topology — and in private networks (Ch 21) the EAP envelope also admits entirely different credentials (certificates via EAP-TLS).

5.5 Authentication Vectors: the Home Network’s Ammunition

An authentication vector (AV) is a one-time package proving the home network’s knowledge of K. The ARPF computes, from K and a fresh RAND + sequence number SQN, via the MILENAGE or TUAK function families (f1…f5):

FIGURE 5.6The Vector Factory — f1…f5 Inside the ARPF
K 🔑long-term key RANDfresh 128-bit random SQNsequence number AMF fieldmgmt bits (sep. bit=1!) MILENAGE / TUAK f1 → MAC f2 → XRES f3 → CK f4 → IK f5 → AK + operator constants (OP_c / TOP_c) MAC→ packed into AUTN XRESexpected response CK · IKkey material → tree AKhides SQN in AUTN AUTN = (SQN ⊕ AK) ∥ AMF ∥ MAC the network’s proof token one AV = ( RAND, AUTN, XRES, CK∥IK ) single use, never reused — Chapter 6 shows its 5G transformations (XRES*→HXRES*, CK/IK→K_AUSF)
Purpose: where vectors come from. Note the AMF “separation bit” — set to 1, it marks the vector as 5G-only, blocking cross-generation vector reuse attacks.
💡 Key idea
The AV design lets the home network delegate the challenge without delegating the secret. A serving network can run authentication for millions of roamers while the key K never leaves the home ARPF — only single-use, SN-bound evidence derived from it travels.

5.6 Mutual Authentication: Who Proves What

FIGURE 5.7Mutual Authentication — Who Proves What to Whom
📱 UE / USIM judge of: AUTN prover of: RES / RES* 🌐 NETWORK (home+serving) prover of: AUTN (MAC over SQN) judge of: RES* (at AUSF) “I am your real network, and FRESH” AUTN: MAC proves K, SQN proves freshness “I hold the real USIM for this SUPI” RES*: correct answer computable only with K both proofs are bound to THIS serving network’s name — a third party can’t replay them elsewhere
Purpose: the symmetric contract. Each side both proves and judges — the asymmetry of 2G is gone.

Serving network name binding

The serving network name — the string 5G:mnc<MNC>.mcc<MCC>.3gppnetwork.org — enters the key derivations (KAUSF, KSEAF; inside the vector for EAP-AKA′). Consequence: keys minted for one network are cryptographically useless in another. The UE computes the same name independently from the network it believes it is on — a mismatch breaks the keys, killing network-spoofing-by-relay tricks.

FIGURE 5.8Serving Network Name — Construction and Binding
SN name = “5G:mnc045.mcc404.3gppnetwork.org” service code + the serving PLMN’s identity UE side builds SN name from the PLMN it believes it is attached to Home network side uses the SN name the AUSF verified for the requesting SEAF SAME name → SAME keys different name → broken keys → attach fails a rogue “network X” relaying real network Y’s challenge mints keys for Y’s name — and can never talk to the UE as X
Purpose: the quiet masterpiece of 5G authentication. One string in the KDF closes an entire class of network-impersonation attacks.

Increased home control

4G let the visited MME judge authentication alone — and roaming-fraud history shows what followed: visited networks asserting a subscriber was present (and billable) when they were not. 5G moves the verdict home: the AUSF verifies RES* itself, then informs the UDM of every result (Nudm_UEAuthentication_ResultConfirmation). The home network can refuse service when claimed location and authentication history don’t add up.

FIGURE 5.9Increased Home Control — Why the AUSF Gets the Final Word
4G / EPS visited MMEjudges XRES alone home HSSships vectors, then blind FRAUD PATTERN (real history) rogue/compromised partner claims “your subscriber is here, authenticated” → billing fraud, fake location, interception setups — home network can’t disprove it 5G visited SEAFhash pre-check only home AUSFverifies RES* — the verdict HOME CONTROL ✓ verdict computed at home, per authentication ✓ AUSF → UDM ResultConfirmation: auditable trail ✓ UDM can cross-check later requests vs auth history
Purpose: the roaming-fraud lesson institutionalized. The visited network can hurry the process along but can no longer manufacture its outcome.

5.7 Method Selection and Non-3GPP Access

The UDM chooses the method, per subscriber — it de-conceals the SUCI, reads the subscription’s authentication policy, and returns either a 5G-AKA vector or an EAP-AKA′ start to the AUSF. The UE doesn’t request a method; it answers whatever arrives. (In SNPNs, the choice extends to key-based EAP methods like EAP-TLS — Chapter 21.)

FIGURE 5.10Authentication Method Selection in the UDM
Nudm_UEAuthentication_Get (SUCI, SN name) SIDF: SUCI → SUPI read subscription auth policy 5G-AKA generate 5G HE AV (XRES* derived, Ch 6) EAP-AKA′ CK′/IK′ vector (SN-bound) AUSF becomes EAP server SNPN only: other EAP methods e.g. EAP-TLS (certificates) — Ch 21
Purpose: who decides. Method choice is subscription data in the UDM — which is why the same phone can authenticate differently in your public and private networks.

Untrusted non-3GPP access: the N3IWF path

Over public Wi-Fi, the UE builds an IPsec tunnel to the N3IWF (Non-3GPP InterWorking Function) using IKEv2; the very same NAS registration and authentication run inside it; EAP-5G encapsulates NAS over IKEv2 during setup. Result: identical authentication, identical anchor key, identical NAS security — over someone else’s Wi-Fi.

FIGURE 5.11Untrusted Non-3GPP Access — Same Authentication via N3IWF
📱 UE on any Wi-Fi untrusted Wi-Fi café · hotel · home N3IWF IPsec terminator AMF/SEAF → AUSF → UDM N2 — identical chain as NR access IKEv2 / IPsec tunnel — EAP-5G carries NAS inside the Wi-Fi network sees only ESP packets — registration, authentication and NAS run unchanged inside the tunnel trusted non-3GPP (TNGF) and wireline (W-AGF) follow the same pattern with access-side trust
Purpose: unified means unified. The coffee-shop Wi-Fi becomes just another untrusted pipe; 5G security rides inside it end-to-end.

5.8 Two Framework Extensions: NSWO and AKMA

NSWO (Non-Seamless WLAN Offload, Rel-17): authenticate to a Wi-Fi network itself with your USIM credentials via the 5GC (EAP-AKA′ to the AUSF through an NSWO function) — Wi-Fi traffic stays local, no 5G session, but the SIM vouches for you.

AKMA (Authentication and Key Management for Applications, TS 33.535): reuse the network authentication to bootstrap application keys. From KAUSF, the UE and the AAnF (AKMA Anchor Function) derive KAKMA → per-application keys KAF. An app gets a SIM-rooted shared key without passwords and without running its own AKA.

FIGURE 5.12AKMA — Application Keys Rooted in Network Authentication (TS 33.535)
primary authentication 5G-AKA / EAP-AKA′ (this chapter) K_AUSF lives in AUSF + UE K_AKMA + A-KID → AAnF (anchor fn) K_AF per application UE AAnF (core) AF (application) ① app session request + A-KID (key identifier) ② “give me K_AF for this A-KID” ③ K_AF + lifetime — UE derives the same K_AF locally result: app and UE share a SIM-rooted key — no passwords, no extra AKA run, no app-stored credentials
Purpose: the framework pays dividends beyond access. One successful network authentication can securely bootstrap every operator-partnered application — Chapter 12 returns to this at the NEF.
FIGURE 5.13Vector Anatomy — What Home Keeps vs What Serving Receives
5G HE AV — stays HOME (UDM→AUSF) RAND AUTN XRES* (the real expected answer) K_AUSF (root of the visit’s tree) 5G SE AV — sent to SERVING (AUSF→SEAF) RAND AUTN HXRES* (only a HASH of the answer) K_SEAF (delivered after success) a compromised visited network cannot fake a success: it never holds XRES*, and K_SEAF arrives only after the AUSF’s verdict
Purpose: the two vector flavors and the trust story they encode. The hash trick (HXRES*) lets the SEAF pre-screen without holding anything forgeable.
FIGURE 5.14Trusted Non-3GPP and Wireline — the Other Two Doors
📱 UEUSIM inside 🏠 5G-RGresidential gateway TNGFtrusted Wi-Fi gateway W-AGFwireline gateway same AMF/SEAF → AUSF → UDM same NAS · same anchor key · same framework operator-trusted Wi-Fi fixed broadband
Purpose: completeness of the “every access” claim — fixed-mobile convergence rides the same four roles.
FIGURE 5.15The Framework on One Card — Decision Map
WHO chooses the method? → the UDM, from subscription data WHO verifies the UE? → 5G-AKA: SEAF (hash) + AUSF (final) → EAP-AKA′: AUSF only WHO verifies the network? → always the USIM, via AUTN WHAT binds keys to the network? → SN name in every derivation WHAT does the home learn? → every verdict (ResultConfirmation to UDM) WHAT comes out? → K_SEAF — always, for every access type → then the whole tree: Chapter 7 remember the card and Chapter 6 becomes pure mechanics
Purpose: the chapter as a single revision card — every question this framework answers, and where the answer lives.

5.9 The Practical Operator View

Common misconfiguration risks

5.10 Threats and Mitigations

ThreatVectorFramework defense
Fake networkrogue gNB challenges UEAUTN verification in USIM (MAC from K)
Challenge replayold vector re-sentSQN freshness; AV single-use
Visited-network fraudfabricated auth successAUSF verdict + UDM result confirmation
Key misuse across networksrelay/spoof PLMN identitySN name binding in derivations
Cross-generation vector abuse5G vector replayed at 4GAMF separation bit = 1
Vector theft in transitinterconnect interceptionXRES* hashed (HXRES*); SBA TLS; SEPP

5.11 Terminology, Example, Checklist

TermMeaning
AKA / 5G-AKA / EAP-AKA′The challenge-response family / native 5G method / EAP-wrapped method
AV / 5G HE AV / 5G SE AVAuthentication vector / home-environment flavor / serving-environment flavor
RAND, AUTN, XRES(*), HXRES*Challenge, network proof token, (5G) expected response, its hash
MILENAGE / TUAKThe two standardized algorithm sets implementing f1–f5
SN nameServing network name string bound into key derivations
N3IWF / TNGF / W-AGFGateways for untrusted / trusted non-3GPP / wireline access
NSWO / AKMA / AAnFSIM-auth for plain Wi-Fi / application key bootstrapping / its anchor function

Real network example. A European MVNO migrating subscribers onto a host operator’s 5G SA core saw a burst of authentication failures — only for roamers in one partner country. Root cause: the partner’s SEAF sent a malformed serving network name (legacy formatting from a 4G-era config). The home AUSF derived different keys than the UEs did, and every attach died at the SMC step. The trail that found it: failure cause analysis showed successful AUTN verification (no MAC failures) but consistent post-auth security mode failures — exactly the SN-name-mismatch signature. The framework’s binding worked as designed; the configuration didn’t.

Chapter Summary

? Review Questions

  1. Why does the serving network receive HXRES* instead of XRES*, and what attack does this design choice frustrate?
  2. In EAP-AKA′, what exactly does the SEAF verify? What does that imply about trust placement?
  3. The UDM — not the UE, not the AMF — selects the authentication method. Give two reasons this is the right place.
  4. Explain how the AMF field’s “separation bit” prevents a 5G vector from being abused against a 4G network.
  5. Walk through what breaks, step by step, when a SEAF presents serving network name X while the UE computes name Y.
  6. Your roaming partner claims your subscriber authenticated at 03:14. Which two 5G records let you verify or refute this — and which 4G gap do they close?
  7. What security does the N3IWF path give a subscriber on hostile café Wi-Fi, layer by layer?
  8. How does AKMA give an application a shared key without the app ever seeing AKA — and what single key does it all grow from?
🧪 Mini lab — watch the method choice happen

In Open5GS, the UDM/AUSF debug logs show the full framework in action. (1) Register a UERANSIM UE and grep the logs for the Nudm_UEAuthentication_Get exchange — find the method decision and the vector hand-off. (2) Locate the HXRES* computation in the AUSF log and the SEAF-side comparison in the AMF log — two different processes, exactly as Figure 5.3 draws. (3) Change the UE’s key K in the UERANSIM config (one hex digit) and watch where the flow now dies — confirm it is a MAC failure at the USIM side, not at the network. You have just located all four roles in running code.