RE: Maximum size Input-Octets/Output-Octets

2005-09-26 Thread Guy Fraser
On Fri, 2005-23-09 at 19:42 +0200, Jonathan De Graeve wrote:
   What radacct are you talking about?  The Acct-Input-Octets stops
 at 2G because the RFC dictates that it's a 32-bit integer.  That's why
 the Acct-Input-Gigawords attribute was defined.  It goes past 2G.
 
 I'm talking about the detail file from freeradius.
 
 This is what I found in RFC2869
 
 5.1.  Acct-Input-Gigawords
 
Description
 
   This attribute indicates how many times the Acct-Input-Octets
   counter has wrapped around 2^32 over the course of this service
   being provided, and can only be present in Accounting-Request
   records where the Acct-Status-Type is set to Stop or Interim-
   Update.
 
 So I assumed that the wrapping went @ 4GB instead of 2GB
 
 From RFC2866:
 
 Value
 
   The Value field is four octets.
 
 Also:
 
   integer  32 bit unsigned value, most significant octet first.
 
 So its 32bit. (4GB right??)
 
 I will use 2147483647 for now. But I can't find the definition which
 says that it should be 2GB so I need to be sure.
 
 J.
What is right and what is in common use may be two different things.

In my experience, some NAS vendors generate negative numbers when 
the Octet Value is greater than 2^31.

By the way a GigaWord is 2147483648 bytes since a Word = 2 Bytes 
and Giga = 1024*1024*1024 = 1073741824. It would therefore make 
sense to use a modulo of 2147483648 for the Octet value which holds
the remainder of the full byte count.

Just in case you were wondering what a TeraQuad was after watching a
Star Trek NG episode it is 4398046511104 Bytes. ;^)


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


RE: Maximum size Input-Octets/Output-Octets

2005-09-26 Thread Jonathan De Graeve
So is it 2147483648 or 2147483647?

J.

--
Jonathan De Graeve
Network/System Administrator
Imelda vzw
Informatica Dienst
015/50.52.98
[EMAIL PROTECTED]

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Guy Fraser
Verzonden: maandag 26 september 2005 17:45
Aan: freeradius-users@lists.freeradius.org
Onderwerp: RE: Maximum size Input-Octets/Output-Octets

On Fri, 2005-23-09 at 19:42 +0200, Jonathan De Graeve wrote:
   What radacct are you talking about?  The Acct-Input-Octets stops
 at 2G because the RFC dictates that it's a 32-bit integer.  That's
why
 the Acct-Input-Gigawords attribute was defined.  It goes past 2G.
 
 I'm talking about the detail file from freeradius.
 
 This is what I found in RFC2869
 
 5.1.  Acct-Input-Gigawords
 
Description
 
   This attribute indicates how many times the Acct-Input-Octets
   counter has wrapped around 2^32 over the course of this service
   being provided, and can only be present in Accounting-Request
   records where the Acct-Status-Type is set to Stop or Interim-
   Update.
 
 So I assumed that the wrapping went @ 4GB instead of 2GB
 
 From RFC2866:
 
 Value
 
   The Value field is four octets.
 
 Also:
 
   integer  32 bit unsigned value, most significant octet first.
 
 So its 32bit. (4GB right??)
 
 I will use 2147483647 for now. But I can't find the definition which
 says that it should be 2GB so I need to be sure.
 
 J.
What is right and what is in common use may be two different things.

In my experience, some NAS vendors generate negative numbers when 
the Octet Value is greater than 2^31.

By the way a GigaWord is 2147483648 bytes since a Word = 2 Bytes 
and Giga = 1024*1024*1024 = 1073741824. It would therefore make 
sense to use a modulo of 2147483648 for the Octet value which holds
the remainder of the full byte count.

Just in case you were wondering what a TeraQuad was after watching a
Star Trek NG episode it is 4398046511104 Bytes. ;^)


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




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


RE: Maximum size Input-Octets/Output-Octets

2005-09-26 Thread Jonathan De Graeve
2147483647 it is :)))


--
Jonathan De Graeve
Network/System Administrator
Imelda vzw
Informatica Dienst
015/50.52.98
[EMAIL PROTECTED]

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Jonathan
De Graeve
Verzonden: maandag 26 september 2005 17:49
Aan: FreeRadius users mailing list
Onderwerp: RE: Maximum size Input-Octets/Output-Octets

So is it 2147483648 or 2147483647?

J.

--
Jonathan De Graeve
Network/System Administrator
Imelda vzw
Informatica Dienst
015/50.52.98
[EMAIL PROTECTED]

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Guy Fraser
Verzonden: maandag 26 september 2005 17:45
Aan: freeradius-users@lists.freeradius.org
Onderwerp: RE: Maximum size Input-Octets/Output-Octets

On Fri, 2005-23-09 at 19:42 +0200, Jonathan De Graeve wrote:
   What radacct are you talking about?  The Acct-Input-Octets stops
 at 2G because the RFC dictates that it's a 32-bit integer.  That's
why
 the Acct-Input-Gigawords attribute was defined.  It goes past 2G.
 
 I'm talking about the detail file from freeradius.
 
 This is what I found in RFC2869
 
 5.1.  Acct-Input-Gigawords
 
Description
 
   This attribute indicates how many times the Acct-Input-Octets
   counter has wrapped around 2^32 over the course of this service
   being provided, and can only be present in Accounting-Request
   records where the Acct-Status-Type is set to Stop or Interim-
   Update.
 
 So I assumed that the wrapping went @ 4GB instead of 2GB
 
 From RFC2866:
 
 Value
 
   The Value field is four octets.
 
 Also:
 
   integer  32 bit unsigned value, most significant octet first.
 
 So its 32bit. (4GB right??)
 
 I will use 2147483647 for now. But I can't find the definition which
 says that it should be 2GB so I need to be sure.
 
 J.
