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.

You are reading Charging Data Function 4.2, an older release. The newest release is 4.3. Read this page in 4.3

Charging Data Function

Charging Data Function (CDF) is a key component in the 3GPP charging architecture for mobile networks. It is responsible for collecting, aggregating, and processing charging data records (CDRs) from various network elements. These CDRs contain information about the users' consumption of network resources.

CDF performs several important functions:

  • Collecting CDRs from network elements such as Gateway GPRS Support Node (GGSN), Serving Gateway (SGW), or Packet Data Network Gateway (PGW)
  • Transferring the processed CDRs to the Charging Gateway Function (CGF)

In the 3GPP charging architecture, CDF is often integrated into the network elements that generate CDRs. It works alongside other components like the CGF to support the overall charging and billing process in mobile networks.

CDF is part of the 3GPP offline charging architecture, where it connects to the CGF to send charging information. This architecture supports both offline and online charging scenarios, allowing for flexible and comprehensive billing solutions in telecommunications networks.

Architecture

CDF consists of two components: CDF Receiver and CDF Sender. The transport between the Receiver and the Sender takes place with NATS.

See the CDF workflow diagram:

CDF with NATS transport
CDF with NATS transport
  1. On application startup, CDF configures the CDR stream and the work-queue consumer.
  2. CDF Receiver receives Accounting Requests (ACRs) from Session Management Controller (SMC) and parses them into charging data content. The charging data is published to NATS.
  3. CDF Receiver queues CDRs in a CDR stream. The stream is limited by the queue size in bytes or time.
  4. The work-queue consumer, which is subscribed for all entries in the stream, consumes entities from the stream (CDRs).
  5. CDF Sender sends CDRs through the Ga reference point to CGF.
  6. CGF acknowledges the CDR delivery.
  7. CDF Sender sends confirmations for the processed CDRs to the work-queue consumer.

Receiver

CDF Receiver processes accounting requests (ACRs) using the Rf interface. There are three types of ACRs:

  • start
  • interim
  • stop

Only the interim and stop requests are saved. Nothing is saved if only start records arrive at the receiver. This behaviour assumes that the Session Management Controller (SMC) accumulates charging data until the reporting interval. The receiver generates CDRs in a format suitable for the sender and publishes each CDR to NATS.

Sender

CDF Sender periodically consumes CDRs from NATS. It verifies the conditions that must be met to send a CDR through the Ga interface to CGF. CDF Sender generates CDRs in a format suitable for the Ga interface. If CDF Sender does not get any response from GTP Echo Requests, it does not send CDRs. CDF Sender is utilizing a configurable, but limited in size connection pool, to send out CDRs to CGF. Each of those “connections” is used to send a single CDR and also waiting for the response. If a CDR is not acknowledged, it is sent again.

The GTP transport protocol is used in a non-standard load-balanced configuration, and the CGF handles duplicate deletion.

Normal case

Potential error scenarios are described in the Troubleshooting document.

NATS services

NATS is a component responsible for transport between CDF Receiver and CDF Sender. CDF uses the following NATS-backed services:

  • Work Queue — queues CDRs for sending to CGFs
  • KV Store — holds key-value data used internally by CDF
  • Archive — stores copies of sent CDRs (optional)

You can configure separate NATS servers for these services to optimise performance.

However, you can also use a single NATS server for all services:

Note

The CDF Sender’s performance is limited by the slower of the Work Queue and Archive services. If they are one and the same there is no drop in performance.

Work queue service

The work queue service handles the queuing of CDRs before they are sent to CGFs. It’s recommended to configure streamsOpens in a new tab on this server with the workqueue retention policy, which allows items to be deleted from the stream immediately after consumption. This ensures the stream remains small and manageable, preventing unnecessary storage growth and reducing maintenance overhead.

See StreamOpens in a new tab for more information.

KV store service

The KV store service is responsible for managing internal key-value data used by CDF. While it’s possible to share this server with other NATS servers, using a separate KV store server can improve performance.