All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Welte <laforge@netfilter.org>
To: jamal <hadi@cyberus.ca>
Cc: sandr8@crocetta.org, devik@cdi.cz, netdev@oss.sgi.com,
	netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH 2/4] deferred drop, __parent workaround, reshape_fail
Date: Tue, 24 Aug 2004 20:57:03 +0200	[thread overview]
Message-ID: <20040824185703.GP26877@sunbeam.de.gnumonks.org> (raw)
In-Reply-To: <1092662998.2874.102.camel@jzny.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3452 bytes --]

On Mon, Aug 16, 2004 at 09:29:59AM -0400, jamal wrote:
> > some later data.  It SHOULD not care whether this later data for the
> > same flow has bigger or smaller byte/packet counters. [and
> > it is very unlikely that the total will be lower, since then in the
> > timeframe [snapshot, terminations] more packets have to be dropped than
> > accepted.  Still, if this is documented with ctnetlink I'm perfectly
> > fine which such behaviour.
> 
> I am too. Good stuff.
> I think 99.9% of accounting would be happy with getting data after the
> call is done; the other 0.01% may have to live with extra packets later
> which undo things. 
> Are you working on something along the IPFIX protocol for transport?

Yes, I am working on the next generation of ulogd (ulogd-2).  It will
allow you to stack multiple plugins on top of each other, such as:

ctnetlink -> ipfix

or 

ulog -> packet parser -> flow_aggrgation -> ipfix 

or even exporting per-packet data in ipfix 

ulog -> packet parser -> ipfix

It's far from complete, but I'm almost finished with the core and can
start to write the plugins:
http://svn.gnumonks.org/branches/ulog/ulogd2/

> Let me think about it.
> Clearly the best place to account for things is on the wire once the
> packet has left the box ;-> 

This is arguable.  Why not once the packet was receieved on the incoming
wire?  If you are Ingress router of your network, your ISP bills you for
the amout of traffic it sends to your ingress router.

OTOTH, for egress traffic I agree.

> How open are you to move accounting further down? My thoughts
> are along the lines of incrementing the contrack counters at the qdisc
> level. Since you transport after the structure has been deleted, it
> should work out fine and fair billing will be taken care of.

Sure, it can be done... but you need to grab ip_conntrack_lock in order
to do so.

> Has someone done experimented and figured how expensive it would be to
> do it at the qdisc level? Note, you can probably have a low level
> grained lock just for stats.

It doesn't help.  Currently we still have one global rwlock for all
conntrack's.  There are patches for per-bucket locking.  

But well, as long as the usage count of ip_conntrack doesn't drop to
zero (which we're guaranteed since our skb still references it), and we
don't need to walk the hash table, we don't actually need to grab
ip_conntrack_lock.   A seperate accounting lock would be possible.

Somebody needs to implement this and run profiles...

> INC_STATS is generic (goes in the generic stats code in attached patch)
> and will have an ifdef for contrack billing (which includes unbilling
> depending on reason code). Reason code could be results that are now
> returned.
> As an example NET_XMIT_DROP is definetely unbilling while
> NET_XMIT_SUCCESS implies bill. 

sounds fine to me.  But this basically means that we would hide
conntrack counters behind generic API - the counters themselves are
stored in our own data structure.

> cheers,
> jamal
-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-08-24 18:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-13  0:48 [PATCH 2/4] deferred drop, __parent workaround, reshape_fail sandr8
2004-08-13 12:51 ` jamal
2004-08-13 14:09   ` sandr8
2004-08-14 21:21     ` jamal
2004-08-16  7:35       ` Harald Welte
2004-08-16 13:29         ` jamal
2004-08-24 18:57           ` Harald Welte [this message]
2004-08-25 12:12             ` jamal
2004-08-16  7:20   ` Harald Welte
2004-08-16 13:00     ` jamal
2004-08-16 13:08       ` Harald Welte
2004-08-16 15:19       ` sandr8
2004-08-17 11:52         ` jamal
2004-08-17 13:40           ` [PATCH 2/4] deferred drop, __parent workaround, reshape_fail , netdev@oss.sgi.com , sandr8
2004-08-22 15:17             ` Billing 1: WAS (Re: " jamal
2004-08-23  9:33               ` sandr8
2004-08-24 18:38               ` Harald Welte
2004-08-22 15:38             ` Billing 2: WAS(Re: " jamal
2004-08-22 16:12             ` Billing 3: " jamal
2004-08-23  9:39               ` sandr8
2004-08-23 11:38                 ` Billing 3-1: " jamal
2004-08-23 12:04                   ` sandr8
2004-08-23 12:31                     ` jamal
2004-08-23 11:58                 ` Billing 3: " jamal
2004-08-23 12:27                   ` sandr8
2004-08-25 11:34                     ` jamal
2004-08-23 12:15                 ` Billing 3-3: " jamal
2004-08-24 18:46               ` Billing 3: " Harald Welte
2004-08-25 11:50                 ` jamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040824185703.GP26877@sunbeam.de.gnumonks.org \
    --to=laforge@netfilter.org \
    --cc=devik@cdi.cz \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=sandr8@crocetta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.