Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit e2c6b9d72b09fa2155f2c840aba455b91657b612 Author: Marek Lindner mareklindner@neomailbox.ch Date: Sun May 9 10:22:40 2010 +0000
doc: batman-adv/Tweaking
e2c6b9d72b09fa2155f2c840aba455b91657b612 batman-adv/Tweaking.textile | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+)
diff --git a/batman-adv/Tweaking.textile b/batman-adv/Tweaking.textile new file mode 100644 index 00000000..333ae6ee --- /dev/null +++ b/batman-adv/Tweaking.textile @@ -0,0 +1,89 @@ + += Tweaking B.A.T.M.A.N. Advanced = + +{{{ +#!div style="width: 46em; text-align: justify" + +This document aims to provide a high level overview about the invidual settings batman-adv allows you to make, in order to tweak its behaviour. If you are trying to find out what these various sysfs files or batctl options are good for, this is the right document for you. Some of the features require extended explanation & examples which is not the scope of this document. Links to complementary documents will be provided if available.[[BR]] + +__Note__: Although this document focusses on the "raw" /sys/ configuration interface you always can use batctl for a more convenient access to the settings. + +=== Interface handling === + +To better understand the background of the new interface configuration concept (as of batman-adv 0.2.2), it is helpful to see in which direction batman-adv is heading: Until now, batman aggregated all configured interface into a single mesh cloud (manifested in a single bat0 interface). In the future it will be possible to let a single mesh node participate in mutliple mesh clouds at the same time which makes it necessary to assign interfaces to individual mesh clouds and having multiple batX interfaces. Although the "multiple mesh cloud" feature is not complete yet, the configuration interface support is already available. + +After loading batman-adv, it will scan your systems interfaces to search for compatible interfaces. Once found, it will create subfolders in the /sys/class/net/<iface> directories of each supported interface, e.g. + +{{{ +ls /sys/class/net/eth0/batman_adv/ +iface_status mesh_iface +}}} + +If an interface does not have the "batman_adv" subfolder it probably is not supported. Not supported interfaces are: loopback, non-ethernet and batman's own interfaces.[[BR]] +__Note__: After the module was loaded it will continuously watch for new interfaces to verify the compatibility. There is no need to reload the module if you plug your USB wifi adapter into your machine after batman advanced was initially loaded. + +To activate a given interface on a mesh cloud simply write the mesh clouds interface name into its "mesh_iface" file inside the batman_adv subfolder. Since the "multiple mesh cloud" feature is currently disabled, you can only write "bat0" but later on you can freely choose the interface name. + +{{{ +echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface +}}} + +Repeat this step for all interfaces you wish to add. All interfaces using the same mesh cloud interface belong into the same mesh cloud. Now batman-adv starts using/broadcasting on this/these interface(s). + +You can check the interface's status by reading the "iface_status" file inside the batman-adv folder: +{{{ +cat /sys/class/net/eth0/batman_adv/iface_status +active +}}} + +To deactivate an interface you have to write "none" into its "mesh_iface" file: +{{{ +echo none > /sys/class/net/eth0/batman_adv/mesh_iface +}}} + +=== Mesh cloud handling === + +After having interfaces added to a mesh cloud, batman-adv automatically creates the appropiate batX mesh interface(s). Each of those interfaces receives a special "mesh" subfolder within their standard /sys/class/net/<iface> folder, e.g. + +{{{ +ls /sys/class/net/bat0/mesh/ +aggregate_ogm originators transtable_global vis_mode +orig_interval transtable_local vis_data +}}} + +'''aggregate originator messages''' + +In order to reduce the protocol overhead created to find all the participants in the network, batman has the ability to collect & aggregate these protocol messages (called originator messages or ogm) and sending them in a single packet instead of several small packets. This feature is enabled by default, since it is helpful in most cases. If you intend to run batman-adv in a highly mobile environment (for example cars) you might want to turn it off as it introduces a (normally negligible) network update delay. + +{{{ +cat /sys/class/net/bat0/mesh/aggregate_ogm +status: enabled +commands: enable, disable, 0, 1 +}}} + +'''originator interval''' + +The value specifies interval (milliseconds) in which batman-adv floods the network with its protocol information. The default value of one message per second allows batman to recognize a route change (in its near neighborhood) within a timeframe of maximal one minute (most likely much sooner). In a very static environment (batman nodes are not moving, rare ups & downs of nodes) you might want to increase the value to save bandwidth. On the other hand, it might prove helpful to decrease the value in a highly mobile environment (e.g. the aforementioned cars) but keep in mind that this will drastically increase the traffic. Unless you experience problems with your setup, it is suggested you keep the default value. + +{{{ +cat /sys/class/net/bat0/mesh/orig_interval +status: 1000 +}}} + +'''visualizing the topology''' + +The vis_mode and vis_data files provide a system to visualize the batman-adv network. The [wiki:VisAdv visualizing the 2nd layer] document describes this system in detail, therefore no in depth explanation is given here. [[BR]] + +The default vis mode is "client" + +{{{ +cat /sys/class/net/bat0/mesh/vis_mode +status: client +commands: client, server, 0, 1 +}}} + +which needs te be changed to "server" before the topology data can be read from the "vis_data" file. + +}}} + +