[RADIATOR] radpwtst - sending multiple packets

Michael ringo at vianet.ca
Thu Jan 6 14:10:12 CST 2011


Sounds good.  i'll check out that module.  What I was trying to do is 
log what I call a 'checkpoint' for all online sessions for the purpose 
of calculating monthly bandwidth usage.  if a session starts in one 
month, but logs out in a different month, you can't calculate the 
monthly usage accurately.  I wanted to log a checkpoint entry containing 
the usage on the 1st of every month for each session.  with that, usage 
can be subtracted to find the usage of that month.

So, i ended up using 'Alive' packets to accomplish this. Seems like kind 
of a hack, but it works pretty good.

<Client ...>
...
# for a 40 minute windows on the 1st of every month, set 
Acct-Status-Type = checkpoint
ClientHook sub { my $req = ${$_[0]}; \
     my $dHM = &Radius::Util::format_special("%d,%H,%M");
     my( $d, $H, $M ) = ( split(/,/,$dHM) )[0,1,2];
     if( $d == 1 && $H == 0 && $M <= 40 && 
$req->get_attr('Acct-Status-Type') eq 'Alive' ) {
&main::log($main::LOG_WARNING, "ClientHook: 1st of the month. 
configuring Alive packet as a checkpoint.");
       $req->change_attr('Acct-Status-Type','checkpoint');
     }
...
</Client>

And then later, in an AuthBy:

<AuthBy SQL>
...
# for Acct-Status-Type = checkpoint
         HandleAcctStatusTypes   checkpoint
         AcctSQLStatement INSERT INTO some_table ( sess_id, timestamp, 
upload, download, ..... ) \
                         VALUES ( '%{Acct-Session-Id}', %b, ... ) \
                         ON DUPLICATE KEY UPDATE (x=y,xx=yy, ....)

...
</AuthBy>


Michael

On 11-01-05 08:43 PM, Kiernan McColl wrote:
> You could use radiator's Radius::Radius perl module from within your own perl script. That way you could fork if a single thread isn't sending them fast enough for your needs.
> I believe there's an example in the goodies directory.
>
> -----Original Message-----
> From: radiator-bounces at open.com.au [mailto:radiator-bounces at open.com.au] On Behalf Of Bjoern A. Zeeb
> Sent: Thursday, January 06, 2011 5:37 AM
> To: Michael
> Cc: radiator at open.com.au list
> Subject: Re: [RADIATOR] radpwtst - sending multiple packets
>
> On Wed, 5 Jan 2011, Michael wrote:
>
> Hi,
>
>> I'm trying to figure out the best way to send multiple radius packets to
>> a server.  It seems that executing radpwtst once for each individual
>> packet is pretty slow.  I assume it is slow since it has to compile,
>> parse the dictionary, and do whatever else radpwtst has to do each time
>> it is run.  I'm wondering if there is a way to have radpwtst run once,
>> and send/receive multiple packets.
>>
>> I see there is a -rawfileseq option that appears to do this, but i don't
>> see this as being a documented option in the manual.  How do you
>> generate raw packets to build a raw file?
>>
>> Is there any other ways of sending/receiving radius packets to a server?
>
> Depends on what you really want to accomplish.  Shell loops of
> radpwtst have often been suggested in the past; I found them painful
> to script though.  There is a problem of deltaT (rtt) as well, so you need
> parallel radpwtst to actually get to speed and with that you need to
> make sure to not send duplicates, yadda yadda yadda.  It's ok if you
> want to check a couple of hundred requests.
>
> For benchmarking and pushing servers in the multiple thousands of
> reqs/s you probably want something more sophisticated but perl and
> Radiator have proven to be able to do that fairly well, even on a
> desktop machine;)
>
> /bz
>



More information about the radiator mailing list