Skip to main content

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+json UriList with nf-type filtering and limit/page-number/page-size pagination.
  • Nnrf_NFDiscovery: filtering by NF type, service names, PLMN, S-NSSAI, and DNN; result ordering by priority/capacity/load; offset/limit pagination with a Link: rel="next" header.
  • Heartbeat aging: continuous background sweep expires NFs silent longer than heartbeat_timeout and notifies subscribers.
  • Status subscriptions: subscrCond.nfType filtering, NF_REGISTERED notifications carry the full nfProfile, optional validityTime-based auto-expiry.
  • Concurrency control: ETag on NF instance responses; conditional If-Match on 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_ADDR defaults to 127.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.