All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Harald Welte <laforge@netfilter.org>
Cc: Henrik Nordstrom <hno@marasystems.com>,
	Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>
Subject: Re: ctnetlink questions
Date: Mon, 20 Oct 2003 21:52:05 +0200	[thread overview]
Message-ID: <3F943CE5.80809@trash.net> (raw)
In-Reply-To: <20031020185258.GD20288@sunbeam.de.gnumonks.org>

Harald Welte wrote:

>Actually, another point is what to do with expectations.  
>
>It's not as problematic as with conntrack's, but in general it's the
>same.  Let's say:
>
>- conntrack helper creates expectation for typle xyz
>- userspace gets a list of unconfirmed expects
>- expectation for tuple xyz is confirmed
>- conntrack helper creates a new expectation for tuple xyz
>- userspace wants to remove expectation by referring to tuple xyz.
>
>At least in this case, that might actually be what the user wants -
>since there is not much difference between the two expectations, other
>than time passing in between.
>
>If the helper is automatically re-adding expectation upon confirmation,
>than the user can race with incoming connections in order to 'break the
>circle' ;) 
>
>I think there is not too much point in removing expect's anyway.  The
>real need is for adding and modyfing expectations, in case there is a
>userspace conntrack/nat helper.
>
>What do you think?
>

I agree. Removing is not very important. Modifying also requires a way to
identify the expectation. Currently (as you might have noticed) the
expectations also include an id. The namespace could probably be smaller
than for conntracks but I need to think about this some more after catching
breakfast.

BTW: I thought a bit about userspace helpers, they need to be synchronous
like they are now so we don't get races were an expectation arrives before
it's registered. So they should probably receive their packets though
ip_queue. How realistic do you think is it to move ftp/irc/amanda... to
userspace ? All of them operate on low traffic protocols, but if they sent
packets to userspace through netlink sockets operation can easily be
interrupted be sending lots of traffic that will fill up the socket buffer.

>btw: In the failover code, I have another problem with regard to
>expect's:  A sibling conntrack has a pointer to the master expect, not
>the master conntrack.  But i somehow need to replicate that pointer.
>Without Krisztians idmap (that I've already ripped out), I'm now passing
>the master conntrack's tuple and the expectation's tuple.    This works
>while doing normal sync:  There can always be only one unconfirmed
>expectation for every tuple.
>
>However, when doing a initial sync (or a full-resync), I cannot
>replicate the whole tree of master and siblings - because I first
>replicate the conntracks and then later have to fill in the [confirmed]
>expectations as glue in between.  
>
>The only idea I have is to use the 'seq' number.  However, this again
>only works for TCP.
>
>Any other options?
>

I have not studied the code intensively, but can't you just sync the tables
in order of the hierachie:

conntrack
conntrack, master-expect, sibling-conntrack, sibling-conntrack, ...
conntrack
...

Best regards,
Patrick

>(in the Future, I think we will at least optionally have per-connection
>byte and packet counters.  Then the 'seq' field could be initialized to
>the byte counter at the time the expectation was raised.  This would
>solve the udp case [and other udp races which Patrick can tell us
>nightmares of]. However, this is once again enlarging conntrack - but
>only if somebody wants to use 'connbytes' match or create netflow-style
>connection logs.  But we could require that compile option in case
>somebody wants to enable failover)
>

  reply	other threads:[~2003-10-20 19:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031019171851.GR21521@sunbeam.de.gnumonks.org>
2003-10-19 19:36 ` ctnetlink questions Patrick McHardy
2003-10-19 20:28   ` Harald Welte
2003-10-19 22:55     ` Patrick McHardy
2003-10-20  1:05       ` Henrik Nordstrom
2003-10-20  3:01         ` Patrick McHardy
2003-10-20  3:09           ` Patrick McHardy
2003-10-20  6:34           ` Henrik Nordstrom
2003-10-20 17:53             ` Patrick McHardy
2003-10-20  7:15           ` Harald Welte
2003-10-20  9:37             ` Henrik Nordstrom
2003-10-20 18:43               ` Patrick McHardy
2003-10-20 18:37                 ` Harald Welte
2003-10-20 19:17                   ` Patrick McHardy
2003-10-20 19:41                   ` Balazs Scheidler
2003-10-20 20:20                     ` Patrick McHardy
2003-10-20 22:59                       ` Harald Welte
2003-10-20 18:17             ` Patrick McHardy
2003-10-20 18:39               ` Harald Welte
2003-10-20 19:21                 ` Patrick McHardy
2003-10-21 16:47                 ` Patrick McHardy
2003-10-21 19:54                   ` Henrik Nordstrom
2003-10-21 20:00                     ` Patrick McHardy
2003-10-20 18:52               ` Harald Welte
2003-10-20 19:52                 ` Patrick McHardy [this message]
2003-10-20 23:09                   ` Harald Welte
2003-10-20  7:04         ` Harald Welte
2003-10-20  7:17         ` Jozsef Kadlecsik
2003-10-20  9:29           ` Henrik Nordstrom
2004-02-06 18:52             ` Harald Welte
2004-02-09 10:33               ` Pablo Neira
2004-02-10 12:39               ` Patrick McHardy
2004-02-14 20:03                 ` Harald Welte
2004-02-15 10:01                   ` Patrick McHardy
2004-02-17 21:37                     ` Harald Welte
2003-10-20 14:48           ` Harald Welte
2003-10-20 18:53             ` Patrick McHardy
2003-10-20 22:57               ` Harald Welte
2003-10-20 11:11         ` Jozsef Kadlecsik
2003-10-20  6:58       ` Harald Welte
2003-10-19 14:54 Harald Welte

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=3F943CE5.80809@trash.net \
    --to=kaber@trash.net \
    --cc=hno@marasystems.com \
    --cc=laforge@netfilter.org \
    --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.