Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

batman-adv: backport routeable mcast address support #2615

Conversation

T-X
Copy link
Contributor

@T-X T-X commented Aug 19, 2022

With batman-adv 2022.0 support for directed multicast in bridged
setups for routeable multicast addresses was refined - if the
Linux kernel is 5.14 or higher.

This backports the according changes made to the Linux bridge in 5.14
and kernel exports to 5.10, to allow batman-adv to tap into and use
the Linux bridge's Multicast Router Discovery (RFC4286) based multicast
router state. Which enables the batman-adv multicast optimizations not
only for IPv6 link-local multicast addresses (ffX2::/16) but now also
IPv6 routeable multicast addresses (ffXY::/16, with Y > 2) in Gluon.

Note that since batman-adv v2019.3 with a Linux < 5.14 multicast routers
were initially "guessed" by checking for listeners on ff02::2 (all-routers).
Which could potentially overestimate - like in our case:
This approach won't work for us, as every Gluon node listens on ff02::2
on the local-node interface due to Gluon's radvd for local IPv6 prefix
assignments.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>

@T-X T-X added 0. type: enhancement The changeset is an enhancement 4. has: upstream-patches This changeset backports upstream patches 3. topic: batman-adv labels Aug 19, 2022
@T-X
Copy link
Contributor Author

T-X commented Aug 21, 2022

To clarify, this backports the following patches from Linux 5.14 for the Linux bridge:

30515832e987 net: bridge: fix build when IPv6 is disabled
bbc6f2cca74e net: bridge: fix br_multicast_is_router stub when igmp is disabled
3b85f9ba3480 net: bridge: mcast: export multicast router presence adjacent to a port
b7fb0916544d net: bridge: mcast: add ip4+ip6 mcast router timers to mdb netlink
a3c02e769efe net: bridge: mcast: split multicast router state for IPv4 and IPv6
ed2d35971a80 net: bridge: mcast: split router port del+notify for mcast router split
d9b8c4d8d937 net: bridge: mcast: prepare add-router function for mcast router split
ee5fb2223ee5 net: bridge: mcast: prepare expiry functions for mcast router split
1a3065a26807 net: bridge: mcast: prepare is-router function for mcast router split
b19232effd09 net: bridge: mcast: prepare query reception for mcast router split
ff391c5d9871 net: bridge: mcast: prepare mdb netlink for mcast router split
44ebb081dc69 net: bridge: mcast: add wrappers for router node retrieval
ce6f709775bd net: bridge: mcast: rename multicast router lists and timers

Cherry-picking was pretty much straightforward and automatic. Only two patches needed minimal manual adjustments.

After that batctl mcast_flags should look as follows:

$ batctl mcast_flags
[B.A.T.M.A.N. adv 2022.0-openwrt-6, MainIF/MAC: primary0/1e:dd:ce:49:3b:db (bat0/02:17:64:a4:31:00 BATMAN_IV)]
Multicast flags (own flags: [U... . ])
* Bridged [U]                           U
* No IGMP/MLD Querier [4/6]:            ./.
* Shadowing IGMP/MLD Querier [4/6]:     ./.
-------------------------------------------
       Originator Flags
[...]

Where before it said "own flags: [U..R4R6]", meaning this node would receive all multicast traffic with routeable destination addresses.

Edit: I also checked once more with mrdisc that a multicast router is recognized fine. When running this command the "own flags" will correctly add the R4 or R6 flags depending on mrdisc -4 or mrdisc -6 was run.

With batman-adv 2022.0 support for directed multicast in bridged
setups for routeable multicast addresses was refined - if the
Linux kernel is 5.14 or higher.

This backports the according changes made to the Linux bridge in 5.14
and kernel exports to 5.10, to allow batman-adv to tap into and use
the Linux bridge's Multicast Router Discovery (RFC4286) based multicast
router state. Which enables the batman-adv multicast optimizations not
only for IPv6 link-local multicast addresses (ffX2::/16) but now also
IPv6 routeable multicast addresses (ffXY::/16, with Y > 2) in Gluon.

Note that since batman-adv v2019.3 with a Linux < 5.14 multicast routers
were initially "guessed" by checking for listeners on ff02::2 (all-routers).
Which could potentially overestimate - like in our case:
This approach won't work for us, as every Gluon node listens on ff02::2
on the local-node interface due to Gluon's radvd for local IPv6 prefix
assignments.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
@T-X T-X force-pushed the pr-batman-adv-enable-routeable-mcast-optimizations branch from c9697b4 to 69cbaba Compare September 9, 2022 12:17
@T-X
Copy link
Contributor Author

T-X commented Sep 9, 2022

Changelog v2:

  • updated to current master

@T-X
Copy link
Contributor Author

T-X commented Oct 11, 2022

As discussed during today's meeting, rebasing it to OpenWrt 22.03 updates might be painful with this size. So closing it, people who want to try this feature can also use the Gluon next branch, where this should work already due to the newer Linux kernel.

@T-X T-X closed this Oct 11, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
0. type: enhancement The changeset is an enhancement 4. has: upstream-patches This changeset backports upstream patches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant