[Docs] [txt|pdf] [Tracker] [WG] [Email] [Diff1] [Diff2] [Nits] [IPR]

Versions: (draft-hakala-aaa-diameter-cc) 00 01 02 03 04 05 06 RFC 4006

   AAA Working Group
   Internet Draft                                          Harri Hakala
   Document: draft-ietf-aaa-diameter-cc-00.txt            Leena Mattila
   Expires: December 2003                                      Ericsson
                                                    Juha-Pekka Koskinen
                                                            Marco Stura
                                                          John Loughney
                                                                  Nokia


                  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 - December 2003     [Page 1]

                   Diameter Credit Control Application        June 2003



   1. Introduction...................................................4
      1.1 Requirements language......................................4
      1.2 Terminology................................................4
      1.3 Advertising application support............................6
   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 Authorization..........................................12
      4.1 First Interogation after Authorization and Authentication.14
      4.2 Authorization Messages for First Interrogation............16
      4.3 Session Based Credit-control..............................20
      4.4 One Time Event............................................24
      4.5 Credit-control Session State Machine......................29
   5. Credit Control AVPs...........................................38
      5.1 Abnormal-Termination-Reason AVP...........................39
      5.2 CC-Correlation-Id AVP.....................................40
      5.3 CC-Request-Number AVP.....................................40
      5.4 CC-Request-Type AVP.......................................40
      5.5 CC-Session-Failover AVP...................................41
      5.6 CC-Sub-Session-Id AVP.....................................41
      5.7 Check-Balance-Result AVP..................................42
      5.8 Cost-Information AVP......................................42
      5.9 Credit-Control AVP........................................43
      5.10 Credit-Control-Failure-Handling AVP......................43
      5.11 Currency-Code AVP........................................44
      5.12 Direct-Debiting-Failure-Handling AVP.....................44
      5.13 Exponent AVP.............................................45
      5.14 Final-Unit-Indication AVP................................45
      5.15 Granted-Service-Unit AVP.................................45
      5.16 Requested-Action AVP.....................................46
      5.17 Requested-Service-Unit AVP...............................46
      5.18 Service-Parameter-Info AVP...............................47
      5.19 Service-Parameter-Type AVP...............................48
      5.20 Service-Parameter-Value AVP..............................48
      5.21 Subscription-Id AVP......................................48
      5.22 Subscription-Id-Data AVP.................................48
      5.23 Subscription-Id-Type AVP.................................48
      5.24 Unit-Type AVP............................................49
      5.25 Unit-Value AVP...........................................49
      5.26 Used-Service-Unit AVP....................................50
      5.27 Value-Digits AVP.........................................50
      5.28 Validity-Time AVP........................................51
   6. Result Code AVP values........................................51
      6.1 Transient Failure.........................................51
      6.2 Permanent Failures........................................51
   7. AVP Occurrence Table..........................................52
      7.1 Credit Control AVP Table..................................52


Hakala et al.             Expires - December 2003             [Page 2]

                   Diameter Credit Control Application        June 2003


   8. RADIUS/Diameter Credit-control Inter-working..................53
      8.1 Initial RADIUS Access-Request.............................54
      8.2 Subsequent RADIUS Access-Request message..................55
      8.3 RADIUS Vendor Specific Attributes for Credit Control......56
   9. IANA Considerations...........................................56
      9.1 Application Identifier....................................57
      9.2 Command Codes.............................................57
      9.3 AVP Codes.................................................57
      9.4 Result-Code AVP Values....................................57
      9.5 Abnormal-Termination-Reason AVP...........................57
      9.6 CC-Session-Failover AVP...................................57
      9.7 Check-Balance-Result AVP..................................57
      9.8 Credit-Control-Failure-Handling AVP.......................57
      9.9 Direct-Debiting-Failure-Handling AVP......................58
      9.10 Requested-Action AVP.....................................58
      9.11 Subscription-Id-Type AVP.................................58
      9.12 Unit-Type AVP............................................58
   10. Credit-control Application Related Parameters................58
   11. Security Considerations......................................59
   12. References...................................................59
      12.1 Normative................................................59
      12.2 Non-Normative............................................60
   13. Acknowledgement..............................................60
   14. Author's Address.............................................60
   15. Full Copyright Statement.....................................61
   16. Notices......................................................62
   17. Expiration Date..............................................62
   Appendix A Credit Control sequences..............................62
      A.1 Flow I....................................................62
      A.2 Flow II...................................................65
      A.3 Flow III..................................................66
      A.4 Flow IV...................................................68
      A.5 Flow V....................................................69


















Hakala et al.             Expires - December 2003             [Page 3]

                   Diameter Credit Control Application        June 2003



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. The purpose is to provide 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 accounting
   protocol. For example, the 3GPP Charging and Billing requirements
   [3GPPCHARG] state that an accounting application must be able to rate
   accounting information (such as service events) 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.

   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.

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].

1.2 Terminology

   AAA

   Authentication, Authorization and Accounting

   AA answer



Hakala et al.             Expires - December 2003             [Page 4]

                   Diameter Credit Control Application        June 2003


   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].

   Accounting

   The act of collection of information on resource usage for the
   purposes of trend analysis, auditing, billing or cost allocation.

   Accounting Server

   The accounting server receives accounting data from the service
   elements and other devices and translates it into session records.
   The processed accounting data is then submitted to a billing server,
   which typically handles rating and invoice generation.

   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



Hakala et al.             Expires - December 2003             [Page 5]

                   Diameter Credit Control Application        June 2003


   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.

   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




Hakala et al.             Expires - December 2003             [Page 6]

                   Diameter Credit Control Application        June 2003


   Diameter nodes conforming to this specification MUST advertise
   support by including the value of TBD (X) in the Auth-Application-Id
   of the Capabilities-Exchange-Request and Capabilities-Exchange-Answer
   command [DIAMBASE].

2. Architecture Models

   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. 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. At least two different
   reasons exist to authorize a subscriber for the use of network
   resources: service specific authorization and credit authorization
   for prepaid users. The authentication and authorization is largely
   service specific that is why different Diameter applications have
   been required. Currently existing authorization applications
   are[NASREQ] and [DiamMIP], other authorization applications will be
   defined in the future. All the existing Diameter authorization
   applications define new command codes; future Diameter authorization
   applications will presumably define new command codes too.
   The credit authorization is more generic and applicable to all the
   service environments required to support prepaid services, therefore
   the credit authorization approach shall be generic and cannot be
   required to support all the current and future authorization
   commands. The scope of this specification is the credit
   authorization, service specific authorization and authentication is
   out of the scope.

   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 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.



Hakala et al.             Expires - December 2003             [Page 7]

                   Diameter Credit Control Application        June 2003


   In servive environments such as the Network Access Server (NAS) and
   Mobile IP, it is a requirement 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 send 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 as
   well as intermediate and final interrogations is executed with credit
   control commands defined in this specification. Implementations of
   credit-control client operating in 3GPP environment SHOULD support
   this method. In 3GPP environment the service element sends the
   request message directly to the credit-control server.

   In case an implementation of the credit-control client supports both
   the methods, it SHOULD be configurable what method to use.

   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.













Hakala et al.             Expires - December 2003             [Page 8]

                   Diameter Credit Control Application        June 2003



                  Service Element AAA and credit-control
   +----------+      +---------+    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 8 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

   The credit-control server, depending on the possible service event
   information, MAY perform the rating and pricing of the service event,
   credit check and credit-reservation. The credit-control server, based
   on the received parameters, calculates the quota granted to the end


Hakala et al.             Expires - December 2003             [Page 9]

                   Diameter Credit Control Application        June 2003


   user for the service request. The credit-control client monitors the
   consumption of the granted quota according to the instructions
   returned by the credit-control server. After the service completion
   the credit-control server deducts the used credit from the account.

   If direct debiting/refunding is requested, the credit-control server
   deducts/increases the end user's account, respectively. The credit-
   control client can also enquire the price of the service or the
   account balance status from the credit-control server.

   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 units are granted to the services.

   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 locate in a centralized
   database. 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 and redirect
   agents between credit-control client and credit-control server. 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        TBD      3.1
    Credit-Control-Answer         CCA        TBD      3.2

3.1 Credit-Control-Request (CCR) Command

   The Credit-Control-Request message (CCR), indicated by the command-
   code field set to TBD and the 'R' bit set in the Command Flags field,



Hakala et al.             Expires - December 2003             [Page 10]

                   Diameter Credit Control Application        June 2003


   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 TBD indicating the
   Diameter credit-control application.

   Message Format

        <Credit-Control-Request> ::= < Diameter Header: TBD, 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 ]
                                       [ Abnormal-Termination-Reason ]
                                      *[ Requested-Service Unit ]
                                      *[ 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 TBD and the 'R' bit cleared in the Command Flags
   field, is used between the credit-control server and the Diameter
   AAA server to acknowledge a Credit-Control-Request command.














Hakala et al.             Expires - December 2003             [Page 11]

                   Diameter Credit Control Application        June 2003


   Message Format

        <Credit-Control-Answer> ::= < Diameter Header: TBD, REQ, 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 ]
                                    [ Cost-Information]
                                    [ Final-Unit-Indication ]
                                    [ Check-Balance-Result ]
                                    [ Credit-Control-Failure-Handling ]
                                    [ Direct-Debiting-Failure-Handling ]
                                    [ Validity-Time]
                                   *[ Proxy-Info ]
                                   *[ AVP ]

4. Credit Authorization

   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.

   In case the first interrogation is not performed as part of the
   authentication and authorization process the end user SHOULD be
   authenticated and authorized before any request is sent to the
   credit-control server. The authentication and authorization
   mechanisms are outside of the scope of this document.

   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.



Hakala et al.             Expires - December 2003             [Page 12]

                   Diameter Credit Control Application        June 2003


   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.

   Different Diameter authorization applications, such as [NASREQ] and
   [DiamMIP] and the future Diameter authentication and authorization
   applications, have been defined to meet the requirements of different
   service environments. The authentication and authorization messages
   in these service environments are largely application-specific, as
   stated in the Diameter base [DIAMBASE] and therefore these messages
   are defined in a Diameter application documents. The target of the
   credit-control application defined in this document is to be a
   generic credit-control application for various service scenarios that
   requires credit-control capabilities. This goal is not achievable by
   defining a generic authentication, authorization and credit control
   message, since authentication and authorization methods are
   application specific. It is not either feasible to require the
   credit-control server to support all the possible authorization
   commands and mandatory AVPs defined in current and future
   authorization applications. Therefore this document defines two new
   commands for credit authorization and mechanisms suitable to
   different service environments and architectures.

   The AAA infrastructure is not always implemented as discussed in
   section 2, for instance in 3GPP environment the
   authorization/authentication, the accounting and the credit control
   servers are different physical entities that in most cases do not
   communicate each others. Additionally, there might be different
   requirements depending on the environment in which the credit control
   application operates as discussed in section 2. Two different
   approaches are then defined for the session-based credit-control 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 authorization
   messages for the first interrogation, which is performed during the
   userÆs authorization/authentication phase, and credit-control
   messages for the intermediate and the final interrogations. What
   method is recommended in different environments is discussed in
   section 2. Additionally, other IETF standards or standards developed
   by other standardization bodies may define what is the most suitable
   method in their architecture.

   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-


Hakala et al.             Expires - December 2003             [Page 13]

                   Diameter Credit Control Application        June 2003


   control). In this case the credit-control server MUST maintain the
   credit control session state.

4.1 First Interogation after Authorization and Authentication

   In the first approach, 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 service element may 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.

   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, such as in 3GPP
   environment. More credit-control sequence examples are given in Annex
   A.






















