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

gluon-mesh-batman-adv-core: disable bridge port learning on bat0 #780

Merged

Conversation

T-X
Copy link
Contributor

@T-X T-X commented May 22, 2016

The mesh side has become fairly huge in many communities. Up to
a few thousand entries can currently be found in the forwarding
database (fdb) of a bridge for its bridge port bat0.

The bridge fdb is kind of redundant to the batman-adv global translation
table here. Therefore this patch tries to reduce memory footprint by
following an approach similar to the IGMP/MLD split patchset approach:

Make the bridge oblivious not only regarding multicast listeners towards
the mesh but with this patch unicast hosts on the mesh, too.

If the destination of an ethernet frame is known by the bridge to be a
local one, then the frame is forwarded to the according port. If it is
unknown, then the frame is forwarded to the wifi AP interface and bat0.

mac80211 and batman-adv then know whether to drop or forward a frame
further through their own book-keeping.

Note that unicast-flood is not disabled for the wifi AP bridge port, nor
is learning disabled on the wifi AP. This is mainly to keep the
configuration in UCI and according setup scripts simple ;). However, not
disalbling unicast-flood on the wifi AP interface might also give a
minor latency improvement for newly joining wifi clients.

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

@T-X
Copy link
Contributor Author

T-X commented May 22, 2016

PS: The included netifd patch was sent to openwrt-devel/lede-devel and is pending for review and upstream netifd inclusion.

@T-X T-X force-pushed the disable-bridge-fdb-learning-for-mesh branch 2 times, most recently from 9d1fb62 to 3dbdb2c Compare May 23, 2016 22:13
@T-X
Copy link
Contributor Author

T-X commented May 23, 2016

New version fixes a bug for the unicast-flood configuration (bug in the gluon-upgrade script part).

@neocturne neocturne added this to the 2016.2 milestone May 26, 2016
@neocturne neocturne added the 0. type: enhancement The changeset is an enhancement label May 26, 2016
@neocturne
Copy link
Member

The netifd patch is included in Gluon now, please rebase.

)
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
uci:set('network', 'client_lan', 'ifname', lanif)
end
Copy link
Member

Choose a reason for hiding this comment

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

This loop won't work if there are multiple LAN interfaces. Maybe you meant add_to_set?

Just adding ifname = lutil.split(sysconfig.lan_ifname, ' ') to the uci:section above seems simpler though, or am I overlooking something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, your two suggestions create a "list ifname" but a "list ifname eth0.1" for instance does not seem to work, unicast_flood is not set correctly upon reboot. Only an "option" works.

Is there supposed to ever be more than one lan interface?

@neocturne neocturne added the 2. status: merge conflict The merge has a conflict and needs rebasing label Jul 28, 2016
@T-X T-X force-pushed the disable-bridge-fdb-learning-for-mesh branch from 3dbdb2c to beab1d7 Compare August 2, 2016 05:47
@T-X
Copy link
Contributor Author

T-X commented Aug 2, 2016

Rebased to master, removed netifd patch as available upstream now.

@T-X T-X force-pushed the disable-bridge-fdb-learning-for-mesh branch from beab1d7 to f316d09 Compare August 2, 2016 07:59
}
)
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
uci:set('network', 'client_lan', 'ifname', lanif)
Copy link
Member

Choose a reason for hiding this comment

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

  1. We should investigate why the list doesn't work here
  2. In any case, this code is plain wrong. If you want to use an option, use uci:set('network', 'client_lan', 'ifname', sysconfig.lan_ifname), your loop will replace the old value in each run otherwise!

The mesh side has become fairly huge in many communities. Up to
a few thousand entries can currently be found in the forwarding
database (fdb) of a bridge for its bridge port bat0.

The bridge fdb is kind of redundant to the batman-adv global translation
table here. Therefore this patch tries to reduce memory footprint by
following an approach similar to the IGMP/MLD split patchset approach:

Make the bridge oblivious not only regarding multicast listeners towards
the mesh but with this patch unicast hosts on the mesh, too.

If the destination of an ethernet frame is known by the bridge to be a
local one, then the frame is forwarded to the according port. If it is
unknown, then the frame is forwarded to the wifi AP interface and bat0.

mac80211 and batman-adv then know whether to drop or forward a frame
further through their own book-keeping.

Note that unicast-flood is not disabled for the wifi AP bridge port, nor
is learning disabled on the wifi AP. This is mainly to keep the
configuration in UCI and according setup scripts simple ;). However, not
disalbling unicast-flood on the wifi AP interface might also give a
minor latency improvement for newly joining wifi clients.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
@T-X T-X force-pushed the disable-bridge-fdb-learning-for-mesh branch from f316d09 to 3c3674d Compare August 7, 2016 11:26
@T-X T-X removed the 2. status: merge conflict The merge has a conflict and needs rebasing label Aug 7, 2016
@neocturne neocturne merged commit d5829d8 into freifunk-gluon:master Aug 22, 2016
ecsv pushed a commit to FreifunkVogtland/gluon that referenced this pull request Jun 9, 2017
…ifunk-gluon#780)

The mesh side has become fairly huge in many communities. Up to
a few thousand entries can currently be found in the forwarding
database (fdb) of a bridge for its bridge port bat0.

The bridge fdb is kind of redundant to the batman-adv global translation
table here. Therefore this patch tries to reduce memory footprint by
following an approach similar to the IGMP/MLD split patchset approach:

Make the bridge oblivious not only regarding multicast listeners towards
the mesh but with this patch unicast hosts on the mesh, too.

If the destination of an ethernet frame is known by the bridge to be a
local one, then the frame is forwarded to the according port. If it is
unknown, then the frame is forwarded to the wifi AP interface and bat0.

mac80211 and batman-adv then know whether to drop or forward a frame
further through their own book-keeping.

Note that unicast-flood is not disabled for the wifi AP bridge port, nor
is learning disabled on the wifi AP. This is mainly to keep the
configuration in UCI and according setup scripts simple ;). However, not
disalbling unicast-flood on the wifi AP interface might also give a
minor latency improvement for newly joining wifi clients.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants