Skip to main content

OmniCHF

OmniCHF implements the Charging Function (CHF) of the 5G Core. The CHF provides converged online and offline charging for 5G PDU sessions through the Nchf_ConvergedCharging service (3GPP TS 32.290 / TS 32.291 / TS 32.255).

A charging consumer, typically the SMF, creates a charging session for each PDU session, reports usage over the lifetime of that session, and finally releases it. OmniCHF translates each 5G charging request into a CGRateS SessionS JSON-RPC call for real-time credit authorization (online charging / quota management) and generates a Charging Data Record (CDR) on session release (offline charging). Each charging session is owned by a dedicated worker process (process-per-session architecture) for fault isolation; session state is held in memory and is rebuilt as consumers create new sessions after a restart.

Documentation

  • Operations Guide - 3GPP role and specification references, SBI endpoints, CGRateS integration, and the key charging procedures with their sequence diagrams.
  • Configuration Reference - Complete runtime configuration parameter tables, management/OAM interfaces, and logging notes.
  • Metrics Reference - Prometheus metrics (charging, CGRateS, NRF, BEAM VM) with example PromQL queries.
  • Troubleshooting - Common issues and diagnostics.

Architecture Overview

The consumer (SMF) reaches OmniCHF over the SBI. CGRateS is an external rating and balance engine, and OmniCHF is a client to it, not the other way around. When CGRateS is disabled, the CGRateS Client short-circuits and returns a fixed default grant (see CGRateS Integration).

Features Overview

  • Converged online + offline charging for 5G PDU sessions via nchf-convergedcharging/v3.
  • Process-per-session architecture (ChargingWorker + Registry) for fault isolation and O(1) lookup.
  • CGRateS SessionS integration over HTTP JSON-RPC using a pooled Finch client.
  • CGRateS bypass mode for lab operation without a rating engine.
  • Quota management with GSU grants and QUOTA_THRESHOLD / TIME_LIMIT triggers.
  • Charging Notify (REAUTHORIZATION, ABORT_CHARGING) toward the consumer's notifyUri.
  • Per-DNN rating groups via rating_groups / default_rating_group.
  • 3GPP charging ID generation (TS 32.251) with configurable per-instance node_id.
  • Offline CDR files (optional) plus always-on CDR logging.
  • NRF registration and heartbeat.
  • Prometheus metrics and structured JSON logging.
  • Management API and Control Panel for status, session inspection, statistics, and OAM actions.

Quick Start

Operator configuration is read from the application environment key :omnichf, populated at startup by config/runtime.exs. Every key is overridable by an OS environment variable. The example below shows the primary runtime configuration with the values applied when the corresponding environment variable is unset.

config :omnichf,
# SBI (service-based interface) listener
sbi_scheme: "http",
sbi_addr: "127.0.0.14",
sbi_port: 7777,

# NRF registration / heartbeat
nrf_uri: "http://127.0.0.1:7777",

# Serving PLMN identity
mcc: "999",
mnc: "70",

# Observability
prometheus_metrics_port: 9568,

# NRF heartbeat cadence
heartbeat_interval: 10_000,

# CGRateS rating / balance engine integration
cgrates_enabled: true,
cgrates_url: "http://localhost:2080/jsonrpc",
cgrates_tenant: "cgrates.org",
cgrates_timeout: 5000

Full parameter documentation, including advanced rating-group, offline-charging, and charging-ID keys, logging, and the management interfaces, lives in the Configuration Reference.