Subject: [AAA-WG]: issue: Multiple services credit control in a single CC session (Diameter CCA)

From: <[email-masked]>
Date: Wed, 15 Oct 2003 15:38:12 +0300

Multiple services credit control in a single CC session (Diameter CCA)
Submitter name: Marco Stura
Submitter email address: [email-masked]
Date first submitted: October 15, 2003
Reference: 
Document: draft-ietf-aaa-diameter-cc-00
Comment type: T
Priority: 2
Section: various
Rationale/Explanation of issue:

There may be service elements in certain service environments that provide multiple services, or
just credit control for multiple services, within the same authorization session to an end user. 
For each of those services the price may be different requiring differentiated credit control per service.
With the current draft such a service element would need to open multiple credit control sessions
(or sub-sessions) resulting in increased signaling load  and resource usage in both the CC-client 
and in the CC-server.

I propose to address the support of multiple services credit control in a single CC session
in the Diameter CCA. This means that credit authorization can be requested for multiple
services, or a group of services, within a single Credit-Control-Request. Multiple quotas associated
to the relevant service, or group of services, will be returned in the corresponding Credit-Control-
Answer in order to enable differentiated credit control per service.

The proposal takes already into account the new structure for the Granted-Service-Unit, 
Requested-Service-Unit and Used-Service-Unit AVPs agreed in the past weeks in AAA mailing
list.

Proposed changes:

Section 4, fourth paragraph
Change
FROM:
	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.

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

	When multiple services are used within one user session and each service or group of services are subject to different cost, making use of credit control sub-sessions will result in increased signaling load and resources usage in both the credit control client and the credit control server. For instance, during one network access session the end user may use several http-services subject to different access cost. To optimally support these scenarios, the credit control application enables for multiple services credit control in a single credit control session. It is possible to request and allocate multiple quotas as a credit pool that is shared between multiple services. The services can be further grouped into rating groups in order to achieve even further aggregation of credit allocation.
	It is also possible to request and allocate multiple quotas on a per service basis. The mechanism is illustrated in Appendix A (Flow xxx).

Section 4.1.1, fifth paragraph
Change
FROM:
	However there MUST be maximum one instance of the same unit type in one
	Answer message.

TO:
	There MUST be maximum one instance of the same unit type in one
	Answer message. In case multiple quotas are conveyed to the credit control client, there MUST be maximum one instance of the same unit type associated to a Service-Identifier, or set of Service-Identifiers, or associated to a Rating-Group.

ADD Service-Identifier and Rating-Group AVPs to section 5.17

	The Service-Identifier and the Rating-Group AVPs are used to request units for a given service(s) or rating group when the service element supports credit control for multiple services in one credit control session. 
	If both the AVPs are present, the Rating-Group AVP indicates the rating group to which the service(s) specified by the Service-Identifier(s) belongs. If only the Rating-Group-Id AVP is present, this is a credit authorization request for all the services that belongs to the specified rating group.

	A server not implementing the Service-Identifier and the Rating-Group must treat them as invalid AVPs.

	 Requested-Service-Unit ::= < AVP Header: TBD > 
	                            [ CC-Time ] 
	                            [ CC-Money ]
	                            [ CC-Total-Octets ]
	                            [ CC-Input-Octets ]
	                            [ CC-Output-Octets ]
	                            [ CC-Service-Specific-Units ]
	                           *[ Service-Identifier ]
	                            [ Rating-Group ]

ADD Service-Identifier and Rating-group AVPs to section 5.15

	The Service-Identifier and the Rating-Group AVPs are used to associate the granted units to a given service or rating group.
	In case both the Service-Identifier and the Rating-Group AVPs are included, the target of the granted units is(are) always the service(s) indicated by the value of the Service-Identifier AVP.

	 Granted-Service-Unit ::= < AVP Header: TBD > 
	                          [ CC-Time ] 
	                          [ CC-Money ]
	                          [ CC-Total-Octets ]
	                          [ CC-Input-Octets ]
	                          [ CC-Output-Octets ]
	                          [ CC-Service-Specific-Units ]
	                         *[ Service-Identifier ]
	                          [ Rating-Group ]

