◉ETESALWI-FI × MOBILE CORE
↓ Download course ZIPA learning notebook · Moallemفارسی ↗
NETWORK NOTEBOOK / 03

UNDERSTAND THE PROBLEM FIRST

Wi-Fi or SIM authentication? Components and standard message paths

Foundations first · Bilingual · Examples and practice

Previous lesson · Course map · فارسی

1. Direct answer and scope

Wi-Fi is an access path; SIM/USIM can hold subscription credentials. They are not alternatives. Home Internet may require local WLAN credentials only. For mobile subscription services over Wi-Fi, the handset can use USIM while carrying authentication exchanges through Wi-Fi to the operator. The AP need not know the SIM secret.

Identify the credential holder, protocol executor, response verifier and enforcement point. Our case is an ordinary USIM subscription on a public operator network. Emergency access, private-network authentication, other SNPN credentials, fast re-authentication and full roaming variants have separate procedures.

Baselines: TS 33.402 18.0.0, TS 29.273 18.6.0, TS 33.501 18.8.0. These do not establish compliance for every product/release. Primary references [S1]–[S15] are below. Diagrams and examples are original teaching material.

2. Whose identity, for which access?

Situation Typical credential Established identity/access
Home WPA2-Personal Shared password and derived keys Local access, not mobile subscription identity
WPA3-Personal Password using SAE Local access, not automatic operator authorization
Enterprise 802.1X Certificate or another EAP-method credential Identity recognized by the organization
SIM-based operator WLAN USIM credential and profile-permitted method Subscription identity toward operator systems
Home WLAN plus ePDG Local WLAN credential; USIM for operator access Two separate authentication domains

WPA2/WPA3 and 802.1X are not one protocol. IEEE 802.1X provides port-based access control and EAP encapsulation over LAN, EAPOL [S5]. EAP distinguishes device peer, access-side authenticator, and EAP server executing the method. A pass-through authenticator relays exchanges rather than independently computing the subscriber's response [S4]. WPA3-SAE is also documented by [S13].

An “802.11 Authentication” frame is not necessarily subscriber authentication: Open System exchanges do not prove SIM identity. Inspect actual AKM, method and later exchanges rather than a frame name alone.

3. SIM, UICC, USIM and device software

First finish the WLAN path. In ordinary WPA2-Personal, the peers obtain a base PMK from the PSK/passphrase and relevant configuration, without sending a plaintext password to the AP. WPA3-Personal uses SAE before the 4-way handshake [S13]. An EAP-based WLAN can obtain PMK-related material from successful EAP according to its profile. None is the USIM's long-term K.

Condensed ordinary RSN 4-way handshake [S14]:

Message Direction Main role
M1 AP → device ANonce and continuation data
M2 Device → AP SNonce and MIC, after device PTK derivation
M3 AP → device Confirmation and protected key data, ordinarily including GTK
M4 Device → AP Final exchange acknowledgement

PMK is the base key, PTK contains connection-specific keys, and GTK serves group traffic. This handshake uses EAPOL-Key; it does not itself mean SIM-based EAP-AKA has run. This is an educational view: replay counters, installation and AKM variants follow the selected IEEE 802.11 edition. Layer-2 EAPOL needs no preceding DHCP. Ordinary DHCP/IP configuration commonly follows access establishment, so not every authentication runs after IP.

  • UICC: secure card platform hosting applications such as USIM.
  • USIM: subscription application/data providing credential-related AKA operations. An active eUICC profile can contain USIM; eSIM does not eliminate operator credentials [S15].
  • ME/UE: equipment and software. EAP, IKEv2, USIM invocation, message construction and connection management are distributed across functions; the whole protocol does not execute in the card.
  • K: long-term secret shared by USIM and the home authentication domain. AKA does not transmit K itself over Wi-Fi.

AKA means Authentication and Key Agreement: identity assurance plus keying material for communication. Network authentication data and USIM operations cooperate. TS 33.102 §6.3 supplies the foundation [S3]. Match card operations to TS 31.102, notably AUTHENTICATE [S12]. Standards do not determine a vendor's handset process names or software packaging.

4. Component responsibilities

Component Role here Incorrect assumption
AP/controller Local access; may host 802.1X authenticator Stores every subscriber K
Router/DHCP IP forwarding/addressing Verifies AKA responses
Historical WAG Its architecture's routing/policy enforcement Necessarily the EAP server
TWAP in TWAN WLAN authentication-related role Performs all TWAG functions
TWAG Trusted WLAN gateway toward EPC Independently owns all secrets and decisions
ePDG IKEv2/IPsec endpoint and EAP relay Computes expected responses from subscriber K
3GPP AAA Server EAP server for these EPS paths using authentication data/profiles RADIUS and Diameter are physical equipment names
HSS/AuC Home profile/authentication-data functions Must hand K to the AP
N3IWF/TNGF Non-3GPP gateways toward 5GC Equivalent to AUSF
AMF/SEAF Serving-side NAS/access control and authentication anchor Long-term secret database
AUSF and UDM/ARPF Authentication and authentication-data generation roles Must be one physical machine

