Diameter Accounting


Diameter Accounting follows Server Directed Model, means server tells accounting client, that is generation accounting information; how the generated accounting information shall be transferred to server. Diameter accounting client may have a non-volatile storage to keep the accounting information until a success is received from accounting server.
Here we shall see the messages used to exchange accounting information and AVP used in those messages. Accounting-Request (ACR) message is generated by client and Accounting-Answer is triggered by server in response.

Co-Relation in Accounting Session


Message No. (ACR/ACA)
AVP and Their example Values.
1
Acct-Multi-Session-Id=101, Session-Id=201, Accounting-Record-Type= EVENT_RECORD

2
Acct-Multi-Session-Id=101, Session-Id=202, Accounting-Record-Type= START_RECORD,
Acct-Interim-Interval=3 sec (ACA)
3
Acct-Multi-Session-Id=101, Session-Id=202, Accounting-Record-Type= INTERIM_RECORD,
Acct-Interim-Interval=3 sec (ACA)
4
Acct-Multi-Session-Id=101, Session-Id=202, Accounting-Record-Type= INTERIM_RECORD,

5
Acct-Multi-Session-Id=101, Session-Id=202, Accounting-Record-Type= STOP_RECORD,


6
Acct-Multi-Session-Id=101, Session-Id=203, Accounting-Record-Type= START_RECORD,
Acct-Interim-Interval=3 sec (ACA)
7
Acct-Multi-Session-Id=101, Session-Id=203, Accounting-Record-Type= INTERIM_RECORD,
8
Acct-Multi-Session-Id=101, Session-Id=203, Accounting-Sub-Session-Id =301, Accounting-Record-Type= EVENT_RECORD
9
Acct-Multi-Session-Id=101, Session-Id=203 Accounting-Record-Type= STOP_RECORD,




Message Definition

<ACR> ::= < Diameter Header: 271, REQ, PXY >
                < Session-Id >
                { Origin-Host }
                { Origin-Realm }
                { Destination-Realm }
                { Accounting-Record-Type }
                { Accounting-Record-Number }
                [ Acct-Application-Id ]
                [ Vendor-Specific-Application-Id ]
                [ User-Name ]
                [ Accounting-Sub-Session-Id ]
                [ Acct-Session-Id ]
                [ Acct-Multi-Session-Id ]
                [ Acct-Interim-Interval ]
                [ Accounting-Realtime-Required ]
                [ Origin-State-Id ]
                [ Event-Timestamp ]
              * [ Proxy-Info ]
              * [ Route-Record ]
              * [ AVP ]

Message Definition

      <ACA> ::= < Diameter Header: 271, PXY >
                < Session-Id >
                { Result-Code }
                { Origin-Host }
                { Origin-Realm }
                { Accounting-Record-Type }
                { Accounting-Record-Number }
                [ Acct-Application-Id ]
                [ Vendor-Specific-Application-Id ]
                [ User-Name ]
                [ Accounting-Sub-Session-Id ]
                [ Acct-Session-Id ]
                [ Acct-Multi-Session-Id ]
                [ Error-Reporting-Host ]
                [ Acct-Interim-Interval ]
                [ Accounting-Realtime-Required ]
                [ Origin-State-Id ]
                [ Event-Timestamp ]
              * [ Proxy-Info ]
              * [ AVP ]



Here are the AVPs and their usage.

(1) Accounting-Record-Type AVP: It shall contain the type of accounting information sent in the message. One of the following values is possible


EVENT_RECORD (1): Accounting record captured for one time event.

START_RECORD (2): Shall be used to indicate the start of measurable length service. Contains accounting information related to initiation of session.

INTERIM_RECORD (3): This indicates that cumulative accounting records sent, are intermediate records for the time interval communicated in Acct-Interim-Interval AVP for a session.
STOP_RECORD (4): Indicates terminates of accounting session and sends cumulative records for exiting session.

(2) Accounting-Record-Number AVP: It contains a unsigned number that is used to uniquely identify accounting record in a session.


(3) Acct-Interim-Interval AVP: It contains the time interval sent by server to client; client uses this information to generate accounting information. Omission of this AVP or AVP is set to Zero(0) implies that EVENT_RECORD, START_RECORD, and STOP_RECORD are produced. If value is set to non-zero means INTERIM_RECORD records MUST be produced between the START_RECORD and STOP_RECORD records.


(4) Accounting-Realtime-Required AVP: This AVP is used to inform client by server whether to continue with service or not, in case of temporary failure. One of following values are communicated.


DELIVER_AND_GRANT (1): Service is granted as long as connection with any of the secondary server is up.

GRANT_AND_STORE (2): Service is granted as long as connection is up with server or client have non-volatile space to store accounting information.

GRANT_AND_LOSE (3): Service can not be granted if records can not be delivered or stored.



Your Comments /Suggestions and Questions are always welcome. I would try to clear your doubts with best of my knowledge. So feel free to put Questions.

11 comments:

  1. Morris Tutoring Services is the largest community of accountants in academia. Founded in 2010, we have a rich and reputable history built on leading-edge research and publications. The diversity of our membership creates a fertile environment for collaboration and innovation. Collectively, we shape the future of accounting through teaching, research and a powerful network, ensuring our position as thought leaders in accounting.

    ReplyDelete
  2. The GRANT_AND_LOSE means that service SHOULD be granted even if the records cannot be delivered or stored. So there is NO case of service failure.

    ReplyDelete
    Replies
    1. Hi Gaurav

      GRANT_AND_LOSE means service SHOULD not be granted if (for Instance Client) either unable to send information or unable to store its own end so that it could be retrieved later once the connection is up.

      We hope above suffice you if we have understood your query properly.


      Thanks for your query.
      Happy to help you again.
      Team-Diameter

      Delete
  3. Will the CDR be generated if only ACR STOP message is exchanged between client and server (no ACR START and ACR Interim) ?

    Thanks,

    ReplyDelete
  4. great ideas thanks for this blog,keep going will make us to follow check this:Finance and Accounting Service

    ReplyDelete
  5. The inclusion of the Acct-Interim-Interval AVP in the ACR has never made any sense to me. Per RFC 6733 that value is supposed to be determined by the server, so including it in the ACA response to a START_RECORD ACR, or omitting it, thus indicating the default of 0 makes sense. But why in the world would the client include it in ACRs? It doesn't server any purpose that I can tell, especially in the START_RECORD ACR.

    ReplyDelete
  6. Well accounting is not very much tough but sometimes you need to take help of professionals like CPAs.

    Olney MD Tax Service

    ReplyDelete
  7. Great post you shared, you have now become top of my list. You were unknown to me before but have found your content to be fantastic.

    So great work for informing us of the possibilities and following a certain path.

    I really appreciate your hard work an giving us some information and inspiring others to follow.

    Thanks so much.

    I hope for more post in the future.


    Success Accounting Group

    ReplyDelete
  8. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information..
    contabilidade bh

    ReplyDelete
  9. It's good to read an article sometimes. Fiona

    ReplyDelete