Hakala et al.             Expires - December 2003             [Page 14]

                   Diameter Credit Control Application        June 2003



    End-User        Service Element        AAA Server         CC Server
                      (CC Client)
       | Registration      | AA request/answer(accounting,cc or both)|
       |<----------------->|<------------------>|                    |
       |        :          |                    |                    |
       |        :          |                    |                    |
       | Service Request   |                    |                    |
       |------------------>|                    |                    |
       |                   | CCR(Initial,Credit-ControlAVPs)         |
       |                  +|---------------------------------------->|
       |         CC stream||                    |  CCA(Granted-Units)|
       |                  +|<----------------------------------------|
       | Service Delivery  |                    |                    |
       |<----------------->| ACR(start,Accounting AVPs)              |
       |         :         |------------------->|+                   |
       |         :         |                ACA || Accounting stream |
       |                   |<-------------------|+                   |
       |         :         |                    |                    |
       |         :         |                    |                    |
       |                   | CCR(Update Used-Units)                  |
       |                   |---------------------------------------->|
       |                   |                    |  CCA(Granted-Units)|
       |                   |<----------------------------------------|
       |         :         |                    |                    |
       |         :         |                    |                    |
       | End of Service    |                    |                    |
       |------------------>| CCA(Termination, Used-Units)            |
       |                   |---------------------------------------->|
       |                   |                    |               CCA  |
       |                   |<----------------------------------------|
       |                   | ACR(stop)          |                    |
       |                   |------------------->|                    |
       |                   |                ACA |                    |
       |                   |<-------------------|                    |

     Figure 3: Protocol example with first interrogation after userÆs
                       authorization/authentication

   The authorization server MAY include the Credit-Control- Failure-
   Handling AVP and 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. 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. The
   credit-control server MAY override the failure handling for credit-
   control session by including the Credit-Control-Failure-Handling AVP
   in the Credit-Control-Answer.


Hakala et al.             Expires - December 2003             [Page 15]

                   Diameter Credit Control Application        June 2003



   The Diameter credit-control server may want to control the validity
   time of the granted quota and/or the production of credit-control
   update requests, 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 10). 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.

4.2 Authorization Messages for First Interrogation

   In the second approach, 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
   authenticate/authorize the subscriber and determine 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 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


Hakala et al.             Expires - December 2003             [Page 16]

                   Diameter Credit Control Application        June 2003


  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.

   The use of the Validity-Time as discussed for the first approach is
   applicable to this model as well.

   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
   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, 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.

   The next time the user issues a service request to the service
   element after a previous end of service, the first interrogation is
   executed with the appropriate AA request according to the service
   specific authorization application, as described above. The AA
   request may only be used for re-authorization and not re-
   authentication (i.e. if the user is still registered and re-
   authentication is not required).

   The service element may 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.

   Therefore the credit-control client MUST add to the service specific
   re-authorization request the Credit-Control AVP with value set to RE-


Hakala et al.             Expires - December 2003             [Page 17]

                   Diameter Credit Control Application        June 2003


   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; therefore 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  |<-------------------|                    |
      |<----------------->|                    |                    |
      |         :         |                    |                    |
      |         :         |                    |                    |
      |         :         |                    |                    |
      |                   |                    |                    |
      |                   | 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 |<-------------------|
      |                   |<-------------------|                    |



Hakala et al.             Expires - December 2003             [Page 18]

                   Diameter Credit Control Application        June 2003


                Figure 4: Protocol example with use of the
            authorization messages for the first interrogation.


   The following paragraphs apply to both the approaches.

   The service specific re-authorization may fails during an ongoing
   credit control session. In this case the user is disconnected and the
   credit-control client MUST send a Credit-Control-Request message with
   CC-Request-Type set to TERMINATION_REQUEST to the credit-control
   server.

   If the user logoff during an ongoing credit-control session or some
   other reason cause 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.

   End-User        Service Element        AAA Server           CC Server
                    (CC Client)
      | Service Delivery  |                    |                    |
      |<----------------->|                    |                    |
      |         :         |                    |                    |
      |         :         |                    |                    |
      |         :         |                    |                    |
      |                   |                    |                    |
      |                   | CCR(Update,Used-Units)                  |
      |                   |------------------->| CCR(Update,Used-Units)
      |                   |                    |------------------->|
      |                   |                    |  CCA(Final-Unit)   |
      |                   |  CCA(Final-Unit)   |<-------------------|
      |                   |<-------------------|                    |
      |         :         |                    |                    |
      |         :         |                    |                    |
      |  Disconnect user  |                    |                    |
      |<------------------| CCR(Termination,Used-Units)             |
      |                   |------------------->| CCR(Term.,Used-Units)
      |                   |                    |------------------->|
      |                   |                    |                CCA |
      |                   |                CCA |<-------------------|
      |                   |<-------------------|                    |
      |                   | STR                |                    |
      |                   |------------------->|                    |
      |                   |               STA  |                    |
      |                   |<-------------------|                    |
          Figure 5: User disconnected due to account exhausted


Hakala et al.             Expires - December 2003             [Page 19]

                   Diameter Credit Control Application        June 2003



   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 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.

   A one-time event MAY be 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.

4.3 Session Based Credit-control

   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.

4.1.1 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. In case the
   first interrogation is performed as part of the
   authentication/authorization process, an appropriate AA request MUST
   be sent. The Subscription-Id-Data AVP SHOULD be included in the
   request to identify the end-user in the credit-control server.

   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 and the Service-
   Parameter-Info AVP SHOULD contain the service event information to be



Hakala et al.             Expires - December 2003             [Page 20]

                   Diameter Credit Control Application        June 2003


   rated by the credit-control server. The Service-Parameter-Info AVP
   always refers to the requested service units.

   The Event-Timestamp AVP contains the time when the service event is
   requested in the service element.

   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. However there
   MUST be maximum one instance of the same unit type in one Answer
   message. When the granted service units for one unit type have been
   spent a new Credit-Control-Request MUST be sent to the credit-control
   server even though there would be service units left for other units
   types. The type of the Granted-Service-Unit AVP can be time, volume,
   service specific or money depending on the type of service event. It
   is not allowed to change the unit type(s) within the session.

   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)
   and terminate the credit-control session.

   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 session. After the end user has used these
   units, the Diameter credit-control client is responsible for
   terminating the service session and the credit-control session by
   sending the final interrogation to the credit-control server.

4.1.2 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 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


Hakala et al.             Expires - December 2003             [Page 21]

                   Diameter Credit Control Application        June 2003


   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
   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.

   The CC-Request-Type AVP is set to the value UPDATE_REQUEST in the
   intermediate request message. The Subscription-Id-Data AVP SHOULD be
   included in the intermediate message to identify the end user in the
   credit-control server.

   The Requested-Service-Unit AVP contains 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 session. After the end user has used these
   units, the Diameter credit-control client is responsible for


Hakala et al.             Expires - December 2003             [Page 22]

                   Diameter Credit Control Application        June 2003


   terminating the service session and the credit-control session by
   sending the final interrogation to the credit-control server.

   There can be several intermediate interrogations within a session.

4.1.3 Final Interrogation

   When the end user terminates the service session or when all the
   granted units are used after a Final-Unit-Indication AVP has been
   received from the credit-control server, 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.

4.1.4 Failure Procedures

   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


Hakala et al.             Expires - December 2003             [Page 23]

                   Diameter Credit Control Application        June 2003


   detected in the credit-control server based on the credit-control
   server session state machine (section 4.3), Session-Id AVP and CC-
   Request-Number AVP.

   If a communication failure occurs during an ongoing credit-control
   session the credit-control client can move the credit control message
   stream to an alternative server if the value of the CC-Session-
   Failover AVP is set to FAILOVER SUPPORTED. A secondary Credit control
   server name received for instance from the AAA server, 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 and the credit control client will
   terminate or continue the service depending on the value set in the
   Credit-Control-Failure-Handling AVP. The Credit-Control-Failure-
   Handling AVP MAY be sent from the authorization server and in the
   Credit-Control-Answer from the credit-control server. For new credit-
   control sessions, failover to an alternate credit-control server
   SHOULD be performed, if possible.

   The timer, Tx (as defined in section 10), is used in the credit-
   control client to supervise the communication with the credit-control
   server.

   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 10) is used
   in the credit-control server to supervise the credit-control session.

4.4 One Time Event

   The one time event is used when there is no need to maintain
   accounting session state in the credit-control server.

   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 6.










Hakala et al.             Expires - December 2003             [Page 24]

                   Diameter Credit Control Application        June 2003


   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 6: 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.

4.2.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-Parameter-Info AVP in the
   Credit-Control-Request message.

   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 price of the requested service event is returned to the
   credit-control client in the Cost-Information AVP in the Credit-
   Control-Answer message.

4.2.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.



Hakala et al.             Expires - December 2003             [Page 25]

                   Diameter Credit Control Application        June 2003


   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-Data 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 (Credit/No Credit) is returned to the
   credit-control client in the Check-Balance-Result AVP in the Credit-
   Control-Answer message.

4.2.3 Direct Debiting

   There are certain service events for which service execution is
   always successful in the service environment. The delay between the
   service 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-Data 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 can include the monetary amount to
   be charged in the Request-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, then the Service-Parameter-Info
   AVP SHOULD contain the service event information to be rated by the
   credit-control server. The Service-Parameter-Info AVP always refers
   to the requested service unit.

   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


Hakala et al.             Expires - December 2003             [Page 26]

                   Diameter Credit Control Application        June 2003


   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.

4.2.4 Refund

   Some services may refund service units to the end user's account, for
   example gaming services.

   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-Data 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 Request-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, then the Service-Parameter-Info
   AVP SHOULD contain the service event information to be rated by the
   credit-control server. The Service-Parameter-Info AVP always refers
   to the requested service unit.

   For informative purposes, the Credit-Control-Answer message MAY also
   include the Cost-Information AVP containing the estimated monetary
   amount of refunded unit.

4.2.5 Failure Procedure

   Failover to an alternate credit-control server is allowed for one
   time event since the server is not maintaining session states. 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].

   When the credit-control client detects a communication failure to the
   credit-control server, its behavior depends on the requested action.



Hakala et al.             Expires - December 2003             [Page 27]

                   Diameter Credit Control Application        June 2003


   The timer Tx (as defined in section 10) is used in the credit-control
   client to supervise the communication with the credit-control server.

   In case the requested action is Service 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 and the Direct-Debiting-
   Failure-Handling AVP is set to TERMINATE_OR_BUFFER the credit-control
   client SHOULD terminate the service if it can determine 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. 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 can't be
   delivered. If the timer Tx expires the credit-control client MUST
   continue the service and eventually buffer the request according to
   the value of the Direct-Debiting-Failure-Handling AVP.

   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.

   The implementation may choose to limit the number of re-transmission
   attempts and define a re-transmission interval.

   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 re-sends messages from its application level non-volatile
   storage it MUST mark these request messages as possible duplicate by
   setting the T-flag in the command headers as described in [DIAMBASE]
   section 3.

   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 server
   is supporting the credit-control application the account manager


Hakala et al.             Expires - December 2003             [Page 28]

                   Diameter Credit Control Application        June 2003


   controlling the account database MAY be responsible for duplicate
   detection.

4.5 Credit-control Session 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 is to be supported are discussed in section 2 and
   section 4.

   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 (i.e. the answer message is not received within
   the validity time of the request). 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 transient failure notification in the Credit-
   Control-Answer command (i.e. the peer sending back a transient
   failure or temporary protocol error notification DIAMETER_TOO_BUSY,
   or DIAMETER_LOOP_DETECTED in the Result-Code AVP).

   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 action 'store record' means that a record is stored in the
   credit-control application level non-volatile storage.



