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

TLS 1.3 Handshake — RFC 8446

Mandatory for 5G SBI
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
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 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)
SuiteAEADHash3GPP Usage
TLS_AES_128_GCM_SHA256AES-128-GCMSHA-256Default for SBI, NRF
TLS_AES_256_GCM_SHA384AES-256-GCMSHA-384High-security deployments
TLS_CHACHA20_POLY1305_SHA256ChaCha20-Poly1305SHA-256Mobile 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).

IKEv2 SA Negotiation — RFC 7296

NDS/IP · TS 33.210
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 ════      │
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}

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 SAs
  • SK_ai/SK_ar — IKE SA integrity keys
  • SK_ei/SK_er — IKE SA encryption keys
  • SK_pi/SK_pr — used in AUTH payload computation
TypeNameID3GPP Notes
ENCRENCR_AES_CBC12Legacy, still supported
ENCRENCR_AES_GCM_1620Recommended (combined-mode)
PRFPRF_HMAC_SHA2_2565Default for NDS
INTEGAUTH_HMAC_SHA2_256_12812When not using combined-mode
DHECP_25619NIST P-256 (required)
DHCURVE_2551931X25519 (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.

Diameter Message Flow — RFC 6733

S6a · Gx · Gy · Rx
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 ════        │
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)                           │
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, ...}  │
FieldSizeDescription
Version1 byteAlways 1
Message Length3 bytesTotal message length
Flags1 byteR(equest), P(roxiable), E(rror), T(retransmit)
Command Code3 bytesE.g., 318 (AIR/AIA), 272 (CCR/CCA)
Application-Id4 bytes16777251 (S6a), 16777238 (Gx)
Hop-by-Hop Id4 bytesMatches request/answer pair
End-to-End Id4 bytesUnique per request, used for dup detection
InterfaceApp-IdClient→ServerKey Commands
S6a/S6d16777251MME→HSSAIR/AIA, ULR/ULA, CLR/CLA, DSR/DSA
S6b16777272PGW→AAAAAR/AAA, STR/STA, ASR/ASA
Gx16777238PCEF→PCRFCCR/CCA (Initial/Update/Term), RAR/RAA
Gy/Ro4 (DCCA)CTF→OCSCCR/CCA (Event/Session)
Rx16777236AF→PCRFAAR/AAA, STR/STA
Cx/Dx16777216I/S-CSCF→HSSUAR/UAA, MAR/MAA, SAR/SAA, LIR/LIA
Sh16777217AS→HSSUDR/UDA, PUR/PUA, SNR/SNA
SWx167772653GPP AAA→HSSMAR/MAA, SAR/SAA
AVPCodeVendorUsed In
User-Name1IETFAll (carries IMSI)
Session-Id263IETFAll session-based
Result-Code268IETFAll answers
Origin-Host264IETFAll messages
Origin-Realm296IETFAll messages
Auth-Application-Id258IETFCER/CEA, session
Visited-PLMN-Id14073GPPS6a
Subscription-Id443IETFGx, Gy
QoS-Class-Identifier10283GPPGx
Charging-Rule-Name10053GPPGx
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).