Time-of-day RADIUS accounting

Brian Candler B.Candler at pobox.com
Fri Sep 14 12:49:33 CEST 2012

On Thu, Sep 13, 2012 at 05:19:52PM -0400, DataWizApp wrote:
> For example, assume that we have 5 NAS devices, one RADIUS server and
> five user sessions connect to five NAS devices respectively, and we
> would like to charge users based on the usage in each hour.
> User 1 initiates the connection at 01:01
> User 2 initiates the connection at 01:11
> User 3 initiates the connection at 01:21
> User 4 initiates the connection at 01:31
> User 5 initiates the connection at 01:41
> For this case, what I think is that the RADIUS server can sends an
> INTERIM-UPDATE with different interval to each session -- e.g., 59,
> 49, 39, 29 and 19 mins. I wonder whether we can do like this way.

That's clearly wrong.

User 1's accounting will arrive at 01:01, 02:00, 02:59, 03:58, ...
User 2's accounting will arrive at 01:11, 02:00, 02:49, 03:38, ...
User 5's accounting will arrive at 01:41, 02:00, 02:19, 02:38, ...

In any case, NASes don't give accounting at *exactly* the interval you ask
for. It will drift one way or the other. For long-lived sessions, as are
often the case on DSL, this simply won't work as you want.

If you need to charge for usage within particular clock hours, you'll have
to set the interim update very frequently (say every 1-5 minutes).

Or you could probably do some sort of SNMP query on the hour, asking the NAS
to list all active sessions and their usage.  You would have to process
accounting records such that those which stopped before the hour were
handled using accounting data only, but those which started before the hour
and stopped after the hour were split using the SNMP information.

This sounds doable, but depends on the availability of MIBs for the NAS
which expose the information you need (Acct-Session-Id and octet counts)



More information about the Freeradius-Devel mailing list