Hakala et al.             Expires - December 2003             [Page 29]

                   Diameter Credit Control Application        June 2003


   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.

   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 - December 2003             [Page 30]

                   Diameter Credit Control Application        June 2003



       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
               credit-control fault           end user
               handling equal to CONTINUE

     PendingI  Failure to send, or            Disconnect   Idle
               temporary error and            user/dev
               credit-control fault
               handling equal to TERMINATE

     PendingI  Tx expired and credit          Disconnect   Idle
               Control fault handling         user/dev
               equal to TERMINATE

     PendingI  Tx expired and credit-control  Grant
               fault handling equal to        service to   Idle
               CONTINUE                       end user

     PendingI  CC initial answer              Disconnect   Idle
               received with result code      user/dev
               SERVICE_ DENIED or
               USER_NOT_FOUND

     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 and credit-control    Service to
               fault handling                 end user
               equal to CONTINUE





Hakala et al.             Expires - December 2003             [Page 31]

                   Diameter Credit Control Application        June 2003


     PendingI  Failed CC initial answer       Disconnect   Idle
               received and credit-control    user/dev
               failure handling equal to
               TERMINATE

     PendingI  User service terminated        Queue        PendingI
                                              termination
                                              event

     PendingI  Change in rating condition     Queue        PendingI
                                              changed
                                              rating
                                              condition
                                              event





































Hakala et al.             Expires - December 2003             [Page 32]

                   Diameter Credit Control Application        June 2003



      CLIENT, SESSION BASED for intermediate and final interrogations
      State     Event                          Action       New State
      ---------------------------------------------------------------

     Open      Granted unit elapses           Send         PendingU
               and no final unit              CC update
               indication received            req.,
                                              start Tx.

     Open      Granted unit elapses           Disconnect   PendingT
               and final unit indication      send
               received                       CC termination
                                              req.,
                                              start Tx.

     Open      Change in rating condition     Send         PendingU
               in queue                       CC update
                                              req.,
                                              Start Tx.

     Open      Service terminated in queue    Send         PendingT
                                              CC termination
                                              req.,
                                              start Tx

     Open      Change in rating condition     Send         PendingU
               or Validity-Time elapses       CC update
                                              req.,
                                              Start Tx.

     Open      User service terminated        Send         PendingT
                                              CC termination
                                              req.,
                                              start Tx

     PendingU  Successful CC update           Stop Tx      Open
               answer received

     PendingU  Failure to send, or            Grant        Idle
               temporary error and            service to
               credit-control fault           end user
               handling equal to CONTINUE

     PendingU  Failure to send, or            Disconnect   Idle
               temporary error and            user/dev
               credit-control fault
               handling equal to TERMINATE



Hakala et al.             Expires - December 2003             [Page 33]

                   Diameter Credit Control Application        June 2003


     PendingU  Tx expired and credit-control  Disconnect   Idle
               fault handling equal to        user/dev
               TERMINATE

     PendingU  Tx expired and credit-control  Grant
               fault handling equal to        service to   Idle
               CONTINUE                       end user.

     PendingU  CC update answer               Disconnect   Idle
               received with result code      user/dev
               SERVICE_DENIED

     PendingU  CC update answer               Grant        Idle
               received with result code      service
               equal to credit-control N/A    to end user

     PendingU  Failed CC update               Grant        Idle
               answer received and credit     service to
               control fault handling equal   end user.
               to CONTINUE

     PendingU  Failed CC update               Disconnect   Idle
               answer received and credit     user/dev
               control fault handling
               equal to TERMINATE

     PendingU  User service terminated        Queue        PendingU
                                              termination
                                              event

     PendingU  Change in rating               Queue        PendingU
               condition                      changed
                                              rating
                                              condition
                                              event

     PendingT  Successful CC                               Idle
               termination answer received

     PendingT  Tx expired                                  Idle

     PendingT  Failure to send, or temporary               Idle
               error or failed answer

     PendingT  Change in rating condition                  PendingT






Hakala et al.             Expires - December 2003             [Page 34]

                   Diameter Credit Control Application        June 2003


                               CLIENT, EVENT BASED
     State     Event                          Action        New State
     ----------------------------------------------------------------
     Idle      Client or device requests      Send          PendingE
               a one-time service             CC event
                                              req.,
                                              Start Tx.

     Idle      Request in storage             Send          PendingB
                                              stored
                                              request

     PendingE  Successful CC event                          Idle
               answer received

     PendingE  Failure to send, temporary     Indicate      Idle
               error or failed CC event       service
               answer received, or            error
               Tx expired, requested
               action GET_BALANCE or
               PRICE_ENQUIRY

     PendingE  CC event answer                Disconnect    Idle
               received with result code      user/dev
               SERVICE_ DENIED or
               USER_NOT_FOUND

     PendingE  CC event answer                Grant         Idle
               received with result code      service
               credit-control N/A, requested  to end
               action DIRECT_DEBITING         user

     PendingE  Failure to send, temporary     Grant         Idle
               error or failed CC event      service
               answer received, or Tx         to end
               expired, requested             user
               action DIRECT_DEBITING and
               fault handling equal to
               CONTINUE

     PendingE  Failed CC event                Disconnect    Idle
               answer received, requested     user/dev
               action DIRECT_DEBITING and
               fault handling equal to
               TERMINATE_OR_BUFFER

     PendingE  Failure to send or Tx          Grant         Idle
               expired, requested             service
               action DIRECT_DEBITING and     to end user


Hakala et al.             Expires - December 2003             [Page 35]

                   Diameter Credit Control Application        June 2003


               fault handling equal to        and store
               TERMINATE_OR_BUFFER            request with
                                              T-flag

     PendingE  Temporary error, requested     Disconnect    Idle
               action DIRECT_DEBITING and     user/dev
               fault handling equal to
               TERMINATE_OR_BUFFER

     PendingE  Failed CC event answer         Indicate      Idle
               received, requested            service
               action REFUND                  error and
                                              delete request

     PendingE  Failure to send or             Store         Idle
               Tx expired, requested          request
               action REFUND                 with T-flag

     PendingE  Temporary error                Store         Idle
               and requested action           request
               REFUND

     PendingB  Successful CC answer           Delete        Idle
               received                       request

     PendingB  Failed CC answer               Delete        Idle
               received                       request

     PendingB  Failure to send or                           Idle
               temporary error





















Hakala et al.             Expires - December 2003             [Page 36]

                   Diameter Credit Control Application        June 2003


                      SERVER, SESSION AND EVENT BASED

     State     Event                          Action        New State
     ----------------------------------------------------------------

     Idle      CC initial request             Send          Open
               received and successfully      CC initial
               processed.                     answer,
                                              reserve units,
                                              start Tcc

     Idle      CC initial request             Send          Idle
               received, but not              CC initial
               successfully processed.        answer with
                                              Result-Code
                                              =! SUCCESS

     Idle      CC event request               Send          Idle
               received and successfully      CC event
               processed.                     answer,
                                              debit units

     Idle      CC event request               Send          Idle
               received, but not              CC event
               successfully processed.        Answer with
                                              Result-Code
                                              != SUCCESS

     Open      CC update request              Send          Open
               received and successfully      CC answer,
               processed                      debit used
                                              units and
                                              reserve
                                              new units,
                                              Restart Tcc

     Open      CC update request              Send          Idle
               received, but not              CC update
               successfully processed.        Answer with
                                              Result-Code
                                              != SUCCESS,
                                              debit used
                                              units

     Open      CC termination request         Send          Idle
               received, and successfully     CC termin.
               processed                      answer,
                                              Stop Tcc,
                                              debit used


Hakala et al.             Expires - December 2003             [Page 37]

                   Diameter Credit Control Application        June 2003


                                              units

     Open      CC termination request         Send          Idle
               received, but not              CC termin.
               successfully processed.        Answer with
                                              Result-Code
                                              != SUCCESS,
                                              debit used
                                              units

     Open      Session supervision timer Tcc  Stop Tcc,      Idle
               expired                        release
                                              reserved
                                              units

5. Credit Control AVPs

   This section defines the credit-control AVPs that are specific to
   Diameter Credit-control Application and MAY be included in the
   Diameter credit control messages.

   The AVPs defined in this section MAY also be included in
   authorization commands defined in authorization specific
   applications, such as [NASREQ] and [DiamMIP], in case the first
   interrogation is performed as part of the
   authorization/authentication process as described in section 4.

   The following table describes the Diameter AVPs defined in Credit-
   control application, their AVP Code values, types, possible flag
   values and whether the AVP MAY be encrypted.





















Hakala et al.             Expires - December 2003             [Page 38]

                   Diameter Credit Control Application        June 2003



                                            +---------------------+
                                            |    AVP Flag rules   |
                                            |----+-----+----+-----|----+
                     AVP  Section           |    |     |SHLD| MUST|    |
   Attribute Name    Code Defined Data Type |MUST| MAY | NOT|  NOT|Encr|
   -----------------------------------------|----+-----+----+-----|----|
   Abnormal-         XXX  5.1    Enumerated | -  |  P  |    |  V  | Y  |
   Termination-Reason                       |    |     |    |     |    |
   CC-               XXX  5.2    OctetString| -  |  P  |    |  V  | Y  |
   Correlation-Id                           |    |     |    |     |    |
   CC-Request-Number XXX  5.3    Unsigned32 | M  |  P  |    |  V  | Y  |
   CC-Request-Type   XXX  5.4    Enumerated | M  |  P  |    |  V  | Y  |
   CC-Sub-Session-Id XXX  5.5    Unsigned64 | M  |  P  |    |  V  | Y  |
   CC-Failover-Supported  5.6    Enumerated | -  |  P  |    |  V  | Y  |
   Check-Balance-    XXX  5.7    Enumerated | M  |  P  |    |  V  | Y  |
   Result                                   |    |     |    |     |    |
   Cost-Information  XXX  5.8    Grouped    | -  |  P  |    |  V  | Y  |
   Credit-Control    XXX  5.9    Enumerated | M  |  P  |    |  V  | Y  |
   Credit-Control-   XXX  5.10   Enumerated | M  |  P  |    |  V  | Y  |
   Failure-Handling                         |    |     |    |     |    |
   Direct-Debiting   XXX  5.12   Enumerated | M  |  P  |    |  V  | Y  |
   Failure-Handling                         |    |     |    |     |    |
   Final-Unit-       XXX  5.14   Unsigned32 | M  |  P  |    |  V  | Y  |
   Indication                               |    |     |    |     |    |
   Granted-Service-  XXX  5.15   Grouped    | M  |  P  |    |  V  | Y  |
   Unit                                     |    |     |    |     |    |
   Requested-Action  XXX  5.16   Enumerated | M  |  P  |    |  V  | Y  |
   Requested-Service XXX  5.17   Grouped    | M  |  P  |    |  V  | Y  |
   Unit                                     |    |     |    |     |    |
   Service-Parameter XXX  5.18   Grouped    | M  |  P  |    |  V  | Y  |
   Info                                     |    |     |    |     |    |
   Subscription-Id   XXX  5.21   Grouped    | M  |  P  |    |  V  | Y  |
   Used-Service-Unit XXX  5.26   Grouped    | M  |  P  |    |  V  | Y  |
   Validity-Time     xxx  5.28   Unsigned32 | M  |  P  |    |  V  | Y  |
   -----------------------------------------+----+-----+----+-----+----+

5.1 Abnormal-Termination-Reason AVP

   The Abnormal-Termination-Reason AVP (AVP Code TBD) is of type
   Enumerated and contains information about the reason for an abnormal
   service termination in a service element.

      The following reasons are defined:

          SERVICE_ELEMENT_TERMINATION                         0
               An error occurred in the service element.

          CONNECTION_TO_END-USER_BROKEN                       1


Hakala et al.             Expires - December 2003             [Page 39]

                   Diameter Credit Control Application        June 2003


               The connection to the end-user is broken.

