Re: per-interface packet filters, design approach

From: Gleb Smirnoff (glebius_at_freebsd.org)
Date: 12/15/04

  • Next message: Luigi Rizzo: "Re: per-interface packet filters"
    Date: Wed, 15 Dec 2004 15:10:33 +0300
    To: Andre Oppermann <andre@freebsd.org>
    
    

    On Wed, Dec 15, 2004 at 12:04:12PM +0100, Andre Oppermann wrote:
    A> > On Tue, Dec 14, 2004 at 03:03:27PM +0100, Andre Oppermann wrote:
    A> > A> d1. The PFIL_HOOKS API has one hook per direction per protocol and
    A> > A> passes the interface information to the firewall package.
    A> > A> d2. Should the PFIL_HOOKS API be changed and be per interface instead
    A> > A> of per protocol? All firewall packages need to be modified and
    A> > A> we are no longer compatible with the PFIL_HOOKS API.
    A> >
    A> > s/API/usage/g
    A>
    A> See my previous mail why your proposal is broken by design.

    Probably many routers are broken by design, too?

    A> > Andre, you are the person, who is optimizing our IP stack. Can you ask
    A> > this question, please: if the interface has no filters associated with it,
    A> > why the hell the packets running on it would enter firewall functions?
    A>
    A> Listen Gleb, first and formost I'm cleaning up network stack from years
    A> of bolt-on hackery to make it maintainable and easily understandable and
    A> extendable again.

    <dirty flame>

    But 4.x is more STABLE than 5.x, while it has rotten design, isn't it?
    Moreover some things stopped working because of better design! Now we have
    kern/71910, kern/73129, kern/73910, plus dozens of people who do not write
    PR because they see these three. But we have better design.

    </dirty flame>

    A> If there is a trade-off to be made between a few CPU cycles wasted with a
    A> clean and structured design versus some hackery pseudo-optimization I'm
    A> going to do the former. This is always the more viable choice.

    A> When looking at the BSD history one thing stands out: Wherever we had a
    A> very clean, concise and documented API (for example protocol independent
    A> sockets) things started to fly. In the network area we have the protosw
    A> structure and API which allows to add any type of network protocol very
    A> easily into the kernel. This has allowed BSD to support many different
    A> network protocols. Most recently IPv6. The price to pay for the small
    A> indirection protosw has is nothing compared to the adavantages of a good
    A> and clean API design.
    A>
    A> History tells us that sticking to certain design principals pays off very
    A> well and is worth some amount of performance tradeoffs. Feel free to ask
    A> Kirk McKusick on this lession of history.

    Good. I'm trying to convince you that design of attaching filters to interfaces
    is not mad, and we should choose it, stick to it, and be happy.

    Protocol level packet filters are excellent for hosts, but not for routers.
    You ain't say that we are building not a router platform. We are building
    a multipurpose platform, that's why I suggest protocol level and per-interface
    filters coexist.

    -- 
    Totus tuus, Glebius.
    GLEBIUS-RIPN GLEB-RIPE
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Luigi Rizzo: "Re: per-interface packet filters"

    Relevant Pages

    • Re: NUMA API
      ... This is against every good design principal. ... The API design should be general enough to work for all the ... be extendable for future architectures. ... This is only the lowest level interface. ...
      (Linux-Kernel)
    • Re: The 2008 IEEE John von Neumann Medal ...
      ... The pointy haired boss wanted a web based interface because ... I managed to design the system so that it was almost no extra effort to ... Too many "programmers' these days are really just API ...
      (comp.text.tex)
    • Re: per-interface packet filters, design approach
      ... A> passes the interface information to the firewall package. ... Should the PFIL_HOOKS API be changed and be per interface instead ... A> of per protocol? ...
      (freebsd-net)
    • Re: internet cafe monitoring program
      ... >> It's not all that hard to instrument a service with a configuration ... You have to have a socket interface, ... > so why not extend the protocol to allow command & control, ... through a control API. ...
      (alt.comp.lang.borland-delphi)
    • Re: lines of code?
      ... It sounds like you're saying that I should use multiple threads ... dont really get anything more than a single-threaded design would. ... a TCP-based protocol cannot, afaik, be "streaming". ... involving multiple levels of recursion? ...
      (comp.programming)