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:
When standalone is false, Rf uses Diameter transport settings from aaa.oss (see Diameter Configuration).
When standalone is true, configure Rf-specific settings:
Network Configuration
Rf can use common network settings or dedicated network configuration.
Using Common Network Settings
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:
Set to null to disable interim records:
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:
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) orTOO_BUSY(3004): charging data retained; session continues, subject to themax_pending_datacap.- 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
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:
Multiple rules can share the same rating group for aggregated billing:
Example Configurations
Basic Rf with Common Settings
Rf with No Interim Records
Note
This configuration only sends Accounting-Start and Accounting-Stop messages, not interim updates.
Rf with Standalone Configuration
Multiple Rating Groups
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:
Verify Diameter transport configuration (see Diameter Configuration)
Check network connectivity:
bashReview SMC logs for Rf connection errors:
bashVerify 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:
Restore Rf connectivity immediately
Monitor memory usage:
promqlIf 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.enabledisfalse- No rules have
offlineEnabled: true - Sessions do not match any offline-enabled rules
Solution:
Verify Rf is enabled:
yamlVerify at least one rule has offline charging enabled:
yamlVerify rules are activated by checking session logs
Verify sessions match rule flow descriptions
Interim Records Not Sent
Symptom: Start and Stop records are received, but no interim records.
Possible causes:
acctInterimIntervalisnullacctInterimIntervalis larger than session duration- Sessions terminate before interim interval expires
Solution:
Configure interim interval:
yamlReduce interval for testing:
yamlVerify sessions last longer than the interim interval
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
offlineRatingGroupoverridesratingGroup
Solution:
Review rule precedence - lower values are evaluated first:
yamlCheck for
offlineRatingGroupoverrides:yamlVerify flow descriptions match intended traffic
Test with simple catch-all rules to isolate the issue