Accounting — traffic accounting (Service 9) [Документация VAS Experts]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:dpi:bras_bng:radius_integration:radius_accounting [2026/03/25 14:45] elena.krasnobryzhen:dpi:bras_bng:radius_integration:radius_accounting [2026/03/26 08:10] (current) elena.krasnobryzh
Line 17: Line 17:
  
   * Enable local user authentication:<code bash>enable_auth=1</code>    * Enable local user authentication:<code bash>enable_auth=1</code> 
-  * Assign service 9 (statistics export for billing) to the subscriber. The Access-Request response must include the following attribute: <code>VasExperts-Enable-Service=9:on</code>+  * Assign service 9 (statistics export for billing) to the subscriber. The Access-Request response must include the following attribute: <code>VasExperts-Enable-Service="9:on"</code>
  
 <note important> <note important>
Line 53: Line 53:
   * 1 — reverse the direction.   * 1 — reverse the direction.
  
-===== Rating Group Settings =====+===== Rating Group =====
  
-Rating groups can be used to track traffic in detail.+Rating Group (RG) is used to break down subscriber traffic accounting in RADIUS Accounting. RGs can only be used if Service 9 (statistics export for billing) is enabled.
  
-The following settings are available: +==== Configuring RG in fastDPI ====
-  * Number of groups:<code bash>rating_group_count=0</code> Default value: ''0'' +
-  * Maximum number of subscribers per rating group:<code bash>rating_group_max_subs=0</code> Default value: ''0'' (RG disabled)+
  
-A value of “0” means that the feature is disabled.+RG storage and processing settings:
  
-The rating group storage is initialized only when billing statistics are enabled.+  * Number of groups: <code bash>rating_group_count=0</code> Default value: 0 — RG disabled. 
 +  * Maximum number of subscribers with RG: <code bash>rating_group_max_subs=0</code> Default value: 0 — RG disabled.
  
-The amount of memory required to store rating group statistics is calculated using the following formula: <code>32 * rating_group_count * rating_group_max_subs * num_thread</code>+The RG storage is initialized only if billing statistics are enabled.
  
 +The amount of memory required to store RG statistics is calculated using the following formula:
 +<code bash>
 +memory_required = 32 * rating_group_count * rating_group_max_subs * num_thread
 +</code>
 where: where:
-  * 32 bytes — the size of counters per group; +  * ''32'' — the size of counters per group (in bytes)
-  * rating_group_count — the number of groups; +  * ''rating_group_count'' — the number of groups; 
-  * rating_group_max_subs — the maximum number of subscribers; +  * ''rating_group_max_subs'' — the maximum number of subscribers; 
-  * num_thread — the number of processing threads.+  * ''num_thread'' — the number of processing threads.
  
-Calculation example+Sample calculation for 10,000 subscribers, 256 rating groups, and 8 processing threads—625 MB of memory is required
-<code>+<code bash>
 rating_group_count = 256 rating_group_count = 256
 rating_group_max_subs = 10000 rating_group_max_subs = 10000
 num_thread = 8 num_thread = 8
- 
 memory_required = 32 * 256 * 10000 * 8 = 625M memory_required = 32 * 256 * 10000 * 8 = 625M
 </code> </code>
  
-<note important>Under heavy load, the accounting data stream from fastDPI may exceed the processing capacity of fastPCRF. In this case, network stack tuning is required.</note>+<note important>Under heavy load, the flow of accounting data from fastDPI may exceed the processing capacity of fastPCRF. In this case, the network stack must be tuned.</note>
  
 {{anchor:acct-pending-queue}} {{anchor:acct-pending-queue}}
-The primary source of events for the start and end of accounting sessions is fastDPI, while the accounting database is maintained in fastPCRF. fastDPI transmits raw traffic data, and fastPCRF aggregates it and generates RADIUS messages. 
  
-Communication between fastDPI and fastPCRF takes place via an internal network protocol. Message loss can result in incorrect session states (for example, the absence of an Acct-Stop or Acct-Start).+==== Transmission of RG Statistics to RADIUS Accounting ====
  
-To improve reliability, a pending queue is usedwhich mitigates short-term unavailability of fastPCRF.+RG statistics are transmitted in separate Interim-Update packets. Only data for non-zero RGs is transmitted.\\ 
 +Due to the RADIUS packet size limit (4096 bytes)RG data may be split across multiple Interim-Update packets.
  
-**PCRF Request Queue Settings:**+A new VSA, ''VasExperts-Acct-Type'' (id=28, vendor=43823, integer), is used to identify the packet type, with the following values: 
 +  ''0'' — standard Interim Update Accounting; 
 +  ''1'' — RG data. 
 + 
 +Each RG and its counters are transmitted in a **single** VSA with the following attributes: 
 +  VasExperts-Acct-Rating-Group (short, 16-bit) — RG number; 
 +  VasExperts-Acct-Input-Octets-64; 
 +  * VasExperts-Acct-Output-Octets-64; 
 +  * VasExperts-Acct-Input-Packets-64; 
 +  * VasExperts-Acct-Output-Packets-64. 
 + 
 +Packet and byte counters for each direction are output according to the <code>acct_swap_dir</code> option (as in Accounting). 
 + 
 +Features of RG transmission: 
 +  * RGs are optional; if the subscriber does not have an RG, the data is not transmitted; 
 +  * if RADIUS does not acknowledge receipt of the RG packet, it is not resent—the latest data will be sent in the next Interim-Update; 
 +  * if the subscriber has RG statistics, the current RG data is sent before sending the Acct-Stop session. 
 + 
 +==== Setting the RG During Subscriber Authentication ==== 
 + 
 +The RG is set at the subscriber level during authentication via a special service profile 9 named 'RG': 
 +<code bash> 
 +VasExperts-Service-Profile :="9:RG" 
 +</code>
  
-  * Maximum request timeout (seconds):<code bash>pcrf_pending_queue_timeout=300</code> +RG statistics can only be collected if Service 9 (bill statis enabled. If Service 9 is disabled, RG is also disabled.
-  * Maximum queue size:<code bash>pcrf_pending_queue_size=10000</code>+
  
-Only critical messages (such as Acct Start/Stopare placed in the queue. If the retention time or queue size is exceededolder entries are deleted.+Examples: 
 +  * Service 9 enabled, RG disabled (standard RADIUS Accounting): <code bash>VasExperts-Enable-Service :="9:on"</code> 
 +  * Service 9 enabled, RG enabled (RG data transmission): <code bash>VasExperts-Service-Profile :="9:RG"</code> 
 +  * Service 9 disabledRG disabled (RADIUS Accounting not sent): <code bash>VasExperts-Enable-Service :="9:off"</code>
  
 ===== Internal Structure ===== ===== Internal Structure =====