update disconnect and order of operations
Hi team, How update disconnect work in accounting section ? For example we have accounting configuration like this sql { fail = 1 } if ( !fail ) { if (&Class) { if (&Class == "outage" && &Acct-Status-Type == "Interim-Update") { update disconnect { Acct-Session-Id := "%{Acct-Session-Id}" } } } } linelog if we receive accounting pack with Class=outage and DB accessible , we should send disconnect message for this session. But, what happens if NAS is busy , or packet will be lost , so we did not receive reply ? Will freeradius wait for some timeout before continue to linelog directive or sending and processing disconnect message will be executed in parallel and we process the linelog without any delay?
On Jul 13, 2023, at 9:57 AM, Anatoliy <cphlpd@gmail.com> wrote: if we receive accounting pack with Class=outage and DB accessible , we should send disconnect message for this session.
Yes.
But, what happens if NAS is busy , or packet will be lost , so we did not receive reply ?
The basic functionality is documented in sites-available/originate-coa.
Will freeradius wait for some timeout before continue to linelog directive or sending and processing disconnect message will be executed in parallel and we process the linelog without any delay?
It sends the disconnect request *after* the accounting request is done. The server replies to the accounting packet, and then sends the disconnect request. If there's no response, the disconnect packet is tried a few times. If the NAS never response, the server just gives up on the disconnect. Note that this is RADIUS... even if the server could do something when the NAS failed to respond to the disconnect packet. What would the server do? Log something? You will still need some kind of manual intervention to fix things. Alan DeKok.
Hi Alan , thank you. From default configuration freeradius will try to resend disconnect message for 30 seconds. So it is possible that all server threads will be busy with "sending disconnect message" to "bad NAS" and will drop other accounting requests ? On Thu, Jul 13, 2023 at 9:36 PM Alan DeKok <aland@deployingradius.com> wrote:
On Jul 13, 2023, at 9:57 AM, Anatoliy <cphlpd@gmail.com> wrote: if we receive accounting pack with Class=outage and DB accessible , we should send disconnect message for this session.
Yes.
But, what happens if NAS is busy , or packet will be lost , so we did not receive reply ?
The basic functionality is documented in sites-available/originate-coa.
Will freeradius wait for some timeout before continue to linelog directive or sending and processing disconnect message will be executed in parallel and we process the linelog without any delay?
It sends the disconnect request *after* the accounting request is done. The server replies to the accounting packet, and then sends the disconnect request.
If there's no response, the disconnect packet is tried a few times. If the NAS never response, the server just gives up on the disconnect.
Note that this is RADIUS... even if the server could do something when the NAS failed to respond to the disconnect packet. What would the server do? Log something? You will still need some kind of manual intervention to fix things.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 13, 2023, at 11:50 AM, Anatoliy <cphlpd@gmail.com> wrote:
Hi Alan , thank you. From default configuration freeradius will try to resend disconnect message for 30 seconds. So it is possible that all server threads will be busy with "sending disconnect message" to "bad NAS" and will drop other accounting requests ?
No. Alan DeKok.
Hi Alan, please can you explain why this is not possible? \ AK
On 14 Jul 2023, at 00:56, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 13, 2023, at 11:50 AM, Anatoliy <cphlpd@gmail.com> wrote:
Hi Alan , thank you. From default configuration freeradius will try to resend disconnect message for 30 seconds. So it is possible that all server threads will be busy with "sending disconnect message" to "bad NAS" and will drop other accounting requests ?
No.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 13, 2023, at 7:31 PM, Anatoliy Kushner <cphlpd@gmail.com> wrote:
Hi Alan, please can you explain why this is not possible?
I really don't know what you mean. If you want to know how FreeRADIUS works, or why it does what it does... the source code is available. You can read it to see what it does. The "update" disconnect" doesn't block the server threads which process requests. Your choices are now: a) believe it, and move on with your life b) read the source code to understand how it works. There isn't much point in (c) - me explaining in detail how the code works. So I don't know what kind off explanation you're looking for. Do I need to explain in detail how the server works, and how asynchronous disconnect packets work? If so, why not just look at the source code? Alan DeKok.
Hi Alan, thank you . That enough for me that update disconnect do not block server threads ! \ AK
On 14 Jul 2023, at 09:01, Alan DeKok <aland@deployingradius.com> wrote:
On Jul 13, 2023, at 7:31 PM, Anatoliy Kushner <cphlpd@gmail.com> wrote:
Hi Alan, please can you explain why this is not possible?
I really don't know what you mean.
If you want to know how FreeRADIUS works, or why it does what it does... the source code is available. You can read it to see what it does.
The "update" disconnect" doesn't block the server threads which process requests. Your choices are now:
a) believe it, and move on with your life
b) read the source code to understand how it works.
There isn't much point in (c) - me explaining in detail how the code works.
So I don't know what kind off explanation you're looking for. Do I need to explain in detail how the server works, and how asynchronous disconnect packets work? If so, why not just look at the source code?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Anatoliy -
Anatoliy Kushner