ADD Service-Identifier and Rating-Group AVPs to section 5.26

	The Service-Identifier and the Rating-Group AVPs are used to associate the used units to a given service or rating group.
	When granted service units are associated to a service or rating group, the credit control client MUST report the corresponding used service units. If the granted units are associated to a rating group, the units used by each of the Service-Identifier belonging to that rating group SHOULD be reported if this information is available to the credit control client. Therefore, multiple instances of the Used-Service-Unit AVP MAY be present in a request, each associated to the relevant Rating-Group-Id and to the identifier of the service (i.e. Service-Identifier) that consumed some of the granted units.

	    Used-Service-Unit ::= < AVP Header: TBD > 
	                          [ CC-Time ] 
	                          [ CC-Money ]
	                          [ CC-Total-Octets ]
	                          [ CC-Input-Octets ]
	                          [ CC-Output-Octets ]
	                          [ CC-Service-Specific-Units ]
	                         *[ Service-Identifier ]
	                          [ Rating-Group ]

5.x Rating-Group AVP

	The Rating-Group AVP is of type Unsigned32 (AVP Code TBD) and contains the identifier of a rating group. All the services subject to the same rating type are part of the same rating group. This is an identifier allocated by the home service provider and MUST be unique within the home service provider domain.

	A usage example of this AVP is illustrated in Appendix A (Flow xxx).

5.y Service-Identifier AVP

	The Service-Identifier AVP is of type UTF8String (AVP Code TBD) and contains a unique identifier of a given service. This is an identifier allocated by the service provider and MUST uniquely identify a given service (e.g. Service [email-masked]).

	A usage example of this AVP is illustrated in Appendix A (Flow xxx).

ADD the Flow xxx to Appendix A

