Quick-Reference Cheat Sheets
One-page protocol summaries — handshakes, message flows, and key derivation
TLS 1.3 Handshake
RFC 8446 · Full & 0-RTT flows
IKEv2 SA Negotiation
RFC 7296 · IKE_SA_INIT + AUTH
Diameter Message Flow
RFC 6733 · CER/CEA + Session
Full Handshake (1-RTT)
Client Server
│ │
│ ─── ClientHello ──────────────────────────────────► │ Contains:
│ + key_share (DH public) │ • supported_versions: 0x0304
│ + supported_versions │ • cipher_suites
│ + signature_algorithms │ • key_share: x25519/P-256
│ + psk_key_exchange_modes │
│ │
│ ◄── ServerHello ────────────────────────────────── │ Contains:
│ + key_share (DH public) │ • selected cipher suite
│ + supported_versions │ • selected key_share
│ │
│ {EncryptedExtensions} │ ── Handshake keys derived ──
│ {CertificateRequest*} │
│ {Certificate} │ Server cert chain
│ {CertificateVerify} │ Signature over transcript
│ ◄── {Finished} ─────────────────────────────────── │ HMAC over transcript
│ │
│ {Certificate*} │ Client cert (if requested)
│ {CertificateVerify*} │
│ ─── {Finished} ──────────────────────────────────► │
│ │
│ ◄═══════════ Application Data ═══════════════► │ ── Application keys derived ──
│ │
{} = encrypted with handshake keys * = optional
0-RTT Resumption Flow
Client Server
│ │
│ ─── ClientHello ──────────────────────────────────► │
│ + early_data │
│ + pre_shared_key │
│ + key_share │
│ ─── (0-RTT Application Data) ───────────────────► │ Encrypted w/ early keys
│ │
│ ◄── ServerHello (+ pre_shared_key) ─────────────── │
│ {EncryptedExtensions} │
│ ◄── {Finished} ─────────────────────────────────── │
│ │
│ ─── {EndOfEarlyData} ────────────────────────────► │
│ ─── {Finished} ──────────────────────────────────► │
│ │
│ ◄═══════════ Application Data ═══════════════► │
⚠ 0-RTT data is NOT forward-secret and is replayable
Key Schedule
Key Derivation Chain (HKDF-based)
Early Secret= HKDF-Extract(0, PSK or 0)Handshake Secret= HKDF-Extract(Derive-Secret(Early, "derived"), DHE)Master Secret= HKDF-Extract(Derive-Secret(HS, "derived"), 0)client_handshake_traffic_secret= Derive-Secret(HS, "c hs traffic", CH..SH)server_handshake_traffic_secret= Derive-Secret(HS, "s hs traffic", CH..SH)client_application_traffic_secret_0= Derive-Secret(MS, "c ap traffic", CH..SF)server_application_traffic_secret_0= Derive-Secret(MS, "s ap traffic", CH..SF)
Cipher Suites (TLS 1.3)
| Suite | AEAD | Hash | 3GPP Usage |
|---|---|---|---|
TLS_AES_128_GCM_SHA256 | AES-128-GCM | SHA-256 | Default for SBI, NRF |
TLS_AES_256_GCM_SHA384 | AES-256-GCM | SHA-384 | High-security deployments |
TLS_CHACHA20_POLY1305_SHA256 | ChaCha20-Poly1305 | SHA-256 | Mobile clients (SW crypto) |
3GPP mandate (TS 29.500 §5.2): All 5G SBI interfaces MUST use TLS 1.3 with mutual authentication.
Certificate profiles per TS 33.310. SEPP N32-c uses TLS; N32-f uses JWE/JWS (RFC 7516/7515).
IKE_SA_INIT + IKE_AUTH Exchange
Initiator Responder
│ │
│ ─── IKE_SA_INIT Request ────────────────────────► │ HDR, SAi1, KEi, Ni
│ SA: proposal (ENCR, PRF, INTEG, DH) │
│ KE: DH public value │
│ Nonce: Ni (random) │
│ │
│ ◄── IKE_SA_INIT Response ─────────────────────── │ HDR, SAr1, KEr, Nr
│ SA: selected proposal │ [CERTREQ]
│ KE: DH public value │
│ Nonce: Nr (random) │
│ │
│ ════ IKE SA established (encrypted) ════ │
│ │
│ ─── IKE_AUTH Request ───────────────────────────► │ HDR, SK {IDi, [CERT],
│ IDi: initiator identity │ [CERTREQ], [IDr],
│ AUTH: signature or PSK proof │ AUTH, SAi2, TSi, TSr}
│ SAi2: child SA proposal │
│ TSi/TSr: traffic selectors │
│ │
│ ◄── IKE_AUTH Response ────────────────────────── │ HDR, SK {IDr, [CERT],
│ IDr: responder identity │ AUTH, SAr2, TSi, TSr}
│ AUTH: signature or PSK proof │
│ SAr2: selected child SA │
│ TSi/TSr: narrowed selectors │
│ │
│ ════ Child SA (IPsec SA) established ════ │
CREATE_CHILD_SA (Rekey / New SA)
Initiator Responder
│ │
│ ─── CREATE_CHILD_SA Request ────────────────────► │ HDR, SK {SA, Ni,
│ [optional KE for PFS] │ [KEi], TSi, TSr}
│ │
│ ◄── CREATE_CHILD_SA Response ─────────────────── │ HDR, SK {SA, Nr,
│ │ [KEr], TSi, TSr}
Key Derivation
IKEv2 Key Material
SKEYSEED= PRF(Ni | Nr, DH-shared-secret){SK_d, SK_ai, SK_ar, SK_ei, SK_er, SK_pi, SK_pr}= PRF+(SKEYSEED, Ni | Nr | SPIi | SPIr)SK_d— used to derive keys for child SAsSK_ai/SK_ar— IKE SA integrity keysSK_ei/SK_er— IKE SA encryption keysSK_pi/SK_pr— used in AUTH payload computation
Common Transform IDs
| Type | Name | ID | 3GPP Notes |
|---|---|---|---|
| ENCR | ENCR_AES_CBC | 12 | Legacy, still supported |
| ENCR | ENCR_AES_GCM_16 | 20 | Recommended (combined-mode) |
| PRF | PRF_HMAC_SHA2_256 | 5 | Default for NDS |
| INTEG | AUTH_HMAC_SHA2_256_128 | 12 | When not using combined-mode |
| DH | ECP_256 | 19 | NIST P-256 (required) |
| DH | CURVE_25519 | 31 | X25519 (recommended) |
3GPP mandate (TS 33.210 §5): IPsec ESP tunnel mode is REQUIRED between all NEs in the security domain.
IKEv2 with certificate-based authentication (TS 33.310). DH group 19 or 31 required for key exchange.
Capabilities Exchange (CER/CEA)
Diameter Client Diameter Server │ │ │ ─── CER (Capabilities-Exchange-Request) ────────► │ │ Origin-Host: "mme01.epc.mnc001.mcc001.3gpp" │ │ Origin-Realm: "epc.mnc001.mcc001.3gppnetwork" │ │ Host-IP-Address: 10.0.1.10 │ │ Vendor-Id: 10415 (3GPP) │ │ Auth-Application-Id: 16777251 (S6a) │ │ Supported-Vendor-Id: 10415 │ │ │ │ ◄── CEA (Capabilities-Exchange-Answer) ───────── │ │ Result-Code: 2001 (DIAMETER_SUCCESS) │ │ Origin-Host: "hss01.epc.mnc001.mcc001.3gpp" │ │ Auth-Application-Id: 16777251 (S6a) │ │ │ │ ════ Diameter peer connection ready ════ │
Authentication (S6a: AIR/AIA)
MME HSS │ │ │ ─── AIR (Auth-Info-Request) ─────────────────────► │ │ Session-Id: "mme01...;1234;5678" │ │ User-Name (IMSI): "001010123456789" │ │ Visited-PLMN-Id: 0x00F110 │ │ Requested-EUTRAN-Auth-Info: │ │ Number-of-Requested-Vectors: 1 │ │ Immediate-Response-Preferred: 1 │ │ │ │ ◄── AIA (Auth-Info-Answer) ────────────────────── │ │ Result-Code: 2001 │ │ Authentication-Info: │ │ E-UTRAN-Vector: │ │ RAND (16 bytes) │ │ XRES (8 bytes) │ │ AUTN (16 bytes) │ │ KASME (32 bytes) │
Session Authorization (Gx: CCR/CCA)
PCEF (P-GW) PCRF
│ │
│ ─── CCR-I (Credit-Control-Request, INITIAL) ────► │
│ CC-Request-Type: INITIAL_REQUEST (1) │
│ Subscription-Id (IMSI / MSISDN) │
│ IP-CAN-Type: 3GPP-EPS (5) │
│ Called-Station-Id (APN) │
│ Framed-IP-Address │
│ Default-EPS-Bearer-QoS: │
│ QoS-Class-Identifier: 9 │
│ Alloc-Retention-Priority: {PL:15, PCI, PVI} │
│ │
│ ◄── CCA-I (Credit-Control-Answer, INITIAL) ───── │
│ Result-Code: 2001 │
│ Charging-Rule-Install: │
│ Charging-Rule-Name: "internet_default" │
│ Flow-Description: "permit in/out ip" │
│ QoS-Information: {QCI, MBR-UL/DL, GBR} │
│ Event-Trigger: {QOS_CHANGE, RAT_CHANGE, ...} │
Diameter Header Format
| Field | Size | Description |
|---|---|---|
Version | 1 byte | Always 1 |
Message Length | 3 bytes | Total message length |
Flags | 1 byte | R(equest), P(roxiable), E(rror), T(retransmit) |
Command Code | 3 bytes | E.g., 318 (AIR/AIA), 272 (CCR/CCA) |
Application-Id | 4 bytes | 16777251 (S6a), 16777238 (Gx) |
Hop-by-Hop Id | 4 bytes | Matches request/answer pair |
End-to-End Id | 4 bytes | Unique per request, used for dup detection |
Common 3GPP Diameter Applications
| Interface | App-Id | Client→Server | Key Commands |
|---|---|---|---|
| S6a/S6d | 16777251 | MME→HSS | AIR/AIA, ULR/ULA, CLR/CLA, DSR/DSA |
| S6b | 16777272 | PGW→AAA | AAR/AAA, STR/STA, ASR/ASA |
| Gx | 16777238 | PCEF→PCRF | CCR/CCA (Initial/Update/Term), RAR/RAA |
| Gy/Ro | 4 (DCCA) | CTF→OCS | CCR/CCA (Event/Session) |
| Rx | 16777236 | AF→PCRF | AAR/AAA, STR/STA |
| Cx/Dx | 16777216 | I/S-CSCF→HSS | UAR/UAA, MAR/MAA, SAR/SAA, LIR/LIA |
| Sh | 16777217 | AS→HSS | UDR/UDA, PUR/PUA, SNR/SNA |
| SWx | 16777265 | 3GPP AAA→HSS | MAR/MAA, SAR/SAA |
Common AVP Codes
| AVP | Code | Vendor | Used In |
|---|---|---|---|
| User-Name | 1 | IETF | All (carries IMSI) |
| Session-Id | 263 | IETF | All session-based |
| Result-Code | 268 | IETF | All answers |
| Origin-Host | 264 | IETF | All messages |
| Origin-Realm | 296 | IETF | All messages |
| Auth-Application-Id | 258 | IETF | CER/CEA, session |
| Visited-PLMN-Id | 1407 | 3GPP | S6a |
| Subscription-Id | 443 | IETF | Gx, Gy |
| QoS-Class-Identifier | 1028 | 3GPP | Gx |
| Charging-Rule-Name | 1005 | 3GPP | Gx |
Transport: Diameter uses SCTP (RFC 9260) or TCP. 3GPP RECOMMENDS SCTP for multi-homing reliability.
Security via IPsec (TS 33.210) or TLS/DTLS (RFC 6083). Application-Id 0xFFFFFFFF is relay (proxy/redirect agent).