netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Werner Almesberger <werner@almesberger.net>
Cc: jamal <hadi@cyberus.ca>, Patrick McHardy <kaber@trash.net>,
	Stephen Hemminger <shemminger@osdl.org>,
	netdev@oss.sgi.com
Subject: Re: [RFC] batched tc to improve change throughput
Date: Wed, 19 Jan 2005 18:22:22 +0100	[thread overview]
Message-ID: <20050119172222.GC26856@postel.suug.ch> (raw)
In-Reply-To: <20050119133353.H15303@almesberger.net>

* Werner Almesberger <20050119133353.H15303@almesberger.net> 2005-01-19 13:33
> Thomas Graf wrote:
> > filtering. The mistake they did was to completely rely on the
> > state machine for even the most simple packet classification
> > problems.
> 
> I don't see much of a performance problem: once you have a nice
> FSM with single-bit decisions, you can quite easily construct
> various efficient matcher stages. You can even prepare (or
> compile on the fly) suitable specialized matchers. If doing the
> matching in hardware, you may even use just the FSM.

I guess we're speaking of slightly different FSMs. I assume yours
is 100% hardcoded and only works for static patterns? Those you
could also implement in FPGAs quite easly.

Assuming one needs 2K rules for classyfing on top of some kind of
dynamic header, assuming IPv4 and IPv6 for now. The static FSMs
needs to parse the headers everytime which isn't much of a
problem with IPv4 but gets really expensive with IPv6 even with
specialized instructions to parse through the options. Sure,
one can put packets into classes and build filters on top of it,
but once splitted one can never merge them together again.

I've seen many static FSMs based on BPF, which I assume is
what you're talking about. _All_ of them break in practical
situations no longer matching the theory.

The only way I see to solve this is to put more logic into the
state machine. Give the state machine the chance to share
data, that's why you need local and global registers. To really
make use of it you want to be able to modify the data and thus
need arithmetic instructions. I know, I'm pretty lonely on this
path but I think this is the way to go.

> You need arithmetic only for pointers, and there it's basically
> mask and shift. You can do surprisingly well without loops. E.g.
> tcng doesn't have loops. (Although they would be a nice addition,
> particularly if you move more in the direction of firewalls.)

How do you parse IPv6 options? Specialized classifiers? mask and
shift might be enough to transform IHL but it won't be sufficent
for higher protocols.

> Huh ? Probably too complex already. Also, if you're in software,
> you may very well compile your own helper modules on the fly.
> tcng has this as a proof-of-concept with the "C" target.

Of course stack frames are only necessary if you introduce variables
and they may only exist in user space and then eliminated for
the kernel state machine.

> > I think the interactive mode is very useful for maintaince.
> 
> Hmm, I kind of doubt it. You're quicker with your editor, just
> changing that line. What you need is a nice way for updating the
> in-kernel configuration without loss of state.

I'm talking about maintaince stuff in terms of checking statistics,
inspecting your filter tree, etc. I fully aggree that the construction
of the configuration belongs into a text editor.

> You also need some "handles" where you can attach automated
> rule generation and/or modification. That's something tcng doesn't
> support very well.

I don't get this.

> Ah, but you know that that first thing tcng does when it sees an
> "if" is that it rips the expression apart and then works on
> "anonymous" fields or even single bits ?

Sure, this is the way to go.

> I think the contrary is the case :-) If things get complex
> enough, you'll want to dry-run them in tcsim or such. It's
> really not very different from programming - if I want to
> change some complicated expression, I just edit it. It wouldn't
> occur to me to tweak assembler instructions, no matter how
> convenient the assembler is.

I agreed, I'm solely and only talking about getting help while
constructing a filter. With all the new extensions comming in
the construction will get more complex with logic expressions,
various small classification tools and one needs to look up
their parameters etc. I think tcng will never be able to 100%
support all of them, because of their easy usage many will
write their own so we might see dozens of new ones like in
netfilter.

  reply	other threads:[~2005-01-19 17:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-17 15:23 [RFC] batched tc to improve change throughput Thomas Graf
2005-01-17 15:45 ` jamal
2005-01-17 16:05   ` Thomas Graf
2005-01-17 16:36     ` jamal
2005-01-17 16:56       ` Thomas Graf
2005-01-17 22:49         ` jamal
2005-01-18 13:44           ` Thomas Graf
2005-01-18 14:29             ` jamal
2005-01-18 14:36               ` Lennert Buytenhek
2005-01-18 14:43                 ` jamal
2005-01-18 15:07                   ` Thomas Graf
2005-01-18 15:20                   ` Lennert Buytenhek
2005-01-19 14:24                     ` jamal
2005-01-18 14:58               ` Thomas Graf
2005-01-18 15:23                 ` Lennert Buytenhek
2005-01-19 14:13                 ` jamal
2005-01-19 14:36                   ` Thomas Graf
2005-01-19 16:45                   ` Werner Almesberger
2005-01-19 16:54                   ` Thomas Graf
2005-01-20 14:42                     ` jamal
2005-01-20 15:35                       ` Thomas Graf
2005-01-20 17:06                         ` Stephen Hemminger
2005-01-20 17:19                           ` Thomas Graf
2005-01-24 14:13                         ` jamal
2005-01-24 15:06                           ` Thomas Graf
2005-01-26 13:48                             ` jamal
2005-01-26 14:35                               ` Thomas Graf
2005-02-11 15:07                               ` Dan Siemon
2005-02-12 13:45                                 ` jamal
2005-02-12 14:29                                   ` Thomas Graf
2005-02-12 22:07                                   ` Dan Siemon
2005-02-12 22:32                                     ` Thomas Graf
2005-02-14  0:23                                       ` Dan Siemon
2005-02-14 14:27                                         ` Thomas Graf
2005-02-15 20:28                                           ` Dan Siemon
2005-02-15 20:47                                             ` Thomas Graf
2005-02-22 21:40                                               ` Dan Siemon
2005-02-22 23:15                                                 ` Thomas Graf
2005-01-18 15:07               ` Werner Almesberger
2005-01-19 14:08                 ` Thomas Graf
2005-01-19 16:33                   ` Werner Almesberger
2005-01-19 17:22                     ` Thomas Graf [this message]
2005-01-17 18:00 ` Stephen Hemminger
2005-01-17 18:02 ` Stephen Hemminger

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=20050119172222.GC26856@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=hadi@cyberus.ca \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    --cc=werner@almesberger.net \
    /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).