public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 21:48 Leif Sawyer
  2001-04-17 22:58 ` Manfred Bartz
  0 siblings, 1 reply; 42+ messages in thread
From: Leif Sawyer @ 2001-04-17 21:48 UTC (permalink / raw)
  To: Jesse Pollard, root, linux-kernel

> > Jesse Pollard replies:
> > to Leif Sawyer who wrote: 
> > >> Besides, what would be gained in making the counters RO, if 
> > >> they were cleared every time the module was loaded/unloaded?
> > > 
> > > 1. Knowlege that the module was reloaded.
> > > 2. Knowlege that the data being measured is correct
> > > 3. Having reliable measures
> > > 4. being able to derive valid statistics
> > > ....
> > 
> > Good.  Now that we have valid objectives to reach, which of these
> > are NOT met by making the fixes entirely in userspace, say by
> > incorporating a wrapper script to ensure that no external 
> applications
> > can flush the table counters?
> > 
> > They're still all met, right?
> 
> Nope - some of the applications that may be purchased do not have
> to go through the scripts to reset the counters. They just need access
> to the counters, and reset is built into the applications. 
> This violates
> all 4 objectives.
> 
> > And we haven't had to fill the kernel with more cruft.
> 
> Removing/no-oping the reset code would make the module
> SMALLER, and simpler.
> 

NO.  Don't remove the functionality that is required.  Fix your
userspace applications to behave correctly.  If _you_ require your
userspace applications to not clear counters, then fix the application.

The counters are not gospel.  The modules are not omnipresent.

Time and again, people beg and plead the kernel developers to change
the kernel to suit their personal biases and applications.  Historically
they have been vehemently against it.  Of what purpose does breaking EVERY
application out there by performing this kernel mod have?

As Matti Aarnio points out, this is nearly beaten to death.  Since none
of the 'Big Boys' have commented, my guess is that this is a moot argument,
and no changes to the kernel will take place.

/me steps off of soapbox
/me retires this thread

 

^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 23:06 Leif Sawyer
  0 siblings, 0 replies; 42+ messages in thread
From: Leif Sawyer @ 2001-04-17 23:06 UTC (permalink / raw)
  To: Manfred Bartz, linux-kernel

Manfred Bartz writes:
> You are confused.  What would you say if a close() by another,
> unrelated application closed all open descriptors for that file,
> including the one you just opened?  Just fix your applications?

Of course I would fix the application.
And I certainly wouldn't rip the close() out of libc, which is
the tactic that you are suggesting.

Sheesh.



 

^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 21:25 Jesse Pollard
  0 siblings, 0 replies; 42+ messages in thread
From: Jesse Pollard @ 2001-04-17 21:25 UTC (permalink / raw)
  To: lsawyer, Jesse Pollard, Ian.Stirling, root, linux-kernel

---------  Received message begins Here  ---------

> 
> Jesse Pollard replies:
> to Leif Sawyer who wrote: 
> >> Besides, what would be gained in making the counters RO, if 
> >> they were cleared every time the module was loaded/unloaded?
> > 
> > 1. Knowlege that the module was reloaded.
> > 2. Knowlege that the data being measured is correct
> > 3. Having reliable measures
> > 4. being able to derive valid statistics
> > ....
> 
> Good.  Now that we have valid objectives to reach, which of these
> are NOT met by making the fixes entirely in userspace, say by
> incorporating a wrapper script to ensure that no external applications
> can flush the table counters?
> 
> They're still all met, right?

Nope - some of the applications that may be purchased do not have
to go through the scripts to reset the counters. They just need access
to the counters, and reset is built into the applications. This violates
all 4 objectives.

> And we haven't had to fill the kernel with more cruft.

Removing/no-oping the reset code would make the module
SMALLER, and simpler.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 19:09 Leif Sawyer
  2001-04-17 19:37 ` Matti Aarnio
  2001-04-17 22:32 ` Manfred Bartz
  0 siblings, 2 replies; 42+ messages in thread
From: Leif Sawyer @ 2001-04-17 19:09 UTC (permalink / raw)
  To: Jesse Pollard, Ian.Stirling, root, linux-kernel

Jesse Pollard replies:
to Leif Sawyer who wrote: 
>> Besides, what would be gained in making the counters RO, if 
>> they were cleared every time the module was loaded/unloaded?
> 
> 1. Knowlege that the module was reloaded.
> 2. Knowlege that the data being measured is correct
> 3. Having reliable measures
> 4. being able to derive valid statistics
> ....

Good.  Now that we have valid objectives to reach, which of these
are NOT met by making the fixes entirely in userspace, say by
incorporating a wrapper script to ensure that no external applications
can flush the table counters?

They're still all met, right?

And we haven't had to fill the kernel with more cruft.


^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 18:31 Jesse Pollard
  0 siblings, 0 replies; 42+ messages in thread
From: Jesse Pollard @ 2001-04-17 18:31 UTC (permalink / raw)
  To: lsawyer, Jesse Pollard, Ian.Stirling, root, linux-kernel

Leif Sawyer <lsawyer@gci.com>:
> > And that introduces errors in measurement. It also depends on 
> > how frequently an uncontroled process is clearing the counters.
> > You may never be able to get a valid measurement.
> 
> This is true.  Which is why application programmers need to write
> code as if they are not the only [ab]users of data.
> 
> Which brings me back to my point.
> 
> Don't force the kernel to uphold your local application requirements
> of stable counters.
> 
> Enforce it in the userspace portion of the code.
> 
> <subtopic>
> Yes, you could extend the proc filesystem (ugh) with a flag that could
> be read by the ip[chains|tables] user app to determine if clearing flags
> were allowed.  Then a simple
> 
> echo 1 > /proc/sys/net/ipv4/counters_locked
> 
> or some such cruft.  But I don't see this extension making into the
> standard kernel at this time.  It just seems to be wasteful.
> </subtopic>
> 
> If you (at your site) really need this type of functionality, it's
> pretty darn simple to write a wrapper to ip[tables|chains] which
> silently (or not so) drops the option to clear the counters before
> calling the real version.
> 
> Besides, what would be gained in making the counters RO, if they were
> cleared every time the module was loaded/unloaded?

1. Knowlege that the module was reloaded.
2. Knowlege that the data being measured is correct
3. Having reliable measures
4. being able to derive valid statistics
....

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 16:57 Leif Sawyer
  0 siblings, 0 replies; 42+ messages in thread
From: Leif Sawyer @ 2001-04-17 16:57 UTC (permalink / raw)
  To: Jesse Pollard, Ian Stirling, linux-kernel

Jesse Pollard continues with:
> Leif Sawyer <lsawyer@gci.com>:
>>> Ian Stirling [mailto:root@mauve.demon.co.uk]
>>>> Manfred Bartz responded to
>>>>> Russell King <rmk@arm.linux.org.uk> who writes:
>>>>>
>>>>> You just illustrated my point.  While there is a 
>>>>> reset capability people will use it and accounting/
>>>>> logging programs will get wrong data.  Resetable
>>>>> counters might be a minor convenience when debugging
>>>>> but the price is unreliable programs and the loss of the 
>>>>> ability of several programs to use the same counters.
>>>> 
>>>> You of course, are commenting from the fact that your 
>>>> applications are stupid, written poorly, and cannot handle
>>>> 'wrapped' data.  Take MRTG
>>>> <snip>
>>>> Similarly, if my InPackets are at 102345 at one read, and 
>>>> 2345 the next read, and I know that my counter is 32 bits,
>>>> then I know i've wrapped and can do
>>> 
>>> I think the point being made is that if InPackets are at 
>>> 102345 at one read, and 2345 the next, and you know it's
>>> a 32 bit counter, it's completely unreliable to assume that
>>> you have in fact recieved 4294867295 packets, if the counter
>>> can be zeroed. You can say nothing other than at least 2345
>>> packets, at most 2345+n*2^32 have been got since you last
>>> checked.
>> 
>> Ah, yes.. I seem to have misplaced a bit of text in my reply.
>> 
>> The continuation of thought:
>> 
>> How the application derives the status of a wrapped counter or
>> a zero'ed counter is dependant on the device being monitored.
>> 
>> Yes, you have to know what your interface is capable of 
>> (maxbytes/sec) so that you can do a simple calculation where:
>> 
>> maximum_throughput = maxbytes_sec * (time_now - time_last_read)
>> 
>> and if your previous good counter + the maximum throughput wraps
>> the counter, you have a good chance that you've simply wrapped.
>> 
>> If not, then you can assume that your counters were cleared 
>> at some point, log the data you've got, and keep moving forward.
> 
> And that introduces errors in measurement. It also depends on 
> how frequently an uncontroled process is clearing the counters.
> You may never be able to get a valid measurement.

This is true.  Which is why application programmers need to write
code as if they are not the only [ab]users of data.

Which brings me back to my point.

Don't force the kernel to uphold your local application requirements
of stable counters.

Enforce it in the userspace portion of the code.

<subtopic>
Yes, you could extend the proc filesystem (ugh) with a flag that could
be read by the ip[chains|tables] user app to determine if clearing flags
were allowed.  Then a simple

echo 1 > /proc/sys/net/ipv4/counters_locked

or some such cruft.  But I don't see this extension making into the
standard kernel at this time.  It just seems to be wasteful.
</subtopic>

If you (at your site) really need this type of functionality, it's
pretty darn simple to write a wrapper to ip[tables|chains] which
silently (or not so) drops the option to clear the counters before
calling the real version.

Besides, what would be gained in making the counters RO, if they were
cleared every time the module was loaded/unloaded?



^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-17 12:28 Jesse Pollard
  0 siblings, 0 replies; 42+ messages in thread
From: Jesse Pollard @ 2001-04-17 12:28 UTC (permalink / raw)
  To: lsawyer, Ian Stirling, linux-kernel

Leif Sawyer <lsawyer@gci.com>:
> > From: Ian Stirling [mailto:root@mauve.demon.co.uk]
> > > Manfred Bartz responded to
> > > > Russell King <rmk@arm.linux.org.uk> who writes:
> > <snip>
> > > > You just illustrated my point.  While there is a reset capability
> > > > people will use it and accounting/logging programs will get wrong
> > > > data.  Resetable counters might be a minor convenience 
> > when debugging
> > > > but the price is unreliable programs and the loss of the 
> > ability of
> > > > several programs to use the same counters.
> > > 
> > > You of course, are commenting from the fact that your 
> > applications are
> > > stupid, written poorly, and cannot handle 'wrapped' data.  Take MRTG
> > <snip>
> > > Similarly, if my InPackets are at 102345 at one read, and 
> > 2345 the next
> > > read,
> > > and I know that my counter is 32 bits, then I know i've 
> > wrapped and can do
> > 
> > I think the point being made is that if InPackets are at 
> > 102345 at one read,
> > and 2345 the next, and you know it's a 32 bit counter, it's completely
> > unreliable to assume that you have in fact recieved 4294867295
> > packets, if the counter can be zeroed.
> > You can say nothing other than at least 2345 packets, at most 
> > 2345+n*2^32 have been got since you last checked.
> 
> Ah, yes.. I seem to have misplaced a bit of text in my reply.
> 
> The continuation of thought:
> 
> How the application derives the status of a wrapped counter or
> a zero'ed counter is dependant on the device being monitored.
> 
> Yes, you have to know what your interface is capable of (maxbytes/sec)
> so that you can do a simple calculation where:
> 
> maximum_throughput = maxbytes_sec * (time_now - time_last_read)
> 
> and if your previous good counter + the maximum throughput wraps the
> counter, you have a good chance that you've simply wrapped.
> 
> If not, then you can assume that your counters were cleared at some point,
> log the data you've got, and keep moving forward.

And that introduces errors in measurement. It also depends on how frequently
an uncontroled process is clearing the counters. You may never be able to
get a valid measurement.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-16 23:52 Leif Sawyer
  0 siblings, 0 replies; 42+ messages in thread
From: Leif Sawyer @ 2001-04-16 23:52 UTC (permalink / raw)
  To: Ian Stirling, linux-kernel

> From: Ian Stirling [mailto:root@mauve.demon.co.uk]
> > Manfred Bartz responded to
> > > Russell King <rmk@arm.linux.org.uk> who writes:
> <snip>
> > > You just illustrated my point.  While there is a reset capability
> > > people will use it and accounting/logging programs will get wrong
> > > data.  Resetable counters might be a minor convenience 
> when debugging
> > > but the price is unreliable programs and the loss of the 
> ability of
> > > several programs to use the same counters.
> > 
> > You of course, are commenting from the fact that your 
> applications are
> > stupid, written poorly, and cannot handle 'wrapped' data.  Take MRTG
> <snip>
> > Similarly, if my InPackets are at 102345 at one read, and 
> 2345 the next
> > read,
> > and I know that my counter is 32 bits, then I know i've 
> wrapped and can do
> 
> I think the point being made is that if InPackets are at 
> 102345 at one read,
> and 2345 the next, and you know it's a 32 bit counter, it's completely
> unreliable to assume that you have in fact recieved 4294867295
> packets, if the counter can be zeroed.
> You can say nothing other than at least 2345 packets, at most 
> 2345+n*2^32 have been got since you last checked.

Ah, yes.. I seem to have misplaced a bit of text in my reply.

The continuation of thought:

How the application derives the status of a wrapped counter or
a zero'ed counter is dependant on the device being monitored.

Yes, you have to know what your interface is capable of (maxbytes/sec)
so that you can do a simple calculation where:

maximum_throughput = maxbytes_sec * (time_now - time_last_read)

and if your previous good counter + the maximum throughput wraps the
counter, you have a good chance that you've simply wrapped.

If not, then you can assume that your counters were cleared at some point,
log the data you've got, and keep moving forward.


^ permalink raw reply	[flat|nested] 42+ messages in thread
* RE: IP Acounting Idea for 2.5
@ 2001-04-16 22:35 Leif Sawyer
  2001-04-16 23:42 ` Ian Stirling
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Leif Sawyer @ 2001-04-16 22:35 UTC (permalink / raw)
  To: Manfred Bartz, linux-kernel

