Re: support for user-space mesh routing daemons (olsr, batman, ...)



On Tue, 2010-03-02 at 20:56 +0100, Daniel Golle wrote:
> i just had the idea to start hacking on networkmanager to support olsr 
> as this would enable e.g. ubuntu users to participate in freifunk 
> networks in a more user-friendly way. out-of-the-box support for open 
> mesh network infrastructures would be a big advantage for both, the 
> linux-newby and the freifunk-newby, and probably give a significant 
> boost to both communities.
> can anyone quickly approximate the effort and possible sketch a way to 
> implement a plugin which basically runs olrsd after connecting to an 
> 802.11 Ad-Hoc network with special settings (i.e. preconfigured settings 
> like no_beacons, Channel 10, ESSID olsr.freifunk.net)?

While I'm not 100% sure about how the olsr stuff works, you can
approximate this by using the dispatcher scripts to start the daemon
when a compatible connection comes up.  See 'man NetworkManager' for
more details on dispatcher scripts.  Basically, scripts
from /etc/NetworkManager/dispatcher.d get run whenever a network
interface goes up or down.

So when the interface goes up, you'll get at the setting service name
and UUID in the script's environment.  You can use these to get the
connection information and determine whether the connection is ad-hoc or
not.  See:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/nm-state.py

for a python example of how to get the connection information from the
settings service which provides it.  The relevant bits are below the "#
ask the provider of the connection for its details" in that example.

So basically you'd preconfigure an ad-hoc network with the correct
settings in either the user's GConf/KConfig (depending on their desktop
environment) or better, via system-settings (you probably want to use
the 'keyfile' plugin for this, see more at
http://live.gnome.org/NetworkManager/SystemSettings ).  When the user
chooses that network from the menu (via "Create new wireless network",
or your tool can tell NM to start that connection on-demand) the
dispatcher script will get the UUID of that preconfigured connection,
and thus it knows that it should start olsrd.

So I'd:

1) make sure 'keyfile' is on the plugins line
of /etc/NetworkManager/nm-system-settings.conf; if not, add it and
restart NM.
2) fire up nm-connection-editor and create a new adhoc wifi network with
the desired channel and characteristics
3) check "Available to all users" and then hit apply; this will save the
connection configuration as a keyfile
in /etc/NetworkManager/system-connections, which you can then copy to
other machines
4) decide how you want to let users start that adhoc network; either by
choosing "Create new wireless network" from the menu, or by a simple
root-level program the tells NM to activate that connection
5) write a short dispatcher script that starts the mesh daemon when
device comes up using a connection with a known UUID

There's probably something in there that's not explained well enough
yet, let me know what that is and I'll try to make it clearer.

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]