What is right and what is in common use may be two different things.

In my experience, some NAS vendors generate negative numbers when 
the Octet Value is greater than 2^31.

By the way a GigaWord is 2147483648 bytes since a Word = 2 Bytes 
and Giga = 1024*1024*1024 = 1073741824. It would therefore make 
sense to use a modulo of 2147483648 for the Octet value which holds
the remainder of the full byte count.

Just in case you were wondering what a TeraQuad was after watching a
Star Trek NG episode it is 4398046511104 Bytes. ;^)


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




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




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


RE: Maximum size Input-Octets/Output-Octets

2005-09-26 Thread Guy Fraser
On Mon, 2005-26-09 at 17:49 +0200, Jonathan De Graeve wrote:
 So is it 2147483648 or 2147483647?
 

2147483648 / 2147483648 = 1
2147483648 mod 2147483648 = 0

The range is 0 through 2147483647.


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


Re: Maximum size Input-Octets/Output-Octets

2005-09-23 Thread Alan DeKok
Jonathan De Graeve [EMAIL PROTECTED] wrote:
 Is it 2^32 or (2^32 - 1)

  2^32 can't be represented in a 32-bit number.  It has 33 bits of data...

  Alan DeKok.

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


RE: Maximum size Input-Octets/Output-Octets

2005-09-23 Thread Jonathan De Graeve
Ok,

I also have another question:

Freeradius seems to use signed integers for the Acc-Input/Output-Octets

Fri Sep 23 16:59:03 2005
Service-Type = Login-User
User-Name = jonathan
NAS-Identifier = hotspot-2.wlan.imz.be
NAS-Port = 0
NAS-Port-Type = Ethernet
Acct-Status-Type = Alive
Acct-Authentic = RADIUS
Acct-Session-Id = 4bd8b325bdeafd2d
Acct-Terminate-Cause = User-Request
Acct-Session-Time = 1353
Acct-Input-Octets = 46596288
Acct-Input-Packets = 1163323
Acct-Input-Gigawords = 0
Acct-Output-Octets = 2147483647
Acct-Output-Packets = 1787355
Acct-Output-Gigawords = 0
Called-Station-Id = 194.8.52.38
Calling-Station-Id = 192.168.2.255
Framed-IP-Address = 192.168.2.255
NAS-IP-Address = 194.8.52.38
Proxy-State = 0x3836
Client-IP-Address = 194.8.52.85
Acct-Unique-Session-Id = 925f85fa82a0afb0
Timestamp = 1127487543

The source really sends unsigned 32bit. Any idea why radacct just stops
@ 2GB

I've implemented Gigawords as follows:


function gigawords($bytes) {
/* We use BCMath functions since normal integers don't work */
$gigawords = bcdiv( bcsub( $bytes, remainder($bytes) ) ,
4294967295);

return $gigawords;
}

function remainder($bytes) {
/* Calculate the remainder */
$bytes = bcmod($bytes, 4294967295);

return $bytes;


-- 
Jonathan De Graeve
Network/System Administrator
Imelda vzw
Informatica Dienst
015/50.52.98
[EMAIL PROTECTED]

-
Always read the manual for the correct way to do things because the
number of incorrect ways to do things is almost infinite
-

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Alan DeKok
Verzonden: vrijdag 23 september 2005 16:39
Aan: FreeRadius users mailing list
Onderwerp: Re: Maximum size Input-Octets/Output-Octets 

Jonathan De Graeve [EMAIL PROTECTED] wrote:
 Is it 2^32 or (2^32 - 1)

  2^32 can't be represented in a 32-bit number.  It has 33 bits of
data...

  Alan DeKok.

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




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


Re: Maximum size Input-Octets/Output-Octets

2005-09-23 Thread Alan DeKok
Jonathan De Graeve [EMAIL PROTECTED] wrote:
 I also have another question:
 
 Freeradius seems to use signed integers for the Acc-Input/Output-Octets

  Nope.  The debug log you posted doesn't show that, and the server
source uses unsigned ints.

 The source really sends unsigned 32bit. Any idea why radacct just stops
 @ 2GB

  What radacct are you talking about?  The Acct-Input-Octets stops
at 2G because the RFC dictates that it's a 32-bit integer.  That's why
the Acct-Input-Gigawords attribute was defined.  It goes past 2G.

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


RE: Maximum size Input-Octets/Output-Octets

2005-09-23 Thread Jonathan De Graeve
  What radacct are you talking about?  The Acct-Input-Octets stops
at 2G because the RFC dictates that it's a 32-bit integer.  That's why
the Acct-Input-Gigawords attribute was defined.  It goes past 2G.

I'm talking about the detail file from freeradius.

This is what I found in RFC2869

5.1.  Acct-Input-Gigawords

   Description

  This attribute indicates how many times the Acct-Input-Octets
  counter has wrapped around 2^32 over the course of this service
  being provided, and can only be present in Accounting-Request
  records where the Acct-Status-Type is set to Stop or Interim-
  Update.

So I assumed that the wrapping went @ 4GB instead of 2GB

From RFC2866:

Value

  The Value field is four octets.

Also:

  integer  32 bit unsigned value, most significant octet first.

So its 32bit. (4GB right??)

I will use 2147483647 for now. But I can't find the definition which
says that it should be 2GB so I need to be sure.

J.



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