Diameter Credit-Control Application
The Diameter Credit-Control Application (DCCA) is a standardized extension to the Diameter protocol that enables real-time credit-control for a variety of end-user services in telecommunications networks, including network access, SIP sessions, messaging, and multimedia services, primarily supporting prepaid charging scenarios through interactions between credit-control clients and servers.[1] Defined in RFC 8506 (March 2019), which obsoletes the earlier RFC 4006, the DCCA facilitates online charging by allowing service providers to authorize, reserve, and deduct credit units dynamically during service delivery, ensuring accurate billing and resource allocation without relying on post-service accounting.[1] It operates via two primary commands: the Credit-Control-Request (CCR, command code 272), sent by the client to request credit authorization or report usage, and the Credit-Control-Answer (CCA), returned by the server to grant units or confirm actions.[1] Key features include session-based credit-control for ongoing services (using INITIAL_REQUEST, UPDATE_REQUEST, and TERMINATION_REQUEST) and one-time event credit-control for discrete events (via EVENT_REQUEST), along with mechanisms for credit reservation, direct debiting, refunds, balance inquiries, and service price queries.[1] In practice, the DCCA is integral to 3GPP-defined interfaces for online charging systems, such as the Ro reference point between application front-ends and the Online Charging System (OCS), and the Gy interface between the Policy and Charging Enforcement Function (PCEF) and OCS, where it supports debit/reserve operations and integrates with additional AVPs for enhanced functionality like tariff changes and final-unit actions.[2] Failure handling for communication issues is addressed through the Credit-Control-Failure-Handling AVP, which specifies actions such as TERMINATE, CONTINUE, or RETRY_AND_TERMINATE to manage service continuity when communication fails. For credit depletion, the Final-Unit-Action AVP specifies TERMINATE, REDIRECT, or RESTRICT_ACCESS.[1] The application emphasizes multiple-service support within a single session via the Multiple-Services-Credit-Control AVP, enabling efficient management of diverse services like voice, data, and content downloads using rating groups and credit pools.[1] While focused on credit authorization, it excludes service-specific authentication or non-credit-related authorization, making it a foundational component for real-time charging in modern mobile and IP networks.[1]Introduction
Overview
The Diameter Credit-Control Application (DCCA) is a standardized extension of the Diameter protocol designed to enable real-time credit-control for a wide range of end-user services, including network access, IP connectivity, and multimedia sessions.[3] It operates as a specific Diameter application identified by Application-ID 4, which nodes advertise during capability exchange to support online charging mechanisms.[4] By integrating with the Diameter base protocol defined in RFC 6733, DCCA facilitates secure, reliable transport and message routing for credit-related interactions without altering the underlying protocol's core functions.[5] This application ensures that service providers can monitor and manage subscriber credit in real time, preventing unauthorized usage and enabling prepaid service models. The primary objectives of DCCA are to authorize service units—such as time, data volume, or discrete events—before granting access, reserve appropriate credit amounts to cover anticipated consumption, and report actual usage for accurate deduction or refunding.[6] These functions collectively mitigate the risk of overspending by verifying credit availability at the start of a service and adjusting reservations dynamically based on ongoing usage patterns.[3] For instance, in a voice call or data session, the application checks and reserves credit upfront, then updates the balance as the service progresses to maintain financial control. Architecturally, DCCA defines two key roles: the Credit-Control Client, typically hosted in network elements like gateways or proxies (e.g., a Network Access Server for IP connectivity or a SIP proxy for multimedia sessions), which initiates requests for credit authorization and reports usage; and the Credit-Control Server, located in backend charging systems (e.g., a prepaid server in the home domain), which evaluates credit, performs rating, and responds with grants or denials.[6] Examples of supported services include voice calls, data sessions for mobile broadband, and content downloads, where real-time interactions ensure seamless yet controlled delivery.[7]Historical Development
The Diameter Credit-Control Application was initially specified in RFC 4006, published in August 2005 by the Internet Engineering Task Force (IETF) Authentication, Authorization, and Accounting (AAA) Working Group.[8] This document introduced a Diameter application designed to enable real-time credit-control mechanisms for end-user services, such as network access and session-based charging, addressing the need for dynamic quota management in emerging multimedia and data services.[8] The specification built upon earlier Diameter applications, including the Network Access Server Requirements (NASREQ) defined in RFC 4005, which provided foundational authentication and authorization frameworks that the credit-control application extended for prepaid and real-time billing scenarios.[9] RFC 4006 was obsoleted by RFC 8506 in March 2019, which updated the protocol to reflect advancements in the Diameter base protocol (RFC 6733).[10] Key revisions in RFC 8506 included modernizing terminology (e.g., replacing "event" with "one-time" for non-session-based requests), clarifying the usage of Attribute-Value Pairs (AVPs) in various scenarios, resolving ambiguities in failure handling procedures, and ensuring compatibility with enhanced Diameter routing and transport features.[10] These changes aimed to improve interoperability and robustness in deployments, mandating support for the updated application in all new implementations while maintaining backward compatibility for legacy systems.[10] Prior to obsoletion, RFC 4006 accumulated errata to address minor issues in its original text, such as an editorial clarification in Section 5.6.2 requiring the explicit addition of "AVP" after "Granted-Service-Unit" to prevent vendor-specific misinterpretations of AVP formatting (Errata ID 3329).[11] Although superseded, these errata remain relevant for legacy implementations still referencing the 2005 specification.[11] As of May 2024, no major IETF updates to the core Diameter Credit-Control Application specifications have occurred since RFC 8506.[12] The protocol continues to be actively utilized and referenced in standards from organizations like 3GPP (e.g., TS 32.299 for online charging management) and ETSI.[13]Core Concepts
Credit-Control Models
The Diameter Credit-Control Application defines several models for managing credit authorization and accounting, enabling the server to control user service consumption in real-time. These models support flexible debit mechanisms tailored to different service types, ensuring accurate charging while minimizing risks associated with credit allocation.[1] In the direct debit model, the server authorizes and debits the exact service units requested by the client upon each service event, without reserving additional credit. This approach is particularly suited for low-risk, event-based scenarios, such as sending an SMS or storing an MMS, where the service outcome is guaranteed and immediate debiting suffices.[14][15][16] The reservation and refund model involves the client reserving a quota of credit units from the server prior to service delivery, followed by reporting actual usage and refunding any unused portions. If the granted quota is depleted, the client initiates re-authorization to obtain additional credit, allowing continued service while maintaining accurate accounting. This model is applied in scenarios requiring upfront credit assurance, such as voice calls or data sessions.[17][18][19][20] The general event-based model performs a one-time credit check and debit for discrete, low-risk events that do not require ongoing session state, such as an SMS transmission or a SIP Advice of Charge request. The client sends a single request to the server, which validates and deducts the necessary credit without establishing a persistent session.[21][20] Failure handling in these models ensures robust service management during credit exhaustion or server errors, as specified in Section 5.7 of RFC 8506. Communication failures (e.g., no response to a Credit-Control-Request) are managed via the Credit-Control-Failure-Handling AVP, with values TERMINATE (0), CONTINUE (1), or RETRY_AND_TERMINATE (2); a rejected credit-control request (e.g., due to insufficient funds) requires the client to terminate the session to prevent unauthorized service. For credit exhaustion, the server indicates the final unit via the Final-Unit-Indication AVP with Final-Unit-Action set to TERMINATE (0), REDIRECT_AND_STOP (1), REDIRECT_AND_CONTINUE (2), or CONTINUE (3), directing the client to end, redirect (e.g., to top-up), or maintain the session. For direct debiting in event-based models, the Direct-Debiting-Failure-Handling AVP specifies TERMINATE_OR_BUFFER (0) or CONTINUE (1).[22][23][15][24] Credit pooling extends these models by allowing multiple services or rating groups to share a single pool of credit resources, facilitated through grouped AVPs that reference a common pool identifier. This mechanism enables independent re-authorization for each service while drawing from the shared pool, optimizing credit utilization across diverse applications.[18][25]Charging Mechanisms
The Diameter Credit-Control Application supports two primary charging paradigms: session-based charging for continuous services and event-based charging for discrete transactions.[1] Session-based charging provides ongoing credit control for services measured by time, volume, or other units, such as data roaming sessions. It begins with an initial reservation of credit units before the service starts, followed by optional interim updates to report usage and request additional quota as units are consumed or validity periods expire, and concludes with final accounting upon service termination to settle any remaining balance, including refunds for unused units.[17] In contrast, event-based charging handles one-off authorizations for non-session-oriented events, such as purchasing premium content, through a single request-response exchange without maintaining ongoing state. This mechanism directly debits the account or performs checks like balance verification and price enquiries upon event occurrence, ensuring immediate processing without subsequent monitoring.[21] The key differences lie in their state management: session-based charging is stateful, requiring the credit-control server to track ongoing sessions and issue re-authorizations, while event-based charging is stateless, relying on isolated transactions. Triggers for session-based charging include service initiation, unit depletion, validity-time expiry, or session closure, whereas event-based charging activates solely on the occurrence of a discrete service event.[26] The application also enables multi-service support within a single session, allowing independent handling of multiple charging units—such as time and volume—through distinct service identifiers to apply granular credit control without session fragmentation.[18]Protocol Elements
Command Codes
The Diameter Credit-Control Application defines specific command codes within the Diameter protocol framework to facilitate online and offline credit-control operations between clients and servers. These commands are routed using Application-ID 4 in the Diameter message header, ensuring peer authentication and proper handling via the base protocol mechanisms.[27][28] The primary commands are the Credit-Control-Request (CCR) and Credit-Control-Answer (CCA), both utilizing Command-Code 272. The CCR, with the 'R' (Request) flag set in the message header, is sent by the credit-control client to the server to request service authorization, report usage, or manage session states, including initial setup, interim updates, termination, or one-time events. The CCA, with the 'R' flag cleared, serves as the server's response, providing granted service units, cost estimates, or indications for final unit depletion, and may include the 'T' (Potentially re-transmitted) flag for messages susceptible to retransmission in failover scenarios. These commands support credit-control models through AVPs such as CC-Request-Type to specify request variants (e.g., INITIAL_REQUEST or TERMINATION_REQUEST).[29][30][31][32] For integration with offline charging, the application leverages the base Diameter Accounting-Request (ACR) and Accounting-Answer (ACA), both with Command-Code 271. The ACR, with 'R' flag set, enables the client to report service usage events or session records to an accounting server when online credit-control is unavailable or as a backup mechanism, incorporating credit-control specific AVPs for failure handling. The ACA, with 'R' flag cleared, acknowledges the ACR, confirming receipt without granting credits. These commands are not exclusive to credit-control but extend base accounting to support hybrid charging scenarios.[33][17] Error handling in credit-control commands relies on the base protocol's Result-Code AVP, with application-specific values such as DIAMETER_CREDIT_LIMIT_REACHED (4012), which signals the exhaustion of subscriber credit and prompts session teardown or redirection via a TERMINATION_REQUEST CCR. Other errors, like DIAMETER_RATING_FAILED (5031), are reported in CCA responses, often accompanied by Failed-AVP for diagnostics.[34][35] RFC 8506 provides clarifications and obsoletes certain ambiguous usages from RFC 4006, such as refined failover procedures for CCR/CCA during server unavailability, while retaining the core command codes and emphasizing support for multiple concurrent services without deprecating the 272 or 271 codes.[36]| Command | Code | 'R' Flag | Primary Purpose |
|---|---|---|---|
| Credit-Control-Request (CCR) | 272 | Set | Request credit authorization or usage reporting |
| Credit-Control-Answer (CCA) | 272 | Cleared | Respond with granted units or error status |
| Accounting-Request (ACR) | 271 | Set | Report usage for offline integration |
| Accounting-Answer (ACA) | 271 | Cleared | Acknowledge accounting reports |
Message Flows
The Diameter Credit-Control Application employs request-response patterns primarily using Credit-Control-Request (CCR) and Credit-Control-Answer (CCA) messages to manage real-time credit for end-user services. These flows support both session-based and event-based charging mechanisms, enabling the credit-control client (typically in the access network) to interact with the credit-control server (in the home network) for quota allocation, usage reporting, and policy enforcement.[1] In the initial session flow, the credit-control client sends a CCR message with the CC-Request-Type set to INITIAL_REQUEST prior to service delivery, requesting quota for the session setup. The server responds with a CCA message containing granted service units and instructions, using the Result-Code AVP to indicate success (2001, DIAMETER_SUCCESS) or denial of service (e.g., END_USER_SERVICE_DENIED). This establishes the session state and reserves credit for the user.[37] For re-authorization during an active session, the client initiates an interim flow by sending a CCR with CC-Request-Type UPDATE_REQUEST when the granted quota is nearing exhaustion, conditions change, or periodic reporting is required. The server replies with a CCA that may renew quota via additional Granted-Service-Unit AVPs, adjust validity times, or issue final unit indications, again using Result-Code 2001 for success or other codes for limited success requiring further action. This ensures continuous service without interruption.[19] The termination flow occurs at session end, where the client sends a CCR with CC-Request-Type TERMINATION_REQUEST to report final used units and request any refunds or cost information. The server responds with a CCA confirming closure, potentially including Cost-Information AVPs, and Result-Code 2001 to acknowledge successful termination. If a Final-Unit-Action was previously set to TERMINATE, the service is gracefully shut down.[38] Event-based flows handle one-time charging events, such as balance checks or direct debiting, without maintaining session state. The client sends a single CCR with CC-Request-Type EVENT_REQUEST, and the server responds with a CCA providing the requested outcome, such as refunded units or status confirmation, using Result-Code 2001 for success or CREDIT_CONTROL_NOT_APPLICABLE for inapplicable requests.[21] Failure scenarios in these flows are managed through policies defined in the Credit-Control-Failure-Handling AVP, which dictates client actions like terminating service (TERMINATE) or continuing with granted units (CONTINUE) or retrying and then terminating (RETRY_AND_TERMINATE) if a CCA is not received before the transmission timer expires. Redirect handling uses Final-Unit-Indication set to REDIRECT for graceful teardown to an alternative service, while multi-round retries and failover to backup servers are supported if the CC-Session-Failover AVP indicates FAILOVER_SUPPORTED, with Result-Code 4012 (DIAMETER_CREDIT_LIMIT_REACHED) or similar for credit-related denials.[22] Diameter routing agents, such as relays and proxies, play a crucial role by transparently forwarding CCR and CCA messages between the client and server, provided they advertise support for the credit-control application identifier (4). These agents facilitate failover by redirecting messages to alternative servers and may issue Result-Code 3006 (DIAMETER_REDIRECT_INDICATION) to guide traffic rerouting during failures.[39]Attribute-Value Pairs
Credit-Control Specific AVPs
The Diameter Credit-Control Application introduces several Attribute-Value Pairs (AVPs) specifically designed to support credit-control operations, enabling the precise management of service units, request types, and session correlations within Credit-Control-Request (CCR) and Credit-Control-Answer (CCA) messages.[1] These AVPs are defined in RFC 8506 and are mandatory or optional based on their role in the protocol, with the Vendor-Specific (V) bit cleared for all, indicating they are not vendor-specific.[40] Their usage ensures accurate quota allocation, consumption reporting, and multi-service handling in real-time charging scenarios.[17] The CC-Request-Type AVP (AVP Code 416) is of type Enumerated and is used to specify the type of credit-control request in CCR messages, informing the receiver whether it is an INITIAL_REQUEST (1) for session initiation, UPDATE_REQUEST (2) for interim updates, TERMINATION_REQUEST (3) for session closure, or EVENT_REQUEST (4) for one-time events without session state maintenance.[41] It is mandatory in all CCR messages (M-bit set) and may be included in CCA messages for context, but must not have the V-bit set.[31] This AVP helps the credit-control server determine the appropriate response based on the request's purpose.[18] The CC-Request-Number AVP (AVP Code 415) is of type Unsigned32 and provides a sequential identifier for correlating credit-control messages within a single session, starting at 0 for INITIAL_REQUEST or EVENT_REQUEST and incrementing by 1 for each subsequent UPDATE_REQUEST or TERMINATION_REQUEST.[36] It is mandatory in both CCR and CCA messages (M-bit set) to ensure session continuity and is used alongside the Session-Id AVP for unique identification, with the V-bit cleared.[42] This numbering prevents message loss or reordering issues during transport.[43] The Granted-Service-Unit AVP (AVP Code 431) is a Grouped type AVP included in CCA messages to specify the service units (such as time via CC-Time, monetary via CC-Money, or volume via CC-Total-Octets) that the client is authorized to provide to the end user until the next CCR or service termination.[44] It is optional (M-bit cleared) and V-bit must not be set, allowing the server to grant quotas based on policy and available credit; multiple instances may appear if different unit types are authorized.[32] This AVP is central to the session-based charging model, enabling controlled resource allocation.[18] The Used-Service-Unit AVP (AVP Code 446) is also a Grouped type and is used in CCR messages for the client to report the amount of service units consumed by the user since the start of the session or the last reported event, including sub-AVPs like CC-Time, CC-Money, or CC-Total-Octets for measured usage.[24] It is optional (M-bit cleared), must not appear in CCA messages, and has the V-bit cleared, providing the server with accurate consumption data independent of previously granted units.[31] This reporting supports quota re-evaluation during update requests.[18] For scenarios involving multiple services or rating groups, the Multiple-Services-Credit-Control AVP (AVP Code 456) is a Grouped type that encapsulates related AVPs, such as Granted-Service-Unit, Used-Service-Unit, and Service-Context-Id, to enable independent credit-control for each service within a single message.[45] It is optional (M-bit cleared) in both CCR and CCA messages, with the V-bit not set, and allows multiple instances to handle diverse charging needs simultaneously.[42] This structure is particularly useful in complex environments with varied service types.[37] The Validity-Time AVP (AVP Code 448) is of type Unsigned32 and indicates the duration in seconds for which the granted service units remain valid, typically included in CCA messages to enforce quota expiration and facilitate graceful service termination if credit is low.[46] It is optional (M-bit cleared), applies only to CCA messages, and must have the V-bit cleared, overriding any default validity periods set by policy.[32] This AVP ensures timely re-authorization requests from the client.[18]| AVP Name | Code | Type | Mandatory in CCR/CCA | V-Bit Rule |
|---|---|---|---|---|
| CC-Request-Type | 416 | Enumerated | Yes/Optional | Must not be set |
| CC-Request-Number | 415 | Unsigned32 | Yes/Yes | Must not be set |
| Granted-Service-Unit | 431 | Grouped | No/Optional | Must not be set |
| Used-Service-Unit | 446 | Grouped | Optional/No | Must not be set |
| Multiple-Services-Credit-Control | 456 | Grouped | Optional/Optional | Must not be set |
| Validity-Time | 448 | Unsigned32 | No/Optional | Must not be set |
Base Protocol AVP Extensions
The Diameter Credit-Control Application, as defined in RFC 8506, extends and reuses several Attribute-Value Pairs (AVPs) from the Diameter base protocol specified in RFC 6733 to support credit-control operations. These extensions include new enumerated values, specific usage rules, and nesting within grouped AVPs to enable session management, error reporting, and event timing in credit-control scenarios.[1][48] The Session-Id AVP (Code 263), a UTF8String type from the base protocol, is mandatory in all Credit-Control-Request (CCR) and Credit-Control-Answer (CCA) messages and serves as a globally unique identifier for credit-control sessions. It remains unchanged throughout the session lifetime and is combined with the CC-Request-Number AVP for message correlation; for credit-control, its format may incorporate service-specific identifiers to distinguish between multiple services in a session.[31][49] The Origin-Host AVP (Code 264) and Origin-Realm AVP (Code 296), both of DiameterIdentity type, follow their standard base protocol usage as mandatory AVPs in all CCR and CCA messages to identify the sending host and its realm, facilitating routing and authentication in credit-control interactions between clients and servers.[31][48] The Result-Code AVP (Code 268), an Unsigned32 type, is extended with credit-control-specific values to indicate success or failure outcomes, including transient and permanent failures. Notable examples include DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE (4011), signaling that no further credit-control is needed (e.g., for free services); DIAMETER_END_USER_SERVICE_DENIED (4010), indicating service denial due to restrictions; DIAMETER_CREDIT_LIMIT_REACHED (4012), used when the credit limit for a service is reached. These values guide client behavior, such as service termination or retry attempts.[35][48] The Redirect-Host-Usage AVP (Code 292), an Enumerated type, specifies redirection behavior in CCA messages during server failures or graceful termination, with values such as ALL_USER (0) to redirect all user traffic to an alternate host listed in the Redirect-Server AVP (Code 434). This supports rerouting in credit-control flows without abrupt session disruption.[50][48] The Event-Timestamp AVP (Code 55), a Time type, is optionally included in CCR and CCA messages to record the timestamp of credit-control events, particularly in event-based charging scenarios like direct debiting via EVENT_REQUEST, enabling accurate billing correlation.[31][48] Base protocol AVPs nest within credit-control-specific grouped AVPs according to rules in RFC 8506, which align with RFC 6733's grouping conventions; for instance, AVPs like Session-Id and Result-Code appear at the message top level, while units from Granted-Service-Unit (Code 431) and identifiers from Multiple-Services-Credit-Control (Code 456) encapsulate service-specific details for concurrent credit management.[18][51] RFC 8506 obsoletes RFC 4006, resolving deprecated usages such as ambiguous Result-Code interpretations and outdated grouping structures by aligning them with RFC 6733 updates, ensuring backward compatibility while clarifying credit-control AVP handling.[52]Standards and Applications
Primary Specifications
The Diameter Credit-Control Application is defined in RFC 8506, published in 2019 by the Internet Engineering Task Force (IETF), which specifies a framework for implementing real-time credit-control in Diameter networks to manage subscriber services such as network access, SIP sessions, messaging, and prepaid accounts.[1] This RFC obsoletes the earlier RFC 4006 and mandates its support in all new implementations, providing mechanisms for credit authorization, usage monitoring, resource allocation, and balance management across event-based and session-based scenarios.[1] Key updates in RFC 8506 from RFC 4006 include revisions to the abstract syntax for better compatibility, enhanced clarification on multi-service handling through the Multiple-Services-Credit-Control AVP to support concurrent services in a single session, addition of illustrative failure code examples for improved error diagnostics, and alignment with the base Diameter protocol in RFC 6733 to ensure interoperability.[1] These changes address ambiguities in prior specifications, such as refined handling of multiple services and updated error reporting, while maintaining backward compatibility where feasible.[1] Security considerations in RFC 8506 emphasize protection against replay attacks using Diameter's sequence numbers combined with the Session-Id AVP to validate message freshness and prevent unauthorized credit manipulations.[1] Confidentiality for sensitive data like monetary values is required, achieved through transport-layer security protocols including IPsec for encapsulation, TLS over TCP, or DTLS over SCTP to safeguard credit-control exchanges from eavesdropping or tampering.[1] IANA considerations in the RFC establish dedicated namespaces for the application, as summarized below:| Category | Allocation | Reference |
|---|---|---|
| Application-ID | 4 ("Diameter Credit Control") | Section 12.1 |
| AVP Codes | 414–456 | Section 12.3 |
| Result-Codes | 5001–5021 | Section 12.4 |