Flow xxx

	The Diameter Credit Control Application defines the Rating-Group and Service-Identifier AVPs that can be used to support credit control for multiple services in a single credit control session for service elements that have such capabilities. The flow example hereafter illustrates the usage of these AVPs.

	It is assumed that the Service-Identifiers and the Rating-Groups are locally configured in the Service Element or provisioned by another entity than the credit control server.

	The credit control client may request credit authorization either for all the possible configured Rating-Groups in one single request, onwards named all-in-one mode, or for a single Rating-Group upon an external triggering event, onwards named on-demand mode. The on-demand mode can be used as well to request individual credit resource limit for each service.
   In this example only the all-in-one mode is shown.

	A single credit reservation is kept for the credit control session to simplify the account management tasks. The credit control server reserves an amount of credit from the user's account and performs rating for all the requested Rating-Groups and Service-Identifiers against the reserved credit.
	For instance, assume a Credit-Control-Request is received with Rating-Group-Id 1 and 2. The credit control server queries the rating server that answers with the following rating parameters: Rating-Group 1 costs $1/Mbyte and Rating-Group 2 costs $1/minute. The credit control server reserves $20 from the user's account; this gives 20Mbytes for Rating-Group 1 and 20minutes for Rating-Group 2.

	The calculated quotas are conveyed to the credit control client in the CCA message, each quota associated with the appropriate Rating-Group or Service-Identifier. At this point the credit control client just need to track the fraction of reserved credit used by the corresponding service or Rating-Group, when the sum of the fractions reaches 100% the credit control client sends an intermediate interrogation since the whole amount of reserved credit is consumed.
	If the credit control client initializes a counter C for each of the received quota Q (C1 for Q1, C2 for Q2 ... Cn for Qn), the intermediate interrogation will be sent when sum(C1/Q1 + C1/Q2 + ... + Cn/Qn)>= 1. 
	Continuing the example, say the end user uses 10 Mbytes from Rating-Group 1 and 10minutes from Rating-Group 2. This means that Rating-Group 1 consumed 50% of the reservation and Rating-Group 2 consumed the remaining 50%. 0.5 + 0.5 >=1, so the credit control client sends an intermediate interrogation to report the used units and request new ones.

	                 Service Element
	 End-User         (CC client)                                 CC Server
	   |(1)User logon      |                                         |
	   |------------------>|(2)CCR(initial,Requested-Units(Rating-Group 1),
	   |                   |        Requested-Units(Rating-Group 2)) |
	   |                   |---------------------------------------->|
	   |                   |(3)CCA(Granted-Units(Rating-Group 1,     |
	   |                   |                     Total-Octets))      |
	   |                   |       Granted-Units(Rating-Group 2,     |
	   |                   |                     Time))              |
	   |                   |<----------------------------------------|
	   :                   :                                         :
	   |(4)Service-Request (Service 1)                               |
	   |------------------>|                                         |
	   :                   :                                         :
	   |(5)Service-Request (Service 2)                               |
	   |------------------>|                                         |
	   :                   :                                         :
	   |                   |(6)CCR(update, Used-Units(Input-Octets,  |
	   |                   |                          Output-Octets, |
	   |                   |                          Service-Id 1,  |
	   |                   |                          Rating-Group 1),
	   |                   |               Used-Units(Time,          |
	   |                   |                          Service-Id 2,  |
	   |                   |                          Rating-Group 2),
	   |                   |               Requested-Units(Rating-G.1),
	   |                   |               Requested-Units(Rating-G.2))
	   |                   |---------------------------------------->|
	   |                   |(7)CCA(Granted-Units(Rating-Group 1,     |
	   |                   |                     Total-Octets),      |
	   |                   |       Granted-Units(Rating-Group 2,     |
	   |                   |                      Time))             |
	   |                   |<----------------------------------------|
	   :                   :                                         :
	   |(8)Service-Request (Service 3)                               |
	   |------------------>|                                         |
	   :                   :                                         :
	   |(9) User logoff    |                                         |
	   |------------------>|(10)CCR(term, Used-Units(Input-Octets,   |
	   |                   |                         Output-Octets,  |
	   |                   |                         Service-Id 1,   |
	   |                   |                         Rating-Group 1),|
	   |                   |              Used-Units(Input-Octets,   |
	   |                   |                         Output-Octets,  |
	   |                   |                         Service-Id 3,   |
	   |                   |                         Rating-Group 1),|
	   |                   |              Used-Units(Time,           |
	   |                   |                         Service-Id 2,   |
	   |                   |                         Rating-Group 2),|
	   |                   |---------------------------------------->|
	   |                   |(11)CCA(term)                            |
	   |                   |<----------------------------------------|

	   Figure A.xxx: Credit Control for Multiple Services in One Credit 
	                 Control Session, flow example

	The user logs onto the network (1). The Service Element sends a Diameter Credit-Control-Request with CC-Request-Type set to INITIAL_REQUEST to the Diameter credit-control server to perform credit authorization for multiple rating groups and to establish a credit control session (2). In this message credit authorization is requested for Rating-Group 1 and Rating-Group 2 by including two instances of the Requested-Service-Unit AVP. The Diameter credit-control server checks the end user's account balance, based on the Rating-Group information rates the request and reserves credit from the end user's account. Multiple quotas are returned to the Service Element, each associated with the relevant Rating-Group (3). The user uses service 1 and service 2 (4, 5). The service 1 belongs to Rating-Group 1 and is volume based charged, the service 2 belongs to Rating-Group 2 and is time based charged. When the user has consumed the allotted credit, the Service Element sends a Diameter Credit-Control-Request with CC-Request-Type set to UPDATE_REQUEST to the credit control server (6). This message contains the units consumed by each of the used services in the Used-Service-Unit AVPs and two instances of the Requested-Service-Unit AVP to request credit re-authorization for the two Rating-Groups. The used units are associated with the relevant Service-Identifier and Rating-Group. 
	The Diameter credit-control server debits the used units from the end user's account and reserves a new amount of credit that is returned in form of multiple quotas to the Service Element in the Diameter Credit-Control-Answer (7). Each quota is associated with the relevant Rating-Group. In addition to service 1 and service 2, the user now starts using service 3 (8). Service 3 belongs to Rating-Group 1 and is charged based on volume. The end user logs off from the network (9). To debit the used units from the end user's account and to stop the credit control session, the Service Element sends a Diameter Credit-Control-Request with CC-Request-Type set to TERMINATION_REQUEST to the credit control server (10).  
	This message contains the units consumed by each of the used services in the Used-Service-Unit AVPs. The used units are associated with the relevant Service-Identifier and Rating-Group. The Diameter credit-control server debits the used units to the user's account and acknowledges the session termination by sending a Diameter Credit-Control-Answer to the Service Element (11).

---

From: <[email-masked]>
Date: Mon, 20 Oct 2003 14:54:10 +0300

Thanks Marco, I've udpated the draft accordingly.

thanks,
John

> -----Original Message-----
> From: ext [mailto:[email-masked]]
> Sent: 15 October, 2003 15:38
> To: [email-masked]
> Subject: [AAA-WG]: issue: Multiple services credit control in a single
> CC session (Diameter CCA)
> 
> 
> For each of those services the price may be different 
> requiring differentiated credit control per service.
> services, or a group of services, within a single 
> Credit-Control-Request. Multiple quotas associated
> to the relevant service, or group of services, will be 
> returned in the corresponding Credit-Control-
> 	When multiple services are used within one user session 
> and each service or group of services are subject to 
> different cost, making use of credit control sub-sessions 
> will result in increased signaling load and resources usage 
> in both the credit control client and the credit control 
> server. For instance, during one network access session the 
> end user may use several http-services subject to different 
> access cost. To optimally support these scenarios, the credit 
> control application enables for multiple services credit 
> control in a single credit control session. It is possible to 
> request and allocate multiple quotas as a credit pool that is 
> shared between multiple services. The services can be further 
> grouped into rating groups in order to achieve even further 
> aggregation of credit allocation.
> 	It is also possible to request and allocate multiple 
> quotas on a per service basis. The mechanism is illustrated 
> in Appendix A (Flow xxx).
> 
> 	Answer message. In case multiple quotas are conveyed to 
> the credit control client, there MUST be maximum one instance 
> of the same unit type associated to a Service-Identifier, or 
> set of Service-Identifiers, or associated to a Rating-Group.
> 
> 
> 	The Service-Identifier and the Rating-Group AVPs are 
> used to request units for a given service(s) or rating group 
> when the service element supports credit control for multiple 
> services in one credit control session. 
> 	If both the AVPs are present, the Rating-Group AVP 
> indicates the rating group to which the service(s) specified 
> by the Service-Identifier(s) belongs. If only the 
> Rating-Group-Id AVP is present, this is a credit 
> authorization request for all the services that belongs to 
> the specified rating group.
> 
> 	A server not implementing the Service-Identifier and 
> the Rating-Group must treat them as invalid AVPs.
> 
> 	The Service-Identifier and the Rating-Group AVPs are 
> used to associate the granted units to a given service or 
> rating group.
> 	In case both the Service-Identifier and the 
> Rating-Group AVPs are included, the target of the granted 
> units is(are) always the service(s) indicated by the value of 
> the Service-Identifier AVP.
> 
> 	The Service-Identifier and the Rating-Group AVPs are 
> used to associate the used units to a given service or rating group.
> 	When granted service units are associated to a service 
> or rating group, the credit control client MUST report the 
> corresponding used service units. If the granted units are 
> associated to a rating group, the units used by each of the 
> Service-Identifier belonging to that rating group SHOULD be 
> reported if this information is available to the credit 
> control client. Therefore, multiple instances of the 
> Used-Service-Unit AVP MAY be present in a request, each 
> associated to the relevant Rating-Group-Id and to the 
> identifier of the service (i.e. Service-Identifier) that 
> consumed some of the granted units.
> 
> 	The Rating-Group AVP is of type Unsigned32 (AVP Code 
> TBD) and contains the identifier of a rating group. All the 
> services subject to the same rating type are part of the same 
> rating group. This is an identifier allocated by the home 
> service provider and MUST be unique within the home service 
> provider domain.
> 
> 	The Service-Identifier AVP is of type UTF8String (AVP 
> Code TBD) and contains a unique identifier of a given 
> service. This is an identifier allocated by the service 
> provider and MUST uniquely identify a given service (e.g. 
> Service [email-masked]).
> 
> 	The Diameter Credit Control Application defines the 
> Rating-Group and Service-Identifier AVPs that can be used to 
> support credit control for multiple services in a single 
> credit control session for service elements that have such 
> capabilities. The flow example hereafter illustrates the 
> usage of these AVPs.
> 
> 	It is assumed that the Service-Identifiers and the 
> Rating-Groups are locally configured in the Service Element 
> or provisioned by another entity than the credit control server.
> 
> 	The credit control client may request credit 
> authorization either for all the possible configured 
> Rating-Groups in one single request, onwards named all-in-one 
> mode, or for a single Rating-Group upon an external 
> triggering event, onwards named on-demand mode. The on-demand 
> mode can be used as well to request individual credit 
> resource limit for each service.
> 	A single credit reservation is kept for the credit 
> control session to simplify the account management tasks. The 
> credit control server reserves an amount of credit from the 
> user's account and performs rating for all the requested 
> Rating-Groups and Service-Identifiers against the reserved credit.
> 	For instance, assume a Credit-Control-Request is 
> received with Rating-Group-Id 1 and 2. The credit control 
> server queries the rating server that answers with the 
> following rating parameters: Rating-Group 1 costs $1/Mbyte 
> and Rating-Group 2 costs $1/minute. The credit control server 
> reserves $20 from the user's account; this gives 20Mbytes for 
> Rating-Group 1 and 20minutes for Rating-Group 2.
> 
> 	The calculated quotas are conveyed to the credit 
> control client in the CCA message, each quota associated with 
> the appropriate Rating-Group or Service-Identifier. At this 
> point the credit control client just need to track the 
> fraction of reserved credit used by the corresponding service 
> or Rating-Group, when the sum of the fractions reaches 100% 
> the credit control client sends an intermediate interrogation 
> since the whole amount of reserved credit is consumed.
> 	If the credit control client initializes a counter C 
> for each of the received quota Q (C1 for Q1, C2 for Q2 ... Cn 
> for Qn), the intermediate interrogation will be sent when 
> sum(C1/Q1 + C1/Q2 + ... + Cn/Qn)>= 1. 
> 	Continuing the example, say the end user uses 10 Mbytes 
> from Rating-Group 1 and 10minutes from Rating-Group 2. This 
> means that Rating-Group 1 consumed 50% of the reservation and 
> Rating-Group 2 consumed the remaining 50%. 0.5 + 0.5 >=1, so 
> the credit control client sends an intermediate interrogation 
> to report the used units and request new ones.
> 
> 	                 Service Element
> 	 End-User         (CC client)                           
>       CC Server
> 	   |(1)User logon      |                                
>          |
> 	   
> 	   |                   
> |---------------------------------------->|
> 	   |                   
> 	   |                   |                     
> Total-Octets))      |
> 	   |                   |                     Time))     
>          |
> 	   |                   
> |<----------------------------------------|
> 	   :                   :                                
>          :
> 	   |------------------>|                                
>          |
> 	   :                   :                                
>          :
> 	   |------------------>|                                
>          |
> 	   :                   :                                
>          :
> 	   |                   |                          
> Output-Octets, |
> 	   |                   |                          
> Service-Id 1,  |
> 	   |                   |                          
> Rating-Group 1),
> 	   |                   |               Used-Units(Time, 
>          |
> 	   |                   |                          
> Service-Id 2,  |
> 	   |                   |                          
> Rating-Group 2),
> 	   |                   
> |---------------------------------------->|
> 	   |                   
> 	   |                   |                     
> Total-Octets),      |
> 	   |                   |                      Time))    
>          |
> 	   |                   
> |<----------------------------------------|
> 	   :                   :                                
>          :
> 	   |------------------>|                                
>          |
> 	   :                   :                                
>          :
> 	   |(9) User logoff    |                                
>          |
> 	   |                   |                         
> Output-Octets,  |
> 	   |                   |                         
> Service-Id 1,   |
> 	   |                   |                         
> Rating-Group 1),|
> 	   |                   |                         
> Output-Octets,  |
> 	   |                   |                         
> Service-Id 3,   |
> 	   |                   |                         
> Rating-Group 1),|
> 	   |                   |              Used-Units(Time,  
>          |
> 	   |                   |                         
> Service-Id 2,   |
> 	   |                   |                         
> Rating-Group 2),|
> 	   |                   
> |---------------------------------------->|
> 	   |                   |(11)CCA(term)                   
>          |
> 	   |                   
> |<----------------------------------------|
> 
> 	The user logs onto the network (1). The Service Element 
> sends a Diameter Credit-Control-Request with CC-Request-Type 
> set to INITIAL_REQUEST to the Diameter credit-control server 
> to perform credit authorization for multiple rating groups 
> and to establish a credit control session (2). In this 
> message credit authorization is requested for Rating-Group 1 
> and Rating-Group 2 by including two instances of the 
> Requested-Service-Unit AVP. The Diameter credit-control 
> server checks the end user's account balance, based on the 
> Rating-Group information rates the request and reserves 
> credit from the end user's account. Multiple quotas are 
> returned to the Service Element, each associated with the 
> relevant Rating-Group (3). The user uses service 1 and 
> service 2 (4, 5). The service 1 belongs to Rating-Group 1 and 
> is volume based charged, the service 2 belongs to 
> Rating-Group 2 and is time based charged. When the user has 
> consumed the allotted credit, the Service Element sends a 
> Diameter Credit-Control-Request with CC-Request-Type set to 
> UPDATE_REQUEST to the credit control server (6). This message 
> contains the units consumed by each of the used services in 
> the Used-Service-Unit AVPs and two instances of the 
> Requested-Service-Unit AVP to request credit re-authorization 
> for the two Rating-Groups. The used units are associated with 
> the relevant Service-Identifier and Rating-Group. 
> 	The Diameter credit-control server debits the used 
> units from the end user's account and reserves a new amount 
> of credit that is returned in form of multiple quotas to the 
> Service Element in the Diameter Credit-Control-Answer (7). 
> Each quota is associated with the relevant Rating-Group. In 
> addition to service 1 and service 2, the user now starts 
> using service 3 (8). Service 3 belongs to Rating-Group 1 and 
> is charged based on volume. The end user logs off from the 
> network (9). To debit the used units from the end user's 
> account and to stop the credit control session, the Service 
> Element sends a Diameter Credit-Control-Request with 
> CC-Request-Type set to TERMINATION_REQUEST to the credit 
> control server (10).  
> 	This message contains the units consumed by each of the 
> used services in the Used-Service-Unit AVPs. The used units 
> are associated with the relevant Service-Identifier and 
> Rating-Group. The Diameter credit-control server debits the 
> used units to the user's account and acknowledges the session 
> termination by sending a Diameter Credit-Control-Answer to 
> the Service Element (11).
> 
>

