03_5g_sa_architecture

Part 3: 5G SA (Standalone) Architecture

Learning Objective: Understand the 5G Standalone core with Service Based Architecture, all network functions, N-series interfaces, and network slicing.


Table of Contents


What is 5G SA?

5G SA (Standalone) is a complete 5G system with:

SA vs NSA

Feature NSA SA
Core 4G EPC 5G Core
Control Plane MME AMF
Session Mgmt MME/SGW/PGW SMF
User Plane PGW-U UPF
Architecture Point-to-point Service-based (HTTP/2)
Network Slicing Limited by EPC anchoring Native 5GC slice selection and policy support
Latency Deployment-dependent Deployment-dependent; SA enables 5GC and edge designs that can reduce latency
Edge Computing Possible, with EPC constraints Native 5GC traffic steering supports edge deployments

Service Based Architecture (SBA)

Unlike 4G's point-to-point interfaces, 5G uses SBA where network functions expose services via HTTP/2 APIs.

graph TB
    subgraph "Service Based Interface (SBI) - HTTP/2"
        NRF[🗂️ NRF
Service Registry] SCP[🔀 SCP
Service Proxy] AMF[📱 AMF
Access & Mobility] SMF[🔧 SMF
Session Mgmt] AUSF[🔐 AUSF
Authentication] UDM[👤 UDM
User Data Mgmt] UDR[(💾 UDR
Data Repository)] PCF[📋 PCF
Policy Control] NSSF[🍕 NSSF
Slice Selection] BSF[🔗 BSF
Binding Support] end subgraph "User Plane" UPF[📦 UPF
User Plane Function] end subgraph "Radio Access" gNB[📡 gNB
5G Base Station] UE[📱 UE] end Internet[🌐 Internet] %% Service registrations AMF -.->|Register| NRF SMF -.->|Register| NRF AUSF -.->|Register| NRF UDM -.->|Register| NRF PCF -.->|Register| NRF %% Service discovery AMF -.->|Discover| NRF SMF -.->|Discover| NRF %% SBI communications (via SCP) AMF <-->|Namf| SCP SMF <-->|Nsmf| SCP AUSF <-->|Nausf| SCP UDM <-->|Nudm| SCP UDR <-->|Nudr| SCP PCF <-->|Npcf| SCP NSSF <-->|Nnssf| SCP BSF <-->|Nbsf| SCP %% N-series interfaces UE <-->|N1
NAS| AMF gNB <-->|N2
NGAP| AMF gNB <-->|N3
GTP-U| UPF SMF <-->|N4
PFCP| UPF UPF <-->|N6| Internet style NRF fill:#ff9999 style SCP fill:#99ccff style AMF fill:#ffcc99 style SMF fill:#99ff99 style UPF fill:#cc99ff style gNB fill:#ffff99

Why SBA?

In 4G, every pair of network functions had a dedicated point-to-point interface with a unique protocol (Diameter for S6a, GTP-C for S11, etc.). SBA replaces this with a shared HTTP/2 service bus where NFs expose and consume APIs — similar to how modern web microservices work.

4G: Point-to-Point 5G: SBA
Communication Dedicated interface per pair (S6a, S11, Gx...) Shared HTTP/2 bus — any NF can call any NF
Discovery Hardcoded IPs in config files Dynamic discovery via NRF (like a service registry)
Protocols Mixed (Diameter, GTP-C, SCTP) Unified HTTP/2 + JSON for all control plane
Scaling Replace the whole box Spin up more NF instances, NRF load balances
Adding features New interface = new spec + new protocol New API endpoint on existing NF

Key benefits:

SBA Key Concepts

Concept Description
Service Producer NF that exposes services (e.g., AMF exposes Namf_Communication)
Service Consumer NF that consumes services (e.g., SMF calls Namf_Communication)
NRF Service registry (like DNS for services)
SCP Optional proxy for indirect communication
SBI HTTP/2 RESTful APIs (JSON payloads)

5G Core Network Functions

NRF (NF Repository Function)

Role: Service discovery and registration

Responsibilities:

Services Exposed:

Important

NRF is the heart of SBA. If NRF fails, NFs cannot discover each other.

SCP (Service Communication Proxy)

Role: Indirect communication between NFs

Benefits:

Communication Models:

AMF (Access and Mobility Management Function)

Role: Replaces 4G MME for access and mobility

Responsibilities:

Interfaces:

Services Exposed:

SMF (Session Management Function)

Role: Replaces 4G PGW-C for session management

Responsibilities:

Interfaces:

Services Exposed:

UPF (User Plane Function)

Role: Replaces 4G PGW-U for user data forwarding

Responsibilities:

Interfaces:

Note