5.2 CC-Correlation-Id AVP

   The CC-Correlation-Id AVP (AVP Code TBD) is type of OctetString and
   contains information to correlate credit control requests generated
   for different components of the service, e.g. transport and service
   level.

5.3 CC-Request-Number AVP

   The CC-Request-Number AVP (AVP Code TBD) is of type Unsigned32 and
   identifies this request within one session. As Session-Id AVPs are
   globally unique, the combination of Session-Id and CC-Request-Number
   AVPs is also globally unique, and can be used in matching credit
   control messages with confirmations.  An easy way to produce unique
   numbers is to set the value to 0 for credit control request of type
   INITIAL_REQUEST and EVENT_REQUEST, and set the value to 1 for the
   first UPDATE_REQUEST, 2 for the second, and so on until the value for
   TERMINATION_REQUEST.

5.4 CC-Request-Type AVP

   The CC-Request-Type AVP (AVP Code TBD) is of type Enumerated and
   contains the reason for sending the Credit-control request message.
   It MUST be present in all CC-Request messages. The following values
   are defined for the CC-Request-Type AVP:

         INITIAL_REQUEST             1
            A Credit-control Initial request is used to initiate a
            credit control session, and contains credit control
            information that is relevant to the initiation of the
            session.

         UPDATE_REQUEST             2
            An Update Credit-control request contains credit control
            information for an existing credit control session. Update
            Credit-control requests SHOULD be sent every time a credit-
            control re-authorization is needed at the expiry of the
            allocated quota or validity time. Further, additional
            service-specific events MAY trigger a spontaneous Update
            request.

         TERMINATION_REQUEST         3
            A Credit-control Termination Request is sent to terminate a
            credit-control session and contains credit control
            information relevant to the existing session.

        EVENT_REQUEST               4


Hakala et al.             Expires - December 2003             [Page 40]

                   Diameter Credit Control Application        June 2003


            A Credit Control Event Request is used when there is no need
            to maintain any credit control session state in the credit-
            control server. This request contains all information
            relevant to the service, and is the only request of the
            service. The reason for the Event request
            is further detailed in the Requested-Action AVP. The
            Requested-AVP MUST be included in the Credit-Control-Request
            message when CC-Request-Type is set to EVENT_REQUEST.

5.5 CC-Session-Failover AVP

   The CC-Session-Failover AVP is type of Enumerated and contains
   information whether the moving of the credit-control message stream
   to a backup server during an ongoing credit-control session is
   supported. In case of communication failures, the credit control
   message streams can be moved to an alternative destination if the
   credit control server supports failover to an alternative server. The
   secondary credit control server name, if received from the AAA
   server, can be used as an address of the backup server. An
   implementation is not required to support the moving of credit
   control message stream to an alternative server, since it requires
   also moving of information related to the credit control session to
   backup server.

   The following values are defined for the CC-Session-Failover AVP:

   FAILOVER_NOT_SUPPORTED                                  0

   When the CC-Session-Failover AVP is set to FAILOVER_NOT_SUPPORTED the
   Credit control message stream MUST NOT to be moved to alternative
   destination in case of communication failure.

   This is the default behavior if the AVP isn't included in the reply
   from the authorization or credit-control server.

   FAILOVER SUPPORTED                                      1

   When the CC-Session-Failover AVP is set to FAILOVER_SUPPORTED, the
   Credit control message stream SHOULD be moved to alternative
   destination in case of communication failure. The moving the credit
   control message stream to backup server MAY require that information
   related to the credit control session should be also forwarded to
   alternative server.


5.6 CC-Sub-Session-Id AVP




Hakala et al.             Expires - December 2003             [Page 41]

                   Diameter Credit Control Application        June 2003


   The CC-Sub-Session-Id AVP (AVP Code 287) is of type Unsigned64 and
   contains the credit-control sub-session identifier. The combination
   of the Session-Id and this AVP MUST be unique per sub-session, and
   the value of this AVP MUST be monotonically increased by one for all
   new sub-sessions. The absence of this AVP implies no sub-sessions are
   in use, with the exception of a CC-Request whose CC-Request-Type is
   set to TERMINATION_REQUEST. A TERMINATION_REQUEST message with no CC-
   Sub-Session-Id AVP present will signal the termination of all sub-
   sessions for a given Session-Id.


5.7 Check-Balance-Result AVP

   The Check Balance Result AVP (AVP code TBD) is of type Enumerated and
   contains the result of the balance check. This AVP is applicable only
   when the Requested-Action AVP indicates CHECK_BALANCE in the Credit-
   Control-Request command.

   The following values are defined for the Check-Balance-Result AVP.

         ENOUGH_CREDIT                                       0
              There is enough credit in the account to cover the
              requested service.

         NO_CREDIT                                           1
               There isn't enough credit in the account to cover the
               requested service.

5.8 Cost-Information AVP

   The Cost-Information AVP (AVP Code TBD) is of type Grouped and is
   used to return the cost information of a service in the Credit-
   Control-Answer command. The included Unit-Value AVP contains the cost
   estimate (always type of money) of the service in case of price
   enquiry or the accumulated cost estimation in the case of credit-
   control session.

   The Currency-Code specifies in which currency the cost was given.

   When the Requested-Action AVP with value PRICE_ENQUIRY is included in
   the Credit-Control-Request command the Cost-Information AVP sent in
   the succeeding Credit-Control-Answer command contains the cost
   estimation of the requested service, without any reservation being
   made.

   The Cost-Information AVP included in the Credit-Control-Answer
   command with the CC-Request-Type set to UPDATE_REQUEST contains the
   accumulated cost estimation for the session without taking any
   credit-reservation into account.


Hakala et al.             Expires - December 2003             [Page 42]

                   Diameter Credit Control Application        June 2003



   The Cost-Information AVP included in the Credit-Control-Answer
   command with the CC-Request-Type set to EVENT_REQUEST or
   TERMINATION_REQUEST contains the estimated total cost for the
   requested service.

      It has the following ABNF grammar:

             <Cost-Information>::=< AVP Header: TBD >
                                  { Unit-Value }
                                  { Currency-Code }

5.9 Credit-Control AVP

   The Credit-Control AVP (AVP Code TBD) is of type Enumerated and MUST
   be included in AA requests when service element has credit control
   capabilities.

   CREDIT_AUTHORIZATION                                            0

     If the AAA server determines the user is a prepaid user, this value
     indicates that credit-control server MUST be contacted to perform
     the first interrogation. The value of the Credit-Control AVP MUST
     always be set to 0 in AA request sent to perform the first
     interrogation and initiate a new credit-control session.

   RE_AUTHORIZATION                                         1

     This value indicates to the Diameter AAA server that a credit-
     control session is ongoing for the subscriber and the credit-
     control server MUST not be contacted. The Credit-Control AVP set to
     the value of 1 is to be used only when the first interrogation has
     been successfully performed and the credit-control session is
     ongoing (i.e. re-authorization triggered by Authorization-
     Lifetime). This value MUST NOT be used in AA request sent to
     perform the first interrogation.

5.10 Credit-Control-Failure-Handling AVP

   The Credit-Control-Failure-Handling AVP (AVP Code TBD) is of type
   Enumerated. The credit-control client uses information in this AVP to
   decide what to do if the sending of credit-control messages to the
   credit-control server has been for instance temporarily prevented due
   to a network problem.

   TERMINATE                                                0

   When the Credit-Control-Failure-Handling AVP is set to TERMINATE the
   service MUST only be granted as long as there is a connection to the


Hakala et al.             Expires - December 2003             [Page 43]

                   Diameter Credit Control Application        June 2003


   credit-control server. If the credit-control client does not receive
   any Credit-Control-Answer message within the Tx timer (as defined in
   section 10) the credit-control request is regarded failed. The moving
   of already started credit-control session to alternative server is
   not allowed.

   This is the default behavior if the AVP isn't included in the reply
   from the authorization or credit-control server.

   CONTINUE                                                 1

   When the Credit-Control-Failure-Handling AVP is set to CONTINUE the
   service SHOULD be granted even if credit-control messages can't be
   delivered.

5.11 Currency-Code AVP

   The Currency-Code AVP (AVP Code TBD) is of type Unsigned32 and
   contains a currency code that specifies in which currency the values
   of AVPs containing monetary units were given. It is specified using
   the numeric values defined in the ISO 4217 standard.

5.12 Direct-Debiting-Failure-Handling AVP

   The Direct-Debiting-Failure-Handling AVP (AVP Code TBD) is of type
   Enumerated. The credit-control client uses information in this AVP to
   decide what to do if the sending of credit-control messages
   (Requested-Action AVP set to Direct Debiting) to the credit-control
   server has been for instance temporarily prevented due to a network
   problem.

       TERMINATE_OR_BUFFER                                   0
       When the Direct-Debiting-Failure-Handling AVP is set to
       TERMINATE_OR_BUFFER the service MUST be granted as long as there
       is a connection to the credit-control server. If the credit-
       control client does not receive any Credit-Control-Answer message
       within the Tx timer (as defined in section 10) the credit-control
       request is regarded failed. The client SHOULD terminate the
       service if it can determine from the failed answer that units
       have not been debited. Otherwise the credit-control client
       SHOULD grant the service, store the request to application level
       non-volatile storage and try to re-send the request.  These
       requests MUST be marked as possible duplicate by setting the T-
       flag in the command header as described in [DIAMBASE] section 3.

       This is the default behavior if the AVP isn't included in the
       reply from the authorization server.

       CONTINUE                                                1


Hakala et al.             Expires - December 2003             [Page 44]

                   Diameter Credit Control Application        June 2003


       When the Direct-Debiting-Failure-Handling AVP is set to CONTINUE
       the service SHOULD be granted even if credit-control messages
       can't be delivered.

5.13 Exponent AVP

   Exponent AVP is of type Integer32 (AVP code TBD) and contains the
   exponent value to be applied for the Value-Digit AVP within the Unit-
   Value AVP.

5.14 Final-Unit-Indication AVP

   The Final-Unit-Indication AVP (AVP Code TBD) is of type Unsigned32
   and indicates that the Granted-Service-Unit AVP in the accounting
   command contains the final units for the service. After these units
   have expired, the Diameter credit-control client is responsible for
   terminating the service and sending the TERMINATION_REQUEST to the
   credit-control server.

   If more than one unit types are received in the Credit-Control-
   Answer, the Unit type which first expired SHOULD cause the
   termination.

   If included in a command, the value of this AVP is always 1.

5.15 Granted-Service-Unit AVP

   Granted-Service-Unit AVP (AVP Code TBD) is of type Grouped and
   contains the amount of units that the Diameter credit-control client
   can provide to the end user until the service must be released or the
   new Credit-Control-Request must be sent. The Unit-Value AVP contains
   the granted units and the Unit-Type AVP defines the type of the unit.

   If the Unit-Type AVP is set to time in the Credit-Control-Answer or
   AA Answer command, the Unit Value AVP specifies the granted time in
   seconds.

   If the Unit-Type AVP is set to volume in the Credit-Control-Answer or
   AA Answer command, the Unit-Value AVP specifies the granted volume in
   bytes.

   If the Unit-Type AVP is set to service specific in the Credit-
   Control-Answer command or AA Answer, the Unit-Value AVP specifies the
   granted number of service specific units (e.g. number of events,
   points) given in a selected service.

   If the Unit-Type AVP is set to money in the Credit-Control-Answer or
   AA answer command, the Unit-Value AVP specifies the granted monetary



Hakala et al.             Expires - December 2003             [Page 45]

                   Diameter Credit Control Application        June 2003


   amount in the given currency. If the unit type is money, a Currency-
   Code AVP SHOULD be included.

   It has the following ABNF grammar:

             <Granted-Service-Unit>::=< AVP Header: TBD >
                                          { Unit-Type }
                                          { Unit-Value }
                                          [ Currency-Code ]