Manfred Bartz responded to
> Russell King <rmk@arm.linux.org.uk> who writes:
> 
> > On Mon, Apr 16, 2001 at 12:07:31PM +1000, Manfred Bartz wrote:
> > > There is another issue with logging in general:
> > > 
> > >                 *COUNTERS MUST NOT BE RESETABLE!!!*
> > 
> > Umm, no.  Counters can be resetable - you just specify that 
> > accounting programs should not reset them, ever.
> > 
> > The ability to reset counters is extremely useful if you're a human
> > looking at the output of iptables -L -v.  (I thus far know of no one
> > who can memorise the counter values for around 40 rules).
> 
> You just illustrated my point.  While there is a reset capability
> people will use it and accounting/logging programs will get wrong
> data.  Resetable counters might be a minor convenience when debugging
> but the price is unreliable programs and the loss of the ability of
> several programs to use the same counters.

You of course, are commenting from the fact that your applications are
stupid, written poorly, and cannot handle 'wrapped' data.  Take MRTG
as one example of a good application, for it can handle counters that
have been cleared between reads.
 
> Also, do you always reset the date and time everytime you make time 
> measurements?

No, but i realize that if my time has incremented, and my date has not
changed, then it's later.  If my time has _decremented_ and my date has not,
then I've time-warped.  If my time has decremented and my date has
incremented,
then it's simply the next-date-increment.

