OmniSMF Operations Guide
Overview
OmniSMF implements the Session Management Function (SMF) of the 5G Core, responsible for the full lifecycle of PDU sessions. It anchors the N4 (PFCP) interface toward the UPF, the N7 interface toward the PCF, and the N10/N11 interfaces toward the UDM and AMF respectively.
Each PDU session is managed by a dedicated SessionWorker GenServer under a SessionSupervisor DynamicSupervisor (process-per-session architecture). All session state (QoS flows, PFCP context, UE IP, UP connection state) is owned by the worker process. One session crash does not affect others. All outbound SBI calls are made over plain HTTP using static URIs configured at startup; NRF-based dynamic discovery is not active in the current release.
Architecture
3GPP Role and Specification References
| Specification | Relevance |
|---|---|
| TS 23.501 | System architecture — SMF role, PDU session concept |
| TS 23.502 | Procedures — PDU Session Establishment (4.3.2), Modification (4.3.3), Release (4.3.4) |
| TS 29.502 | Nsmf_PDUSession API (HTTP/2 SBI) |
| TS 29.244 | N4 interface — PFCP protocol between SMF and UPF |
| TS 29.503 | Nudm_SubscriberDataManagement and Nudm_UEContextManagement |
| TS 29.512 | Npcf_SMPolicyControl — SM policy association toward PCF |
| TS 29.518 | Namf_Communication — N1N2MessageTransfer toward AMF |
SBI Endpoints
All endpoints are served under the base URL {sbi_scheme}://{sbi_addr}:{sbi_port}.
| Method | Path | Service | Description | Spec |
|---|---|---|---|---|
| POST | /nsmf-pdusession/v1/sm-contexts | Nsmf_PDUSession | Create SM Context (PDU session establishment) | TS 29.502 6.1.6.2.2 |
| POST | /nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify | Nsmf_PDUSession | Update SM Context (N2 info, UP state change, handover, release flag) | TS 29.502 6.1.6.4.2 |
| POST | /nsmf-pdusession/v1/sm-contexts/{smContextRef}/release | Nsmf_PDUSession | Release SM Context (session teardown) | TS 29.502 6.1.6.5.2 |
Request / Response Summary
Create SM Context — mandatory request fields: supi, sNssai, servingNetwork, dnn, smContextStatusUri, pduSessionId. Returns 201 Created with Location: /nsmf-pdusession/v1/sm-contexts/{ref}.
Update SM Context — dispatches on the first recognized key in the body:
| Body key | Scenario |
|---|---|
n2SmInfo + n2SmInfoType | N2 SM information from gNB (PDU_RES_SETUP_RSP / PDU_RES_REL_RSP) |
upCnxState: DEACTIVATED | AN release / UE idle entry |
upCnxState: ACTIVATING | Service request — returns N2 PDU_RES_SETUP_REQ |
release: true | AMF-initiated release |
servingNfId | AMF instance change during mobility |
Release SM Context — body may include ueLocation for final location recording. Returns 204 No Content.
Configuration Reference
Configuration is read from the application environment key :omnismf. The standard deployment mechanism is config/runtime.exs or OS environment variables mapped at startup.
config :omnismf,
sbi_scheme: "http",
sbi_addr: "127.0.0.4",
sbi_port: 7777,
nrf_uri: "http://127.0.0.10:7777",
udm_uri: "http://127.0.0.12:7777",
pcf_uri: "http://127.0.0.13:7777",
amf_uri: "http://127.0.0.5:7777",
upf_addr: "127.0.0.7",
upf_pfcp_port: 8805,
mcc: "999",
mnc: "70",
heartbeat_interval: 10_000,
pfcp_addr: "127.0.0.4",
ue_ip_pool: "10.45.0.0/16",
dns: ["8.8.8.8", "8.8.4.4"],
dns6: ["2001:4860:4860::8888"],
mtu: 1400
Parameter Table
| Parameter | Type | Default | Description |
|---|---|---|---|
sbi_scheme | string | "http" | HTTP scheme for the SBI listening socket (http or https) |
sbi_addr | string | "127.0.0.4" | IP address the SBI HTTP server binds to |
sbi_port | integer | 7777 | TCP port the SBI HTTP server listens on |
nrf_uri | string | "http://127.0.0.10:7777" | Base URI of the NRF. Used for NF registration and heartbeat only (NRF-based discovery is not active) |
udm_uri | string | "http://127.0.0.12:7777" | Base URI of the UDM. Used for Nudm-SDM (sm-data) and Nudm-UECM (smf-registrations) calls |
pcf_uri | string | "http://127.0.0.13:7777" | Base URI of the PCF. Used for Npcf-SMPolicyControl (sm-policies) calls |
amf_uri | string | "http://127.0.0.5:7777" | Base URI of the AMF. Used for N1N2MessageTransfer (namf-comm). Overridden per-session by the smContextStatusUri host if present |
upf_addr | string | "127.0.0.7" | IP address of the UPF PFCP endpoint (N4 interface) |
upf_pfcp_port | integer | 8805 | UDP port of the UPF PFCP endpoint. Standard PFCP port per TS 29.244 |
mcc | string | "999" | Mobile Country Code of the serving PLMN |
mnc | string | "70" | Mobile Network Code of the serving PLMN |
heartbeat_interval | integer (ms) | 10000 | Interval in milliseconds between NRF heartbeat requests. Also used to derive the URR time threshold (heartbeat_interval / 1000 * 6 seconds) |
dns | list of strings | ["8.8.8.8", "8.8.4.4"] | IPv4 DNS server addresses delivered to the UE in PDU Session Establishment Accept |
dns6 | list of strings | ["2001:4860:4860::8888"] | IPv6 DNS server addresses delivered to the UE in PDU Session Establishment Accept |
pfcp_addr | string | "127.0.0.4" | Source IP address for PFCP (N4) messages sent to the UPF. Must be routable from the UPF |
ue_ip_pool | string | "10.45.0.0/16" | CIDR subnet from which UE IPv4 addresses are allocated. Managed by UeIpPool GenServer with deduplication and release-on-teardown |
mtu | integer | 1400 | MTU value advertised to the UE for the PDU session |
Key Procedures
PDU Session Establishment (TS 23.502 Section 4.3.2)
PDU Session Release (TS 23.502 Section 4.3.4)
UE Idle / Service Request (UP Connection State)
N4 PFCP Session Structure
Each PDU session results in the following PFCP IEs being installed on the UPF:
| IE | ID | Direction | Purpose |
|---|---|---|---|
| PDR (uplink) | 1 | Access -> Core | Match GTP-U traffic from gNB on UPF N3 F-TEID |
| PDR (downlink) | 2 | Core -> Access | Match traffic from N6 by UE IP address |
| FAR (uplink) | 1 | Core | Forward to N6 (no outer header) |
| FAR (downlink) | 2 | Access | Initially BUFFER; updated to GTP-U FORWARD after PDU_RES_SETUP_RSP |
| QER | 1 | Both | Enforce session AMBR (uplink and downlink MBR) |
| URR | 1 | Both | Time-based usage reporting (threshold = heartbeat_interval * 6 s) |
Prometheus Metrics
SBI / PDU Session Metrics
| Metric | Type | Tags | Description |
|---|---|---|---|
omni_smf.pdu_session.create.count | counter | result | PDU session create operations |
omni_smf.pdu_session.modify.count | counter | result | PDU session modify operations |
omni_smf.pdu_session.release.count | counter | result | PDU session release operations |
omni_smf.pdu_session_creates.total | counter | result, dnn | Total PDU session creates by DNN |
omni_smf.pdu_session_releases.total | counter | result | Total PDU session releases |
omni_smf.active_pdu_sessions.count | gauge | dnn | Number of active PDU sessions by DNN |
omni_smf.session.duration_seconds | distribution | -- | PDU session duration in seconds (buckets: 1, 5, 15, 30, 60, 300, 900, 3600, 86400) |
PFCP / UPF Metrics
| Metric | Type | Tags | Description |
|---|---|---|---|
omni_smf.pfcp_sessions.total | counter | operation | Total PFCP session operations |
omni_smf.upf.health | gauge | -- | UPF PFCP association health (1=up, 0=down) |
NRF Metrics
| Metric | Type | Tags | Description |
|---|---|---|---|
omni_smf.nrf.registration.status | gauge | nf_type | NRF registration status (1=registered, 0=not) |
BEAM VM Metrics
| Metric | Type | Description |
|---|---|---|
beam.memory.total | gauge | Total BEAM memory in bytes |
beam.memory.processes | gauge | Memory used by Erlang processes |
beam.memory.processes_used | gauge | Memory actually used by processes |
beam.memory.system | gauge | System memory |
beam.memory.atom | gauge | Total atom memory |
beam.memory.atom_used | gauge | Used atom memory |
beam.memory.binary | gauge | Binary memory |
beam.memory.code | gauge | Code memory |
beam.memory.ets | gauge | ETS table memory |
beam.processes.count | gauge | Number of Erlang processes |
beam.ports.count | gauge | Number of Erlang ports |
beam.atom.count | gauge | Number of atoms |
beam.vm.uptime | gauge | VM uptime in seconds |
Known Limitations
The following gaps were identified during an operational audit. Reference IDs correspond to internal tracking.
| ID | Area | Description |
|---|---|---|
| SMF-H5 | N4 Reporting | Session Report Request messages received from the UPF are not processed. Usage reports from URR triggers are silently discarded. |
| SMF-H7 | NAS | The N1 SM container in SmContextCreateData is not decoded. NAS PDU Session Establishment Request content (5GSM capability, extended protocol configuration options) is not inspected or forwarded. |
| SMF-M1 | Handover | Handover state handling is partial. Xn-based handover and inter-AMF N2 handover path switches are not fully supported; the servingNfId update path handles AMF change but the full handover procedure (TS 23.502 4.9) is not implemented. |
| SMF-M3 | UE IP | UE IPv4 addresses are allocated randomly from 10.45.0.0/16 on each session establishment. There is no address pool management, no overlap detection, and no IPv6 prefix delegation. |
| SMF-M4 | Notifications | SM context status notifications to the AMF callback URI (smContextStatusUri) are not sent. The AMF is not informed of SMF-initiated state changes (e.g., network-triggered release). |
| SMF-M5 | NRF Discovery | An NRF registration module exists and the SMF registers with the NRF. However, all outbound SBI calls (to UDM, PCF, AMF) use static URIs from configuration. NRF-based discovery is not performed. |
| SMF-M7 | PFCP Reporting | SessionReportResponse is not sent to the UPF in response to Session Report Requests. |
| SMF-L1 | SM Context Retrieval | There is no GET /nsmf-pdusession/v1/sm-contexts/{ref} endpoint. SM context retrieval by external consumers is not supported. |
| SMF-L3 | QoS Modification | QoS flow modification after session establishment is not supported. Adding, modifying, or deleting QoS flows (TS 23.502 4.3.3) cannot be triggered post-establishment. |
Troubleshooting
PDU Session Establishment Fails with 404 DNN_DENIED
The UDM returned session management subscription data that does not include the requested DNN. Verify that the UDM's subscriber data for the SUPI contains a dnnConfigurations entry matching the requested DNN (case-insensitive). Check the SMF log for the line SM context creation failed: dnn_not_found.
PDU Session Establishment Fails with 503 NF_DISCOVERY_FAILURE
The SMF could not reach the UDM at udm_uri. Verify connectivity from the SMF host to the configured udm_uri. Check firewall rules and that the UDM SBI port is reachable. The SMF log will show [SBI->UDM] GET sm-data failed with the underlying reason.
PFCP Session Establishment Rejected
The UPF returned a non-"Request accepted" cause in the PFCP Session Establishment Response. Common causes:
upf_addrorupf_pfcp_portis incorrect — verify withss -ulnp | grep 8805on the UPF host.- The UPF does not support the PDR/FAR IEs sent by the SMF — check UPF capability logs.
- PFCP heartbeat (association) is not established — the SMF must complete PFCP Association Setup before sending session requests. Check logs for
[PFCP] Associationmessages at startup.
The SMF log will contain [PFCP] Session establishment rejected: <cause> or [PFCP] Session establishment failed: <reason>.
N1N2MessageTransfer to AMF Fails
After the SMF returns 201 to the AMF for context creation, it asynchronously sends the N1N2MessageTransfer. If this call fails, the PDU session is created in the SMF and UPF but the UE will not receive the Establishment Accept. The SMF logs [SBI->AMF] N1N2 transfer failed. This failure is currently non-fatal from the SMF's perspective — no retry is attempted. To recover, release the SM context and retry the PDU session establishment.
UE Receives No IP Address
IP allocation is performed at PFCP session establishment time using a random selection from 10.45.0.0/16. If the UPF returns a different IP in its Created PDR (UPF-allocated addressing), the SMF will use the UPF-returned F-TEID but will still record its own randomly generated IP. Ensure the UPF is configured to accept SMF-specified UE IP addresses or to allocate and return them via the Created PDR. See limitation SMF-M3.
High Session Count / Memory Growth
Session contexts are stored in an in-process Agent. They are only removed on explicit release_sm_context. If AMF or UE-initiated releases are missed (e.g., due to AMF restart), orphaned contexts will accumulate. Monitor with the /statistics internal API endpoint. There is currently no session timeout or garbage collection.
Log Correlation
Each log line from the session path is prefixed [{supi}:{pdu_session_id}]. Filter by SUPI to trace a subscriber's session lifecycle end-to-end. PFCP-path log lines are prefixed [PFCP] and SBI client calls are prefixed [SBI->UDM], [SBI->PCF], or [SBI->AMF].