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.

Charging Overview

What is Charging?

Charging is the process of collecting, measuring, and reporting resource usage for billing purposes. In mobile networks, charging tracks data volume, session duration, and service usage to generate bills for subscribers.

SMC implements charging functions for both traditional (EPC) and 5G Core networks, collecting detailed usage information and sending it to charging systems.

Online vs Offline Charging

Mobile networks use two charging models:

Online Charging

Online charging (also called prepaid or real-time charging) verifies credit availability before allowing service usage. The network checks with a charging system in real-time to ensure the subscriber has sufficient credit.

How it works:

  1. User requests service (for example, data session)
  2. SMC requests quota from Online Charging System (OCS)
  3. OCS checks subscriber balance and grants quota (for example, 100 MB or 1 hour)
  4. SMC allows service up to the granted quota
  5. When quota is consumed, SMC requests more quota or terminates service
  6. OCS deducts charges from subscriber balance immediately

Advantages:

  • Prevents overspending
  • Real-time balance deduction
  • Fraud prevention

Disadvantages:

  • Requires constant OCS availability
  • Higher latency (quota checks delay service establishment)
  • More complex implementation

Use cases:

  • Prepaid mobile services
  • Pay-as-you-go data
  • Budget-controlled accounts

Protocol: Diameter Ro over Gy reference point (3GPP TS 32.299)

Offline Charging

Offline charging (also called postpaid or batch charging) collects usage information during service delivery and processes it later for billing. The network allows service first and charges afterwards.

How it works:

  1. User requests service
  2. SMC allows service immediately
  3. SMC collects usage information (data volume, duration, location)
  4. SMC sends charging records to Charging Gateway Function (CGF) or billing system
  5. Billing system processes records later (hourly, daily, monthly)
  6. Subscriber receives bill periodically

Advantages:

  • Simple implementation
  • Low latency (no quota checks)
  • Works when charging system is temporarily unavailable

Disadvantages:

  • Risk of overspending
  • Delayed fraud detection
  • Requires credit risk management

Use cases:

  • Postpaid mobile services
  • Enterprise accounts
  • Flat-rate unlimited plans

Protocols:

Charging in SMC

SMC supports both online and offline charging simultaneously. PCC rules control which charging type applies to specific traffic.

yaml

Charging Triggers

SMC generates charging records based on configured triggers. Different triggers cause different actions:

CDR Generation Triggers

These triggers cause SMC to close the current CDR and send a new one:

  • ms-time-zone-change - User's time zone changes
  • rat-change - Radio Access Technology changes (for example, 3G to 4G)
  • sgsn-sgw-change - Serving gateway changes
  • sgsn-sgw-plmn-id-change - Serving network PLMN changes

Charging Container Update Triggers

These triggers update the charging containers within the current CDR without closing it:

  • cgi-sai-change - Cell Global Identity or Service Area Identity changes
  • ecgi-change - E-UTRAN Cell Global Identifier changes
  • qos-change - QoS parameters change
  • rai-change - Routing Area Identifier changes
  • tai-change - Tracking Area Identifier changes
  • tariff-switch-change - Charging tariff changes
  • user-location-info-change - User location information changes

Trigger Configuration by Role

Triggers vary depending on SMC's role:

SMC as GGSN/PGW:

  • Container updates: cgi-sai-change, ecgi-change, qos-change, rai-change, tai-change, tariff-switch-change, user-location-info-change
  • CDR generation: ms-time-zone-change, rat-change, sgsn-sgw-change, sgsn-sgw-plmn-id-change

SMC as TDF (Traffic Detection Function):

  • Container updates: sgsn-sgw-plmn-id-change, tariff-switch-change
  • CDR generation: ms-time-zone-change

Reference: 3GPP TS 32.251, sections 5.2.3.4, 5.2.3.9, 5.2.3.10

Change Reporting Action (CRA)

For location-dependent triggers, SMC sends a Change Reporting Action (CRA) IE in GTPv2 Create Session Response messages. This instructs the SGSN/SGW to notify SMC when location changes occur.

The CRA IE depends on:

  • Access network type (UTRAN, E-UTRAN)
  • CRSI (Change Reporting Support Indication) flag
  • ENBCRSI (eNodeB Change Reporting Support Indication) flag
  • Configured triggers

Example CRA values:

Rating Groups

Rating groups categorise traffic for different billing rates. Multiple rules can share the same rating group to aggregate usage.

yaml

Rating groups are sent in charging messages and used by the charging system to apply the correct billing rates.

Reference: RFC 4006Opens in a new tab, section 5.1.2

Metering Methods

Metering methods define what is measured for charging:

Configure per rule:

yaml

Charging Interfaces

SMC supports multiple charging interfaces:

See interface-specific documentation:

Charging Data Records (CDRs)

A CDR (Charging Data Record) contains detailed information about resource usage:

Common CDR fields:

  • Session identifiers - IMSI, MSISDN, Session-Id
  • Time information - Start time, stop time, duration
  • Location information - Cell ID, Tracking Area, PLMN
  • Volume information - Uplink bytes, downlink bytes, total bytes
  • QoS information - QoS class, bandwidth
  • Rating information - Rating group, service identifier
  • Network information - APN/DNN, IP address, RAT type
  • Charging identifiers - Charging ID, correlation IDs

CDR types in SMC:

  • PGW-CDR - Generated by SMC in PGW role
  • TDF-CDR - Generated by SMC in TDF role
  • GGSN-CDR - Generated by SMC in GGSN role (legacy 3G)

Reference: 3GPP TS 32.251

Configuration Overview

Charging configuration is split across multiple areas:

AAA Transport:

Policy Control:

Charging Interfaces:

Next Steps

  1. Configure AAA transports:

  2. Define PCC rules with charging parameters:

  3. Enable charging interfaces:

  4. Configure policy interfaces to activate rules: