netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Ben Greear <greearb@candelatech.com>
Cc: David Ahern <dsahern@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: vrf and multicast is broken in some cases
Date: Wed, 15 Jan 2020 22:23:54 +0200	[thread overview]
Message-ID: <20200115202354.GB1513116@splinter> (raw)
In-Reply-To: <2b5cae7b-598a-8874-f9e9-5721099b9b6d@candelatech.com>

On Wed, Jan 15, 2020 at 12:00:08PM -0800, Ben Greear wrote:
> 
> 
> On 01/15/2020 11:19 AM, Ido Schimmel wrote:
> > On Wed, Jan 15, 2020 at 11:02:26AM -0800, Ben Greear wrote:
> > > 
> > > 
> > > On 01/15/2020 10:45 AM, David Ahern wrote:
> > > > On 1/15/20 10:57 AM, Ben Greear wrote:
> > > > > Hello,
> > > > > 
> > > > > We put two different ports into their own VRF, and then tried to run a
> > > > > multicast
> > > > > sender on one and receiver on the other.  The receiver does not receive
> > > > > anything.
> > > > > 
> > > > > Is this a known problem?
> > > > > 
> > > > > If we do a similar setup with policy based routing rules instead of VRF,
> > > > > then the multicast
> > > > > test works.
> > > > > 
> > > > 
> > > > It works for OSPF for example. I have lost track of FRR features that
> > > > use it, so you will need to specify more details.
> > > > 
> > > > Are the sender / receiver on the same host?
> > > 
> > > Yes, like eth2 sending to eth3, eth2 is associated with _vrf2, eth3 with _vrf3.
> > 
> > Two questions:
> > 
> > 1. Did you re-order the FIB rules so that l3mdev rule is before the main
> > table?
> 
> That seems OK:
> 
> [root@lf0313-6477 lanforge]# ip ru show
> 1000:	from all lookup [l3mdev-table]
> 1512:	from all lookup local
> 32766:	from all lookup main
> 32767:	from all lookup default
> 
> 
> > 2. Did you configure a default unreachable route in the VRF?
> 
> I did not have this, so maybe that is the issue.  This is my mcast
> transmitter table.
> 
> [root@lf0313-6477 lanforge]# ip route show table 10
> broadcast 7.7.1.0 dev rddVR0  proto kernel  scope link  src 7.7.1.2
> 7.7.1.0/24 dev rddVR0  scope link  src 7.7.1.2
> local 7.7.1.2 dev rddVR0  proto kernel  scope host  src 7.7.1.2
> broadcast 7.7.1.255 dev rddVR0  proto kernel  scope link  src 7.7.1.2
> 
> When sniffing, I see IGMP group add/delete messages sent from the receiver
> towards the sender, but transmitted mcast frames are not seen on the rddVR0
> (veth mcast sender port).
> 
> > 
> > IIRC, locally generated multicast packets are forwarded according to the
> > unicast FIB rules, so if you don't have the unreachable route, it is
> > possible the packet is forwarded according to the default route in the
> > main table.
> 
> And now that is interesting.  When I sniff on eth0, which holds the default
> route outside of the VRFs, then I do see the mcast frames sent there.
> 
> I tried adding default routes, and now sure enough it starts working!

I'm not sure this is the correct way (David?). Can you try to delete
this default route and instead add a default unreachable route with an
high metric according to step 3 in Documentation/networking/vrf.txt:

"
3. Set the default route for the table (and hence default route for the VRF).
       ip route add table 10 unreachable default metric 4278198272

   This high metric value ensures that the default unreachable route can
   be overridden by a routing protocol suite.  FRRouting interprets
   kernel metrics as a combined admin distance (upper byte) and priority
   (lower 3 bytes).  Thus the above metric translates to [255/8192].
"

If I'm reading ip_route_output_key_hash_rcu() correctly, then the error
returned from fib_lookup() because of the unreachable route should allow
you to route the packet via the requested interface.

> 
> [root@lf0313-6477 lanforge]# ip route show table 10
> default via 7.7.1.1 dev rddVR0
> broadcast 7.7.1.0 dev rddVR0  proto kernel  scope link  src 7.7.1.2
> 7.7.1.0/24 dev rddVR0  scope link  src 7.7.1.2
> local 7.7.1.2 dev rddVR0  proto kernel  scope host  src 7.7.1.2
> broadcast 7.7.1.255 dev rddVR0  proto kernel  scope link  src 7.7.1.2
> 
> 
> I'll work on adding an un-reachable route when a real gateway is not
> configured...
> 
> Thanks for the hint, saved me lots of work!
> 
> --Ben
> 
> > 
> > > 
> > > I'll go poking at the code.
> > > 
> > > Thanks,
> > > Ben
> > > 
> > > --
> > > Ben Greear <greearb@candelatech.com>
> > > Candela Technologies Inc  http://www.candelatech.com
> > 
> 
> -- 
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2020-01-15 20:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 17:57 vrf and multicast is broken in some cases Ben Greear
2020-01-15 18:45 ` David Ahern
2020-01-15 19:02   ` Ben Greear
2020-01-15 19:19     ` Ido Schimmel
2020-01-15 20:00       ` Ben Greear
2020-01-15 20:23         ` Ido Schimmel [this message]
2020-01-15 20:33           ` David Ahern
2020-01-15 21:09             ` Ben Greear
2020-01-15 22:53               ` David Ahern
2020-01-15 20:24         ` David Ahern

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=20200115202354.GB1513116@splinter \
    --to=idosch@idosch.org \
    --cc=dsahern@gmail.com \
    --cc=greearb@candelatech.com \
    --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).