Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support Babeld without VLAN on ethernet interfaces inside br-lan #600

Closed
wants to merge 9 commits into from

Conversation

ilario
Copy link
Member

@ilario ilario commented Sep 20, 2019

Fix #596
Part of the code has been copied and pasted from BMX6 (which run on br-lan by default).

We want to support running Babeld without VLAN (list protocols babeld:0) because:

But Babeld cannot run directly on an interface (e.g. eth0 or eth0.1) which is included into a bridge (e.g. br-lan) because it cannot have an IPv6 Link-Local.
What have that is the bridge itself, so Babeld has to run on the bridge.
But the bridge includes bat0 (Batman-adv stuff) which assures that all the packets get through, distorting the way that Babeld has for determining the metric of a route (sending UDP packets and checking how many get lost).

Maybe the configurable option babeld_over_batman is not useful and we can consider that it is always false?

I am still testing this PR, please review but wait for merging :)

@@ -23,7 +23,7 @@ define Package/$(PKG_NAME)
URL:=http://libremesh.org
DEPENDS:=+dnsmasq-dhcpv6 @(!PACKAGE_dnsmasq) +ebtables +libuci-lua \
+lime-system +lua +kmod-ebtables +kmod-macvlan \
+shared-state +shared-state-dnsmasq_leases
+shared-state +shared-state-dnsmasq_leases +kmod-ebtables-ipv6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you fixed this in another PR? here it seems unrelated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That kernel module is needed both by anygw (see #599) and Babeld in case of no VLAN and presence of Batman.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gosh, now I noticed that this file was actually not pertaining to this PR, sorry.

--! the bridge interface br-lan
--! If Babeld's Hello packets run over Batman-adv (whose bat0 is also
--! included in br-lan), the links will have a wrong quality metric,
--! so these hello on bat0 have to be filtered
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not that they have a wrong quality metric, it's that babeld will see all nodes as direct neighbours through batman

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mh... Isn't this the same? But ok, I'll change the text :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it is not the same

elseif(proto == "batadv") then hasBatman = true end
end

if hasLan and ifname:match("^eth%d") then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with wan port? Or port manually configured with ground routing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also consider to move this to configure method as it don't seems to need to be run for each interface, run it once seems enough

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with wan port?

Woops... With this PR, WAN port is not anymore used by Babeld.
This was unintentional, sorry.
Anyway WAN port is used for connecting to non-LibreMesh networks, so Babeld is not needed there.
I am ok with fixing it if we want Babeld on WAN.
Rather than checking for lan protocol, I can check for the presence of the interface into the

config interface 'lan'
	list ifname 'bat0'
	list ifname 'eth0.1'

table.

Or port manually configured with ground routing?

Ports configured with specific configuration are not treated by the whole section.
Do you mean that even if ground routing ports have a specific configuration, they should trigger this fix anyway? Are them included into br-lan bridge?

Also consider to move this to configure method as it don't seems to need to be run for each interface, run it once seems enough

Sounds good!
Currently it runs more than once even if running once would be ok.
Running more than once is not detrimental but I agree that it is a waste.
If I put this into the configure, it would be executed even if no ethernet lan port is present, but I suppose this is ok, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also consider to move this to configure method as it don't seems to need to be run for each interface, run it once seems enough

If I put this into the configure, it would be executed even if no ethernet lan port is present, but I suppose this is ok, right?

Wait, the ebtables rule can be in the configuration part, but the ifname = "br-lan" stuff has to stay into the setup interface one...
This is a mess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ports configured with specific configuration are not treated by the whole section.
Do you mean that even if ground routing ports have a specific configuration, they should trigger this fix anyway? Are them included into br-lan bridge?

It all depends on what kind of configuration they got, if they have babled specified as proto they get there too

Copy link
Member

@G10h4ck G10h4ck Sep 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a mess.

Networking is a complex problem, every apparently dumb change usually have unexpectedly complex implications to handle

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ports configured with specific configuration are not treated by the whole section.

I was wrong, interfaces with specific configuration are treated by this section.

Do you mean that even if ground routing ports have a specific configuration, they should trigger this fix anyway? Are them included into br-lan bridge?

The answer to my question was: no, interfaces configured via ground routing should not be touched by this fix and they will never be included in br-lan.

It all depends on what kind of configuration they got, if they have babled specified as proto they get there too

Interfaces managed by ground routing will never have VLAN ID 0, right? If this is correct, they will never trigger the fix and the problem is solved. Otherwise, how can I check if the interface is also configured for ground routing?

@ilario
Copy link
Member Author

ilario commented Oct 11, 2019

I tested these modifications and it works. I think I addressed all the comments.
Now the complete list of protocols of an interface gets passed to each of the protocols scripts, so that the Babeld script can check the presence of the lan proto on the same interface.
This way, the WAN interface will not get touched and neither will the interfaces managed by ground routing.
The code grew to an exaggerated length, I am sorry.
One awful thing is the check for the kind of interface in the last part of the code, where I add a new IPv4 to the interface. Is there a reason and a better way to do it or is it just an OpenWrt bug?
Please review again @G10h4ck

@ilario
Copy link
Member Author

ilario commented Oct 12, 2019

@spiccinini could you advise about where to insert the MTU fix from #601?
I mean, if Babeld is running on br-lan and inside of it there are some ethernet interfaces, the br-lan MTU needs to be set or is it already ok?

@spiccinini
Copy link
Contributor

@spiccinini could you advise about where to insert the MTU fix from #601?
I mean, if Babeld is running on br-lan and inside of it there are some ethernet interfaces, the br-lan MTU needs to be set or is it already ok?

The fix from #601 should be enough, it lowers the MTU only when using vlans (vid !=0)

@@ -51,6 +51,7 @@ config lime network
option bmx7_over_batman false
option bmx7_pref_gw none # Force bmx7 to use a specific gateway to Internet (hostname must be used as identifier)
option bmx7_wifi_rate_max 'auto'
option babeld_over_batman false # When Babeld is run without VLAN (babeld:0), it runs on the bridge which includes Batman-adv's bat0, keeping this false avoids to have Babeld metrics distorted by Batman-adv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilario When someone would want to change from false to true ? If there is not known useful use case I prefer not to add more options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, and I'll remove this.
I added this originally just because the same was present for BMX6 over Batman-adv

@ilario
Copy link
Member Author

ilario commented Oct 20, 2019

Replaced by #631

@ilario ilario closed this Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Babeld without VLAN does not run on LAN ethernet ports
4 participants