These are logical roles and can be colocated. AAA means Authentication, Authorization and Accounting, not a protocol. RADIUS/Diameter carry AAA information. TWAN is described in [S9 §16], and 5G roles in [S7].

5. Proof without transmitting the secret

For full initial AKA/EAP-AKA:

  1. Home authentication creates a challenge and expected response: basic AKA names include RAND, AUTN, XRES.
  2. UE extracts RAND and network token AUTN from EAP method data and invokes USIM.
  3. USIM checks validity/freshness; successful execution yields RES and associated keying material.
  4. UE constructs the EAP response with required attributes including AT_RES and AT_MAC. USIM need not construct the entire EAP frame.
  5. EAP server checks response and message protection. Knowing an IMSI or telephone number does not generate valid proof.

RAND is not a user-typed OTP; AUTN is not just an identifier; RES is not K. Do not transfer the basic comparison unchanged across generations: 5G-AKA also specifies RES*, XRES*, HXRES* and related processing. This section teaches the AKA/EAP-AKA foundation [S3 §6.3; S6 §§2–3].

Invented teaching model, NOT a standard formula:
network: expected = response(secret, fresh_challenge)
USIM:    answer   = response(secret, fresh_challenge)
server:  verify(answer, expected, message_protection)

Transport a secret-dependent result, not the secret.

Real implementations follow specified algorithms, KDFs, encodings, freshness, MAC checks and failure behavior; a simple hash is not a substitute. MAC failure and synchronization failure are distinct; AKA defines resynchronization mechanisms [S6].

6. Path A: home Wi-Fi and EPC ePDG

Local WLAN access and separate USIM subscription authentication through ePDG, AAA and HSS

Original illustration: Wi-Fi provides transport; the subscription secret is not handed to the AP.

AP supplies IP connectivity. Subscriber EAP terminates in 3GPP AAA Server, while ePDG relays EAP. TS 33.402 §8.2.2 uses EAP-AKA for this tunnel authentication [S1].

USIM ↔ UE software
          |
     Wi-Fi / IP   (AP has no SIM secret)
          | SWu: IKEv2 with EAP inside IKE_AUTH
         ePDG
          | SWm: Diameter with EAP-Payload
    3GPP AAA Server
          | SWx: authentication data/profile procedures
        HSS/AuC

Successful initial flow, omitting optional notifications, caching and full roaming variants:

Step Exchange Message/data Result
1 UE ↔ WLAN Local access, IP configuration ePDG reachable, not completed AKA
2 UE ↔ ePDG IKE_SA_INIT, proposals, nonce, DH Initial IKE, not subscriber proof
3 UE → ePDG First IKE_AUTH with identity/APN per profile, initially no UE AUTH Request EAP authentication
4 ePDG ↔ AAA ↔ HSS SWm DER/DEA; SWx MAR/MAA if required Authentication data available; not necessarily one message pair
5 AAA → ePDG → UE EAP-Request/AKA-Challenge within IKE_AUTH response; also validate gateway authentication UE invokes USIM to construct answer
6 UE → ePDG → AAA EAP-Response/AKA-Challenge AAA checks method response
7 AAA → ePDG → UE EAP success; keying material to authorized component EAP result bound into IKE
8 UE ↔ ePDG Final AUTH and continued Child SA establishment Complete relevant protection/context

Ordering: [S1 figure 8.2.2-1]; wire Diameter commands: [S2 §§7–8]; general IKE/EAP: [S8 §§1.2, 2.16]. EAP-Success alone does not complete IKE, network session and service. IKE SA protects IKE control; Child SAs protect IPsec traffic [S8].

Authentication has two directions: UE validates ePDG identity/certificate according to profile; operator verifies subscription via EAP. USIM possession does not remove gateway-certificate validation.

7. Path B: trusted WLAN and EPC TWAG

Authentication may run during WLAN access before ordinary IP. Do not assume ePDG's IKE_AUTH encapsulation. The selected trusted procedure uses EAP-AKA′; §6.1 prohibits EAP-SIM for EPS non-3GPP access authentication. General EAP capability is not permission to select arbitrary methods [S1 §§6.1–6.2].

UE / USIM
    | EAPOL over WLAN in an 802.1X scenario
trusted access / TWAN authenticator
    | AAA carriage; EPC-side STa toward 3GPP AAA Server
3GPP AAA Server ↔ HSS
    | result/access-appropriate keying material
WLAN enforcement + onward connection via TWAG to PGW

AP-to-AAA infrastructure may use RADIUS, with Diameter on the EPC side. Specify each hop separately. RADIUS is not AKA; EAPOL is not AP-to-HSS transport. RFC 3579 defines EAP carriage in RADIUS Access-Request, Access-Challenge, Access-Accept and Access-Reject [S10].

EAP-AKA′ can use AKA-related credentials but differs in key derivation/binding. RFC 9048 is a later backward-compatible specification; the selected TS 33.402 cites RFC 5448. Read profile and references together rather than replacing requirements mechanically with the newest RFC [S11].

8. Path C: Wi-Fi and 5GC

