Acct-Unique-Session-Id Uniqueness

classic Classic list List threaded Threaded
4 messages Options
| Threaded
Open this post in threaded view
|

Acct-Unique-Session-Id Uniqueness

Users mailing list
Hello,

I am using freeradius 3.0.20 on ubuntu 20.04 with backend mssql.
I have problem with the uniqueness of AcctUniqueId ( Acct-Unique-Session-Id ), but they are not unique across radacct table.
Because there may be multiple records with the same AcctUniqueId value an interim update updates all records with the same AcctUniqueId  value even for different users, which is a problem for usage calculation, and for some other custom calculations, 

I want to create AcctUniqueId in database as a "uniqueidentifier" so it is unique in database which can be retrieved as a string to be used as "Acct-Unique-Session-Id" in radius when inserting a new record. If it is possible to generate a guid by unlang and use it then it would be better.
I think raddb/policy.d/accounting file is where this value is created,
Any suggestion about making Acct-Unique-Session-Id as unique in radacct table will be greatly appreciated.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Acct-Unique-Session-Id Uniqueness

Alan DeKok-2
On Oct 29, 2020, at 7:29 AM, Ali Arslan via Freeradius-Users <[hidden email]> wrote:
>
> I am using freeradius 3.0.20 on ubuntu 20.04 with backend mssql.
> I have problem with the uniqueness of AcctUniqueId ( Acct-Unique-Session-Id ), but they are not unique across radacct table.

  It's as unique as possible.

  If it's not unique, it's likely because the NAS is broken.

> Because there may be multiple records with the same AcctUniqueId value an interim update updates all records with the same AcctUniqueId  value even for different users, which is a problem for usage calculation, and for some other custom calculations,

  It should be unique for different users.  This is how it works in the default configuration.

> I want to create AcctUniqueId in database as a "uniqueidentifier" so it is unique in database which can be retrieved as a string to be used as "Acct-Unique-Session-Id" in radius when inserting a new record. If it is possible to generate a guid by unlang and use it then it would be better.
> I think raddb/policy.d/accounting file is where this value is created,

  Yes.  Which means you can edit it.

> Any suggestion about making Acct-Unique-Session-Id as unique in radacct table will be greatly appreciated.

  Don't edit the default configuration and break it.

  The Acct-Unique-Session-Id value is calculated by taking an MD5 has of many things, including the User-Name.  If you're seeing the same value for different User-Names, then something has changed from the default configuration.

  Oh, and "something something debug output".  I don't know why I even say that anymore.  It's not like people listen.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Acct-Unique-Session-Id Uniqueness

Users mailing list
>> 
>> I have problem with the uniqueness of AcctUniqueId ( Acct-Unique-Session-Id ), but they are not unique across radacct table.

 > It's as unique as possible.

 > If it's not unique, it's likely because the NAS is broken.

I come across the problem when i wanted show user statuses in a list in which i used latest record of radacct row for each user but it was showing u ser was offline even if it was online in real, and saw that an old record of the same user was being updated.

> NAS must be sending the same session id that that has been used earlier

Yes, you are right, problem is with NAS.

> >Because there may be multiple records with the same AcctUniqueId value an interim update updates all records with the same AcctUniqueId  value even for different users, which is a problem for usage calculation, and for some other custom calculations,

 > It should be unique for different users.  This is how it works in the default configuration.

I was wrong, it was for the same user. I just thought it maybe for different users as well.

>  Oh, and "something something debug output".  I don't know why I even say that anymore.  It's not like people listen.

Since i thought  there was no problem with the normal working of freeradius  i thought no need to send debug output.

 > Alan DeKok.

Thanks.



-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Acct-Unique-Session-Id Uniqueness

Alan DeKok-2
On Oct 29, 2020, at 8:39 AM, Ali Arslan via Freeradius-Users <[hidden email]> wrote:
> I was wrong, it was for the same user. I just thought it maybe for different users as well.

  The NAS is broken.  It's 2020.  There is just no reason for the NAS to send the same user information for different sessions.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html