netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>
Subject: Re: AF_PACKET fanout not working on MPLS traffic
Date: Tue, 15 Jan 2019 09:22:50 +0100	[thread overview]
Message-ID: <20190115082250.GA23010@svana.org> (raw)
In-Reply-To: <CAF=yD-KCAFT9QcFLhFrh9s4BqGDeT_ZzVuf=3wDCNTr6CeaBLw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]

Hoi Willem,

On Mon, Jan 14, 2019 at 03:03:42PM -0500, Willem de Bruijn wrote:
> On Mon, Jan 14, 2019 at 2:12 PM Martijn van Oosterhout wrote:
> > I see a two ways this could be fixed.
> >
> > Option 1: include FLOW_DISSECTOR_KEY_MPLS in
> > flow_keys_dissector_symmetric but that seems a big assumption, we don't
> > do that for VLANs for example.
> 
> This sounds fine to me. Though it will require extra work to make
> __skb_get_has_symmetric actually use the entropy. And in practice it's
> not clear that this will result in much entropy.

Ok, I guess this really depends on the kind of traffic. You'd have to
assume that flows in both directions get the same labels, which may or
may not be true. (The assumption here is that you want flows to stay
together, otherwise you may as well use round-robin).

> > And there is actually another problem: MPLS provides no information
> > about the next header because it assumes the endpoints in the network
> > recognise the MPLS headers. Which means you'd have to make a guess
> > about what the next layer should be.
> 
> This is the real issue. I don't think this can be done in general
> purpose code. The new BPF flow dissector, however, does allow you to
> deploy a custom dissector in environments where the inner protocol is
> known.
> 
>   https://lwn.net/Articles/764200/

Thanks for the reference! Is this code considered mature enough for
production?

Also, since this is new, I can't find much info on how to use it. But
if I understand correctly you create a flow dissector in BPF which
extracts the various parts.  There is one such dissector per namespace,
it replaces the internal one completely.  You attach it using
bpftool[1], which loads the program and confiigures where the BPF
program will store various keys.  We can then make a BPF program which
works for our traffic, load it and then the hashing code from AF_PACKET
will start using it instead of the builtin dissector.

Does that sound right?

[1]: https://patchwork.kernel.org/patch/10673201/

Thanks in advance,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> The combine: one man, one day, wheat for half a million loaves of bread.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2019-01-15  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 18:40 AF_PACKET fanout not working on MPLS traffic Martijn van Oosterhout
2019-01-14 20:03 ` Willem de Bruijn
2019-01-15  8:22   ` Martijn van Oosterhout [this message]
2019-01-15 16:06     ` Willem de Bruijn
2019-01-15 17:35 ` Ido Schimmel

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=20190115082250.GA23010@svana.org \
    --to=kleptog@svana.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.com \
    /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).