For public 5GC with 3GPP credentials, primary authentication can use 5G-AKA or EAP-AKA′. AUSF, UDM/ARPF and AMF/SEAF have distinct roles. EAP-5G carries NAS during non-3GPP access establishment; it does not replace the underlying subscriber authentication method [S7 §§6.1.3, 7.2.1].

UE/USIM → Wi-Fi with IP → N3IWF → AMF/SEAF → AUSF → UDM/ARPF
            NWu: IKEv2      N2       control/authentication
          EAP-5G carries NAS
          NAS carries selected authentication exchanges

UE selects N3IWF and initiates IKE; EAP-5G carries registration/NAS; primary authentication runs if required; NAS security and access context are established and IKE/IPsec continues. Existing context may be reused under specified conditions. N3IWF is not holder of all K values or the AUSF's EAP-AKA′ method server.

Trusted 5G uses TNAP/TNGF: initial EAP-5G travels over layer 2/AAA, not the same initial N3IWF tunnel. The NAS-capable UE procedure later establishes NWt with TNGF. Trusted does not remove security mechanisms [S7 §7A.2.1]. Follow that procedure for exact ordering; TWIF/devices lacking relevant NAS support have separate flows.

9. Standards map

Question Reference
USIM proof of identity TS 33.102 §6.3; RFC 4187
EAP peer/authenticator/server RFC 3748 §1.2; IEEE 802.1X
Trusted/ePDG method selection TS 33.402 §§6.1, 6.2, 8.2.2
STa/SWm/SWx and commands TS 29.273 §§5, 7, 8
IKE_AUTH and EAP RFC 7296 §2.16; TS 33.402 §8.2
5G primary authentication roles TS 33.501 §§6.1.3, 7.2.1, 7A.2.1

10. Worked troubleshooting example

WLAN password works, IP is assigned and browsing succeeds, but ePDG access fails:

Observation Supported investigation Invalid conclusion
No IKE_SA_INIT response Reachability, filtering, DNS/destination, gateway availability “USIM definitely broken”
Certificate rejected by UE Trust anchor, name, time, certificate profile “Wrong Wi-Fi password”
Synchronization failure after challenge Resynchronization path and mismatch cause “Always wrong K”
EAP succeeds, no data Final AUTH, SAs, session, forwarding “Every service must work”

Evidence depends on capture location. AP need not see EAP plaintext inside protected IKE_AUTH; UDP 500/4500 alone does not identify the method. Correlate UE/ePDG/AAA logs using time and session identifiers; exclude real keys and personal identities from public reports.

11. Implementation prerequisites

Write a profile sheet: EPC/5GC, trusted/untrusted, UE capabilities and authorized USIM access, required method, protocol endpoints, standard editions and actual WAG role. Then design:

  1. EAP/IKE/AAA states, timers, retries;
  2. authorized lab authentication-data integration, never IMSI as proof;
  3. realm routing/temporary identities;
  4. context and SA installation/release;
  5. distinct credential, MAC, synchronization, certificate, authorization and forwarding errors;
  6. interoperability tests using successful/failing traces in that profile.

This is an engineering map, not a complete production checklist. Telephone number, MAC, IMEI and IMSI are not credentials. Human authentication is not identical to subscription-credential possession; USIM PIN and screen unlock are separate steps.

12. Practice and continuation

  1. Home WLAN/ePDG: who holds K, serves EAP and terminates IKE?
  2. Can this EPS profile use EAP-SIM just because AP supports it? Cite the clause.
  3. Why are EAPOL and SWm different hops?
  4. Explain EAP-AKA′ versus EAP-5G in a sentence.
  5. Another handset works with the same WLAN password. Does that prove the first USIM's state?
  6. Authentication succeeds but a call fails. Name two later independent stages.
Reveal answers after your attempt
  1. K is in USIM and home authentication domain; 3GPP AAA Server serves EAP, ePDG terminates network-side IKE/IPsec, and AP gives local access.
  2. No: TS 33.402 v18.0.0 §6.1 excludes EAP-SIM for EPS non-3GPP authentication. Trusted §6.2 uses AKA′; ePDG §8.2.2 uses AKA.
  3. EAPOL carries EAP over LAN; SWm connects ePDG/AAA using Diameter. Endpoints and encapsulation differ.
  4. EAP-AKA′ authenticates and agrees keys; EAP-5G carries NAS without replacing primary authentication.
  5. No. Another handset's local-access success does not conclusively establish the first subscription's state.
  6. IKE/IPsec and data context, session/forwarding, then IMS registration/SIP call procedures are separate checks.

Repair: name the evidence collection point for each error. Add a role and protocol if your answer only names Wi-Fi or SIM.

Continue when you can locate credential, method executor, transport intermediary and enforcement point for each path without reading. Repair role errors in §4 and message errors in §§6–8. Reconstruct §9 tomorrow from memory; this is only a review suggestion.

Primary references and date

Practical continuation: Message analysis and troubleshooting laboratory.

Checked 2026-10-16. Editions matter; this explanation does not replace complete normative requirements.