UPF is the only user plane function in 5G SA (simpler than 4G's SGW-U + PGW-U).

AUSF (Authentication Server Function)

Role: Replaces 4G HSS for authentication

Responsibilities:

Interfaces:

Services Exposed:

UDM (Unified Data Management)

Role: Subscriber data management (part of 4G HSS)

Responsibilities:

Interfaces:

Services Exposed:

UDR (Unified Data Repository)

Role: Database for subscriber and policy data

Stores:

Interfaces:

Note

In Open5GS, UDR uses MongoDB as the backend database.

PCF (Policy Control Function)

Role: Replaces 4G PCRF for policy control

Responsibilities:

Interfaces:

Services Exposed:

NSSF (Network Slice Selection Function)

Role: Select network slice for UE

Responsibilities:

Interfaces:

Services Exposed:

BSF (Binding Support Function)

Role: Maintain PCF bindings for UE sessions

Responsibilities:

Services Exposed:

SEPP (Security Edge Protection Proxy)

Role: Secure inter-PLMN communication (roaming)

Responsibilities:

Interfaces:


N-Series Reference Points

Interface Between Protocol Purpose
N1 UE ↔ AMF NAS Registration, session management
N2 gNB ↔ AMF NGAP/SCTP Control plane signaling
N3 gNB ↔ UPF GTP-U/UDP User plane data
N4 SMF ↔ UPF PFCP/UDP Packet forwarding control
N5 PCF ↔ AF HTTP/2 Application policies
N6 UPF ↔ DN IP Data network (Internet)
N7 SMF ↔ PCF HTTP/2 Session policies
N8 AMF ↔ UDM HTTP/2 Subscription data
N9 UPF ↔ UPF GTP-U/UDP UPF-to-UPF forwarding
N10 SMF ↔ UDM HTTP/2 Session subscription data
N11 AMF ↔ SMF HTTP/2 PDU session management
N12 AMF ↔ AUSF HTTP/2 Authentication
N13 UDM ↔ AUSF HTTP/2 Authentication vectors
N14 AMF ↔ AMF HTTP/2 Inter-AMF handover
N15 AMF ↔ PCF HTTP/2 Access policies
N22 AMF ↔ NSSF HTTP/2 Slice selection
N32 SEPP ↔ SEPP HTTP/2 Inter-PLMN security

5G Registration Procedure

sequenceDiagram
    participant UE as 📱 UE
    participant gNB as 📡 gNB
    participant AMF as AMF
    participant AUSF as AUSF
    participant UDM as UDM
    participant SMF as SMF
    participant UPF as UPF
    participant NRF as NRF
    
    UE->>gNB: RRC Setup Request
    gNB->>UE: RRC Setup
    UE->>gNB: RRC Setup Complete
(NAS: Registration Request) gNB->>AMF: N2: Initial UE Message
(SUCI, Registration Request) AMF->>NRF: Nnrf_NFDiscovery
(Find AUSF) NRF->>AMF: AUSF address AMF->>AUSF: Nausf_UEAuthentication
(SUCI) AUSF->>UDM: Nudm_UEAuthentication
(SUPI) UDM->>AUSF: Authentication Vectors
(RAND, AUTN, XRES*, KAUSF) AUSF->>AMF: RAND, AUTN, XRES* AMF->>UE: NAS: Authentication Request
(RAND, AUTN) UE->>AMF: NAS: Authentication Response
(RES*) Note over AMF: Verify RES* == XRES* AMF->>UE: NAS: Security Mode Command UE->>AMF: NAS: Security Mode Complete AMF->>UDM: Nudm_UECM_Registration
(Register UE context) UDM->>AMF: Registration complete AMF->>UDM: Nudm_SDM_Get
(Get subscriber data) UDM->>AMF: Subscriber profile
(DNN, S-NSSAI, QoS) AMF->>UE: NAS: Registration Accept
(5G-GUTI, TAI list) UE->>AMF: NAS: Registration Complete Note over UE,AMF: UE is now registered (RM-REGISTERED) UE->>AMF: NAS: PDU Session Establishment Request
(DNN, S-NSSAI) AMF->>NRF: Nnrf_NFDiscovery
(Find SMF for DNN) NRF->>AMF: SMF address AMF->>SMF: Nsmf_PDUSession_CreateSMContext
(SUPI, DNN, S-NSSAI) SMF->>UDM: Nudm_SDM_Get
(Session subscription data) UDM->>SMF: Session data SMF->>UPF: N4: PFCP Session Establishment
(Install forwarding rules) UPF->>SMF: N4: PFCP Session Establishment Response
(UE IP: 10.45.0.2) SMF->>AMF: Nsmf_PDUSession_CreateSMContext Response
(UE IP, QoS, N3 tunnel info) AMF->>gNB: N2: PDU Session Resource Setup Request
(QoS, UPF N3 TEID) gNB->>UE: RRC: Reconfiguration
(Radio bearers) UE->>gNB: RRC: Reconfiguration Complete gNB->>AMF: N2: PDU Session Resource Setup Response AMF->>SMF: Nsmf_PDUSession_UpdateSMContext
(gNB N3 TEID) SMF->>UPF: N4: PFCP Session Modification
(Update gNB TEID) UPF->>SMF: N4: PFCP Session Modification Response AMF->>UE: NAS: PDU Session Establishment Accept
(UE IP: 10.45.0.2) Note over UE,UPF: N3 GTP-U tunnel established:
UE ↔ gNB ↔ UPF ↔ Internet

Network Slicing

Network slicing allows a single physical network to support multiple logical networks (slices) with different characteristics.

S-NSSAI (Single Network Slice Selection Assistance Information)

S-NSSAI = SST + SD
Field Description Example
SST Slice/Service Type (8-bit) 1 = eMBB, 2 = URLLC, 3 = MIoT
SD Slice Differentiator (24-bit, optional) 0x000001 (custom slice ID)

Slice Types (SST)

SST Type Use Case Latency Bandwidth
1 eMBB Enhanced Mobile Broadband ~20ms High
2 URLLC Ultra-Reliable Low Latency ~1ms Medium
3 MIoT Massive IoT ~100ms Low
4 V2X Vehicle-to-Everything ~10ms Medium

Slicing Architecture

graph TB
    UE1[📱 UE 1
eMBB User] UE2[🚗 UE 2
V2X Vehicle] UE3[📡 UE 3
IoT Sensor] gNB[📡 gNB
Shared Radio] subgraph "Slice 1: eMBB (SST=1)" AMF1[AMF] SMF1[SMF] UPF1[UPF] end subgraph "Slice 2: URLLC (SST=2)" AMF2[AMF] SMF2[SMF] UPF2[UPF
Edge MEC] end subgraph "Slice 3: MIoT (SST=3)" AMF3[AMF] SMF3[SMF] UPF3[UPF] end NSSF[🍕 NSSF
Slice Selector] UE1 --> gNB UE2 --> gNB UE3 --> gNB gNB --> NSSF NSSF --> AMF1 NSSF --> AMF2 NSSF --> AMF3 AMF1 --> SMF1 --> UPF1 AMF2 --> SMF2 --> UPF2 AMF3 --> SMF3 --> UPF3 style AMF1 fill:#99ccff style AMF2 fill:#ff9999 style AMF3 fill:#99ff99

Slice Selection Process

  1. UE sends Registration Request with requested S-NSSAI
  2. AMF queries NSSF for slice selection
  3. NSSF returns allowed S-NSSAI and target AMF (if different)
  4. AMF assigns UE to slice
  5. SMF/UPF instances dedicated to that slice handle sessions

SUPI/SUCI Privacy

Problem: LTE normally reuses a temporary GUTI, but a UE can send its IMSI before NAS security when no valid temporary identity is available or when the procedure requires it. A rogue network can abuse pre-authentication identity handling to track subscribers.

5G control: 5G identifies the subscriber over the radio with SUCI, a concealed form of SUPI. With a non-null protection scheme, the concealed subscriber portion does not reveal the SUPI. Operators can configure the null scheme, and emergency and provisioning cases can also use it, so captures must verify the scheme instead of assuming encryption.

Terminology

Term Description Example
SUPI Subscription Permanent Identifier (like IMSI) imsi-001010123456789
SUCI Subscription Concealed Identifier; conceals the subscriber part when a non-null scheme is used suci-0-001-01-0-1-abcd1234...
5G-GUTI 5G Globally Unique Temporary Identifier Assigned after registration

SUCI Concealment

graph LR
    subgraph "UE"
        SUPI[SUPI
imsi-001010123456789] HomeKey[Home Network
Public Key] end subgraph "Encryption" ECIES[ECIES Encryption
Elliptic Curve] end subgraph "Network" SUCI[SUCI
suci-0-001-01-...] UDM[UDM
Decrypts with
Private Key] end SUPI --> ECIES HomeKey --> ECIES ECIES --> SUCI SUCI --> UDM UDM --> SUPI style SUPI fill:#ff9999 style SUCI fill:#99ff99

Benefits:


5G-AKA Authentication

Similar to 4G AKA, but with enhanced privacy:

Key Differences from 4G

Aspect 4G 5G
Identifier before authentication GUTI when valid; IMSI can appear when a temporary identity is unavailable or requested 5G-GUTI when valid; otherwise SUCI, whose protection depends on the configured scheme
Base Key KASME KAUSF
Auth Server HSS AUSF + UDM
Anchor Key KASME KSEAF (at SEAF in AMF)

5G Key Hierarchy

KAUSF (at AUSF, derived from CK/IK)
  └─ KSEAF (at AMF)
      └─ KAMF (at AMF)
          ├─ KgNB (at gNB, for AS security)
          │   ├─ KRRCenc
          │   ├─ KRRCint
          │   └─ KUPenc
          └─ NAS keys
              ├─ KNASenc
              └─ KNASint

Summary

You now understand:

Next: Part 4: Docker Lab - 4G EPC →