Powered by Jitbit Forum free trial version.
home recent topics recent posts search faq  

TekRADIUS Forum



register | lost password   open id
Messages in this topic - RSS

Home » Bugs » Accounting Stop and Session Clearing

Bugs
16.07.2011 17:42:18

dcbanaynal
dcbanaynal
Posts: 19
As of download ver 7/16/2011:

When a user disconnects, the Accounting-Stop request is sent by the NAS and received by TR, as evidenced by the TR log.
But TR does not clear the session, preventing the user from connecting again, when user has Simultaneous-Use = 1.

Thanks,

Dexter
0 permalink
16.07.2011 18:04:43

Admin
Admin
Administrator
Posts: 1833
Can you send me a wireshark trace with TekRADIUS log for this case?
0 permalink
16.07.2011 19:10:09

dcbanaynal
dcbanaynal
Posts: 19
I used SQL Server Profiler to monitor the point when user disconnected. TR submitted:

INSERT into Accounting (StatusType, InputOcts, OutOcts, UserName, NasIPAddr, CallingStationId, CalledStationId, AcctSessTime, NasIdentifier, NasPort, NasPortId, NasPortType, FramedIPAddr, DisconnectCause, [TimeStamp], [Amount]) values ('Stop', '', '', 'test', '192.168.2.254', 'C446196384F4', '00C0023AC50F:nowirez', '10', 'SC3AC50F', '0', 'STA port # 0', 'Wireless', '192.168.2.130', 'User-Request', DATEADD(second, -0, GETDATE()), 0)

, for which SQL Server replied:
Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'SessionID', table 'TekRADIUS.dbo.Accounting'; column does not allow nulls. INSERT fails.
The statement has been terminated.


the log:

7/17/2011 12:05:29 AM - Debug Message : (Radius Accounting [i1])
Cannot insert the value NULL into column 'SessionID', table 'TekRADIUS.dbo.Accounting'; column does not allow nulls. INSERT fails.
Acct-Session-Time = 10
Acct-Status-Type = Stop
NAS-IP-Address = 192.168.2.254
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Framed-IP-Address = 192.168.2.130
User-Name = test
NAS-Port = 0
Acct-Delay-Time = 0
Acct-Terminate-Cause = User-Request
Connect-Info = CONNECT 54Mbps 802.11g
Service-Type = Framed
NAS-Port-Type = Wireless
NAS-Port-Id = STA port # 0
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = 2
NAS-Identifier = SC3AC50F
0 permalink
16.07.2011 19:40:02

Admin
Admin
Administrator
Posts: 1833
Have you edited Accounting Table mappings at Settings / Accounting Table tab? There should be a mapping for SessionID -> Acct-Session-Id
0 permalink
17.07.2011 03:28:12

dcbanaynal
dcbanaynal
Posts: 19
Hi,

For the previous test, the Acct-Session-ID was unintentionally not mapped.

After I already added it in the Accounting table mappings, and testing the user logon:
1. The insert statement for the Accounting table succeeded <- ok
2. The accounting table has a record for the stop event. <- ok

But still the session is not cleared.

The log shows that the Accounting Stop encountered NO error:

RadAcct req. from : 192.168.2.254:1028 - 7/17/2011 8:17:05 AM
Size : 186 / 186
Identifier : 25
Attributes :
Acct-Session-Time = 11
Acct-Status-Type = Stop
NAS-IP-Address = 192.168.2.254
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Framed-IP-Address = 192.168.2.130
User-Name = test
NAS-Port = 0
Acct-Delay-Time = 0
Acct-Terminate-Cause = User-Request
Connect-Info = CONNECT 54Mbps 802.11g
Service-Type = Framed
NAS-Port-Type = Wireless
NAS-Port-Id = STA port # 0
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = 2
NAS-Identifier = SC3AC50F
0 permalink
17.07.2011 03:55:19

dcbanaynal
dcbanaynal
Posts: 19
... previous post not yet through moderation.

TR seems to cache the reply, i.e., when I clear the Sessions and Accounting table, and user tries to authenticate, TR replies the same (simult-use exceeded). This is ok for a few users, but will this behavior scale up when number of users increase many-folds?
Isn't it better to submit query again to SQL Server, especially because databases have been designed for scalability now? SQL might also reside on another server, thereby offloading/negating the need for cached-reply memory needs.

Thanks,

Dexter
0 permalink
17.07.2011 08:09:36

dcbanaynal
dcbanaynal
Posts: 19
.. previous post not yet through, but this is a debugging update:
I think TR matches Start and Stop event for a session using the session's attributes. Here's from the TR log for the Start and Stop event. Notice the dissimilarity of the NAS-Port values for the Start and Stop event. These are for the same session:

RadAcct req. from : 192.168.2.254:1027 - 7/17/2011 12:59:15 PM
Size : 168 / 168
Identifier : 14
Attributes :
NAS-Port-Id = STA port # 1
Acct-Status-Type = Start
NAS-Identifier = SC3AC50F
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Connect-Info = CONNECT 54Mbps 802.11g
User-Name = test
NAS-Port = 1
Acct-Delay-Time = 0
Service-Type = Framed
NAS-IP-Address = 192.168.2.254
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = 1
NAS-Port-Type = Wireless
RadAcct req. from : 192.168.2.254:1027 - 7/17/2011 12:59:59 PM
Size : 186 / 186
Identifier : 15
Attributes :
Acct-Session-Time = 44
Acct-Status-Type = Stop
NAS-IP-Address = 192.168.2.254
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Framed-IP-Address = 192.168.2.130
User-Name = test
NAS-Port = 0
Acct-Delay-Time = 0
Acct-Terminate-Cause = User-Request
Connect-Info = CONNECT 54Mbps 802.11g
Service-Type = Framed
NAS-Port-Type = Wireless
NAS-Port-Id = STA port # 0
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = 1
NAS-Identifier = SC3AC50F


I cannot pinpoint at which part of the system did the NAS-Port value turned to zero, as I cannot debug either the NAS or TR.

Many thanks,

Dexter
0 permalink
17.07.2011 09:01:24

Admin
Admin
Administrator
Posts: 1833
Can you try the latest built which I've posted today? Let me know the result.
0 permalink
17.07.2011 09:39:27

dcbanaynal
dcbanaynal
Posts: 19
Hi,

I downloaded file as of 7/17/2011 2:11PM GMT+8.

Problem fixed!


By the way Sir, how long will TR remain free? Or is the free version has some kind of (any) limit?


Thanks,

Dexter
0 permalink
17.07.2011 10:08:56

dcbanaynal
dcbanaynal
Posts: 19
Hi,
This is an update. In fixing the Sessions clearing bug, TR somehow behaved diffrently with regards to Accounting table. With a user-requested stop, TR does insert for the Stop event, but it does delete operation:
@2011-07-17 14:58:52.753
INSERT into Accounting (StatusType, InputOcts, OutOcts, UserName, NasIPAddr, CallingStationId, CalledStationId, AcctSessTime, NasIdentifier, NasPort, NasPortId, NasPortType, FramedIPAddr, DisconnectCause, SessionID, [TimeStamp], [Amount]) values ('Stop', '', '', 'test', '192.168.2.254', 'C446196384F4', '00C0023AC50F:nowirez', '31', 'SC3AC50F', '0', 'STA port # 0', 'Wireless', '192.168.2.130', 'User-Request', 'e', DATEADD(second, -0, GETDATE()), 0)

Sometime after this TR submits:

@2011-07-17 14:58:52.787:
SELECT AcctSessTime from Accounting with (NOLOCK) where UserName = 'test' and AcctSessTime < 31 and StatusType = 'Stop' and NasIPAddr = '192.168.2.254' and NasIdentifier = 'SC3AC50F' and NasPortType = 'Wireless' and SessionID = 'e'

And then the delete:

@2011-07-17 14:58:52.803
DELETE from Accounting where AcctSessTime < 31 and StatusType = 'Stop' and NasIPAddr = '192.168.2.254' and NasIdentifier = 'SC3AC50F' and NasPortType = 'Wireless' and SessionID = 'e'

The log:

RadAcct req. from : 192.168.2.254:1037 - 7/17/2011 2:58:52 PM
Size : 186 / 186
Identifier : 135
Attributes :
RadAcct req. from : 192.168.2.254:1037 - 7/17/2011 2:58:52 PM
Size : 174 / 174
Identifier : 136
Attributes :
Acct-Session-Time = 31
Acct-Status-Type = Stop
NAS-IP-Address = 192.168.2.254
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Framed-IP-Address = 192.168.2.130
User-Name = test
NAS-Port = 0
Acct-Delay-Time = 0
Acct-Terminate-Cause = User-Request
Connect-Info = CONNECT 54Mbps 802.11g
Service-Type = Framed
NAS-Port-Type = Wireless
NAS-Port-Id = STA port # 0
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = e
NAS-Identifier = SC3AC50F
NAS-Port-Id = STA port # 1
NAS-Identifier = SC3AC50F
NAS-IP-Address = 192.168.2.254
Calling-Station-Id = C446196384F4
Acct-Authentic = RADIUS
Framed-MTU = 1488
Framed-IP-Address = 192.168.2.130
User-Name = test
NAS-Port = 1
Acct-Delay-Time = 0
Connect-Info = CONNECT 54Mbps 802.11g
Service-Type = Framed
Called-Station-Id = 00C0023AC50F:nowirez
Acct-Session-Id = f
Acct-Status-Type = Start
NAS-Port-Type = Wireless
0 permalink
17.07.2011 13:13:27

dcbanaynal
dcbanaynal
Posts: 19
For unknown reasons, I cannot reproduce the above problem, so I guess the problem's fixed until it shows up again. wink
0 permalink
17.07.2011 14:58:59

Admin
Admin
Administrator
Posts: 1833
TekRADIUS inserts interim-updates as Stop records to the accounting table. TekRADIUS will attempt to delete these artificial stop
records when "real" stop received.
0 permalink
17.07.2011 19:16:54

Admin
Admin
Administrator
Posts: 1833
TekRADIUS has already commercial editions; Enterprise and SP. TekRADIUS will always have a free edition.
0 permalink

Home » Bugs » Accounting Stop and Session Clearing





Powered by Jitbit Forum 7.2.13.0 © 2006-2011 Jitbit Software