netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org
Subject: Re: [flamebait] xdp, well meaning but pointless
Date: Thu, 1 Dec 2016 15:58:34 +0100	[thread overview]
Message-ID: <20161201145834.GA569@pox.localdomain> (raw)
In-Reply-To: <20161201091108.GF26507@breakpoint.cc>

On 12/01/16 at 10:11am, Florian Westphal wrote:
> Aside from this, XDP, like DPDK, is a kernel bypass.
> You might say 'Its just stack bypass, not a kernel bypass!'.
> But what does that mean exactly?  That packets can still be passed
> onward to normal stack?
> Bypass solutions like netmap can also inject packets back to
> kernel stack again.

I have a fundamental issue with the approach of exporting packets into
user space and reinjecting them: Once the packet leaves the kernel,
any security guarantees are off. I have no control over what is
running in user space and whether whatever listener up there has been
compromised or not. To me, that's a no go, in particular for servers
hosting multi tenant workloads. This is one of the main reasons why
XDP, in particular in combination with BPF, is very interesting to me.

> b). with regards to a programmable data path: IFF one wants to do this
> in kernel (and thats a big if), it seems much more preferrable to provide
> a config/data-based approach rather than a programmable one.  If you want
> full freedom DPDK is architecturally just too powerful to compete with.

I must have missed the legal disclaimer that is usually put in front
of the DPDK marketing show :-)

I don't want full freedom. I want programmability with stack integration
at sufficient speed and the ability to benefit from the hardware
abstractions that the kernel provides.

> Proponents of XDP sometimes provide usage examples.
> Lets look at some of these.

[ I won't comment on any of the other use cases because they are of no
  interest to me ]

> * Load balancer
> State holding algorithm need sorting and searching, so also no fit for
> eBPF (could be exposed by function exports, but then can we do DoS by
> finding worst case scenarios?).
> 
> Also again needs way to forward frame out via another interface.
> 
> For cases where packet gets sent out via same interface it would appear
> to be easier to use port mirroring in a switch and use stochastic filtering
> on end nodes to determine which host should take responsibility.
> 
> XDP plus: central authority over how distribution will work in case
> nodes are added/removed from pool.
> But then again, it will be easier to hande this with netmap/dpdk where
> more complicated scheduling algorithms can be used.

I agree with you if the LB is a software based appliance in either a
dedicated VM or on dedicated baremetal.

The reality is turning out to be different in many cases though, LB
needs to be performed not only for north south but east west as well.
So even if I would handle LB for traffic entering my datacenter in user
space, I will need the same LB for packets from my applications and
I definitely don't want to move all of that into user space.

> * early drop/filtering.
> While its possible to do "u32" like filters with ebpf, all modern nics
> support ntuple filtering in hardware, which is going to be faster because
> such packet will never even be signalled to the operating system.
> For more complicated cases (e.g. doing socket lookup to check if particular
> packet does match bound socket (and expected sequence numbers etc) I don't
> see easy ways to do that with XDP (and without sk_buff context).
> Providing it via function exports is possible of course, but that will only
> result in an "arms race" where we will see special-sauce functions
> all over the place -- DoS will always attempt to go for something
> that is difficult to filter against, cf. all the recent volume-based
> floodings.

You probably put this last because this was the most difficult to
shoot down ;-)

The benefits of XDP for this use case are extremely obvious in combination
with local applications which need to be protected. ntuple filters won't
cut it. They are limited and subject to a certain rate at which they
can be configured. Any serious mitigation will require stateful filtering
with at least minimal L7 matching abilities and this is exactly where XDP
will excel.

  parent reply	other threads:[~2016-12-01 14:58 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01  9:11 [flamebait] xdp, well meaning but pointless Florian Westphal
2016-12-01 13:42 ` Hannes Frederic Sowa
2016-12-01 14:58 ` Thomas Graf [this message]
2016-12-01 15:52   ` Hannes Frederic Sowa
2016-12-01 16:28     ` Thomas Graf
2016-12-01 20:44       ` Hannes Frederic Sowa
2016-12-01 21:12         ` Tom Herbert
2016-12-01 21:27           ` Hannes Frederic Sowa
2016-12-01 21:51             ` Tom Herbert
2016-12-02 10:24               ` Jesper Dangaard Brouer
2016-12-02 11:54                 ` Hannes Frederic Sowa
2016-12-02 16:59                   ` Tom Herbert
2016-12-02 18:12                     ` Hannes Frederic Sowa
2016-12-02 19:56                       ` Stephen Hemminger
2016-12-02 20:19                         ` Tom Herbert
2016-12-02 18:39             ` bpf bounded loops. Was: [flamebait] xdp Alexei Starovoitov
2016-12-02 19:25               ` Hannes Frederic Sowa
2016-12-02 19:42                 ` John Fastabend
2016-12-02 19:50                   ` Hannes Frederic Sowa
2016-12-03  0:20                   ` Alexei Starovoitov
2016-12-03  9:11                     ` Sargun Dhillon
2016-12-02 19:42                 ` Hannes Frederic Sowa
2016-12-02 23:34                   ` Alexei Starovoitov
2016-12-04 16:05                     ` [flamebait] xdp Was: " Hannes Frederic Sowa
2016-12-06  3:05                       ` Alexei Starovoitov
2016-12-06  5:08                         ` Tom Herbert
2016-12-06  6:04                           ` Alexei Starovoitov
2016-12-05 16:40                 ` Edward Cree
2016-12-05 16:50                   ` Hannes Frederic Sowa
2016-12-05 16:54                     ` Edward Cree
2016-12-06 11:35                       ` Hannes Frederic Sowa
2016-12-01 16:06   ` [flamebait] xdp, well meaning but pointless Florian Westphal
2016-12-01 16:19   ` David Miller
2016-12-01 16:51     ` Florian Westphal
2016-12-01 17:20     ` Hannes Frederic Sowa
     [not found] ` <CALx6S35R_ZStV=DbD-7Gf_y5xXqQq113_6m5p-p0GQfv46v0Ow@mail.gmail.com>
2016-12-01 18:02   ` Tom Herbert
2016-12-02 17:22 ` Jesper Dangaard Brouer
2016-12-03 16:19   ` Willem de Bruijn
2016-12-03 19:48     ` John Fastabend
2016-12-05 11:04       ` Jesper Dangaard Brouer

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=20161201145834.GA569@pox.localdomain \
    --to=tgraf@suug.ch \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.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).