From: Pablo Neira <pablo@eurodev.net>
To: Josh Samuelson <josamue1@wsc.edu>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] new match extension `flow'
Date: Sun, 31 Oct 2004 15:41:49 +0100 [thread overview]
Message-ID: <4184F9AD.9040902@eurodev.net> (raw)
In-Reply-To: <20041031063813.GA29402@wsc.edu>
Josh,
Josh Samuelson wrote:
>On Fri, Oct 29, 2004 at 09:32:44PM +0200, Pablo Neira wrote:
>
>
>>cool, nice work. But can't we do a match which counts new connections? I
>>bet that
>>the problem is that we don't know when a connection is closed, maybe we
>>could add a
>>new ip_conntrack_status (something like IPS_CLOSED_BIT) which would be
>>set when
>>a connection is closed, i.e. in tcp tracking when in time
>>TIME_WAIT/FIN_WAIT). I don't
>>like so much the idea of adding more stuff to the core of the conntrack
>>to keep things simpler.
>>
>>Pablo
>>
>>
>
>That's what I thought was elegant about this approach, the simplicity.
>Besides the added code needed to set up the memory structures to store
>the counters and the proc entries, there are only two entry points for
>the added code. One in init_conntrack() -> ip_conntrack_flow_inc(), the
>other in destroy_conntrack() -> ip_conntrack_flow_dec().
>Counter increment/decrement happen closest to when the state
>of the connection tracking actually change. The cost of this
>code path is always going to contain a hash computation, a linked list
>search to find the structure, then increment/decrement the relevant
>counter. New and unused old flow structures will have an
>allocation/deallocation and linked list add/delete overhead added to the
>former stated cost.
>
>Later, the match modules that could use the data from these flow structures
>only have to compute a hash/LL search for the structure, then compare the
>data. No looping through the ip_conntrack_hash to count protocol types,
>meanwhile checking states/timeouts or even invalidating the existence
>of conntracks the match function believes exist against what the
>connection tracking core actually has; executing said process for
>each matched packet.
>
>
Sure, your solution is smart but I still think we can do that that this
stuff without adding it to the core of the conntrack. I think that this
is a perfect client of the event notification API which is *still* in
development (expect changes).
See:
https://lists.netfilter.org/pipermail/netfilter-devel/2004-October/017132.html
What I have in mind:
a) Move the flow API as is into a kernel module that implements a match.
b) register two functions which catch IPCT_NEW/RELATED and IPCT_DESTROY
events. These functions keep updated the hash table with info about
new/closed connections.
Another issue, AFAICS with your approach we can limit the number of
connections per machine, but not per network, i.e. limit to 256 tcp
connections for the whole 192.168.20.0/24, that's a different problem to
resolve though..
Pablo
next prev parent reply other threads:[~2004-10-31 14:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-28 2:05 [PATCH] new match extension `flow' Josh Samuelson
2004-10-28 20:15 ` Josh Samuelson
2004-10-29 19:32 ` Pablo Neira
2004-10-31 6:38 ` Josh Samuelson
2004-10-31 14:41 ` Pablo Neira [this message]
2004-11-04 2:20 ` Josh Samuelson
2004-11-06 15:19 ` Pablo Neira
2004-11-08 2:52 ` Josh Samuelson
2004-11-10 18:12 ` Pablo Neira
2004-11-13 22:12 ` Pablo Neira
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=4184F9AD.9040902@eurodev.net \
--to=pablo@eurodev.net \
--cc=josamue1@wsc.edu \
--cc=netfilter-devel@lists.netfilter.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.