For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

Rf Offline Charging Configuration

Overview

Rf is the Diameter interface used for offline charging in 3GPP networks, specified in 3GPP TS 32.299. SMC sends Accounting-Request (ACR) messages to a Charging Gateway Function (CGF) or charging system, which generates CDRs (Charging Data Records) for billing.

Offline charging allows service delivery without real-time credit checks. Usage information is collected during the session and processed later for billing.

References:

  • 3GPP TS 32.299 - Diameter charging applications
  • 3GPP TS 32.251 - Packet Switched (PS) domain charging
  • Diameter Configuration - Diameter transport configuration
  • Charging Overview - Charging concepts and triggers

Basic Configuration

Enable Rf and configure whether to use common Diameter settings:

yaml

When standalone is false, Rf uses Diameter transport settings from aaa.oss (see Diameter Configuration).

When standalone is true, configure Rf-specific settings:

yaml

Network Configuration

Rf can use common network settings or dedicated network configuration.

Using Common Network Settings

yaml

Using Separate Network Settings

Rf does not have separate network settings. It always uses networking.oss. For separate network configuration, use Ro interface settings (see Ro Configuration).

Accounting Phases

Rf supports three accounting phases:

Accounting-Start

Sent when a user session is established. Contains initial session information:

  • User identity (IMSI, MSISDN)
  • Session start time
  • Network context (PLMN, location, RAT type)
  • IP address allocation
  • QoS parameters

Automatically enabled when aaa.rf.enabled is true.

Accounting-Interim

Sent periodically during an active session. Contains cumulative usage information:

  • Data volume (uplink and downlink)
  • Session duration
  • Current location
  • Current QoS

Interim interval controlled by aaa.acctInterimInterval:

yaml

Set to null to disable interim records:

yaml

Caution

If RADIUS Stop or Interim accounting are enabled, acctInterimInterval cannot be null.

Accounting-Stop

Sent when a user session terminates. Contains final usage information:

  • Final data volume
  • Total session duration
  • Termination cause
  • Final location

Automatically enabled when aaa.rf.enabled is true.

Connection Monitoring

Monitor Rf connections using the diameter_connections metric with label svc="ergw_rf".

Example Prometheus query:

promql

When the metric shows 0, no Rf connections are active.

CDF failure handling

SMC handles CDF failures based on the Diameter Result-Code and transport state. Throughout this section, answer refers to a Diameter Accounting-Answer (ACA), the response to an Accounting-Request (ACR). The following behavior applies to both real CDF answers and synthetic answers injected by the transport failure options described below:

  • Success (2xxx): charging data cleared; session continues.
  • UNABLE_TO_DELIVER (3002) or TOO_BUSY (3004): charging data retained; session continues, subject to the max_pending_data cap.
  • Any other Result-Code: session torn down.

A rejected or timed-out ACR-Initial aborts GTP session creation with cause system_failure.

Transport failure options

Four Helm values control the behavior when the CDF is unreachable or a request times out.

answer_if_down and answer_if_timeout accept separate settings for each request state because the impact differs: a failure during session creation (initial) is typically fatal, whilst a failure during an interim update (update) may be tolerable for a limited time. ACR-Stop is always best-effort and does not use these settings.

When answer_if_down or answer_if_timeout is set, SMC injects the referenced synthetic answer instead of treating the transport failure as an immediate error. The Result-Code in the synthetic answer then follows the same Result-Code semantics described at the start of this section.

When max_pending_data is set and the accumulated service data container and traffic data volume count exceeds the configured value, SMC tears down the session regardless of the Result-Code.

The Prometheus gauge ergw_aaa_rf_queued_containers (labels svc, kind) reports the current number of buffered Rf accounting containers — Service-Data-Containers (sdc), Traffic-Data-Volumes (tdv), and Secondary-RAT-Usage-Data-Reports (sec_rat) — summed across active sessions. Watch it during a CDF outage to size max_pending_data against actual buffering rates rather than guessing. See Diameter metrics for the full metric description.

Example: reject sessions when CDF is down, keep sessions on timeout

yaml

In this configuration:

  • New sessions are rejected when the CDF is down or an ACR times out.
  • Existing sessions continue during timeouts (with charging data retained), but SMC tears them down after 100 accumulated data records or when the CDF returns a permanent error.
  • Existing sessions are torn down immediately when the CDF is unreachable, because Result-Code 5012 is outside the 2xxx/3002/3004 keep-alive range.

Caution

Without max_pending_data configured, the 3002/3004 keep-alive path retains charging data in memory indefinitely. Configure a cap appropriate for your deployment to bound per-session memory growth during extended CDF outages.

Charging Triggers

Rf offline charging generates CDRs based on triggers. See Charging Overview for detailed trigger configuration.

CDR generation triggers:

  • ms-time-zone-change
  • rat-change
  • sgsn-sgw-change
  • sgsn-sgw-plmn-id-change

Container update triggers:

  • cgi-sai-change
  • ecgi-change
  • qos-change
  • rai-change
  • tai-change
  • tariff-switch-change
  • user-location-info-change

PCC Rule Integration

Offline charging is enabled per PCC rule. Configure rules with offlineEnabled: true:

yaml

Multiple rules can share the same rating group for aggregated billing:

yaml

Example Configurations

Basic Rf with Common Settings

yaml

Rf with No Interim Records

yaml

Note

This configuration only sends Accounting-Start and Accounting-Stop messages, not interim updates.

Rf with Standalone Configuration

yaml

Multiple Rating Groups

yaml

Troubleshooting

No Rf Connection

Symptom: Metric diameter_connections{svc="ergw_rf"} shows 0.

Possible causes:

  • CGF/charging system unreachable
  • Diameter transport misconfiguration
  • Firewall blocking port 3868

Solution:

  1. Verify Diameter transport configuration (see Diameter Configuration)

  2. Check network connectivity:

    bash
  3. Review SMC logs for Rf connection errors:

    bash
  4. Verify CGF/charging system is running and accepting connections

Memory Growth

Symptom: SMC memory usage increases continuously when Rf connection is down.

Cause: Charging data is queued in memory while Rf is unavailable.

Solution:

  1. Restore Rf connectivity immediately

  2. Monitor memory usage:

    promql
  3. If memory continues to grow dangerously, consider restarting SMC:

    bash

Important

Restarting SMC during an Rf outage results in loss of queued offline charging records.

No CDRs Generated

Symptom: CGF receives no CDRs despite active sessions.

Possible causes:

  • aaa.rf.enabled is false
  • No rules have offlineEnabled: true
  • Sessions do not match any offline-enabled rules

Solution:

  1. Verify Rf is enabled:

    yaml
  2. Verify at least one rule has offline charging enabled:

    yaml
  3. Verify rules are activated by checking session logs

  4. Verify sessions match rule flow descriptions

Interim Records Not Sent

Symptom: Start and Stop records are received, but no interim records.

Possible causes:

  • acctInterimInterval is null
  • acctInterimInterval is larger than session duration
  • Sessions terminate before interim interval expires

Solution:

  1. Configure interim interval:

    yaml
  2. Reduce interval for testing:

    yaml
  3. Verify sessions last longer than the interim interval

  4. Check SMC logs for interim accounting messages

Wrong Rating Group in CDRs

Symptom: CDRs contain unexpected rating group values.

Possible causes:

  • Multiple rules match the same traffic
  • Wrong rule has higher precedence
  • offlineRatingGroup overrides ratingGroup

Solution:

  1. Review rule precedence - lower values are evaluated first:

    yaml
  2. Check for offlineRatingGroup overrides:

    yaml
  3. Verify flow descriptions match intended traffic

  4. Test with simple catch-all rules to isolate the issue