OmniNRF
OmniNRF implements the Network Repository Function (NRF) of the 5G Core. The NRF is the central registry and service directory of the Service Based Architecture (SBA): every other Network Function (NF) registers its profile with the NRF at start-up, keeps that registration alive with periodic heartbeats, and queries the NRF to discover the endpoints of the NFs it needs to talk to.
OmniNRF exposes two SBI services. Nnrf_NFManagement (nnrf-nfm/v1) handles NF profile registration, update, heartbeat, deregistration, retrieval, and NF status-change subscriptions/notifications. Nnrf_NFDiscovery (nnrf-disc/v1) handles resolution of target NF instances by type, service, S-NSSAI, DNN, and PLMN. All NF profiles and subscriptions are held in in-memory (ETS) stores; there is no external database, so the registry is rebuilt as NFs re-register after an NRF restart. A background sweep continuously ages out NF instances that have stopped sending heartbeats, so the registry only ever advertises NFs that are demonstrably alive.
Documentation
- Operations Guide - 3GPP role, SBI endpoints, and the key registration, discovery, and subscription procedures with sequence diagrams.
- Configuration Reference - Full runtime configuration reference, parameter tables, management/OAM API, and logging.
- Metrics - Prometheus metrics for registrations, discovery, heartbeats, and BEAM VM health, with example PromQL.
- Troubleshooting - Common issues and their resolutions.
Architecture Overview
The NRF sits at the centre of the SBA. Producers (UDM, AUSF, PCF, …) register so they can be found; consumers (AMF, SMF, NSSF, …) discover them. Any NF can be both, and all of them heartbeat.
Features Overview
- Nnrf_NFManagement: register (PUT), heartbeat and JSON-Patch update (PATCH, RFC 6902 with nested JSON-Pointer paths), deregister (DELETE), single retrieve and list (GET). NF instance list is returned as a
3gppHal+jsonUriList withnf-typefiltering andlimit/page-number/page-sizepagination. - Nnrf_NFDiscovery: filtering by NF type, service names, PLMN, S-NSSAI, and DNN; result ordering by priority/capacity/load;
offset/limitpagination with aLink: rel="next"header. - Heartbeat aging: continuous background sweep expires NFs silent longer than
heartbeat_timeoutand notifies subscribers. - Status subscriptions:
subscrCond.nfTypefiltering,NF_REGISTEREDnotifications carry the fullnfProfile, optionalvalidityTime-based auto-expiry. - Concurrency control:
ETagon NF instance responses; conditionalIf-Matchon PUT/PATCH (412 on mismatch). - Content-type enforcement: PATCH bodies must be
application/json-patch+json(415 otherwise); an absent Content-Type is tolerated for simple heartbeat clients. - Structured JSON logging with per-request metadata (NF instance ID, procedure).
- Prometheus metrics for registrations, discovery, heartbeats, and BEAM VM health.
Quick Start
OmniNRF reads its operator configuration from config/runtime.exs, which maps environment variables onto the :omninrf application environment.
import Config
config :omninrf,
sbi_addr: System.get_env("SBI_ADDR", "127.0.0.1"),
sbi_port: String.to_integer(System.get_env("SBI_PORT", "7777")),
mcc: System.get_env("MCC", "999"),
mnc: System.get_env("MNC", "70"),
heartbeat_timeout: String.to_integer(System.get_env("HEARTBEAT_TIMEOUT", "30000")),
prometheus_metrics_port: String.to_integer(System.get_env("PROMETHEUS_PORT", "9568"))
config :logger, :default_formatter,
format: {OmniLogger.JsonFormatter, :format},
metadata: :all
SBI_ADDRdefaults to127.0.0.1(loopback). In any multi-host or containerised deployment this must be overridden to an address the other NFs can reach, otherwise no NF will be able to register or discover.
The full parameter reference, including every environment variable and default, lives in the Configuration Reference.