When all servers in a RADIUS server policy are unreachable, it is possible to buffer the Accounting Start, Accounting Stop, and Accounting Interim-Update messages for up to 25 hours. Accounting Start messages have a separate buffer from Accounting Interim-Update and Stop messages. When a RADIUS server becomes reachable again, the messages in the buffer are retransmitted. If, for the same accounting session, an Accounting Start message and an Accounting Interim-Update or Stop message is buffered, then the Accounting Start message is sent before the Interim-Update or Stop message.
RADIUS Accounting message buffering parameters can be configured per message type, for example:
config
aaa
radius-server-policy "aaa-server-policy-1" create
servers
router "Base"
buffering
acct-start min 60 max 3600 lifetime 12
acct-interim min 60 max 3600 lifetime 12
acct-stop min 60 max 3600 lifetime 12
exit
server 1 name "server-1"
exit
exit
exit
When RADIUS accounting message buffering is enabled:
The message is stored in the buffer, a lifetime timer is started and the message is sent to the RADIUS server.
If, after retry timeout seconds, no RADIUS accounting response is received, then a new attempt to send the message is started after a minimum [(min-val*2n), max-val] seconds. The min-val and max-val parameters are configurable and correspond to each accounting message type.
Repeat step 2 until one of the following events occurs and the message is purged from the buffer:
RADIUS accounting response is received
the lifetime of the buffered message expires (as shown in Figure: Purging message from buffer)
(if the buffered message is an Accounting Interim-Update only) A new Accounting Interim-Update or an Accounting Stop or for the same accounting session-id and radius-server-policy is stored in the buffer
the message is manually purged from the message buffer with a clear command
When Accounting Start message buffering is enabled:
the Accounting Start message is stored in the buffer
enabling Accounting Interim-Update and Stop message buffering with the same lifetime value is recommended. This guarantees the message ordering per accounting session. The RADIUS Accounting Start message is used to re-establish a connection to the RADIUS server. Therefore, when the connections to RADIUS servers are restored, Accounting Start messages are always sent first followed by the Accounting Interim-Update or Stop messages. In addition, when connection to the RADIUS server is restored, the system attempts to send the buffered Accounting Start messages first, as Accounting responses are received for the Accounting Start messages, Accounting Interim-Update or Stop messages for that particular subscriber session are sent.
if, for the same accounting session, an Accounting Start message and an Accounting Interim-Update or Stop message are both buffered, it is possible for the Start message to be dropped from the accounting buffer because of lifetime expiry. As a result, when the connection to the RADIUS server is restored, only the Accounting Interim-Update or Stop message is sent.
if the RADIUS server is unreachable for a prolonged period, it is possible for subscribers to have started and terminated more than one session. If buffering for Accounting Start is enabled, an Accounting Start message for each session is buffered.
a Python script is applied only when the RADIUS Start message is sent. In other words, buffered RADIUS messages are never processed by Python. It is possible to alter the Python scripts when RADIUS messages are buffered and the message is subjected to the newest applied Python script.
When Accounting Interim-Update message buffering is enabled:
only the last Accounting Interim-Update or Accounting Stop message (if enabled) is stored in the buffer. Accounting session events that are reported by a triggered Accounting Interim-Update, such as an SLA-Profile Change can be lost.
enabling Accounting Stop message buffering is recommended. This guarantees message ordering per accounting session.
Use the following clear command to manually delete messages from the RADIUS accounting message buffer:
clear aaa radius-server-policy policy-name msg-buffer [acct-session-id acct-session-id]
When specifying the account session ID, only that specific message is deleted from the message buffer. If no account session ID is specified, all messages for that RADIUS server policy are deleted from the message buffer.
Use the following show commands to display the RADIUS accounting message buffer statistics:
# show aaa radius-server-policy "aaa-server-policy-1" msg-buffer-stats
===============================================================================
buffering acct-start : enabled
min interval (s) : 60
max interval (s) : 300
lifetime (hrs) : 25
buffering acct-interim : enabled
min interval (s) : 60
max interval (s) : 300
lifetime (hrs) : 25
buffering acct-stop : enabled
min interval (s) : 60
max interval (s) : 300
lifetime (hrs) : 25
Statistics
-------------------------------------------------------------------------------
Total acct-start messages in buffer : 0
Total acct-interim messages in buffer : 0
Total acct-stop messages in buffer : 0
Total acct-start messages dropped (lifetime expired) : 0
Total acct-interim messages dropped (lifetime expired) : 0
Total acct-stop messages dropped (lifetime expired) : 0
Last buffer clear time : N/A
Last buffer statistics clear time : N/A
-------------------------------------------------------------------------------
===============================================================================
Use the following clear command to reset the RADIUS accounting message buffer statistics:
clear aaa radius-server-policy policy-name statistics msg-buffer-only
Use the following tools commands to display the RADIUS accounting message buffer content:
tools dump aaa radius-server-policy policy-name msg-buffer [session-id acct-session-id]
For example:
# tools dump aaa radius-server-policy "aaa-server-policy-1" msg-buffer
===============================================================================
RADIUS server policy "aaa-server-policy-1" message buffering
===============================================================================
message type Acct-Session-Id remaining lifetime
-------------------------------------------------------------------------------
acct-interim 242FFF0000009A512B36FC 0d 11:58:54
acct-interim 242FFF0000009B512B36FC 0d 11:58:48
acct-interim 242FFF0000009C512B36FC 0d 11:58:30
acct-interim 242FFF0000009D512B36FC 0d 11:58:29
acct-interim 242FFF0000009E512B36FC 0d 11:59:05
-------------------------------------------------------------------------------
No. of messages in buffer: 5
===============================================================================
When specifying the Acct-Session-Id, the message details are displayed.