netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Richard Weinberger <richard@nod.at>
Cc: jengelh@medozas.de, eric.dumazet@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, rostedt@goodmis.org
Subject: Re: [PATCH v6] Netfilter ring buffer support
Date: Mon, 12 Mar 2012 14:08:03 +0100	[thread overview]
Message-ID: <20120312130803.GA31865@1984> (raw)
In-Reply-To: <4F5875B5.1090802@nod.at>

Hi Richard,

On Thu, Mar 08, 2012 at 10:02:45AM +0100, Richard Weinberger wrote:
> On 08.03.2012 02:28, Pablo Neira Ayuso wrote:
> >On Tue, Mar 06, 2012 at 12:19:42AM +0100, Richard Weinberger wrote:
> >>This patch set merges ipt_LOG and ip6t_LOG and adds ring buffer support
> >>to xt_LOG.
> >>
> >>Using "--ring" an user can create LOG rules which log messages into
> >>one or more ring buffers.
> >>Each ring buffer is represented as pipe-like file in
> >>/proc/net/netfilter/nf_log_ring/.
> >
> >I've spent part of the evening testing this and checking its
> >possibilities, the drawbacks that I see for this contribution are:
> >
> >* it uses the /proc entry, we have rejected similar add-ons in the
> >   past that have used these interfaces.
> 
> My fist implementation used sysfs/debug.
> I've switched to /proc/net/netfilter/ to make it consistent to the other
> netfilter stuff...
>
> Moving back to sysfs/debug/whatever can be done within minutes.
>
> >* one single reader can be reading at a time.
> 
> In which use-cache you need two _consuming_ readers?

One scenario in which two sysadmins are checking the logs to debug
some issues seems reasonable to me.

Anyway, my main points after testing several your buffer-ring things
are at the bottom of this email.

> Steve's ring_buffer supports also concurrent non-consuming reads.
> I can add support for this...
> 
> >Having said that, I still think that the feature that this provides
> >is useful, but I think that implementing this in user-space over
> >nfnetlink_log results in a much more flexible solution.
> >
> >I have made proof-of-concept daemon (it's a quick hack of several
> >hours) that implements the similar feature over nfnetlink_log,
> >advantages are:
> >
> >* You don't need to upgrade your kernel / iptables.
> >* You only need to install libnfnetlink, libnetfilter_log and the
> >   daemon.
> >* It can be extended to support multiple readers.
> >
> >So my conclusion is that you can make this in userspace in a much more
> >flexible way.
> >
> >You can find it here:
> >
> >http://1984.lsi.us.es/git/rlogd/
> >
> >The initial commit provides some description on how to use it:
> >
> >http://1984.lsi.us.es/git/rlogd/commit/?id=ccb88a8dc8ad674b860f2d3edabf07fe4830baf3
> >
> >I don't plan to develop / maintain that software. The last thing I
> >want in my todo list is yet another thing to maintain. If someone is
> >interested, please, feel free to grab it, make a nice website for it
> >and maintain it.
> >
> >The repository also contains an unfinished patch to add LOG format
> >support to libnetfilter_log.
> 
> I really don't like this rlogd thing.
>
> 1. It's yet another random netfilter userspace component.
> Please don't fragment it more.

IMO modularity is a good thing, independent user-space components
allow you to just upgrade the thing that you require.

> Installing iptables/conntrack/ulogd/etc... is already enough PITA
> because not all distros ship all this clustered components.

I think that recompiling your kernel or even wait until your distro
ships the new kernel with new extensions will take longer than packaging
some small user-space software and deploying it. Not talking about
packaging a new iptables package containing support for some new
feature.

This rlogd proof-of-concept thing (and user-space stuff in general)
will:

1) not need any kernel update.
2) be very easy to make a package and to deploy.
3) require no Linux kernel update since NFLOG has been there since
   long time.

> 2. As I described in my very fist RLOG patch, NFLOG does not include
> the same information.
> You cannot derive "PHYSIN" and "PHYSOUT" from the packet header.

Looking at the code, those are included if bridging is enabled.
Otherwise, I'll be happy to take a patch for this.

> 3. rlogd needs NFLOG which copies every packet (header) to userspace.
> What about performance...?

Reliability is also important, running things in user-space means that
bugs will no crash your system. Instead, they may crash your logging
daemon.

What I find hard to justify is that this feature can be implemented in
user-space with the existing netfilter logging interface.

  reply	other threads:[~2012-03-12 13:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 23:19 [PATCH v6] Netfilter ring buffer support Richard Weinberger
2012-03-05 23:19 ` [PATCH 1/6] Netfilter: Merge ipt_LOG and ip6_LOG into xt_LOG Richard Weinberger
2012-03-05 23:19 ` [PATCH 2/6] netfilter: xt_LOG: fix bogus extra layer-4 logging information Richard Weinberger
2012-03-05 23:19 ` [PATCH 3/6] ring_buffer: Export for_each_buffer_cpu() Richard Weinberger
2012-03-05 23:19 ` [PATCH 4/6] xt_log: Make printk() in sb_close() optional Richard Weinberger
2012-03-05 23:19 ` [PATCH 5/6] Netfilter: xt_LOG: Implement ring buffer support Richard Weinberger
2012-03-06  2:47   ` Steven Rostedt
2012-03-05 23:19 ` [PATCH 6/6] Netfilter: xt_LOG: Add timestamp support Richard Weinberger
2012-03-07 15:29   ` Pablo Neira Ayuso
2012-03-07 15:33     ` Richard Weinberger
2012-03-07 15:40     ` Eric Dumazet
2012-03-08  1:28 ` [PATCH v6] Netfilter ring buffer support Pablo Neira Ayuso
2012-03-08  9:02   ` Richard Weinberger
2012-03-12 13:08     ` Pablo Neira Ayuso [this message]
2012-03-12 13:27       ` Richard Weinberger
2012-03-12 14:12         ` Pablo Neira Ayuso
2012-03-12 18:00           ` Richard Weinberger

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=20120312130803.GA31865@1984 \
    --to=pablo@netfilter.org \
    --cc=eric.dumazet@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).