Similarly, if my InPackets are at 102345 at one read, and 2345 the next
read,
and I know that my counter is 32 bits, then I know i've wrapped and can do
my
own math.

Applications need to get smarter.  Don't place arbitrary rules where they
don't
belong.

^ permalink raw reply	[flat|nested] 42+ messages in thread
* IP Acounting Idea for 2.5
@ 2001-04-16 21:53 David Findlay
  2001-04-16  0:21 ` Michael Clark
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: David Findlay @ 2001-04-16 21:53 UTC (permalink / raw)
  To: linux-kernel

I am using the kernel IP Accounting in Linux to record the amount of data 
transfered via my Linux internet gateway from individual IP addresses. This 
currently requires me to set up an accounting rule for each IP address that I 
want to record accounting info for. If I had 200 machines to individually log 
this would require me to set 200 rules.

In the 2.5 series of kernels, working towards 2.6, could you please make the 
IP Accounting so that I can set a single rule that will make it watch all IP 
traffic going from the local network, through the masquerading service to the 
internet, and log local IP Addresses using it? This would allow me to set 1 
rule, but have the information I want on a per IP address system.

One other person I have talked to would like to see this too, and he 
basically says we need a software version of the Cisco IP Accounting 
server/router.

Could you please add this to the next kernel? Please CC me your responses as 
I am not a member of the kernel mailing list. Thanks,

David

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2001-05-01 23:14 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-17 21:48 IP Acounting Idea for 2.5 Leif Sawyer
2001-04-17 22:58 ` Manfred Bartz
2001-04-17 23:13   ` Alan Cox
2001-04-17 23:35     ` Manfred Bartz
2001-04-18  0:02       ` Alan Cox
2001-04-20  2:51         ` Ton Hospel
2001-05-01 23:13           ` Mark van Walraven
2001-04-18  8:16     ` Kenneth Johansson
2001-04-18 14:45       ` Jonathan Lundell
  -- strict thread matches above, loose matches on Subject: below --
2001-04-17 23:06 Leif Sawyer
2001-04-17 21:25 Jesse Pollard
2001-04-17 19:09 Leif Sawyer
2001-04-17 19:37 ` Matti Aarnio
2001-04-18 13:49   ` Michael Clark
2001-04-17 22:32 ` Manfred Bartz
2001-04-17 18:31 Jesse Pollard
2001-04-17 16:57 Leif Sawyer
2001-04-17 12:28 Jesse Pollard
2001-04-16 23:52 Leif Sawyer
2001-04-16 22:35 Leif Sawyer
2001-04-16 23:42 ` Ian Stirling
2001-04-17  1:13 ` Manfred Bartz
2001-04-17 10:34 ` Olaf Titz
2001-04-16 21:53 David Findlay
2001-04-16  0:21 ` Michael Clark
2001-04-16  0:40 ` Mike A. Harris
2001-04-16 22:46   ` David Findlay
2001-04-16  0:50     ` Mike A. Harris
2001-04-16  1:58       ` swds.mlowe
2001-04-16  1:24     ` Matti Aarnio
2001-04-16  2:07     ` Manfred Bartz
2001-04-16  9:43       ` Russell King
2001-04-16 22:24         ` Manfred Bartz
2001-04-17 10:29         ` Olaf Titz
2001-04-17  1:43       ` Harald Welte
2001-04-17  2:37         ` Manfred Bartz
2001-04-17  6:56         ` Henning P. Schmiedehausen
2001-04-20 16:17           ` Harald Welte
2001-04-20 21:00             ` Henning P. Schmiedehausen
2001-04-16 11:21     ` Andreas Ferber
2001-04-16  2:40 ` Dax Kelson
2001-04-17  1:39 ` Harald Welte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox