[isf-wifidog] Download and time based limits

Tarken Winn tarkenwinn at gmail.com
Mer 12 Juil 17:37:22 EDT 2006

Hi Raj,

I am attempting a similar thing. I have hooked some code into auth/index.php
as you suggest which confirms whether a user still has credit remaining (I
am only implementing data usage restrictions) before allowing continued
access. I added a data_credit field to the users table to store this credit
information. When the session ends (authenticator->logout() and
includes/common.php->garbage_collect() methods from memory) I update this
field with session data (from connections table).

A couple of issues with my implementation - because data usage is only
updated every XX seconds a user can exceed their data limit for XX seconds
before they are kicked off. I don't consider this a major issue and for my
needs it is near enough. However, if you require totally accurate data
accounting my implementation would not be suitable. To a degree this could
be mitigated by lowering the ping/auth timing, however doing so could
potentially place considerable load on your auth server (as all nodes will
be pinging and sending auth requests more frequently). Also, disallowing
users suddenly when their credit expires seems a little unfriendly. I think
a two stage credit expiration will be necessary - warning at XX MB remaining
to give the user a chance to add more credit to their account.

I guess a timing based authentication would also be possible along similar
lines. Store a running total of time user has been connected and log them
out when their limit has been exceeded - time remaining == 0. One issue to
consider is that if a node goes down while a time restricted user is logged
in the auth server will need to account for how long said user was logged
in. I guess you could utilize the time of last heartbeat from given node and
integrate this into your time based accounting system? I haven't looked at
the connections table/data at all with a view to using time based
restrictions so I could be well off the mark here and it may just work 'as
is' if you deem the user to have been logged in up until the time of their
last heartbeat rather than the TIMESTAMP_OUT value (which may be set later
by garbage_collect).

Okay, I think this email could very easily end up a rambling mess as I
continue to think out loud. I hope at least some of my comments are correct
and useful for you. If you have any questions don't hesitate to ask.

DISCLAIMER: I am pretty new to this myself so am still attempting to get my
head around things. Anyone who has any better ideas or can correct me,
please do so!


On 7/13/06, Alexis Cornellier <alexis.cornellier at gmail.com> wrote:
> Hey, anyone, can you answer that guy? he seems to want to do something
> that we want for long time here at ISF operation.
> Alexis
> On 7/12/06, Rajkumar S. <rajkumars at asianetindia.com> wrote:
> >
> > Hi,
> >
> > I have a requirement to terminate customer's connection based on
> > either download limit or usage time. As far as I understand this is
> > not possible with wifidog. So I am trying to add support for these,
> > and if possible support for prepaid tokens and pins also.
> >
> > I am going through the code trying to read and understand. My idea is
> > to hook the limit checking into auth/index.php after the call to
> > $authenticator->acctStart
> >
> > I will add another method to authenticator to check if the user has
> > exceeded the defined limits.
> >
> > I am just checking if there are any existing plans/designs to get this
> > done. As far as possible I want to make sure that what I do is
> > compatable with the overall design of wifidog so that it can be
> > intagrated into the code base.
> >
> > I also want the meaning of Network, node, portal and content in the
> > context of wifidog. I have some vague idea and understanding but
> > getting a canonical def can help a lot in clarifying the concept.
> >
> > Right now when I try to browse from a machine I get the wifidog login
> > page but after logging I am not redirected to the url that I was
> > trying to browse, but to the logged in page. what I want is to get a
> > popup with the logout button and the browser should proceed to the url
> > I had originally typed.
> >
> > with regards,
> >
> > raj
> >
> >
> >
> > _______________________________________________
> > WiFiDog mailing list
> > WiFiDog at listes.ilesansfil.org
> > http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog
> >
> --
> Alexis Cornellier
> 327 53eme Avenue
> Pointe-Calumet, Québec
> J0N 1G4
> (450) 623-8454
> _______________________________________________
> WiFiDog mailing list
> WiFiDog at listes.ilesansfil.org
> http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listes.ilesansfil.org/pipermail/wifidog/attachments/20060713/47e2181a/attachment.htm

Plus d'informations sur la liste de diffusion WiFiDog