AAA Working Group Internet Draft Harri Hakala Document: draft-ietf-aaa-diameter-cc-03.txt Leena Mattila Expires: August 2004 Ericsson Juha-Pekka Koskinen Marco Stura John Loughney Nokia February 16, 2004 Diameter Credit-Control Application Status of this memo This document is an Internet-Draft and is subject to all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or cite them other than as "work in progress". The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/lid-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html This document is a product of the Authentication, Authorization and Accounting (AAA) Working Group of the Internet Engineering Task Force (IETF). Comments are welcome should be submitted to the mailing list aaa-wg@merit.edu. Abstract This document specifies a DIAMETER application that can be used to implement real-time credit-control for a variety of end user services such as network access, SIP services, messaging services, download services etc. Hakala et al. Expires - August 2004 [Page 1] Diameter Credit Control Application February 2004 1. Introduction...................................................5 1.1 Requirements language......................................5 1.2 Terminology................................................6 1.3 Advertising application support............................7 2. Architecture Models............................................7 3. Credit-Control Messages.......................................10 3.1 Credit-Control-Request (CCR) Command......................10 3.2 Credit-Control-Answer (CCA) Command.......................11 4. Credit Control Application Overview...........................12 4.1 Service-Specific Rating Input and Interoperability........14 5. Session Based Credit-control..................................15 5.1 General Principles........................................15 5.2 First Interrogation.......................................20 5.3 Intermediate Interrogation................................25 5.4 Final Interrogation.......................................27 5.5 Server-Initiated Credit Re-Authorization..................28 5.6 Graceful Service Termination..............................30 5.7 Failure Procedures........................................35 6. One Time Event................................................38 6.1 Service Price Enquiry.....................................39 6.2 Balance Check.............................................39 6.3 Direct Debiting...........................................39 6.4 Refund....................................................40 6.5 Failure Procedure.........................................41 7. Credit Control Application State Machine......................43 8. Credit Control AVPs...........................................53 8.1 CC-Correlation-Id AVP.....................................55 8.2 CC-Request-Number AVP.....................................55 8.3 CC-Request-Type AVP.......................................56 8.4 CC-Session-Failover AVP...................................56 8.5 CC-Sub-Session-Id AVP.....................................57 8.6 Check-Balance-Result AVP..................................57 8.7 Cost-Information AVP......................................58 8.8 Unit-Value AVP............................................58 8.9 Exponent AVP..............................................59 8.10 Value-Digits AVP.........................................59 8.11 Currency-Code AVP........................................59 8.12 Cost-Unit AVP............................................59 8.13 Credit-Control AVP.......................................59 8.14 Credit-Control-Failure-Handling AVP......................60 8.15 Direct-Debiting-Failure-Handling AVP.....................61 8.16 Multiple-Services-Credit-Control AVP.....................61 8.17 Granted-Service-Unit AVP.................................62 8.18 Requested-Service-Unit AVP...............................63 8.19 Used-Service-Unit AVP....................................63 8.20 Tariff-Time-Change AVP...................................64 8.21 CC-Time AVP..............................................64 8.22 CC-Money AVP.............................................64 Hakala et al. Expires - August 2004 [Page 2] Diameter Credit Control Application February 2004 8.23 CC-Total-Octets AVP......................................64 8.24 CC-Input-Octets AVP......................................65 8.25 CC-Output-Octets AVP.....................................65 8.26 CC-Service-Specific-Units AVP............................65 8.27 Tariff-Change-Usage AVP..................................65 8.28 Service-Identifier AVP...................................66 8.29 Rating-Group AVP.........................................67 8.30 G-S-U-Pool-Reference AVP.................................67 8.31 G-S-U-Pool-Identifier AVP................................67 8.32 CC-Unit-Type AVP.........................................67 8.33 Validity-Time AVP........................................68 8.34 Final-Unit-Indication AVP................................68 8.35 Final-Unit-Action AVP....................................69 8.36 Restriction-Filter-Rule AVP..............................70 8.37 Redirect-Server AVP......................................70 8.38 Redirect-Address-Type AVP................................70 8.39 Redirect-Server-Address AVP..............................71 8.40 Multiple-Services-Indicator AVP..........................71 8.41 Requested-Action AVP.....................................71 8.42 Service-Parameter-Info AVP...............................72 8.43 Service-Parameter-Type AVP...............................73 8.44 Service-Parameter-Value AVP..............................73 8.45 Subscription-Id AVP......................................73 8.46 Subscription-Id-Type AVP.................................73 8.47 Subscription-Id-Data AVP.................................74 9. Result Code AVP values........................................74 9.1 Transient Failure.........................................74 9.2 Permanent Failures........................................75 10. AVP Occurrence Table.........................................75 10.1 Credit Control AVP Table.................................76 10.2 Re-Auth-Request/Answer AVP Table.........................77 11. RADIUS/Diameter Credit-control Interworking..................77 11.1 Initial RADIUS Access-Request............................78 11.2 Subsequent RADIUS Access-Request message.................79 11.3 RADIUS Vendor Specific Attributes for Credit Control.....79 12. IANA Considerations..........................................80 12.1 Application Identifier...................................80 12.2 Command Codes............................................80 12.3 AVP Codes................................................81 12.4 Result-Code AVP Values...................................81 12.5 CC-Request-Type AVP......................................81 12.6 CC-Session-Failover AVP..................................81 12.7 CC-Unit-Type AVP.........................................81 12.8 Check-Balance-Result AVP.................................81 12.9 Credit-Control AVP.......................................81 12.10 Credit-Control-Failure-Handling AVP.....................81 12.11 Direct-Debiting-Failure-Handling AVP....................82 12.12 Final-Unit-Action AVP...................................82 12.13 Multiple-Services-Indicator AVP.........................82 Hakala et al. Expires - August 2004 [Page 3] Diameter Credit Control Application February 2004 12.14 Redirect-Address-Type AVP...............................82 12.15 Requested-Action AVP....................................82 12.16 Subscription-Id-Type AVP................................82 12.17 Tariff-Change-Usage AVP.................................82 13. Credit-control Application Related Parameters................82 14. Security Consideration.......................................83 14.1 Direct Connection with Redirects.........................84 15. References...................................................85 15.1 Normative................................................85 15.2 Non-Normative............................................86 16. Acknowledgement..............................................86 17. Author's Address.............................................86 18. Full Copyright Statement.....................................87 19. Notices......................................................88 20. Expiration Date..............................................88 Appendix A Credit Control sequences..............................88 A.1 Flow I..................................................88 A.2 Flow II.................................................90 A.3 Flow III................................................92 A.4 Flow IV.................................................93 A.5 Flow V..................................................94 A.6 Flow VI.................................................95 A.7 Flow VII................................................96 A.8 Flow VIII...............................................97 A.9 Flow IX.................................................99 A.10 Flow X..................................................100 Hakala et al. Expires - August 2004 [Page 4] Diameter Credit Control Application February 2004 1. Introduction This document specifies a DIAMETER application that can be used to implement real-time credit-control for a variety of end user services such as network access, SIP services, messaging services, download services etc. It provides a general solution to the real-time cost and credit control. The prepaid model shown to be very successful for instance in GSM networks where network operators offering prepaid services have experienced a substantial growth of their customer base and revenues, prepaid services are now cropping up in many other wireless and wire line based networks as well. In next generation wireless networks, additional functionality is required beyond that specified in the Diameter base protocol. For example, the 3GPP Charging and Billing requirements [3GPPCHARG] state that an application must be able to rate service information in real- time. In addition, it is necessary to check that the end user's account provides coverage for the requested service, prior to initiation of that service. When an account is exhausted or expired, the user must be denied the ability to compile additional chargeable events. A mechanism needs to be provided to allow the user to be informed of the charges to be levied for a requested service. In addition, there are services such as gaming and advertising that may credit as well as deduct from a user account. The other Diameter applications provide service specific authorization and they do not provide credit authorization for prepaid users. The credit authorization shall be generic and applicable to all the service environments required to support prepaid services. To fulfill these requirements, it is necessary to facilitate communication between the network element providing the service (e.g. NAS, SIP Proxy, Application Server etc.) and a credit-control server, in order to minimize financial risk. The scope of this specification is the credit authorization. Service specific authorization and authentication is out of the scope. 1.1 Requirements language In this document, the key words "MAY", "MUST, "MUST NOT", "OPTIONAL", "RECOMMENDED", "SHOULD", and "SHOULD NOT", are to be interpreted as described in [KEYWORDS]. Hakala et al. Expires - August 2004 [Page 5] Diameter Credit Control Application February 2004 1.2 Terminology AAA Authentication, Authorization and Accounting AA answer AA answer does generically refer to a service specific authorization and authentication answer. AA answer commands are defined in service specific authorization applications e.g. [NASREQ] and [DIAMMIP]. AA request AA request does generically refer to a service specific authorization and authentication request. AA request commands are defined in service specific authorization applications e.g. [NASREQ] and [DIAMMIP]. Credit-control Credit-control is a mechanism, which directly interacts in real-time with an account and controls or monitors the charges, related to the service usage. Credit-control is a process of checking if credit is available, credit-reservation, deduction of credit from the end user account when service is completed and refunding of reserved credit not used. Diameter Credit-control Server Diameter Credit-control server acts as a prepaid server, performing real-time rating and credit control. It is located in the home domain and is accessed by service elements or AAA servers in real-time for purpose of price determination and credit-control before the service event is delivered to the end-user. It may also interact with business support systems. Diameter Credit-control Client A Diameter credit-control client is an entity that interacts with a credit-control server. It monitors the usage of the granted quota according to instructions returned by credit-control server. Interrogation The Diameter credit-control client uses interrogation to initiate a session based credit-control process and during the credit-control process to report the used quota and request a new one. An interrogation maps to a request/answer transaction. Hakala et al. Expires - August 2004 [Page 6] Diameter Credit Control Application February 2004 One-time event Basically a request/answer transaction of type event. The credit- control server is not required to maintain session state for one-time event. Rating The act of determining the cost of the service event. Service A type of task that is performed by a service element for an end user. Service Element A network element that provides a service to the end users. The Service Element may include the Credit-control Client, or another entity (e.g. RADIUS AAA server) can act as a Credit-control Client on behalf of the Service Element. In the latter case the interface between the Service Element and the Diameter Credit-control Client is outside the scope of this specification. Examples of the Service Elements include NAS, SIP Proxy and Application Servers such as messaging server, content server and gaming server. Service Event An event relating to a service provided to the end user. Session based credit-control Credit-control process that makes use of several interrogations: the first, possible intermediates and the final interrogation. The first interrogation is used to reserve money from the user's account and initiate the process. The intermediate interrogations may be needed to request new quota while the service is being rendered. The final interrogation is used to exit the process. The credit-control server is required to maintain session state for session-based credit- control. 1.3 Advertising application support Diameter nodes conforming to this specification MUST advertise support by including the value of 4 in the Auth-Application-Id of the Capabilities-Exchange-Request and Capabilities-Exchange-Answer command [DIAMBASE]. 2. Architecture Models Hakala et al. Expires - August 2004 [Page 7] Diameter Credit Control Application February 2004 The current accounting models specified in the Radius Accounting [RFC2866] and Diameter base [DIAMBASE] are not sufficient for real- time credit control, where credit-worthiness is to be determined prior to service initiation. Also, the existing Diameter authorization applications [NASREQ] and [DIAMMIP] only provides service authorization, but do not provide credit authorization for prepaid users. In order to support real-time credit control a new type of server is needed in the AAA infrastructure; Diameter credit-control server. The Diameter credit-control server is the entity responsible of credit authorization for prepaid subscribers. A service element may authenticate and authorize the end user with the AAA server using AAA protocols, e.g. RADIUS or a Diameter base protocol with a possible Diameter application. Accounting protocols such as RADIUS accounting and the Diameter base accounting protocol can be used to provide accounting data to the accounting server after service is initiated, and to provide possible interim reports until service completion. However, for real-time credit control, these authorization and accounting models are not sufficient. When real-time credit-control is required, the credit-control client contacts the credit-control server with possible service event information included before the service is provided to the end user. This process is performed in order to determine potential charges and to verify whether the end user's account balance is sufficient to cover the cost of the service being rendered. Figure 1 illustrates the typical credit-control architecture, which consist of a Service Element with embedded Diameter credit-control client, a Diameter credit-control server and an AAA server. A Business Support System is usually deployed; it includes at least the billing functionality. The credit-control server and AAA server in this architecture model are logical entities. The real configuration can combine them into a single host. The credit-control protocol is the Diameter base protocol with the Diameter credit-control application. When an end user requests services such as for instance SIP services or messaging services, the request is typically forwarded to a service element (e.g. SIP Proxy) in the user's home domain. In some cases it might be possible that the service element in the visited domain can offer services to the end user, however a commercial agreement must exist between the visited domain and the home domain. Network access is an example of a service offered in the visited domain where the NAS, through an AAA infrastructure, authenticates and authorizes the user with the user's home network. Hakala et al. Expires - August 2004 [Page 8] Diameter Credit Control Application February 2004 Service Element AAA and CC +----------+ +---------+ protocols+-----------+ +--------+ | End |<---->|+-------+|<------------>| AAA | |Business| | User | +->|| CC || | Server |->|Support | | | | || client||<-----+ | | |System | +----------+ | |+-------+| | +-----------+ | | | +---------+ | ^ +--------+ +----------+ | | CC protocol | ^ | End |<--+ | +-----v----+ | | User | +------>|Credit- | | +----------+ credit-control |control |--------+ protocol |server | +----------+ Figure 1: Typical credit-control architecture Other entities, such as RADIUS AAA server, may act as a Diameter credit-control client towards the Diameter credit-control server for service elements that use credit control mechanisms other than Diameter credit-control. In this case the AAA server contact the Diameter credit-control server as part of the authorization process. The interworking architecture is illustrated in Figure 2, the interaction between the Diameter credit-control client and the service element is outside the scope of this specification. Interworking with RADIUS is addressed in section 11 and Annex A. AAA +--------+ +---------+ protocol +------------+ +--------+ | End |<----->| Service |<------------>| AAA | |Business| | User | | Element | | Server | |Support | +--------+ +-->| | |+----------+|-->|System | | +---------+ ||CC client || | | | |+----------+| | | +--------+ | +------^-----+ +--------+ | End |<--+ credit-control | ^ | User | protocol | | +--------+ +-------V------+ | |Credit-control|--------+ | Server | +--------------+ Figure 2: Credit-control architecture with Service Element not supporting the credit-control protocol There can be multiple credit-control servers in the system for reasons of redundancy and load balancing. The system can also contain separate rating server(s) and accounts can be located in a centralized database. For duplicate detection only one place in the credit-control system should perform duplicate detection to ensure that the end Hakala et al. Expires - August 2004 [Page 9] Diameter Credit Control Application February 2004 user's account is not debited or credited multiple times for the same service event. System internal interfaces can exist to relay messages between servers and an account manager. However the detailed architecture of credit-control system and its interfaces are implementation specific and are out of scope of this specification. There can exist protocol transparent Diameter relays between credit- control client and credit-control server. Also Diameter Redirect agents, which refer credit control clients to credit control servers and allow them to communicate directly can exist. These agents transparently support the Diameter credit-control application. If Diameter credit-control proxies exist between the credit-control client and the credit-control server, they MUST advertise the Diameter credit-control application support. 3. Credit-Control Messages This section defines new Diameter message Command-Code values that MUST be supported by all Diameter implementations that conform to this specification. The Command Codes are: Command-Name Abbrev. Code Reference ----------------------------------------------------------- Credit-Control-Request CCR 272 3.1 Credit-Control-Answer CCA 272 3.2 3.1 Credit-Control-Request (CCR) Command The Credit-Control-Request message (CCR), indicated by the command- code field set to 272 and the 'R' bit set in the Command Flags field, is used between the Diameter credit-control client and the credit- control server to request credit authorization for a given service. The Auth-Application-Id MUST be set to the value 4 indicating the Diameter credit-control application. Hakala et al. Expires - August 2004 [Page 10] Diameter Credit Control Application February 2004 Message Format ::= < Diameter Header: 272, REQ, PXY > < Session-Id > { Origin-Host } { Origin-Realm } { Destination-Realm } { Auth-Application-Id } { CC-Request-Type } { CC-Request-Number } [ Destination-Host ] [ User-Name ] [ CC-Sub-Session-Id ] [ Acct-Multi-Session-Id ] [ Origin-State-Id ] [ Event-Timestamp ] *[ Subscription-Id ] [ Service-Identifier ] [ Termination-Cause ] [ Requested-Service-Unit ] [ Requested-Action ] *[ Used-Service-Unit ] [ Multiple-Services-Indicator ] *[ Multiple-Services-Credit-Control ] *[ Service-Parameter-Info ] *[ CC-Correlation-Id ] *[ Proxy-Info ] *[ Route-Record ] *[ AVP ] 3.2 Credit-Control-Answer (CCA) Command The Credit-Control-Answer message (CCA), indicated by the command-code field set to 272 and the 'R' bit cleared in the Command Flags field, is used between the credit-control server and the Diameter credit- control client to acknowledge a Credit-Control-Request command. Hakala et al. Expires - August 2004 [Page 11] Diameter Credit Control Application February 2004 Message Format ::= < Diameter Header: 272, PXY > < Session-Id > { Result-Code } { Origin-Host } { Origin-Realm } { Auth-Application-Id } { CC-Request-Type } { CC-Request-Number } [ User-Name ] [ CC-Session-Failover ] [ CC-Sub-Session-Id ] [ Acct-Multi-Session-Id ] [ Origin-State-Id ] [ Event-Timestamp ] [ Subscription-Id ] [ Granted-Service-Unit ] *[ Multiple-Services-Credit-Control ] [ Cost-Information] [ Final-Unit-Indication ] [ Check-Balance-Result ] [ Credit-Control-Failure-Handling ] [ Direct-Debiting-Failure-Handling ] [ Validity-Time] [ Redirect-Host AVP ] [ Redirect-Host-Usage AVP ] [ Redirect-Max-Cache-Time AVP ] *[ Proxy-Info ] *[ Route-Record ] *[ AVP ] 4. Credit Control Application Overview The credit authorization process takes place before and during service delivery to the end user, it generally requires user's authentication and authorization before any request is sent to the credit-control server. The credit control application defined in this specification supports for two different credit authorization models: credit authorization with money reservation and credit authorization with direct debiting. In both the models, the credit control client requests credit authorization to the credit control server prior to allow any service to be delivered to the end user. In the first model, the credit control server rates the request, reserves a suitable amount of money from the user's account and returns the corresponding amount of credit resources. Note that credit Hakala et al. Expires - August 2004 [Page 12] Diameter Credit Control Application February 2004 resources may not imply actual monetary credit; credit resources may be granted to the credit control client in form of units (e.g. data volume or time) to be metered. Upon reception of a successful credit authorization answer with a certain amount of credit resources, the credit control client allows service delivery to the end user and starts monitoring the usage of the granted resources. When the credit resources granted to the user have been consumed, or the service has been successfully delivered or terminated, the credit control client reports back to the server the used amount. The credit control server deducts the used amount from the end user's account; it may perform rating and make a new credit reservation if the service delivery is continuing. This process is accomplished with session based credit control that includes the first interrogation, possible intermediate interrogations and the final interrogation. For session based credit control, both the credit control client and the credit control server are required to maintain credit control session state. In contrast, credit authorization with direct debiting is a single transaction process where the credit control server directly deducts the suitable amount of money from the user's account as soon as the credit authorization request is received. Upon reception of a successful credit authorization answer, the credit control client allows service delivery to the end user. This process is accomplished with the one time event. Session state is not maintained. In a multi-service environment, an end user may issue an additional service request (e.g. data service) during an ongoing service (e.g. voice call) towards the same account; or during an active multimedia session an additional media type is added to the session causing a new simultaneous request towards same account. Consequently this needs to be considered when credit resources are granted to the services. The credit control application also supports operations such as service price enquiry, user's balance check and refund of credit on the user's account. These operations are accomplished with the one time event. Session state is not maintained. A flexible Credit control application specific failure handling is defined where the home service provider can model the credit control client behavior according to its own credit risk management policy. The Credit-Control-Failure-Handling AVP and the Direct-Debiting- Failure-Handling AVP are defined to determine what to do if the sending of credit-control messages to the credit-control server has been temporarily prevented. The usage of Credit-Control-Failure- Handling AVP and the Direct-Debiting-Failure- Handling AVP gives flexibility to have different failure handling for credit-control session and one time event direct debiting. Hakala et al. Expires - August 2004 [Page 13] Diameter Credit Control Application February 2004 4.1 Service-Specific Rating Input and Interoperability The Diameter Credit Control Application defines the framework for credit control; it provides generic credit control mechanisms supporting multiple service applications. The Credit Control Application, therefore, does not define AVPs that could be used as input in the rating process. Listing the possible services that could use this Diameter application is seen as out of scope for this generic mechanism as well. It is reasonable to expect that there will exist a service level agreement between providers of the credit control client and the credit control server covering the charging, services offered, roaming agreements, agreed rating input, etc. There are two ways for providing rating input to the credit control server, either by using AVPs or by including them in the Service- Parameter-Info AVP. The general principle for sending rating parameters is that the service SHOULD re-use existing AVPs, if the service can use AVPs defined in existing service specific Diameter applications (e.g. NASREQ for network access services). Alternatively, new AVPs can be defined if the existing AVPs do not provide sufficient rating information. The Service-Parameter-Info AVP MAY be used as a container to pass legacy-rating information in its original encoded form (e.g. ASN.1 BER). In that case the rating input is embedded in the Service-Parameter-Info AVP as defined in section 8.42. New service applications SHOULD favor the use of explicitly defined AVPs, to simplify interoperability. The service specific rating input AVPs, the contents of the Service- Parameter-Info AVP or Service-Identifier AVP are not within the scope of this document. To facilitate interoperability, it is RECOMMENDED that the rating input and values of service identifiers are coordinated via an informational RFC or other permanent and readily available reference such as the specification of another cooperative standardization body (e.g. 3GPP, OMA and 3GPP2) SHOULD be used. However, private services may be deployed that are subject to agreements between providers of the credit control server and client, in this case vendor specific AVPs can be used. This specification, together with service specific documents, is governing the credit control message. The rule is that service specific documents only define what existing AVPs or new AVPs are used as input to the rating process (i.e. they do not define new credit control applications), and thus need to be included in the Credit- Control-Request command by a Diameter Credit Control Client supporting a given service as *[AVP]. In order to define new AVPs, service specific documents MUST follow the practices defined in Hakala et al. Expires - August 2004 [Page 14] Diameter Credit Control Application February 2004 [DIAMBASE]. The service SHOULD be identified using the Service- Identifier AVP. The Service-Identifier AVP MUST be a unique identifier for a given service as defined in section 8.28. As a result it is the combination of support of the Diameter Credit Control Application and the service defined in the Service-Identifier AVP, which defines interoperability between any given credit control client and server. Diameter credit control implementations are required to support the Mandatory rating AVPs defined in service specific documentation of the services they support. Introducing new credit control mechanisms not defined in this specification implies the definition of a new version of the Diameter Credit Control Application and corresponding Application Identifier. In case a rating input required for the rating process is incorrect in the Credit control request, or the credit control server does not support the requested service, the Credit control answer MUST contain error code DIAMETER_RATING_FAILED. A CCR message with this error MUST contain one or more Failed-AVP AVPs containing the missing and/or unsupported AVPs that caused the failure. A Diameter credit control client receiving error code DIAMETER_RATING_FAILED in answer to a request MUST NOT send such similar requests in the future. 5. Session Based Credit-control 5.1 General Principles For a session-based credit-control, several interrogations are needed: the first, intermediate (optional) and the final interrogation. This is illustrated in Figure 3 and Figure 4. If the credit-control client performs credit-reservation before granting service to the end user it MUST use several interrogations towards the credit-control server (i.e. session based credit-control). In this case the credit-control server MUST maintain the credit control session state. Each credit-control session MUST have globally unique Session-Id as defined in [DIAMBASE] and it MUST NOT be changed during the lifetime of a credit-control session. There are certain applications that require multiple credit control sub-sessions. Such applications would send messages with a constant Session-Id AVP, but a different CC-Sub-Session-Id AVP. If several credit sub-sessions will be used, all sub-sessions MUST be closed separately before the closing the main session to be able to report used units per sub-session. The absence of this AVP implies no sub- sessions are in use. Hakala et al. Expires - August 2004 [Page 15] Diameter Credit Control Application February 2004 It should be noted that the service element might send a service specific re-authorization message to the Diameter AAA server due to expiration of the authorization-lifetime during an ongoing credit control session. However, the service specific re-authorization does not influence the credit authorization that is ongoing between credit- control client and credit-control server since credit authorization is controlled by the burning rate of the granted quota. In the event that service specific re-authorization fails the user will be disconnected and the credit-control client MUST send a final interrogation to the credit-control server. The Diameter credit-control server may want to control the validity time of the granted quota and/or the production of intermediate interrogations, thus it MAY include the Validity-Time AVP in the answer message to the credit-control client. Upon expiration of the Validity-Time, the credit-control client MUST generate a credit- control update request and report the used quota to the credit-control server. It is up to the credit-control server to determine, the value of the Validity-Time to be used for consumption of the granted service units. If the Validity-Time is used, its value SHOULD be given as input to set the session supervision timer Tcc (the session supervision timer MAY be set to two times the value of the Validity- Time as defined in section 13). Since credit-control update requests are also produced at the expiry of granted service units and/or for mid-session service events the omission of Validity-Time does not mean that intermediate interrogation for the purpose of credit control are not performed. The Diameter credit-control server and client MAY optionally support a tariff change mechanism. The Diameter credit-control server may include a Tariff-Time-Change AVP in the answer message. Note that the granted units should be allocated based on the worst-case scenario in case of forthcoming tariff change, so that the overall reported used units would never exceed the credit reservation. When the Diameter credit-control client reports the used units and a tariff change has occurred during the reporting period then the Diameter credit-control client SHOULD itemize the units used before and after the tariff change. In case some units straddled the tariff change, the credit-control client SHOULD itemize those units as well. For time based services the quota is consumed at the regular rate of 60 seconds per minute, the server already knows at the time when credit resources are allocated how many units will be consumed before the tariff time change and how many units will be consumed after. Similarly, the server can determine the units consumed at the before rate and the units consumed at the rate afterwards in the event that the end-user closes the session before the consumption of the allotted quota. There is no need for additional traffic between client and server in case of tariff time changes for time based service, Hakala et al. Expires - August 2004 [Page 16] Diameter Credit Control Application February 2004 therefore the tariff change mechanism is not used for time based services. 5.1.1 Credit-Control for Multiple Services within a (sub-)Session When multiple services are used within one user session and each service or group of services are subject to different cost, it is necessary to perform credit-control for each of these services somewhat independently. Making use of credit control sub-sessions to achieve independent credit-control will result in increased signaling load and resources usage in both the credit control client and the credit control server. For instance, during one network access session the end user may use several http-services subject to different access cost, the network access specific attributes such as the quality of service (QoS) are common to all the services carried within the access bearer, but the cost of the bearer may vary dependent on its content. To optimally support these scenarios, the credit control application enables for independent credit control of multiple services in a single credit control (sub-)session. This is achieved by including the optional Multiple-Services-Credit-Control AVP in Credit-Control- Request/Answer messages. It is possible to request and allocate resources as a credit pool that is shared between multiple services. The services can be further grouped into rating groups in order to achieve even further aggregation of credit allocation. It is also possible to request and allocate quotas on a per service basis. Where quotas are allocated to a pool by means of the Multiple-Services- Credit-Control AVP, the quotas remain independent objects which can be re-authorised independently at any time. Quotas can also be given independent result codes, validity times and Final-Unit-Indications. In case independent credit control of multiple services is used the validity-time and final-unit-indication SHOULD be present either in the Multiple-Service-Credit-Control AVP(s) or at command level as single AVPs. However, the Result-Code AVP MAY be present both on the command level and within the Multiple-Services-Credit-Control AVP. If the Result-Code on the command level indicates other value than SUCCESS then the Result-Code on command level takes precedence over the one(s) included in the Multiple-Services-Credit-Control AVP. The Credit-control client MUST indicate support for independent credit control of multiple services within a (sub-)session by including the Multiple-Services-Indicator AVP in the first interrogation. A Credit- Control-server not supporting the feature MUST treat the Multiple- Services-Indicator AVP and possibly received Multiple-Services-Credit- Control AVPs as invalid AVPs. If the client indicated support for independent credit control of multiple services, a credit-control server that whishes to use the Hakala et al. Expires - August 2004 [Page 17] Diameter Credit Control Application February 2004 feature MUST return the granted units within the Multiple-Services- Credit-Control AVP associated to the corresponding service-identifier and/or rating-group. To avoid credit fragmentation and unnecessary load on the credit control server, it is possible for service units to be provided to multiple services or rating groups as a pool. This is achieved by providing the service units in the form of a quota for a particular service or rating group in the Multiple-Services-Credit-Control AVP, but also including a reference to a credit pool for that unit type. The reference includes a multiplier derived from the rating parameter, which translates from service units of a specific type to the abstract service units in the pool. For instance if the rating parameter for service 1 is $1/MB and rating parameter for service 2 is $0.5/MB the multipliers could be 10 and 5 for service 1 and service 2 respectively. If M is the total service units within the pool, M1, M2, ..., Mn are the multipliers provided for services 1, 2, ..., n and C1, C2,... ,Cn are the used resources within the session, then the pool credit is exhausted and re-authorisation MUST be sought when: C1*M1 + C2*M2 + ... + Cn*Mn >= M The total credit in the pool, M, is calculated from the quotas which are currently allocated to the pool as follows: M = Q1*M1 + Q2*M2 + ... + Qn*Mn If services or rating groups are added to or removed from the pool, then the total credit is adjusted appropriately. Note that when the total credit is adjusted because services or rating groups are removed from the pool, the value that need to be removed is the consumed one (i.e. Cx*Mx). Re-authorisation for an individual service or rating group may be sought at any time, for example if a 'non-pooled' quota is used up or the Validity-Time expires. Where multiple G-S-U-Pool-Reference AVPs with the same G-S-U-Pool- Identifier are provided within a Multiple-Services-Credit-Control AVP together with the Granted-Service-Unit AVP, then these MUST have different CC-Unit-Type values and they all draw on the credit pool separately. For instance, if one multiplier for time (M1t) and one multiplier for volume (M1v) are given, then the used resources from the pool is the sum C1t*M1t + C1v*M1v, where C1t are the time units and C1v are the volume unit. Hakala et al. Expires - August 2004 [Page 18] Diameter Credit Control Application February 2004 Where service units are provided within a Multiple-Services-Credit- Control AVP without a corresponding G-S-U-Reference AVP then these are handled independently from any credit pool and from any other services or rating groups within the session. The credit pool concept is an optimal tool to avoid the over- reservation effect of the basic single quota tariff time change mechanism (the mechanism described in section 5.1). Therefore, Diameter credit-control clients and servers implementing the independent credit control of multiple services SHOULD leverage the credit pool concept when supporting the tariff time change. The Diameter credit-control server SHOULD include both the Tariff-Time- Change and Tariff-Change-Usage AVPs in two quota allocations in the answer message (i.e. two instances of the Multiple-Services-Credit- Control AVP). One of the granted units is allocated to be used before the potential tariff change while the second granted units are used after a tariff change. Both granted unit quotas MUST contain the same Service-Identifier and/or Rating-Group. This dual quota mechanism ensures that the overall reported used units would never exceed the credit reservation. The Diameter credit-control client reports both the used units before and after the tariff change in a single instance of the Multiple- Services-Credit-Control AVP. The failure handling for the credit control session is defined in section 5.7 and reflected to the basic credit-control state machine in section 7. Credit-control client and servers implementing the independent credit control of multiple services in a (sub-)session functionality MUST ensure a failure handling and general behavior fully consistent with the above mentioned sections while capable of handling parallel ongoing credit re-authorization within a (sub- )session. It is then RECOMMENDED that Diameter credit-control clients maintain a PENDING-U message queue and restarts the Tx timer every time a CCR[Update] message is sent while in PENDING-U state. When answers to all the pending messages are received the state machine moves to OPEN and Tx is stopped. Naturally the action performed when a problem is detected for the session according to section 5.7, affect all the ongoing services (e.g. failover to a backup server if possible affect all the CCR[Update] messages in the PENDING-U queue). Since the client may send CCR[Update] messages while in PENDING-U (i.e. without waiting for an answer to ongoing credit re- authorization), the time space between these requests may be very short and the server may not have received the previous request(s) yet. Therefore in this situation the server may receive out of sequence requests and SHOULD NOT consider this as an error condition, a proper answer is to be returned to each of those requests. Hakala et al. Expires - August 2004 [Page 19] Diameter Credit Control Application February 2004 5.2 First Interrogation When session based credit-control is required (e.g. the authentication server indicated prepaid user), the first interrogation MUST be sent before the Diameter credit-control client allows any service event to the end user. The CC-Request-Type is set to the value INITIAL_REQUEST in the request message. If the Diameter credit-control client knows the cost of the service event (e.g. a content server delivering ringing tones may know their cost) the monetary amount to be charged is included in the Requested- Service-Unit AVP. If the Diameter credit-control client does not know the cost of the service event, the Requested-Service-Unit AVP MAY contain the number of requested service events. The Service-Identifier AVP, in case of multiple services the Service-Identifier AVP or the Rating-Group AVP within the Multiple-Services-Credit-Control AVP, always indicates the concerned service. Additional service event information to be rated MAY be sent as service specific AVPs or MAY be sent within the Service-Parameter-Info AVP at command level. The Event-Timestamp AVP contains the time when the service event is requested in the service element. The Subscription-Id AVP SHOULD be included to identify the End-User in the credit-control server. The credit-control server SHOULD rate the service event and make a credit-reservation from the end user's account that covers the cost of the service event. If the type of the Requested-Service-Unit AVP is money, no rating is needed but the corresponding monetary amount is reserved from end user's account. The credit-control server returns the Granted-Service-Unit AVP in the Answer message to the Diameter credit-control client. The Granted- Service-Unit AVP contains the amount of service units that the Diameter credit-control client can provide to the end user until a new Credit-Control-Request MUST be sent to the credit-control server. If several unit types are sent in the Answer message the credit-control client MUST handle each unit type separately. The type of the Granted- Service-Unit AVP can be time, volume, service specific or money depending on the type of service event. The unit type(s) SHOULD NOT be changed within an ongoing credit-control session. There MUST be maximum one instance of the same unit type in one Answer message. However, in case multiple quotas are conveyed to the credit control client in the Multiple-Services-Credit-Control AVPs, it is possible to carry two instances of the same unit type associated to a service-identifier/rating-group for instance when a tariff time change is expected. Hakala et al. Expires - August 2004 [Page 20] Diameter Credit Control Application February 2004 If the credit-control server determines that no further control is needed for the service it MAY include the result code indicating that the credit-control is not applicable (e.g. service is free of charge). This result code at command level implies that the credit-control session is to be terminated. The Credit-Control-Answer message MAY also include the Final-Unit- Indication AVP to indicate that the answer message contains the final units for the service. After the end user has consumed these units, the Diameter credit-control-client MUST behave as described in section 5.6. Two different approaches are defined for the first interrogation to suit properly in all the possible architectures. The first approach uses credit-control messages after user's authorization and authentication took place. The second approach uses service specific authorization messages to perform the first interrogation during the user's authorization/authentication phase, and credit-control messages for the intermediate and the final interrogations. In case an implementation of the credit-control client supports both the methods, it SHOULD be configurable what method to use. In service environments such as the Network Access Server (NAS), it is desired to perform the first interrogation as part of the authorization/authentication process for the sake of protocol efficiency. Further credit authorizations after the first interrogation took place are performed with credit control commands defined in this specification. Implementations of credit-control client operating in the mentioned environments SHOULD support this method. In case the credit-control server and AAA server are separate physical entities the service element sends the request messages to the AAA server, which then issue an appropriate request or proxy the received request forward to the credit-control server. In other service environments, such as the 3GPP network and some SIP scenario, there is a substantial decoupling between registration/access to the network and the actual service request (i.e. the authentication/authorization is executed once at registration/access to the network and is not executed for every service event requested by the subscriber). In such environments it is more appropriate to perform the first interrogation after the user has been authenticated and authorized. The first interrogation, the intermediate and final interrogations are executed with credit control commands defined in this specification. Other IETF standards or standards developed by other standardization bodies may define what is the most suitable method in their architecture. Hakala et al. Expires - August 2004 [Page 21] Diameter Credit Control Application February 2004 5.2.1 First Interrogation after Authorization and Authentication The Diameter credit-control client in the service element may get information from the authorization server whether credit-control is required based on its knowledge of the end user. If credit-control is required the credit-control server needs to be contacted prior to initiate the service delivery to the end user. The accounting protocol and the credit-control protocol can be used in parallel, the authorization server may also drive whether the parallel accounting stream is required. The following diagram illustrates the case where both protocols are used in parallel and the service element sends credit-control messages directly to the credit-control server. More credit-control sequence examples are given in Annex A. End-User Service Element AAA Server CC Server (CC Client) | Registration | AA request/answer(accounting,cc or both)| |<----------------->|<------------------>| | | : | | | | : | | | | Service Request | | | |------------------>| | | | | CCR(Initial,Credit-Control AVPs) | | +|---------------------------------------->| | CC stream|| | CCA(Granted-Units)| | +|<----------------------------------------| | Service Delivery | | | |<----------------->| ACR(start,Accounting AVPs) | | : |------------------->|+ | | : | ACA || Accounting stream | | |<-------------------|+ | | : | | | | : | | | | | CCR(Update,Used-Units) | | |---------------------------------------->| | | | CCA(Granted-Units)| | |<----------------------------------------| | : | | | | : | | | | End of Service | | | |------------------>| CCR(Termination, Used-Units) | | |---------------------------------------->| | | | CCA | | |<----------------------------------------| | | ACR(stop) | | | |------------------->| | | | ACA | | Hakala et al. Expires - August 2004 [Page 22] Diameter Credit Control Application February 2004 | |<-------------------| | Figure 3: Protocol example with first interrogation after user's authorization/authentication 5.2.2 Authorization Messages for First Interrogation The Diameter credit-control client in the service element MUST actively contribute with the authorization/authentication client in the construction of the AA request by adding appropriate credit control AVPs. The credit-control client MUST add the Credit-Control AVP to indicate credit-control capabilities and MAY add other relevant credit-control specific AVPs to the proper authorization/authentication command to perform the first interrogation towards the home Diameter AAA server. The Auth- Application-Id is set to the appropriate value as defined in the relevant service specific authorization/authentication application document (e.g. [NASREQ], [DIAMMIP]). The home Diameter AAA server authenticates/authorizes the subscriber and determines whether or not credit-control is required. If credit-control is not required for the subscriber the home AAA will respond as usual with an appropriate AA answer message. If credit-control is required for the subscriber and the Credit-Control AVP with the value set to CREDIT_AUTHORIZATION was present in the authorization request, the home AAA server MUST contact the credit- control server to perform the first interrogation. If credit-control is required for the subscriber and the Credit-Control AVP was not present in the authorization request, the home AAA server MUST send an authorization reject answer message. The Diameter AAA server supporting credit-control is required to send the Credit-Control-Request command (CCR) defined in this document to the credit-control server. The Diameter AAA server populates the CCR based on service specific AVPs used for input to the rating process and possibly credit-control AVPs received in the AA request. The credit-control server will make money reservation from the user's account, will rate the request and will send a credit-control answer message to the home Diameter AAA server. The answer message includes the Granted-Service-Unit AVP(s) and MAY include other credit-control specific AVPs as appropriate. Additionally, the credit-control server MAY set the Validity-Time and MAY include the Credit-Control-Failure- Handling AVP and the Direct-Debiting-Failure-Handling AVP to determine what to do if the sending of credit-control messages to the credit- control server has been temporarily prevented. Upon receiving the credit-control answer message from the credit- control server, the home Diameter AAA server will populate the AA answer with the received credit-control AVPs and with usual service Hakala et al. Expires - August 2004 [Page 23] Diameter Credit Control Application February 2004 attributes according to the authorization/authentication specific application (e.g. [NASREQ], [DIAMMIP]) and forward the packet to the credit-control client. If the home AAA server receives a credit- control reject message, it will simply generate an appropriate authorization reject message to the credit-control client including the credit-control specific error code. The credit-control client in this model sends further credit-control messages to the credit-control server via the home AAA server. Upon receiving successful authorization answer message with the Granted-Service-Unit AVP(s), the credit-control client will grant the service to the end user and will generate intermediate credit-control request as required by using Credit-Control commands. The CC-Request- Number of the first intermediate request MUST be set to 1 (for how to produce unique value for the CC-Request-Number AVP see section 8.2). If service specific re-authorization is performed (i.e. authorization- lifetime expires), the credit-control client MUST add to the service specific re-authorization request the Credit-Control AVP with value set to RE-AUTHORIZATION to indicate that the credit-control server MUST NOT be contacted. When session based credit-control is used for the subscriber a constant Credit-Control messages stream is flowing through the Diameter AAA server. The Diameter AAA server can make use of this credit-control messages flow to deduce that user's activity is ongoing; hence it is recommended to set the authorization-lifetime to a reasonably high value when credit-control is used for the subscriber. In this scenario the home AAA server MUST advertise support for the credit-control application to its peers during the capability exchange process. The following diagram illustrates the use of authorization / authentication messages to perform the first interrogation. The parallel accounting stream is not shown in the figure. End-User Service Element AAA Server CC Server (CC Client) | Service Request | AA Request (CC AVPs) | |------------------>|------------------->| | | | | CCR(Initial, CC AVPs) | | |------------------->| | | | CCA(Granted-Units) | | |<-------------------| | | AA Answer(Granted-Units) | | Service Delivery |<-------------------| | |<----------------->| | | | : | | | | : | | | Hakala et al. Expires - August 2004 [Page 24] Diameter Credit Control Application February 2004 | : | | | | | | | | | CCR(Update,Used-Units) | | |------------------->| CCR(Update,Used-Units) | | |------------------->| | | | CCA(Granted-Units)| | | CCA(Granted-Units)|<-------------------| | |<-------------------| | | : | | | | : | | | | End of Service | | | |------------------>| CCR(Termination,Used-Units) | | |------------------->| CCR(Term.,Used-Units) | | |------------------->| | | | CCA | | | CCA |<-------------------| | |<-------------------| | Figure 4: Protocol example with use of the authorization messages for the first interrogation. 5.3 Intermediate Interrogation When all of the granted service units for one unit type are spent by the end user or the Validity-Time is expired, the Diameter credit- control client MUST send a new Credit-Control-Request to the credit- control server. In the event that credit control for multiple services in one credit control session is applied (i.e. units are granted associated to Service-Identifier(s) or Rating-Group), a new Credit- Control-Request MUST be sent to the credit-control server when the whole credit reservation has been consumed, or upon expiration of the Validity-Time. In the case when the Validity-Time is used, it is always up to the Diameter credit-control client to send a new request well in advance before the expiration of the previous request in order to avoiding interruption in the service element. Even if the granted service units reserved by the credit-control server have not been spent upon expiration of the Validity-Time, the Diameter credit- control client MUST send a new Credit-Control-Request to the credit- control server. There can be also mid-session service events, which might affect the rating of the current service events. In this case a spontaneous updating (a new Credit-Control-Request) SHOULD be sent including information related to the service event even if all the granted Hakala et al. Expires - August 2004 [Page 25] Diameter Credit Control Application February 2004 service units have not been spent or the Validity-Time has not expired. When the used units are reported to the credit-control server, the credit-control client will not have any units in its possession before new granted units are received from the credit-control server. When the new granted units are received from the credit-control server these units apply from the point where the measurement of the reported used units stopped. Where independent credit-control of multiple services is supported, this process may be executed for one or more services, a single rating-group or for a pool within the (sub- )session. The CC-Request-Type AVP is set to the value UPDATE_REQUEST in the intermediate request message. The Subscription-Id AVP SHOULD be included in the intermediate message to identify the end user in the credit-control server. The Requested-Service-Unit AVP MAY contain the new amount of requested service units. The Used-Service-Unit AVP contains the amount of used service units measured from the point when the service became active or, in case of interim interrogations are used during the session, from the point when the previous measurement ended. The same unit types that are used in the previous message MUST be used. If several unit types were included in the previous answer message the used service units for each unit type MUST be reported. The Event-Timestamp AVP contains the time of the event that triggered the sending of the new Credit-Control-Request. The credit-control server MUST deduct the used amount from the end user's account. It MAY rate the new request and make a new credit- reservation from the end user's account that covers the cost of the requested service event. The Credit-Control-Answer message with the CC-Request-Type AVP set to the value UPDATE_REQUEST MAY include the Cost-Information AVP containing the accumulated cost estimation for the session without taking any credit-reservation into account. The Credit-Control-Answer message MAY also include the Final-Unit- Indication AVP to indicate that the answer message contains the final units for the service. After the end user has consumed these units, the Diameter credit-control-client MUST behave as described in section 5.6. There can be several intermediate interrogations within a session. Hakala et al. Expires - August 2004 [Page 26] Diameter Credit Control Application February 2004 5.4 Final Interrogation When the end user terminates the service session or according to the graceful service termination as described in section 5.6, the Diameter credit-control client MUST send a final Credit-Control-Request message to the credit-control server. The CC-Request-Type AVP is set to the value TERMINATION_REQUEST. The Event-Timestamp AVP MAY contain the time of the session was terminated. The Used-Service-Unit AVP contains the amount of used service units measured from the point when the service became active or, in case of interim interrogations are used during the session, from the point when the previous measurement ended. If several unit types were included in the previous answer message the used service units for each unit type MUST be reported. After final interrogation the credit-control server MUST refund the reserved credit amount not used to the end user's account and deduct the used monetary amount from the end user's account. The Credit-Control-Answer message with the CC-Request-Type set to the value TERMINATION_REQUEST MAY include the Cost-Information AVP containing the estimated total cost for the session in question. If the user logoff during an ongoing credit-control session or some other reason causes the user to be logged-off (e.g. final-unit indication causes user logoff according to local policy) the service element, according to application specific policy, may send a session- termination-request (STR) to the home Diameter AAA server as usual [DIAMBASE]. Figure 5 illustrates the case when the final-unit indication causes the user logoff upon consumption of the final granted units and STR is generated. Hakala et al. Expires - August 2004 [Page 27] Diameter Credit Control Application February 2004 End-User Service Element AAA Server CC Server (CC Client) | Service Delivery | | | |<----------------->| | | | : | | | | : | | | | : | | | | | | | | | CCR(Update,Used-Units) | | |------------------->| CCR(Update,Used-Units) | | |------------------->| | | CCA(Final-Unit, Terminate) | CCA(Final-Unit, Terminate)|<-------------------| | |<-------------------| | | : | | | | : | | | | Disconnect user | | | |<------------------| CCR(Termination,Used-Units) | | |------------------->| CCR(Term.,Used-Units) | | |------------------->| | | | CCA | | | CCA |<-------------------| | |<-------------------| | | | STR | | | |------------------->| | | | STA | | | |<-------------------| | Figure 5: User disconnected due to account exhausted 5.5 Server-Initiated Credit Re-Authorization The Diameter Credit Control Application supports the server-initiated re-authorization. The credit control server MAY optionally initiate the credit re-authorization by issuing a Re-Auth-Request (RAR) as defined in the Diameter base protocol [DIAMBASE]. The Auth- Application-Id in the RAR message is set to 4 to indicate the Diameter Credit Control Application and the Re-Auth-Request-Type is set to AUTHORIZE_ONLY. Where multiple services in a user's session are supported as defined in section 5.1.1, the server MAY request credit re-authorization at: (sub-)session level, credit pool level granularity, service-identifier level granularity or rating-group granularity. To request credit re- authorization at credit pool granularity the server includes in the RAR message the G-S-U-Pool-Identifier AVP indicating the affected pool. To request credit re-authorization at service or rating-group granularity the server includes in the RAR message the Service- Identifier AVP or the Rating-Group AVP respectively. To request credit Hakala et al. Expires - August 2004 [Page 28] Diameter Credit Control Application February 2004 re-authorization for all the ongoing services within the (sub-)session the server does not include any of the above mentione AVPs in the RAR message. If a credit re-authorization is not already ongoing (i.e. the credit control session is in OPEN state), a credit control client that receives such a RAR message with Session-Id equal to a currently active credit control session acknowledges the request by sending the Re-Auth-Answer (RAA) message and MUST initiate the credit re- authorization towards the server by sending a Credit-Control-Request message with the CC-Request-Type AVP set to the value UPDATE_REQUEST. The Result-Code 2002 (DIAMETER_LIMITED_SUCCESS) SHOULD be used in the RAA message to indicate an additional message (i.e. CCR[Update]) is required to complete the procedure. If a quota was allocated to the service, the credit control client MUST report the used quota in the Credit-Control-Request. Note that the end user does not need to be prompted for the credit re-authorization, since the credit re- authorization is transparent to the user (i.e it takes place exclusively between the credit control client and the credit control server). Where multiple services in a userĘs session are supported, the procedure of the above paragraph will be executed at the granularity as requested by the server in the RAR message. If credit re-authorization is ongoing at the time when the RAR message is received (i.e. RAR-CCR collision), the credit control client successfully acknowledges the request but it does not initiate a new credit re-authorization. The Result-Code 2001 (DIAMETER_SUCCESS) SHOULD be used in the RAA message to indicate a credit re- authorization procedure is already ongoing (i.e. the client was in PendingU state when the RAR was received). The credit control server SHOULD process the Credit-Control-Request as if it was received in answer to the server initiated credit re-authorization, and should consider the server initiated credit re-authorization process successful upon reception of the Re-Auth-Answer message. Where multiple services in a user's session are supported, it may happen that the server requests credit re-authorization for a credit pool (or for the (sub-)session) and a credit re-authorization is already ongoing for some of the services or rating-groups. In this case the client acknowledges the server request with a RAA message and MUST send a new Credit-Control-Request message to perform re- authorization for the remaining services/rating-groups. The Result- Code 2002 (DIAMETER_LIMITED_SUCCESS) SHOULD be used in the RAA message to indicate an additional message (i.e. CCR[Update]) is required to complete the procedure. The server processes the received requests and returns an appropriate answer to both of the requests. Hakala et al. Expires - August 2004 [Page 29] Diameter Credit Control Application February 2004 The above-defined procedures are enabled for each of the possibly active Diameter credit-control sub-sessions. The server MAY request re-authorization for an active sub-session by including the CC-Sub- Session-Id AVP in the RAR message in addition to the Session-Id AVP. 5.6 Graceful Service Termination When the user's account runs out of money the user may be denied to compile additional chargeable events. However, the home service provider may offer some services, for instance access to a service portal where it is possible to top-up the account, for which the user is allowed to benefit for a limited amount of time. This time is usually dependant on the home service provider policy. This section defines the graceful service termination optional feature that MAY be supported by the credit control server. Credit control client implementations MUST support the Final-Unit-Indication with at least the tear down of the ongoing service session upon the subscriber has consumed all the final granted units. Where independent credit control of multiple services in a single credit control (sub-)session is supported, it is possible to use the graceful service termination for each of the services/rating-groups independently. Naturally, the graceful service termination process defined in the following sub-sections will apply to the specific service/rating-group as requested by the server. In some service environments (e.g. NAS) the graceful service termination may be used to redirect the subscriber to a service portal for online balance top-up or other services offered by the home service provider. In this case the graceful termination process installs a set of packet filters to restrict the user's access capability only to/from the specified destinations, all the IP packets not matching the filters will be dropped or possibly re-directed to the service portal. The user may also be displayed an appropriate notification why the access has been limited. These actions may be communicated explicitly from the server to client or may be configured per-service at the client. Explicitly signalled redirect or restrict instructions always take precedence over configured ones. It is also possible use the graceful service termination to connect the prepaid user to a top-up server that play an announcement and prompt the user to replenish the account. In such a case the credit control server sends only the address of the top-up server where the prepaid user shall be connected after the final granted units have been consumed. An example of this is given in Appendix A (Flow VIII). The credit control server MAY initiate the graceful service termination by including the Final-Unit-Indication AVP in the Credit Hakala et al. Expires - August 2004 [Page 30] Diameter Credit Control Application February 2004 Control Answer to indicate that the message contains the final units for the service. When the credit control client receives the Final-Unit-Indication AVP in the answer from the server its behavior depends on the value indicated in the Final-Unit-Action AVP. The server may request the following actions: TERMINATE, REDIRECT and RESTRICT_ACCESS. The following Figure illustrates the graceful service termination procedure described in the following sub-sections. End-User Service Element AAA Server CC Server (CC Client) | Service Delivery | | | |<----------------->| | | | |CCR(Update,Used-Units) | | |------------------->|CCR(Update,Used-Units) | : | |------------------->| | : | |CCA(Final-Unit,Action) | : | |<-------------------| | |CCA(Final-Unit,Action) | | |<-------------------| | | | | | | : | | | | : | | | | : | | | | /////////////// |CCR(Update,Used-Units) | |/Final Units End/->|------------------->|CCR(Update,Used-Units) |/Action and // | |------------------->| |/Restrictions // | | CCA(Validity-Time)| |/Start // | CCA(Validity-Time)|<-------------------| | ///////////// |<-------------------| | | : | | | | : | | | | Replenish Account +-------+ | |<-------------------------------------------->|Account| | | | | +-------+ | | | | RAR | | + | RAR |<===================| | | |<===================| | | | | RAA | | | ///////////// | |===================>| RAA | | /If supported / | | CCR(Update) |===================>| | /by CC Server/ | |===================>| CCR(Update) | | ///////////// | | |===================>| | | | | CCA(Granted-Unit)| | | | CCA(Granted-Unit)|<===================| | Restrictions ->+ |<===================| | | removed | | | Hakala et al. Expires - August 2004 [Page 31] Diameter Credit Control Application February 2004 | : | | | | OR | CCR(Update) | | | Validity-Time ->|------------------->| CCR(Update) | | expires | |------------------->| | | | CCA(Granted-Unit)| | | CCA(Granted-Unit)|<-------------------| | Restrictions ->|<-------------------| | | removed | | | Figure 6: Optional graceful service termination procedure 5.6.1 Terminate Action The Final-Unit-Indication AVP with Final-Unit-Action TERMINATE does not include any other information. Upon the subscriber has consumed the final granted units the service element MUST terminate the service. This is the default handling applicable whenever the credit control client receives an unsupported Final-Unit-Action value and MUST be supported by all the Diameter credit control client implementations conforming to this specification. A final Credit- Control-Request message to the credit control server MUST be sent if the Final-Unit-Indication AVP indicating action TERMINATE was present at command level. The CC-Request-Type AVP in the request is set to the value TERMINATION_REQUEST. 5.6.2 Redirect Action The Final-Unit-Indication AVP with Final-Unit-Action REDIRECT indicates to the service element supporting this action that, upon consumption of the final granted units, the user MUST be re-directed to the address specified in the Redirect-Server AVP as follow. The credit control server sends the Redirect-Server AVP in the Credit- Control-Answer message. In such a case the service element MUST redirect or connect the user to the destination specified in the Redirect-Server AVP, if possible. When the end user is redirected (by using other protocols than Diameter) to the specified server or connected to the top-up server, an additional authorization (and possibly authentication) may be needed before the subscriber can replenish the account, however, this is out of the scope of this specification. In addition to the Redirect-Server AVP, the credit control server MAY include one or more Restriction-Filter-Rule AVP or one or more Filter- Id AVP in the Credit-Control-Answer message in order to enable the user to access other services (for example zero-rated services). In such a case the access device MUST drop all the packets not matching the IP filters specified in the Credit-Control-Answer message and redirect the user to the destination specified in the Redirect-Server AVP, if possible. Hakala et al. Expires - August 2004 [Page 32] Diameter Credit Control Application February 2004 Another entity than the credit control server may provision the access device with appropriate IP packet filters to be used in conjunction with the Diameter credit control application. This case is considered in section 5.6.3. When the final granted units have been consumed the credit control client MUST perform an intermediate interrogation. The purpose of this intermediate interrogation is to indicate to the credit control server that the specified action started and to report the used units. The credit control server MUST deduct the used amount from the end user's account but MUST NOT make a new credit reservation. The credit control client, however, may send intermediate interrogations before all the final granted units have been consumed for which rating and money reservation may be needed, for instance upon Validity-Time expires or upon mid-session service event that affect the rating of the current service. Therefore, the credit control client MUST NOT include any rating related AVP in the request sent upon all the final granted units have been consumed as a hint to the server that the requested final unit action started, rating and money reservation are not required (when the Multiple-Services-Credit-Control AVP is used, the Service-Identifier or Rating-Group AVPs is included to indicate the concerned services). Naturally, the Credit-Control-Answer message does not contain any granted service unit and MUST include the Validity- Time AVP to indicate to the credit control client how long the subscriber is allowed to use network resources before a new intermediate interrogation is sent to the server. At the expiry of Validity-Time the credit control client sends a Credit-Control-Request (UPDATE_REQUEST) as usual. This message does not include the Used-Service-Unit AVP since there is no allotted quota to report. The credit control server processes the request and MUST perform the credit reservation. If during this time the subscriber did not replenish his/her account whether he/she will be disconnected or will be granted access to services not controlled by credit control server for unlimited time is dependent on the home service provider policy (note: the latter option implies that the service element should not remove the restriction filters upon termination of the credit control). The server will return the appropriate Result-Code (see section 9.1) in the Credit-Control-Answer message in order to implement the policy-defined action. Otherwise new quota will be returned, the service element MUST remove all the possible restrictions activated by the graceful service termination process and continue the credit control session and the service session as usual. The credit control client may not wait until the expiration of the Validity-Time and may send a spontaneous updating (a new Credit- Control-Request) if the service element can determine for instance Hakala et al. Expires - August 2004 [Page 33] Diameter Credit Control Application February 2004 that communication between the end user and the top-up server took place. An example of this is given in Appendix A (Figure A.8). It is worth noting that the credit control server may initiate the above-described process already for the first interrogation. However, the user's account might be empty at the time when the first interrogation is performed. In this case the subscriber can be offered a chance to replenish the account and continue the service. The credit control client receives a Credit-Control-Answer or service specific authorization answer with the Final-Unit-Indication AVP, Validity-Time AVP but no Granted-Unit. In such a case it starts immediately the graceful service termination without sending any message to the server. An example of this case is illustrated in Appendix A. 5.6.3 Restrict Access Action The Final-Unit-Indication AVP with Final-Unit-Action RESTRICT_ACCESS indicates to the access device supporting this action that the user MUST be restricted access according to the IP packet filters given in the Restriction-Filter-Rule AVP(s) or according to the IP packet filters identified by the Filter-Id AVP(s). The credit control server SHOULD include either the Restriction-Filter-Rule AVP or the Filter-Id AVP in the Credit-Control-Answer message. Another entity than the credit control server may provision the access device with appropriate IP packet filters to be used in conjunction with the Diameter credit control application. Such an entity, for instance, may configure the access device with IP flows that are to be passed when the Diameter credit control application indicates RESTRICT_ACCESS or REDIRECT. The access device passes IP packets according to the filter rules possibly received in the Credit-Control- Answer message in addition to the filter rules possibly configured by the other entity. However, the action to be taken when the user's account cannot cover the cost of the requested service is the responsibility of the credit control server that controls the prepaid subscriber. If another entity working in conjunction with the Diameter Credit control application already provisions the access device with all the required filter rules for the end user, it is presumably not needed for the credit control server to send any additional filter. Therefore it is RECOMMENDED that credit control server implementations supporting the graceful service termination can be configurable whether to send the Restriction-Filter-Rule AVP, the Filter-Id AVP or none of the above. When the final granted units have been consumed, the credit control client MUST perform an intermediate interrogation. The credit control client and the credit control server process this intermediate Hakala et al. Expires - August 2004 [Page 34] Diameter Credit Control Application February 2004 interrogation and execute subsequent procedures as specified in the previous section for the REDIRECT action. The credit control server may initiate the graceful service termination with action RESTRICT_ACCESS already for the first interrogation as specified in the previous section for the REDIRECT action. 5.6.4 Usage of the Server-Initiated Credit Re-Authorization Once the subscriber replenishes the account she presumably expects all the restrictions placed by the graceful termination procedure be immediately removed and unlimited services' access be resumed. For the best user experience the credit control server implementation MAY support the server-initiated credit re-authorization (see section 5.5). In such a case, upon the successful account top-up took place, the credit control server sends the Re-Auth-Request (RAR) message to solicit the credit re-authorization. The credit control client initiates then the credit re-authorization by sending the Credit- Control-Request message with the CC-Request-Type AVP set to the value UPDATE_REQUEST. The Used-Service-Unit AVP is not included in the request since there is no allotted quota to report. The Requested- Service-Unit AVP MAY be included in the request. After the credit control client successfully receives the Credit-Control-Answer with new Granted-Service-Unit all the possible restrictions activated for the purpose of the graceful service termination MUST be removed in the service element, the credit control session and the service session continue as usual. 5.7 Failure Procedures The Credit-Control-Failure-Handling AVP (CCFH) as described in this section determines the behavior of the credit control client in fault situations. The CCFH may be received from the Diameter home AAA server, from the credit control server or may be locally configured. The CCFH value received from the home AAA server overrides the locally configured value and the CCFH value received from the credit control server in the Credit-Control-Answer message always override any already existing value. The authorization server MAY include the Accounting-Realtime-Required AVP to determine what to do if the sending of accounting records to the accounting server has been temporarily prevented as defined in [DIAMBASE]. It is RECOMMENDED that the client complement the credit- control failure procedures with backup accounting flow towards an accounting server. Using different combinations of Accounting- Realtime-Required and Credit-Control-Failure-Handling AVPs different safety levels can be built. For example by choosing the Credit- Control-Failure-Handling AVP equal to CONTINUE for the credit control Hakala et al. Expires - August 2004 [Page 35] Diameter Credit Control Application February 2004 flow and Accounting-Realtime-Required AVP equal to DELIVER_AND_GRANT for the accounting flow, the service can be granted to the end user even if the connection to the credit-control server is down but the accounting server is able to collect the accounting information, provided that there is information exchange taking place between the accounting server and credit-control server. Since the credit-control application is based on real-time bi- directional communication between the credit-control client and the credit-control server, the usage of alternative destinations and the buffering of messages may not be sufficient in the event of communication failures. Since the credit-control server has to maintain session states, moving the credit-control message stream to a backup server requires a complex context transfer solution. Whether the credit-control message stream is moved to a backup credit-control server during an ongoing credit-control session depends on the value of the CC-session-Failover AVP. However, failover may occur at any point in the path between credit-control client and credit-control server in the event that a transport failure is detected with a peer, as described in [DIAMBASE]. As a consequence the credit-control server might receive duplicate messages. These duplicates or out of sequence messages can be detected in the credit-control server based on the credit-control server session state machine (section 7), Session-Id AVP and CC-Request-Number AVP. If a failure occurs during an ongoing credit-control session, the credit-control client may move the credit control message stream to an alternative server if the CC-server indicated FAILOVER_SUPPORTED in the CC-Session-Failover AVP. A secondary credit control server name, received from the AAA server or locally configured, can be used as an address of the backup server. If the CC-Session-Failover AVP is set to FAILOVER_NOT SUPPORTED the credit control message stream MUST NOT be moved to backup server. For new credit control sessions, failover to an alternative credit- control server SHOULD be performed if possible. For instance, if an implementation of the credit control client can determine primary credit control server unavailability it can establish the new credit control sessions with a possibly available secondary credit control server. The AAA client/agent is typically using only a single persistent transport connection to the AAA agent or server, but it may have connections to multiple AAA agents or servers and treat them as primary/secondary or balance load between them. The AAA transport profile [AAATRANS] defines the application layer watchdog algorithm that enables failover from a peer that has failed and is controlled by the timer Twinit. The recommended default value for Twinit is 30 seconds. Since the AAA infrastructure is common to several different Hakala et al. Expires - August 2004 [Page 36] Diameter Credit Control Application February 2004 types of AAA applications, tuning the timer Twinit to a lower value in order to satisfy the requirements of real-time applications, such as the Diameter Credit Control application, will certainly increase the probability of premature failover significantly and potentially cause congestive collapse in heavy loaded networks. For prepaid services, however, the end user expects an answer from the network in a reasonable time, thus the Diameter credit control client shall react faster than the underlying base protocol. Therefore this specification defines the timer Tx that is used by the credit-control client (as defined in section 13) to supervise the communication with the credit- control server. When the timer Tx elapses the credit-control client takes an action to the end user according to the Credit-Control- Failure-Handling AVP. When Tx expires, the Diameter credit control client always terminates the service if the Credit-Control-Failure-Handling (CCFH) AVP is set to the value TERMINATE. The credit control session may be moved to an alternative server only in case a protocol error DIAMETER_TOO_BUSY or DIAMETER_UNABLE_TO_DELIVER is received before Tx expires, therefore, the value TERMINATE is not appropriate if proper failover behavior is desired. If the Credit-Control-Failure-Handling AVP is set to the value CONTINUE or RETRY_AND_TERMINATE, the service will be granted to the end user upon the timer Tx expires. An answer message with granted- units may arrive later on due to the base protocol transport failover occurred in the path to the Credit Control Server (Twinit default value is 3 times more than the Tx recommended value). The credit control client SHOULD grant the service to the end user, start monitoring the resource usage and wait for the possible late answer until the timeout of the request (e.g. 120 seconds). If the request fails and the CC-Session-Failover AVP is set to FAILOVER_NOT SUPPORTED, the credit control client terminates or continues the service depending on the value set in the CCFH and MUST free all the reserved resources for the credit control session. If a protocol error DIAMETER_UNABLE_TO_DELIVER or DIAMETER_TOO_BUSY is received or the request timeout and the CC-Session-Failover AVP is set to FAILOVER SUPPORTED, the credit control client MAY send the request to a backup server if possible. If the credit control client receives a successful answer from the backup server, it continues the credit control session with such a server. If also the re-transmitted request fails, the credit control client terminates or continues the service depending on the value set in the CCFH and MUST free all the reserved resources for the credit control session. If a communication failure occurs during the graceful service termination procedure, the service element SHOULD always terminate the ongoing service session. Hakala et al. Expires - August 2004 [Page 37] Diameter Credit Control Application February 2004 If the credit-control server detects a failure during an ongoing credit-control session, it will terminate the credit-control session and return the reserved units back to the end user's account. The supervision session timer Tcc (as defined in section 13) is used in the credit-control server to supervise the credit-control session. In order to support the failover between credit control servers information transfer about the credit control session and account state SHOULD take place between the primary and the secondary credit control server. Implementations supporting the credit control session failover MUST also ensure proper detection of duplicate or out of sequence messages. The communication between the servers is regarded as an implementation issue and is outside of the scope of this specification. 6. One Time Event The one-time event is used when there is no need to maintain any state in the Diameter credit-control server, for example enquiring the price of the service. The use of one-time event implies that the user has been authenticated and authorized beforehand. The one time event can be used when the credit-control client wants to know the cost of the service event without any credit-reservation or to check the account balance without any credit-reservation. It can be used also for refunding service units on the user's account or direct debiting without any credit-reservation. The one time event is shown in Figure 7. End-User Service Element AAA Server CC Server (CC Client) | Service Request | | | |------------------>| | | | | CCR(Event) | | | |------------------->| CCR(Event) | | | |------------------->| | | | CCA(Granted-Units)| | | CCA(Granted-Units)|<-------------------| | Service Delivery |<-------------------| | |<----------------->| | | Figure 7: One time event In environments such as the 3GPP architecture the one time event can be sent from the service element directly to the credit-control server. Hakala et al. Expires - August 2004 [Page 38] Diameter Credit Control Application February 2004 6.1 Service Price Enquiry The credit-control client may need to know the price of the service event. There might exist services offered by application service providers, whose prices are not known in the credit-control client. End user might also want to get an estimation of the price of a service event before requesting it. A Diameter credit-control client requesting the cost information MUST set the CC-Request-Type AVP equal to EVENT_REQUEST, include the Requested-Action AVP set to PRICE_ENQUIRY and set the requested service event information into the Service-identifier AVP in the Credit-Control-Request message. Additional service event information MAY be sent as service specific AVPs or MAY be sent within the Service-Parameter-Info AVP. The credit-control server calculates the cost of the requested service event, but it does not perform any account balance check or credit- reservation from the account. The estimated cost of the requested service event is returned to the credit-control client in the Cost-Information AVP in the Credit- Control-Answer message. 6.2 Balance Check The Diameter credit-control client may need only to verify that the end user's account balance covers the cost for a certain service without reserving any units from the account at the time of the inquiry. This method does not guarantee that there would be credit left when the Diameter credit-control client requests the debiting of the account with a separate request. A Diameter credit-control client requesting the balance check MUST set the CC-Request-Type AVP equal to EVENT_REQUEST, include Requested- Action AVP set to CHECK_BALANCE and include the Subscription-Id AVP to identify the End-User in the credit-control server. The credit-control server makes the balance check, but it does not do any credit-reservation from the account. The result of balance check (ENOUGH_CREDIT/NO_CREDIT) is returned to the credit-control client in the Check-Balance-Result AVP in the Credit-Control-Answer message. 6.3 Direct Debiting There are certain service events for which service execution is always successful in the service environment. The delay between the service Hakala et al. Expires - August 2004 [Page 39] Diameter Credit Control Application February 2004 invocation and the actual service delivery to the end user can be sufficiently long that the use of the session-based credit-control would lead to unreasonable long credit-control sessions. In these cases the Diameter credit-control client can use the one-time event scenario for direct debiting. The Diameter credit-control client SHOULD be sure that the requested service event execution would be successful, when this scenario is used. The CC-Request-Type is set to the value EVENT_REQUEST and the Requested-Action AVP set to DIRECT_DEBITING in the Credit-Control- Request message. The Subscription-Id AVP SHOULD be included to identify the End-User in the credit-control server. The Event- Timestamp AVP contains the time when the service event is requested in the service element. The Diameter credit-control client MAY include the monetary amount to be charged in the Requested-Service-Unit AVP, if it knows the cost of the service event. If the Diameter credit-control client does not know the cost of the service event, the Requested-Service-Unit AVP MAY contain the number of requested service events. The Service-Identifier AVP always indicates the concerned service, additional service event information to be rated MAY be sent as service specific AVPs or MAY be sent within the Service-Parameter-Info AVP. The credit-control server SHOULD rate the service event and deduct the corresponding monetary amount from end user's account. If the type of the Requested-Service-Unit AVP is money, no rating is needed but the corresponding monetary amount is deducted from the End User's account. The credit-control server returns the Granted-Service-Unit AVP in the Answer message to the Diameter credit-control client. The Granted- Service-Unit AVP contains the amount of service units that the Diameter credit-control client can provide to the end user. The type of the Granted-Service-Unit can be time, volume, service specific or money depending on the type of service event. If the credit-control server determines that no credit-control is needed for the service it can include the result code indicating that the credit-control is not applicable (e.g. service is free of charge). For informative purposes, the Credit-Control-Answer message MAY also include the Cost-Information AVP containing the estimated total cost of the requested service. 6.4 Refund Some services may refund service units to the end user's account, for example gaming services. Hakala et al. Expires - August 2004 [Page 40] Diameter Credit Control Application February 2004 The credit-control client MUST set CC-Request-Type to the value EVENT_REQUEST and the Requested-Action AVP to REFUND in the Credit- Control-Request message. The Subscription-Id AVP SHOULD be included to identify the End-User in the credit-control server. The Diameter credit-control client MAY include the monetary amount to be refunded in the Requested-Service-Unit AVP. The Service-Identifier AVP always indicates the concerned service. If the Diameter credit- control client does not know the monetary amount to be refunded, in addition to the Service-Identifier AVP it MAY send service specific AVPs or the Service-Parameter-Info AVP containing additional service event information to be rated. For informative purposes, the Credit-Control-Answer message MAY also include the Cost-Information AVP containing the estimated monetary amount of refunded unit. 6.5 Failure Procedure Failover to an alternative credit-control server is allowed for one time event since the server is not maintaining session states, for instance, if the credit control client receives a protocol error DIAMETER_UNABLE_TO_DELIVER or DIAMETER_TOO_BUSY it can re-send the request to an alternative server if possible. There MAY exist protocol transparent Diameter relays and redirect agents or Diameter credit- control proxies between credit-control client and credit-control server. Failover may occur at any point in the path between credit- control client and credit-control server in the event that a transport failure is detected with a peer, as described in [DIAMBASE]. Because there can be duplicate requests for various reasons the credit-control server is therefore responsible for the real time duplicate detection. Implementation issues for duplicate detection are discussed in [DIAMBASE] Appendix C. When the credit-control client detects a communication failure to the credit-control server, its behavior depends on the requested action. The timer Tx (as defined in section 13) is used in the credit-control client to supervise the communication with the credit-control server. In case the requested action is PRICE_ENQUIRY or BALANCE_CHECK and communication failure is detected the credit-control client SHOULD forward the request messages to an alternative credit-control server, if possible. The secondary Credit control server name, if received from the AAA server, can be used as an address of backup server. If the requested action is DIRECT_DEBITING the Direct-Debiting- Failure-Handling AVP (DDFH) controls the credit control client behavior. The DDFH may be received from the Diameter home AAA server or may be locally configured. The credit control server may also send Hakala et al. Expires - August 2004 [Page 41] Diameter Credit Control Application February 2004 the DDFH in any CCA message to be used for direct debiting events compiled thereafter. The DDFH value received from the home AAA server overrides the locally configured value and the DDFH value received from the credit control server in a Credit-Control-Answer message always override any already existing value. If the DDFH is set to TERMINATE_OR_BUFFER, the credit-control client SHOULD NOT grant the service if it can determine, eventually after a possible re- transmission attempt to an alternative credit control server, from the result code or error code in the answer message that units have not been debited. Otherwise the credit-control client SHOULD grant the service to the end user and store the request in the credit-control application level non-volatile storage (Note that re-sending the request at a later time is not a guarantee that the service will be debited, since the user's account may be empty at the time when the server successfully processes the request). The credit-control client MUST mark these request messages as possible duplicate by setting the T-flag in the command header as described in [DIAMBASE] section 3. If the Direct-Debiting-Failure-Handling AVP is set to CONTINUE, the service SHOULD be granted even if credit-control messages cannot be delivered and messages are not buffered. If the timer Tx expires the credit-control client MUST continue the service and wait for a possible late answer. If the request timeout the credit control client re-transmit the request (marked with T-flag) to a backup credit control server if possible. In the event that also the re-transmitted request timeout or a temporary error is received in answer to such a request, the credit control client buffers the request if the value of the Direct-Debiting-Failure-Handling AVP is set to TERMINATE_OR_BUFFER. If a failed answer is received for the re- transmitted request, the credit control client frees all the resources reserved for the event message and deletes the request regardless the value of the DDFH. The Credit-Control-Request with requested action REFUND should always be stored in the credit-control application level non-volatile storage in case of temporary failure. The credit-control client MUST mark the re-transmitted request message as possible duplicate by setting the T- flag in the command header as described in [DIAMBASE] section 3. For stored requests, the implementation may choose to limit the number of re-transmission attempts and define a re-transmission interval. It should be noted that only one place in the credit-control system SHOULD be responsible for duplicate detection. If there is only one credit-control server within the given realm, the credit-control server may perform duplicate detection. In case when more than one credit-control servers are serving a given realm, only one entity in the credit control system should be responsible to ensure that the end Hakala et al. Expires - August 2004 [Page 42] Diameter Credit Control Application February 2004 user's account is not debited or credited multiple times for the same service event. 7. Credit Control Application State Machine This section defines the credit control application state machine. The first four state machines are to be observed by credit-control clients. The first one describes the session-based credit-control when the first interrogation is executed as part of the authorization/authentication process. The second one describes the session-based credit-control when the first interrogation is executed after the authorization/authentication process. The requirements what state machine need to be supported are discussed in section 5.2. The third state machine describes the session-based credit-control for intermediate and final interrogations. The fourth one describes the event-based credit-control. These latter state machines are to be observed by all the implementations that conform to this specification. The fifth state machine describes the credit-control session from a credit-control server perspective. Any event not listed in the state machines MUST be considered as an error condition, and a corresponding answer, if applicable, MUST be returned to the originator of the message. In the state table, the event 'Failure to send' means that the Diameter credit-control client is unable to communicate with the desired destination or with a possibly defined alternative destination in case failover procedure is supported (e.g. the request timeout and the answer message is not received). This could be due to the peer being down, or due to a physical link failure in the path to/from the credit-control server. The event 'Temporary error' means that the Diameter credit-control client received a protocol error notification DIAMETER_TOO_BUSY, DIAMETER_UNABLE_TO_DELIVER or DIAMETER_LOOP_DETECTED in the Result- Code AVP of the Credit-Control-Answer command. The above protocol error notification may be ultimately received in answer to the re- transmitted request to a possibly defined alternative destination if failover is supported. The event 'Failed answer' means that the Diameter credit-control client received non-transient failure (permanent failure) notification in the Credit-Control-Answer command. The above permanent failure notification may be ultimately received in answer to the re- Hakala et al. Expires - August 2004 [Page 43] Diameter Credit Control Application February 2004 transmitted request to a possibly defined alternative destination if failover is supported. The action 'store request' means that a request is stored in the credit-control application level non-volatile storage. The event 'Not successfully processed' means that the credit-control server could not process the message, e.g. due to unknown end user, account being empty or due to errors defined in [DIAMBASE]. The states PendingI, PendingU, PendingT PendingE and PendingB stand for pending states to wait for an answer to a credit control request related to Initial, Update, Termination, Event or Buffered request respectively. The abbreviations CCFH and DDFH stand for Credit-Control-Failure- Handling and Direct-Debiting-Failure-Handling respectively. In the following state machine table the failover to a possibly secondary server upon 'Temporary error' or 'Failure to send' is not explicitly described. Moving an ongoing credit control message stream to an alternative server is, however, possible if the CC-Session- Failover AVP is set to FAILOVER_SUPPORTED as described in section 5.7. Re-sending a credit control event to an alternative server is supported as described in section 6.5. Hakala et al. Expires - August 2004 [Page 44] Diameter Credit Control Application February 2004 CLIENT, SESSION BASED for the first interrogation with AA request State Event Action New State --------------------------------------------------------------- Idle Client or device requests Send PendingI access/service AA request with added CC AVPs, start Tx PendingI Successful AA req. Grant Open answer received service to end user, stop Tx PendingI Tx expired Disconnect Idle user/dev PendingI Failed AA answer received Disconnect Idle user/dev PendingI AA answer Grant Idle received with result code service equal to credit-control N/A to end user PendingI User service terminated Queue PendingI termination event PendingI Change in rating condition Queue PendingI changed rating condition event Hakala et al. Expires - August 2004 [Page 45] Diameter Credit Control Application February 2004 CLIENT, SESSION BASED for the first interrogation with CCR State Event Action New State ---------------------------------------------------------------- Idle Client or device requests Send PendingI access/service CC initial req., start Tx. PendingI Successful CC initial Stop Tx Open answer received PendingI Failure to send, or Grant Idle temporary error and service to CCFH equal to CONTINUE end user PendingI Failure to send, or Terminate Idle temporary error and end user's CCFH equal to TERMINATE service or equal to RETRY_AND_TERMINATE PendingI Tx expired and CCFH Terminate Idle equal to TERMINATE end user's service PendingI Tx expired and CCFH equal Grant PendingI to CONTINUE or equal to service to RETRY_AND_TERMINATE end user PendingI CC initial answer Terminate Idle received with result code end user's SERVICE_ DENIED or service USER_UNKNOWN PendingI CC initial answer Grant Idle received with result code service equal to credit-control N/A to end user PendingI Failed CC initial answer Grant Idle received CCFH equal to Service to CONTINUE end user PendingI Failed CC initial answer Terminate Idle received and CCFH equal end user's to TERMINATE or equal to service RETRY_AND_TERMINATE Hakala et al.