5.16 Requested-Action AVP

   The Requested-Action AVP (AVP Code TBD) is type of Enumerated and
   contains the requested action being sent by Credit-Control-Request
   command where the CC-Request-Type is set to EVENT_REQUEST. The
   following values are defined for the Requested-Action AVP:

       DIRECT DEBITING                              0
       Direct debiting indicates that the request is to decrease the
       end user's account according to information specified in the
       Requested-Service-Unit AVP and/or Service-Parameter-Info AVP.
       The Granted-Service Unit AVP in the Credit-Control-Answer command
       contains the debited units.

       REFUND ACCOUNT                               1
       Refund account indicates that the request is to increase the end
       user's account according to information specified in the
       Requested-Service-Unit AVP and/or Service-Parameter-Info AVP.
       The Granted-Service Unit AVP in the Credit-Control-Answer command
       contains the refunded units.

       CHECK_BALANCE                                2
       Check balance indicates that the request is a balance check
       request. In this case the checking of the account balance is
       done without any credit reservation from the account. The Check-
       Balance-Result AVP in the Credit-Control-Answer command contains
       the result of the Balance Check.

       PRICE_ENQUIRY                                3
       Price Enquiry indicates that the request is a price enquiry
       request. In this case neither checking of the account balance
       nor reservation from the account will be done, only the price of
       the service will be returned in the Cost-Information AVP in the
       Credit-Control-Answer Command.

5.17 Requested-Service-Unit AVP

   The Requested-Service-Unit AVP (AVP Code TBD) is of type Grouped and
   contains the amount of requested units specified by the Diameter


Hakala et al.             Expires - December 2003             [Page 46]

                   Diameter Credit Control Application        June 2003


   credit-control client. The included Unit-Value AVP contains the
   requested Unit-Value and the Unit-Type AVP defines the type of the
   unit. A server is not required to implement all of the unit types,
   and must treat unknown or unsupported unit types as invalid AVP
   values.

   If the Unit Type AVP is set to time in the Credit-Control-Request
   command, the Unit-Value AVP specifies the requested time in seconds.

   If the Unit-type AVP is set to volume in the Credit-Control-Request
   command, the Unit-Value AVP specifies the requested volume in bytes.

   If the Unit-type AVP is set to service specific in the Credit-
   Control-Request command, the Unit-Value AVP specifies the requested
   number of service specific units (e.g. number of events) given in a
   selected service.

   If the Unit-Type AVP is set to money in the Credit-Control-Request
   command, the Unit-Value AVP specifies the monetary amount in the
   given currency. If the unit type is money, a Currency-Code AVP SHOULD
   be included.

   It has the following ABNF grammar:

             <Requested-Service-Unit>::=< AVP Header: TBD >
                                      { Unit-Type }
                                      { Unit-Value }
                                      [ Currency-Code ]

5.18 Service-Parameter-Info AVP

   The Service-Parameter-Info AVP (AVP Code TBD) is of type Grouped and
   contains a service specific information used for price calculation or
   rating. The Service-Parameter-Type AVP defines the service parameter
   type and the Service-Parameter-Value AVP contains the parameter
   value. The actual contents of these AVPs are not within the scope of
   this document and SHOULD be defined in another Diameter application,
   standards written by other standardization bodies, or service
   specific documentation.

   In case of unknown service request (e.g. unknown Service-Parameter-
   Type), the corresponding answer message MUST contain error code
   DIAMETER_RATING_FAILED. A Credit Control Answer message with this
   error MUST contain one or more Failed-AVP AVPs containing the
   Service-Parameter-Info AVPs that caused the failure.

   It has the following ABNF grammar:




Hakala et al.             Expires - December 2003             [Page 47]

                   Diameter Credit Control Application        June 2003


             <Service-Parameter-Info>::=< AVP Header: TBD >
                                      [ Service-Parameter-Type ]
                                      [ Service-Parameter-Value ]

5.19 Service-Parameter-Type AVP

   The Service-Parameter-Type AVP is of type Unsigned32 (AVP Code TBD)
   and defines the type of the service event specific parameter (e.g. it
   can be end-user location, service name). The different parameters and
   their types are service specific and the meanings of these parameters
   are not defined in this document. The Service-Parameter-Value AVP
   contains the service parameter type.

5.20 Service-Parameter-Value AVP

   The Service-Parameter-Value AVP is of type UTF8String (AVP Code TBD)
   and contains the value of the service parameter type.

5.21 Subscription-Id AVP

   The Subscription-Id AVP (AVP Code TBD) is used to identify the end
   user's subscription and is of type Grouped.  The Subscription-Id AVP
   includes a Subscription-Id-Data AVP that hold the identifier and a
   Subscription-Id-Type AVP that defines the identifier type.

   It has the following ABNF grammar:

                    <Subscription-Id>::=< AVP Header: TBD >
                                      { Subscription-Id-Data }
                                      { Subscription-Id-Type }

5.22 Subscription-Id-Data AVP

   The Subscription-Id-Data AVP (AVP Code TBD) is used to identify the
   end-user and is of type UTF8String. The Subscription-Id-Type AVP
   defines which type of identifier is used.

5.23 Subscription-Id-Type AVP

   The Subscription-Id-Type AVP (AVP Code TBD) is of type Enumerated and
   it is used to determine which type of identifier that is carried by
   the Subscription-Id AVP. A server is not required to implement all of
   the Subscription-Id-Types, and MUST treat unknown or unsupported
   Subscription-Id-Types as invalid AVP values.

   The identifier can be one of the following:

      END_USER_MSISDN                                              0



Hakala et al.             Expires - December 2003             [Page 48]

                   Diameter Credit Control Application        June 2003


           The identifier is in international MSISDN format, according
           to the ITU-T E.164 numbering plan as defined in [E164] and
           [CE164].

       END_USER_IMSI                                                1
           The identifier is in international IMSI format, according to
           the ITU-T E.212 numbering plan as defined in [E121] and
           [CE121].

       END_USER_SIP_URL                                             2
          The identifier is in the form of a SIP URL as defined in
          [SIP].

       END_USER_NAI                                                 3
           The identifier is in the form of a Network Access Identifier
           as defined in [NAI].

       END_USER_PRIVATE                                             4
           The Identifier is a credit-control server private identifier.

5.24 Unit-Type AVP

   The Unit-Type AVP is of type Enumerated (AVP Code TBD) and contains
   the type of the unit.

   The unit type can be one of the following:

       CREDIT_TYPE_TIME                                             0
       The unit is of type time, given in seconds.

       CREDIT_TYPE_VOLUME                                           1
       The unit is of type volume, given in bytes.

       CREDIT_TYPE_SERVICE_SPECIFIC                                 2
       The unit is service specific (e.g. number of events,
       points, chips, services etc), given in a selected service.

       CREDIT_TYPE_MONEY                                            3
       The unit is of type money, given as a monetary value, whose
       currency SHOULD be specified by the Currency-Code AVP.

5.25 Unit-Value AVP

   Unit-Value AVP is of type Grouped (AVP Code TBD). The value can be
   time in seconds, volume in bytes, number of service specific units or
   monetary amount depending on the given unit type. The Unit-Value is a
   value together with an exponent, i.e. Unit-Value = Value-Digits AVP *
   10^Exponent. This representation avoids unwanted rounding off. For
   example the value of 2,3 is represented as Value-Digits = 23 and


Hakala et al.             Expires - December 2003             [Page 49]

                   Diameter Credit Control Application        June 2003


   Exponent = -1. The absence of exponent part MUST be interpreted as
   exponent being equal to zero.

   It has the following ABNF grammar:

                   <Unit-Value>::=< AVP Header: TBD >
                                  { Value-Digits }
                                  [ Exponent ]

5.26 Used-Service-Unit AVP

   The Used-Service-Unit AVP is of type Grouped AVP (AVP Code TBD) and
   contains the amount of used 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 included Unit-Type AVP defines the type of the unit and
   the Unit-Value AVP contains the used amount.

   If the Unit Type AVP is set to time in the Credit-Control-Request
   command, the Unit-Value AVP specifies the used time in seconds.

   If the Unit-Type AVP is set to volume in the Credit-Control-Request
   command, the Unit-Value AVP specifies the used volume in bytes.

   If the Unit-type AVP is set to service specific in the Credit-
   Control-Request command, the Unit-Value AVP specifies the used number
   of service specific units (e.g. number of events) given in a selected
   service.

   If the Unit-Type AVP is set to money in the Credit-Control-Request
   command, the Unit-Value AVP specifies the used monetary amount in the
   given currency. If the unit type is money, a Currency-Code AVP SHOULD
   be included.

   It has the following ABNF grammar:
                 <Used-Service-Unit>::=< AVP Header: TBD >
                                       { Unit-Type }
                                       { Unit-Value }
                                       [ Currency-Code ]

5.27 Value-Digits AVP

   The Value-Digits AVP is of type Unsigned64 (AVP code TBD) and
   contains the number of seconds, volume in bytes, number of service
   specific units or monetary amount depending on the given Unit-Type
   AVP. If decimal values are needed to present the units, the scaling
   MUST be indicated with the related Exponent AVP. For example for the
   monetary amount $ 0.05 the value of Value-Digits AVP MUST be set to 5
   and the scaling MUST be indicated with the Exponent AVP set to -2.


Hakala et al.             Expires - December 2003             [Page 50]

                   Diameter Credit Control Application        June 2003



5.28 Validity-Time AVP

   The Validity-Time AVP is of type Unsigned32 (AVP code TBD) and is
   sent from the credit-control server to the credit-control client. The
   AVP contains the validity time of the granted service units. If the
   granted service units have not been consumed within the validity time
   specified in this AVP, the credit-control client MUST send a Credit-
   Control-Request request to the server with CC-Request-Type set to
   UPDATE_REQUEST. The value field of the Validity-Time AVP is given in
   seconds.


6. Result Code AVP values

   This section defines new Result-Code AVP [DIAMBASE] values that must
   be supported by all Diameter implementations that conform to this
   specification.

   The Credit-Control-Answer message includes the Result-Code AVP, which
   MAY indicate that an error was present in the Credit-Control-Request
   message. A rejected Credit-Control-Request message SHOULD cause the
   user's session to be terminated.

6.1 Transient Failure

   Errors that fall within the transient failures category are used to
   inform a peer that the request could not be satisfied at the time it
   was received, but MAY be able to satisfy the request in the future.

        DIAMETER_END_USER_SERVICE_DENIED                         40XX
        The credit-control server denies the service request due to
        service restrictions or limitations related to the end-user,
        for example the end-user's account could not cover the requested
        service. The possibly reported used-service-units with the CCR
        are deducted.

        DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE                   40XX
        The credit-control server determines that the service can be
        granted to the end user but no further credit-control is needed
        for the service (e.g. service is free of charge).

6.2 Permanent Failures

   Errors that fall within permanent failure category are used to inform
   the peer that the request failed, and should not be attempted again.

         DIAMETER_USER_UNKNOWN                                    50XX
         The specified end user is unknown in the credit-control server.


Hakala et al.             Expires - December 2003             [Page 51]

                   Diameter Credit Control Application        June 2003



         DIAMETER_RATING_FAILED                                   50xx
         This error code is used to inform the credit-control client
         that the credit-control server cannot rate the service request
         due to insufficient rating input, incorrect AVP combination or
         due to an AVP or an AVP value that is not recognized or
         supported in the rating. The Failed-AVP AVP MUST be included
         and contain a copy of the entire AVP(s) that could not be
         processed successfully or an example of the missing AVP
         complete with the Vendor-Id if applicable. The value field of
         the missing AVP should be of correct minimum length and contain
         zeroes.