---

From: <[email-masked]>
Date: Thu, 23 Oct 2003 07:17:40 +0300

Hi Marco,

I have made the changes.

John

> Requested-Units(Rating-Group 2)) |
> 	   |                   
> |(3)CCA(Granted-Units(Rating-Group 1,     |
> 	   |                   |                     
> Total-Octets))      |
> 	   |                   |       
> Granted-Units(Rating-Group 2,     |
> 	   |                   |                     Time))     
>          |
> 	   |                   
> Requested-Units(Rating-G.1),
> 	   |                   |               
> Requested-Units(Rating-G.2))
> 	   |                   
> |(7)CCA(Granted-Units(Rating-Group 1,     |
> 	   |                   |                     
> Total-Octets),      |
> 	   |                   |       
> Granted-Units(Rating-Group 2,     |
> 	   |                   |                      Time))    
>          |
> 	   |                   
> Used-Units(Input-Octets,   |
> 	   |                   |                         
> Output-Octets,  |
> 	   |                   |                         
> Service-Id 3,   |
> 	   |                   |                         
> Rating-Group 1),|
> 	   |                   |              Used-Units(Time,  
>          |
> 	   |                   |                         
> Service-Id 2,   |
> 	   |                   |                         
> Rating-Group 2),|
> 	   |