BATMAN (Better Approach to Mobile Ad-hoc Networking), as developed and used by the Freifunk project, is a routing protocol for (primarily wireless) multi-hop ad-hoc networks. Freifunk is a German initiative to build an open Wi-Fi network at city-scale, based on the principles of net-neutrality. BATMAN's motive is to be a completely decentralized protocol; no one node in the network knows or has to care about the topology of the whole network.
Support for this protocol is provided by the batman-adv kernel module on Linux, which has been ported to FreeBSD through the batman_adv(4) kernel module.
IFLA_MASTER) to add it to the mesh interface.iproute2.batctl (and by extension libnl).I plan to continue working on this after the final evaluation :)
This is explained in more detail in the deliverables section.
batman-adv into the FreeBSD tree.struct net_device by struct ifnet and mbuf ⇔ sk_buff conversion).batadv cloner for creating BATMAN soft interfaces.GitHub: https://github.com/obiwac/freebsd-gsoc/pull/1.
This is the diff w.r.t. FreeBSD with the batman-adv sources already pulled into the tree.
The diff with just the batman-adv sources are here: https://github.com/obiwac/freebsd-gsoc/pull/3
The last GSoC-related commit was a06c5b5befe37df259d5e5e4af77723dd5815089 (“netlink: Only compile LinuxKPI-related code when COMPAT_LINUXKPI is set”),
This project consisted of the following parts:
The first step was getting batman-adv kernel module for Linux compiling & working on FreeBSD.
This included a bunch of additions to the LinuxKPI and the relatively new Netlink API in FreeBSD.
Support for creating and managing BATMAN networks was added to ifconfig(8). Setting attributes other than the routing algorithm is currently not supported due to limited support for Netlink Generic.
This ended up being a little more complicated than expected ;)
batctl uses libnl on Linux, whereas FreeBSD has snl(3) for user programs.
I'd like to port libnl to FreeBSD, backed by snl(3), such that future Linux programs which rely on Netlink may easily be ported.
The ifconfig(8), rtnetlink(4), and ifnet(9) manpages have been updated.
There's also a batman_adv(4) manpage which describes the batman_adv kernel module at a high level, and shows a basic example of usage.
batman-adv: https://www.kernel.org/doc/html/latest/networking/batman-adv.htmlbatman-adv: https://www.open-mesh.org/projects/batman-adv/wiki/Understand-your-batman-adv-network