7. AVP Occurrence Table

   The following table presents the AVPs defined in this document, and
   specifies in which Diameter messages they MAY, or MAY NOT be present.
   Note that AVPs that can only be present within a Grouped AVP are not
   represented in this table.

   The table uses the following symbols:
         0     The AVP MUST NOT be present in the message.
         0+    Zero or more instances of the AVP MAY be present in the
               message.
         0-1   Zero or one instance of the AVP MAY be present in the
               message. It is considered an error if there are more than
               once instance of the AVP.
         1     One instance of the AVP MUST be present in the message.
         1+    At least one instance of the AVP MUST be present in the
               message.

7.1 Credit Control AVP Table

   The table in this section is used to represent which Credit-control
   applications specific AVPs defined in this document are to be present
   in the Credit Control messages.















Hakala et al.             Expires - December 2003             [Page 52]

                   Diameter Credit Control Application        June 2003


                                       +-----------+
                                       |  Command  |
                                       |   Code    |
                                       |-----+-----+
         Attribute Name                | CCR | CCA |
         ------------------------------|-----+-----+
         Abnormal-Termination-Reason   | 0-1 | 0   |
         Acct-Multi-Session-Id         | 0-1 | 0-1 |
         Auth-Application-Id           | 1   | 1   |
         CC-Correlation-Id             | 0-1 | 0   |
         CC-Failover-Supported         | 0   | 0-1 |
         CC-Request-Number             | 1   | 1   |
         CC-Request-Type               | 1   | 1   |
         CC-Sub-Session-Id             | 0-1 | 0-1 |
         Check-Balance-Result          | 0   | 0-1 |
         Cost-Information              | 0   | 0-1 |
         Credit-Control-Failure-       | 0-1 | 0-1 |
         Handling                      |     |     |
         Destination-Host              | 0-1 | 0   |
         Destination-Realm             | 1   | 0   |
         Direct-Debiting-Failure-      | 0-1 | 0-1 |
         Handling AVP                  |     |     |
         Event-Timestamp               | 0-1 | 0-1 |
         Final-Unit-Indication         | 0   | 0-1 |
         Granted-Service-Unit          | 0   | 0+  |
         Origin-Host                   | 1   | 1   |
         Origin-Realm                  | 1   | 1   |
         Origin-State-Id               | 0-1 | 0-1 |
         Proxy-Info                    | 0+  | 0+  |
         Requested-Action              | 0-1 | 0   |
         Requested-Service-Unit        | 0-1 | 0   |
         Route-Record                  | 0+  | 0+  |
         Service-Parameter-Info        | 0+  | 0   |
         Session-Id                    | 1   | 1   |
         Subscription-Id               | 0-1 | 0-1 |
         Used-Service-Unit             | 0+  | 0   |
         User-Name                     | 0-1 | 0-1 |
         Validity-Time                 | 0-1 | 0-1 |
         ------------------------------|-----+-----+

8. RADIUS/Diameter Credit-control Inter-working

   This section defines some basic guidelines to provide the Diameter
   Credit- control/RADIUS inter-working, that is a protocol translation
   between RADIUS [RFC2865] and Diameter Credit-control application. A
   complete description of all protocol translations between RADIUS and
   Diameter Credit-control application is beyond the scope of this
   document. Note that this document does not restrict implementations
   from creating additional methods; it just provides some guiding


Hakala et al.             Expires - December 2003             [Page 53]

                   Diameter Credit Control Application        June 2003


   principles for protocol translation. Translation makes use of RADIUS
   Vendor Specific Attributes (VSAs) for transporting Diameter credit-
   control AVPs.

   The Diameter NASREQ [NASREQ] application defines how a RADIUS Request
   is forwarded as a Diameter Request. Guidelines defined in the
   Diameter NASREQ should be followed to the appropriate extent.

   A protocol translation between RADIUS and Diameter Credit-control
   application is shown in Annex A.

8.1 Initial RADIUS Access-Request

   When an AAA server acting as a Translation Agent receives an initial
   RADIUS Access-Request message indicating that the service element is
   capable of credit-control (e.g. Radius VSA Pre-Paid-Accounting-
   Capability), and if the AAA server determines that the subscriber is
   a prepaid subscriber then a Diameter Credit control request MUST be
   sent towards the credit-control server.

   In addition to those steps defined in [NASREQ] the AAA server should
   perform the following steps related to the protocol translation
   between RADIUS and Diameter Credit-control application:

      - The credit control Session-Id should be included in the
        Session-Id AVP.
      - The CC-Request-Type is set to INITIAL_REQUEST and CC-Request-
        Number value is set to 0.
      - Subscription-Id should be added using User-Name attribute from
        the RADIUS Access-Request message or some AAA server local Id
        to identify userÆs credit control subscription.
      - If the Access-Request message contains the Event-Timestamp
        attribute it should be included in the Event-Timestamp AVP

   The following steps are applied to response the Access-Request
   message when successful credit-control answer is received from the
   Credit-control server:

      - The AAA server shall generate a RADIUS VSA Quota Id to
        correlate subsequent RADIUS message with the credit-control
        session.
      - The Termination-Action attribute must be set to be æRADIUS-
        requestÆ to ensure that the used quota is returned by the
        service element upon termination of the service.
      - If the Granted-Service-Unit AVP with the Unit-Type Time or the
        Validity-Time AVP is returned by the credit control server,
        then the smallest value should be included in the RADIUS VSA
        Duration-Quota.



Hakala et al.             Expires - December 2003             [Page 54]

                   Diameter Credit Control Application        June 2003


      - If the Granted-Service-Unit AVP with the Unit-Type Volume is
        returned by the credit-control server, then the volume should
        be included in the RADIUS VSA Volume-Quota.
      - If separate RADIUS VSA Thresholds (volume or duration) are
        required by RADIUS implementation, the AAA server shall derive
        the threshold values from the Granted-Service-Unit AVPs. The
        threshold should be less than the Duration-Quota or Volume-
        Quota, except when the Final-Unit-Indication AVP is returned by
        the credit control server.

   When credit-control answer message includes the Result-Code, which
   indicates that credit control authorization is rejected, the AAA
   server shall send an Access-Reject message to service element.

8.2 Subsequent RADIUS Access-Request message

   When an AAA server receives a RADIUS Access-Request message
   containing RADIUS VSA Quota Id, it indicates that the Access-Request
   message is subsequent RADIUS Request related to the credit control
   session. The AAA server shall use the Quota Id to identify the
   credit-control session.

   The AAA serverÆs next steps depend on the value of the RADIUS VSA
   Update-Reason. If the Update-Reason indicates æThreshold reachedÆ
   then the AAA server should perform the following steps related to a
   new quota request:

     - The CC-Request-Type is set to UPDATE_REQUEST and CC-Request-
       Number value is increased by one.
     - If the RADIUS Access-Request message contains the RADIUS VSA
       Volume-Quota, the value shall be included in the Used-Service-
       Unit AVP and Unit-Type shall be set to Volume.
     - If the RADIUS Access-Request message contains RADIUS VSA Time-
       Quota, the value shall be included in the Used-Service-Unit AVP
       and the Unit-Type shall be set to Time.

   The reply to the RADIUS Access-Request message shall be handled as
   described in initial Radius Access-Request.

   If the RADIUS VSA Update-Reason indicates that the associated
   resources are released at the service element, then the AAA server
   shall terminate the credit control session by performing the
   following steps:

     - The CC-Request-Type is set to TERMINATION_REQUEST and CC-Request-
       Number value is increased by one.
     - If RADIUS VSA Volume-Quota, the value shall be included in the
       Used-Service-Unit AVP and Unit-Type shall be set to Volume.



Hakala et al.             Expires - December 2003             [Page 55]

                   Diameter Credit Control Application        June 2003


     - If RADIUS VSA Time-Quota, the value shall be included in the
       Used-Service-Unit AVP and the Unit-Type shall be set to Time.

   After the AAA server receives response to the final credit Control
   Credit-Control-Request the RADIUS Access-Accept message shall be
   return to the service element.

8.3 RADIUS Vendor Specific Attributes for Credit Control

   To provide the credit control for RADIUS implementation the RADIUS
   Vendor Specific Attributes (VSAs) are used for transporting Diameter
   credit-control AVPs. The RADIUS Type 26 (= Vendor-Specific) is used
   for RADIUS VSA.

   RADIUS Inter-working with the Diameter Credit control uses the
   following VSA included with the RADIUS Access Request and Access
   Accept messages:

      - Pre-Paid-Accounting-Capability; defines that the Service
        element in RADIUS implementation is capable of credit-control.
      - Quota Id; generated by the AAA server and it is used to
        correlate subsequent RADIUS message with the credit-control
        session.
      - Duration-Quota; in RADIUS Access-Request message it indicates
        the used Duration and in RADIUS Access-Accept message it
        indicates the Duration allocated for the service element.
      - Volume-Quota; in RADIUS Access-Request message it indicates the
        used Volume and in RADIUS Access-Accept message it indicates
        the Volume allocated for the service element.
      - Volume-Threshold; If RADIUS implementation requires separate
        threshold attribute for Volume, then Volume-Threshold is sent
        in RADIUS Access-Accept message and it represents the volume
        (in bytes) that shall be used by the service element before
        requesting a new Volume quota.
      - Duration-Threshold; If RADIUS implementation requires separate
        threshold attribute for Duration, then Duration-Threshold is
        sent in RADIUS Access-Accept message and it represents the
        duration (in seconds) that shall be used by the service element
        before requesting a new Duration quota.
      - Update-Reason; in RADIUS Access-Request message it indicates
        the reason for the initiating the quota update operation.

9. IANA Considerations

   This section contains the namespaces that have either been created in
   this specification, or the values assigned to existing namespaces
   managed by IANA.




Hakala et al.             Expires - December 2003             [Page 56]

                   Diameter Credit Control Application        June 2003


9.1 Application Identifier

   This specification assigns the value TBD to the Application
   Identifier namespace defined in [DIAMBASE]. See section 1.3 for more
   information.

9.2 Command Codes

   This specification uses the value XXX [TBD] from the Command code
   namespace defined in [DIAMBASE].

9.3 AVP Codes

   This specification assigns the values TBD - TBD from the AVP code
   namespace defined in [DIAMBASE] See section 4.0 for the assignment of
   the namespace in this specification.

9.4 Result-Code AVP Values

   This specification assigns the values 40XX and 50XX from the Result-
   Code AVP (AVP Code 268) value namespace defined in [DIAMBASE]. See
   section 5.0 for the assignment of the namespace in this
   specification.

9.5 Abnormal-Termination-Reason AVP

   As defined in Section 4.1, the Abnormal-Termination-Reason AVP (AVP
   Code TBD) defines the values 0-1. All remaining values are available
   for assignment via Designated Expert [IANA].

9.6 CC-Session-Failover AVP

   As defined in section 5.6, the CC-Failover-Supported AVP (AVP code
   TBD) defines the value 0-1. All remaining values are available for
   assignment via Designated Expert [IANA].

9.7 Check-Balance-Result AVP

   As defined in Section 4.3, the Check-Balance-Result AVP (AVP Code
   TBD) defines the values 0-1. All remaining values are available for
   assignment via Designated Expert [IANA].

9.8 Credit-Control-Failure-Handling AVP

   As defined in Section 4.6, the Credit-Control-Failure-Handling AVP
   (AVP Code TBD) defines the values 0-1. All remaining values are
   available for assignment via Designated Expert [IANA].




Hakala et al.             Expires - December 2003             [Page 57]

                   Diameter Credit Control Application        June 2003


9.9 Direct-Debiting-Failure-Handling AVP

   As defined in Section 4.8, the Direct-Debiting-Failure-Handling AVP
   (AVP Code TBD) defines the values 0-1. All remaining values are
   available for assignment via Designated Expert [IANA].

9.10 Requested-Action AVP

   As defined in Section 4.11, the Requested-Action AVP (AVP Code TBD)
   defines the values 0-3. All remaining values are available for
   assignment via Designated Expert [IANA].

9.11 Subscription-Id-Type AVP

   As defined in Section 4.17, the Subscription-Id-Type AVP (AVP Code
   TBD) defines the values 0-4. All remaining values are available for
   assignment via Designated Expert [IANA].

9.12 Unit-Type AVP

   As defined in Section 4.20, the Unit-Type AVP (AVP Code TBD) defines
   the values 0-3. All remaining values are available for assignment via
   Designated Expert [IANA].

10. Credit-control Application Related Parameters

   Tx timer

      When real-time credit-control is required, the credit-control
      client contacts the credit-control server before and during the
      service is provided to an end user. Due to real-time nature of
      application the communication delays SHOULD be minimized, e.g. to
      avoid too long service set up time experienced by the end user.
      The Tx timer is introduced to control the waiting time in the
      client in the PENDING state.

      The recommended value is 10 seconds.

   Tcc timer

     The Tcc timer supervises an ongoing credit control session in the
      credit control server. It is RECOMMENDED to use the Validity-Time
      as input to set the Tcc timer value. To avoid the credit control
      session in the Diameter credit control server to change to Idle
      state in case of short transient network failure, Tcc MAY be set
      to two times the value of Validity-Time.

   Credit-Control-Failure-Handling and Direct-Debiting-Failure-Handling



Hakala et al.             Expires - December 2003             [Page 58]

                   Diameter Credit Control Application        June 2003


      Client implementations may offer the possibility to locally
      configure these AVPs. In such a case their value and behavior is
      defined in section 4.1.4 for the Credit-Control-Failure-Handling
      and in section 4.7 for the Direct-Debiting-Failure-Handling.

      The credit control server may override the failure handling by
      including for credit control session by including the Credit-
      Control-Failure-Handling AVP in the Credit-Control-Answer
      command.

11. Security Considerations

   The security models as defined in the Diameter base protocol
   [DIAMBASE] applies to this application too.

12. References

12.1 Normative

   [DIAMBASE]  P. Calhoun, J. Arkko, E. Guttman, G. Zorn, J. Loughney
               "Diameter Base Protocol", IETF work in progress.

   [3GPPCHARG] 3rd Generation Partnership Project; Technical
               Specification Group Services and System Aspects, Service
               aspects; Charging and Billing, (release 5), 3GPP TS
               22.115 v. 5.2.1, 2002-03

   [SIP]       M. Handley, H. Schulzrinne, E. Schooler, J. Rosenberg, G.
               Camarillo, A. Johnston, J. Peterson, R. Sparks
               "SIP: Session Initiation Protocol", RFC 3261. June 2002.

   [NAI]       Aboba, Beadles "The Network Access Identifier." RFC 2486.
               January 1999.

   [E164]      Recommendation E.164/I.331 (05/97): The International
               Public Telecommunication Numbering Plan. 1997.

   [CE164]     Complement to ITU-T Recommendation E.164 (05/1997):"List
               of
               ITU-T Recommendation E.164 assigned country codes", June
               2000.

   [E212]      Recommendation E.212 (11/98): The international
               identification plan for mobile terminals and mobile
               users.
               1998.

   [CE212]     Complement to ITU-T Recommendation E.212 (11/1997):" List
               of mobile country or geographical area codes ", February


Hakala et al.             Expires - December 2003             [Page 59]

                   Diameter Credit Control Application        June 2003


               1999.

   [IANA]      Narten, Alvestrand, "Guidelines for Writing an IANA
               Considerations Section in RFCs", BCP 26, RFC 2434,
               October
               1998

12.2 Non-Normative

   [KEYWORDS]  S.Bradner, "Key words for use in RFCs to Indicate
               Requirement Levels", BCP 14, RFC 2119, March 1997.

   [ACCMGMT]   B.Aboba, J.Arkko, D.Harrington. "Introduction to
               Accounting Management", RFC 2975, October 2000.

   [RFC2866]   C.Rigney. "Radius Accounting", RFC 2866, June 2000

   [NASREQ]    P. Calhoun, G. Zorn, D. Spence, D. Mitton. "Diameter
               NASREQ Application", IETF work in progress.

   [DIAMMIP]   P. Calhoun, T. Johansson, C. Perkins "Diameter Mobile IP
               Application",
               IETF work in progress.

   [RFC2865]   C. Rigney, S. Willens, A. Rubens, W. Simpson.
               "Remote Authentication Dial In User Service (RADIUS), RFC
               2865, June 2000

13. Acknowledgement

   The authors would like to thank Bernard Aboba, Avi Lior, Paco Marin
   and our colleagues at Ericsson and Nokia for their comments and
   suggestions.

14. Author's Address

   Harri Hakala
   Oy L M Ericsson Ab
   Joukahaisenkatu 1
   20520 Turku
   Finland
   Phone: +358 2 265 3722
   EMail: Harri.Hakala@ericsson.fi

   Leena Mattila
   Oy L M Ericsson Ab
   Joukahaisenkatu 1
   20520 Turku
   Finland


Hakala et al.             Expires - December 2003             [Page 60]

                   Diameter Credit Control Application        June 2003


   Phone: +358 2 265 3731
   EMail: Leena.Mattila@ericsson.fi

   Juha-Pekka Koskinen
   Nokia Networks
   Hatanpaanvaltatie 30
   33100 Tampere
   Finland

   Phone: +358 7180 74027
   Email: juha-pekka.koskinen@nokia.com

   Marco Stura
   Nokia Networks
   Valimotie 21
   00380 Helsinki
   Finland
   Phone: +358 7180 64308
   Email: marco.stura@nokia.com

   John Loughney
   Nokia Research Center
   Itamerenkatu 11-13
   00180 Helsinki
   Finland
   Phone: +358 50 483 642
   Email: John.Loughney@nokia.com

15. Full Copyright Statement

   Copyright (C) The Internet Society (2003). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English. The limited permissions granted above are perpetual and will
   not be revoked by the Internet Society or its successors or assigns.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING


Hakala et al.             Expires - December 2003             [Page 61]

                   Diameter Credit Control Application        June 2003


   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

16. Notices

   The IETF takes no position regarding the validity or scope of any
   intellectual property or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; neither does it represent that it
   has made any effort to identify any such rights.  Information on the
   IETF's procedures with respect to rights in standards-track and
   standards-related documentation can be found in BCP-11.  Copies of
   claims of rights made available for publication and any assurances of
   licenses to be made available, or the result of an attempt made to
   obtain a general license or permission for the use of such
   proprietary rights by implementors or users of this specification can
   be obtained from the IETF Secretariat.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights, which may cover technology that may be required to practice
   this standard.  Please address the information to the IETF Executive
   Director.

17. Expiration Date

   This memo is filed as <draft-ietf-aaa-diameter-cc-00.txt> and expires
   in December 2003.

Appendix A Credit Control sequences

A.1 Flow I
















Hakala et al.             Expires - December 2003             [Page 62]

                   Diameter Credit Control Application        June 2003



   End-User              NAS             AAA Server           CC Server
                     (CC Client)
      |(1)User Logon      |(2)AA Request (CC AVPs)                  |
      |------------------>|------------------->|                    |
      |                   |                    |(3)CCR(initial, CC AVPs)
      |                   |                    |------------------->|
      |                   |                    | (4)CCA(granted Units)
      |                   |                    |<-------------------|
      |                   |(5)AA Answer(granted Units)              |
      |(6)Access granted  |<-------------------|                    |
      |<----------------->|                    |                    |
      |                   |                    |                    |
      :                   :                    :                    :
      |                   |(7)CCR(update,used Units)                |
      |                   |------------------->|(8)CCR              |
                                                  (update,used units)
      |                   |                    |------------------->|
      |                   |                    |(9)CCA(granted Units)
      |                   |(10)CCA(granted Units)<------------------|
      |                   |<-------------------|                    |
      :                   :                    :                    :
      |         (Auth. lifetime expires)       |                    |
      |                   |(11) AAR (CC AVP)   |                    |
      |                   |------------------->|                    |
      |                   |          (12) AAA  |                    |
      |                   |<-------------------|                    |
      :                   :                    :                    :
      :                   :                    :                    :
      |(13) User logoff   |                    |                    |
      |------------------>|(14)CCR(term.,used-Units)                |
      |                   |------------------->|(15)CCR             |
      |                   |                    |   (term.,used-Units)
      |                   |                    |------------------->|
      |                   |                    |            (16)CCA |
      |                   |            (17)CCA |<-------------------|
      |                   |<-------------------|                    |
      |                   |(18)STR             |                    |
      |                   |------------------->|                    |
      |                   |            (19)STA |                    |
      |                   |<-------------------|                    |

                            Figure A.1: Flow I

   A credit control flow for Network Access Services prepaid is shown in
   Figure A.1. The Diameter [NASREQ] is implemented in the Network
   Access Server (NAS). The focus of this flow is in the credit
   authorization.



Hakala et al.             Expires - December 2003             [Page 63]

                   Diameter Credit Control Application        June 2003


   The user logs onto the network (1). The Diameter NAS first sends a
   Diameter Authorization-Authentication-Request to the home AAA
   Server, the credit-control client populates the AAR with the Credit-
   Control AVP set to CREDIT_AUTHORIZATION and service specific AVPs
   are included as usual [NASREQ]. The home AAA server performs service
   specific Authentication and Authorization as usual. The AAA server
   determines that the user is a prepaid user and notices from the
   Credit-Control AVP that the NAS has credit control capabilities, it
   sends a Diameter Credit-Control-Request with CC-Request-Type set to
   INITIAL_REQUEST to the Diameter credit-control server to perform
   credit authorization (3) and to establish a credit control session
   (the AAA server may forward service specific AVPs as received from
   the NAS as input for the rating process). The Diameter credit-
   control server checks the end user's account balance, rates the
   service and reserves credit from the end user's account. The
   reserved quota is returned to the Home AAA server in the Diameter
   Credit-Control-Answer (4). The Home AAA server sends the reserved
   quota to the NAS in the Diameter Authorization-Authentication-
   Answer. Upon successful AAA the NAS starts the credit-control
   session and starts monitoring the granted units (5). The NAS grant
   access to the end user (6). At the expiry of the allocated quota,
   the NAS sends a Diameter Credit-Control-Request with CC-Request-Type
   set to UPDATE_REQUEST to the Home AAA server (7). This message
   contains the units used this far. The AAA server forwards the CCR to
   the Diameter credit-control server (8). The Diameter credit-control
   server debits the used units from the end user's account and
   allocates a new quota that is returned to the Home AAA server in the
   Diameter Credit-Control-Answer (9). The message is forwarded to the
   NAS (10). During the ongoing credit-control session the
   authorization-lifetime expires, the authorization/authentication
   client in the NAS performs service specific re-authorization to the
   Home AAA server as usual. The credit-control client populate the AAR
   with the Credit-Control AVP set to RE_AUTHORIZATION indicating that
   the credit-control server shall not be contacted, since the credit
   authorization is controlled by the burning rate of the granted units
   (11). The Home AAA server performs service specific re-authorization
   as usual and returns the Authorization-Authentication-Answer to the
   NAS (12). The end user logs off from the network (13). To debit the
   used units from the end user's account and to stop the credit
   control session, the NAS sends a Diameter Credit-Control-Request
   with CC-Request-Type set to TERMINATION_REQUEST to the Home AAA
   server (14). The AAA server forwards the CCR to the credit-control
   server (15). The Diameter credit-control server acknowledges the
   session termination by sending a Diameter Credit-Control-Answer to
   the Home AAA server (16). The AAA server forwards the answer to the
   NAS (17). STR/STA take place between NAS and Home AAA server as
   usual (18-19).




