Skip to main content

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

SpecificationRelevance
TS 23.501System architecture — SMF role, PDU session concept
TS 23.502Procedures — PDU Session Establishment (4.3.2), Modification (4.3.3), Release (4.3.4)
TS 29.502Nsmf_PDUSession API (HTTP/2 SBI)
TS 29.244N4 interface — PFCP protocol between SMF and UPF
TS 29.503Nudm_SubscriberDataManagement and Nudm_UEContextManagement
TS 29.512Npcf_SMPolicyControl — SM policy association toward PCF
TS 29.518Namf_Communication — N1N2MessageTransfer toward AMF

SBI Endpoints

All endpoints are served under the base URL {sbi_scheme}://{sbi_addr}:{sbi_port}.

MethodPathServiceDescriptionSpec
POST/nsmf-pdusession/v1/sm-contextsNsmf_PDUSessionCreate SM Context (PDU session establishment)TS 29.502 6.1.6.2.2
POST/nsmf-pdusession/v1/sm-contexts/{smContextRef}/modifyNsmf_PDUSessionUpdate 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}/releaseNsmf_PDUSessionRelease 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 keyScenario
n2SmInfo + n2SmInfoTypeN2 SM information from gNB (PDU_RES_SETUP_RSP / PDU_RES_REL_RSP)
upCnxState: DEACTIVATEDAN release / UE idle entry
upCnxState: ACTIVATINGService request — returns N2 PDU_RES_SETUP_REQ
release: trueAMF-initiated release
servingNfIdAMF 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

ParameterTypeDefaultDescription
sbi_schemestring"http"HTTP scheme for the SBI listening socket (http or https)
sbi_addrstring"127.0.0.4"IP address the SBI HTTP server binds to
sbi_portinteger7777TCP port the SBI HTTP server listens on
nrf_uristring"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_uristring"http://127.0.0.12:7777"Base URI of the UDM. Used for Nudm-SDM (sm-data) and Nudm-UECM (smf-registrations) calls
pcf_uristring"http://127.0.0.13:7777"Base URI of the PCF. Used for Npcf-SMPolicyControl (sm-policies) calls
amf_uristring"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_addrstring"127.0.0.7"IP address of the UPF PFCP endpoint (N4 interface)
upf_pfcp_portinteger8805UDP port of the UPF PFCP endpoint. Standard PFCP port per TS 29.244
mccstring"999"Mobile Country Code of the serving PLMN
mncstring"70"Mobile Network Code of the serving PLMN
heartbeat_intervalinteger (ms)10000Interval in milliseconds between NRF heartbeat requests. Also used to derive the URR time threshold (heartbeat_interval / 1000 * 6 seconds)
dnslist of strings["8.8.8.8", "8.8.4.4"]IPv4 DNS server addresses delivered to the UE in PDU Session Establishment Accept
dns6list of strings["2001:4860:4860::8888"]IPv6 DNS server addresses delivered to the UE in PDU Session Establishment Accept
pfcp_addrstring"127.0.0.4"Source IP address for PFCP (N4) messages sent to the UPF. Must be routable from the UPF
ue_ip_poolstring"10.45.0.0/16"CIDR subnet from which UE IPv4 addresses are allocated. Managed by UeIpPool GenServer with deduplication and release-on-teardown
mtuinteger1400MTU 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:

IEIDDirectionPurpose
PDR (uplink)1Access -> CoreMatch GTP-U traffic from gNB on UPF N3 F-TEID
PDR (downlink)2Core -> AccessMatch traffic from N6 by UE IP address
FAR (uplink)1CoreForward to N6 (no outer header)
FAR (downlink)2AccessInitially BUFFER; updated to GTP-U FORWARD after PDU_RES_SETUP_RSP
QER1BothEnforce session AMBR (uplink and downlink MBR)
URR1BothTime-based usage reporting (threshold = heartbeat_interval * 6 s)

Prometheus Metrics

SBI / PDU Session Metrics

MetricTypeTagsDescription
omni_smf.pdu_session.create.countcounterresultPDU session create operations
omni_smf.pdu_session.modify.countcounterresultPDU session modify operations
omni_smf.pdu_session.release.countcounterresultPDU session release operations
omni_smf.pdu_session_creates.totalcounterresult, dnnTotal PDU session creates by DNN
omni_smf.pdu_session_releases.totalcounterresultTotal PDU session releases
omni_smf.active_pdu_sessions.countgaugednnNumber of active PDU sessions by DNN
omni_smf.session.duration_secondsdistribution--PDU session duration in seconds (buckets: 1, 5, 15, 30, 60, 300, 900, 3600, 86400)

PFCP / UPF Metrics

MetricTypeTagsDescription
omni_smf.pfcp_sessions.totalcounteroperationTotal PFCP session operations
omni_smf.upf.healthgauge--UPF PFCP association health (1=up, 0=down)

NRF Metrics

MetricTypeTagsDescription
omni_smf.nrf.registration.statusgaugenf_typeNRF registration status (1=registered, 0=not)

BEAM VM Metrics

MetricTypeDescription
beam.memory.totalgaugeTotal BEAM memory in bytes
beam.memory.processesgaugeMemory used by Erlang processes
beam.memory.processes_usedgaugeMemory actually used by processes
beam.memory.systemgaugeSystem memory
beam.memory.atomgaugeTotal atom memory
beam.memory.atom_usedgaugeUsed atom memory
beam.memory.binarygaugeBinary memory
beam.memory.codegaugeCode memory
beam.memory.etsgaugeETS table memory
beam.processes.countgaugeNumber of Erlang processes
beam.ports.countgaugeNumber of Erlang ports
beam.atom.countgaugeNumber of atoms
beam.vm.uptimegaugeVM uptime in seconds

Known Limitations

The following gaps were identified during an operational audit. Reference IDs correspond to internal tracking.

IDAreaDescription
SMF-H5N4 ReportingSession Report Request messages received from the UPF are not processed. Usage reports from URR triggers are silently discarded.
SMF-H7NASThe 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-M1HandoverHandover 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-M3UE IPUE 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-M4NotificationsSM 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-M5NRF DiscoveryAn 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-M7PFCP ReportingSessionReportResponse is not sent to the UPF in response to Session Report Requests.
SMF-L1SM Context RetrievalThere is no GET /nsmf-pdusession/v1/sm-contexts/{ref} endpoint. SM context retrieval by external consumers is not supported.
SMF-L3QoS ModificationQoS 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_addr or upf_pfcp_port is incorrect — verify with ss -ulnp | grep 8805 on 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] Association messages 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].