Hakala et al.             Expires - December 2003             [Page 64]

                   Diameter Credit Control Application        June 2003


A.2 Flow II


                                 AAA Server
            NAS                  (CC Client)             CC Server
             |(1)  Access-Request     |                        |
             |----------------------->|                        |
             |                        |(2) CCR (initial)       |
             |                        |----------------------->|
             |                        |(3) CCA (granted_Units) |
             |                        |<-----------------------|
             |(4)  Access-Accept      |                        |
             |     (granted Units)    |                        |
             |<-----------------------|                        |
             :                        :                        :
             |(5)  Access-Request     |                        |
             |     (used Units)       |                        |
             |----------------------->|                        |
             |                        |(6) CCR (update,        |
             |                        |         used Units,    |
             |                        |----------------------->|
             |                        |(7) CCA (granted_Units) |
             |                        |<-----------------------|
             |(8)  Access-Accept      |                        |
             |     (granted Units)    |                        |
             |<-----------------------|                        |
             :                        :                        :
             |(9)  Access-Request     |                        |
             |----------------------->|                        |
             |                        |(10) CCR (termin.,      |
             |                        |          used Units)   |
             |                        |----------------------->|
             |                        |(11) CCA                |
             |                        |<-----------------------|
             |(12) Access-Accept      |                        |
             |<-----------------------|                        |
             |                        |                        |

                            Figure A.2: Flow II

   A credit control flow for RADIUS prepaid - Diameter credit control
   interworking is shown in Figure A.2. The focus of this flow is in the
   AAA Server (Diameter credit-control client) and Diameter credit-
   control server interworking.

   The NAS first sends a RADIUS Access-Request to the home AAA Server
   (1). The home AAA server performs regular Authentication and
   Authorization. When the AAA server notices that the user is a prepaid
   user it sends a Diameter Credit-Control-Request with CC-Request-Type


Hakala et al.             Expires - December 2003             [Page 65]

                   Diameter Credit Control Application        June 2003


   set to INITIAL_REQUEST to the Diameter credit-control server to
   perform credit authorization (2) and to establish a credit control
   session. The Diameter credit-control server checks the end user's
   account balance, rates the service and reserves credit from the end
   user's account. The reserved quota is returned to the Home AAA server
   in the Diameter Credit-Control-Answer (3). The Home AAA server sends
   the reserved quota to the NAS in the RADIUS Access-Accept (4). At the
   expiry of the allocated quota, the NAS sends a new RADIUS Access-
   Request to the Home AAA server (5). This message contains the units
   used this far. The units are reported to the Diameter credit-control
   server in a Diameter Credit-Control-Request (UPDATE_REQUEST) (6). The
   Diameter credit-control server debits the used units from the end
   user's account and allocates a new quota that is returned to the Home
   AAA server in the Diameter Credit-Control-Answer (7). The quota is
   transferred to the NAS in the RADIUS Access-Accept (8). When the end
   user terminates the service the NAS sends a RADIUS Access-Request
   (9). To debit the used units from the end user's account and to stop
   the credit control session, the Home AAA server sends a Diameter
   Credit-Control-Request (TERMINATION_REQUEST) to the credit-control
   server (10). The Diameter credit-control server acknowledges the
   session termination by sending a Diameter Credit-Control-Answer to
   the Home AAA server (11). The RADIUS Access-Accept is sent to the NAS
   (12).

A.3 Flow III


























Hakala et al.             Expires - December 2003             [Page 66]

                   Diameter Credit Control Application        June 2003


              SIP Proxy/Registrar   AAA
        A           (CC Client)     Server           B        CC Server
        |(i)  REGISTER |              |              |              |
        |------------->|(ii)          |              |              |
        |              |------------->|              |              |
        |              |authentication &             |              |
        |              |authorization |              |              |
        |              |<-------------|              |              |
        |(iii)200 OK   |                             |              |
        |<-------------|                             |              |
        :              :                             :              :
        |(1)  INVITE   |                                            :
        |------------->|
        |              |(2)  CCR (Intial, SIP specific AVP)         |
        |              |------------------------------------------->|
        |              |(3)  CCA (granted_Units)                    |
        |              |<-------------------------------------------|
        |              |(4)  INVITE                  |              |
        |              |---------------------------->|              |
        :              :                             :              :
        |              |(5)  CCR (update, used Units)               |
        |              |------------------------------------------->|
        |              |(6)  CCA (granted_Units)                    |
        |              |<-------------------------------------------|
        :              :                             :              :
        |(7)  BYE      |                             |              |
        |------------->|                             |              |
        |              |(8)  BYE                     |              |
        |              |---------------------------->|              |
        |              |(9)  CCR (termination, used Units)----------|
        |              |------------------------------------------->|
        |              |(10) CCA ()                                 |
        |              |<-------------------------------------------|
        |              |                             |              |

                           Figure A.3: Flow III

   The end user (SIP User Agent A) sends REGISTER with credentials (i).
   The SIP Proxy sends a request to the AAA server to perform Multimedia
   authentication and authorization by using for instance Diameter
   Multimedia application (ii). The AAA server checks that the
   credentials are correct and checks the user profile.  Eventually, 200
   OK response (iii) is sent to the UA. Note that the Authentication and
   Authorization is valid for the registration validity period duration
   (i.e. until re-registration is performed), of several SIP sessions
   may be established without re-authorization is performed.

   UA A sends an INVITE (1). The SIP Proxy sends a Diameter Credit-
   Control-Request (INITIAL_REQUEST) to the Diameter credit-control


Hakala et al.             Expires - December 2003             [Page 67]

                   Diameter Credit Control Application        June 2003


   server (2). The Credit-Control-Request contains information obtained
   from the SIP signaling describing the requested service (e.g. calling
   party, called party, Session Description Protocol attributes). The
   Diameter credit-control server checks the end userÆs account balance,
   rates the service and reserves credit from the end userÆs account.
   The reserved quota is returned to the SIP Proxy in the Diameter
   Credit-Control-Answer (3). The SIP Proxy forwards the SIP INVITE to
   UA B (4). BÆs phone rings, and B answers. The media flows between
   them and the SIP Proxy starts measuring the quota. At the expiry of
   the allocated quota, the SIP Proxy sends a Diameter Credit-Control-
   Request (UPDATE_REQUEST) to the Diameter credit-control server (5).
   This message contains the units used this far. The Diameter credit-
   control server debits the used units from the end userÆs account and
   allocates new credit that is returned to the Sip Proxy in the
   Diameter Credit-Control-Answer (6). The end user terminates the
   service by sending a BYE (7). The SIP Proxy forwards the BYE message
   to UA B (8) and sends a Diameter Credit-Control-Request
   (TERMINATION_REQUEST) to the Credit-control server (9). The Diameter
   Credit-control server acknowledges the session termination by sending
   a Diameter Credit-Control-Answer to the SIP Proxy (10).


A.4 Flow IV

                          MMS Server
             A           (CC Client)           B           CC Server
             |(1) Send MMS    |                |                |
             |--------------->|                |                |
             |                |(2)  CCR (event, DIRECT_DEBITING,|
             |                |          MMS specific AVP)      |
             |                |-------------------------------->|
             |                |(3)  CCR (granted_Units)         |
             |                |<--------------------------------|
             |(4) Send MMS Ack|                |                |
             |<---------------|                |                |
             |                |(5) Notify MMS  |                |
             |                |--------------->|                |
             :                :                :                :
             |                |(6) Retrieve MMS|                |
             |                |<---------------|                |
             |                |(7) Retrieve MMS|                |
             |                |    Ack         |                |
             |                |--------------->|                |
             |                |                |                |


   Figure A.4: Flow IV




Hakala et al.             Expires - December 2003             [Page 68]

                   Diameter Credit Control Application        June 2003


   A credit control flow for Multimedia Messaging Services is shown in
   Figure A.4. The sender is charged as soon as the messaging server
   successfully stores the message.

   The end user A sends a Multimedia Message (MMS) to the MMS Server
   (1). The MMS Server stores the message and sends a Diameter Credit-
   Control-Request (EVENT_REQUEST with Requested-Action:
   DIRECT_DEBITING) to the Diameter credit-control server (2). The
   Credit-Control-Request contains information about the MMS message
   (e.g. size, recipient address, image coding type). The Diameter
   credit-control server checks the end userÆs account balance, rates
   the service and debits the service from the end userÆs account. The
   granted quota is returned to the MMS Server in the Diameter Credit-
   Control-Answer (3). The MMS Server acknowledges the successful
   reception of the MMS message (4). The MMS Server notifies the
   recipient about the new MMS (5), and the end user B retrieves the
   message from the MMS message store (6),(7).

A.5 Flow V

                          MMS Server
      Content Server     (CC Client)           B           CC Server
             |(1) Send MMS    |                |                |
             |--------------->|                |                |
             |                |(2)  CCR (event, BALANCE_CHECK,  |
             |                |          MMS specific AVP)      |
             |                |-------------------------------->|
             |                |(3)  CCA (OK)                    |
             |                |<--------------------------------|
             |(4) Send MMS Ack|                |                |
             |<---------------|                |                |
             |                |(5) Notify MMS  |                |
             |                |--------------->|                |
             :                :                :                :
             |                |(6) Retrieve MMS|                |
             |                |<---------------|                |
             |                |(7)  CCR (event, DIRECT_DEBITING,|
             |                |          MMS specific AVP)      |
             |                |-------------------------------->|
             |                |(8)  CCA (granted_Units)         |
             |                |<--------------------------------|
             |                |(9) Retrieve MMS|                |
             |                |    Ack         |                |
             |                |--------------->|                |
             |                |                |                |


   Figure A.5: Flow V



Hakala et al.             Expires - December 2003             [Page 69]

                   Diameter Credit Control Application        June 2003


   A credit control flow for Multimedia Messaging Service is shown in
   Figure A.5. The recipient is charged at the message delivery.

   A Content Server sends a Multimedia Message (MMS) to the MMS Server
   (1) that stores the message. The message recipient will be charged
   for the MMS message in this case. Since there can be substantially
   long time between the reception of the message at the MMS Server and
   the actual retrieval of the message, the MMS Server does not
   establish any credit control session to the Diameter Credit-Control
   Server but performs first only a balance check (without any credit
   reservation) by sending a Diameter Credit-Control-Request
   (EVENT_REQUEST with Requested-Action: BALANCE_CHECK) to verify that
   the end user BÆs can cover the cost for the MMS (2). The Diameter
   credit-control server checks the end userÆs account balance and
   returns the answer to the MMS Server in the Diameter Credit-Control-
   Answer (3). The MMS Server acknowledges the successful reception of
   the MMS message (4). The MMS Server notifies the recipient about the
   new MMS (5), and after some time the end user B retrieves the message
   from the MMS message store (6). The MMS Server sends a Diameter
   Credit-Control-Request (EVENT_REQUEST with Requested-Action:
   DIRECT_DEBITING) to the Diameter Credit-control server (7). The
   Credit-Control-Request contains information about the MMS message
   (e.g. size, recipient address, coding type). The Diameter credit-
   control server checks the end userÆs account balance, rates the
   service and debits the service from the end userÆs account. The
   granted quota is returned to the MMS Server in the Diameter Credit-
   Control-Request (8). The MMS is transferred to the end user B (9).
























Hakala et al.             Expires - December 2003             [Page 70]


Html markup produced by rfcmarkup 1.109, available from https://tools.ietf.org/tools/rfcmarkup/