Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit b331665a0c32008c8e9df011a9f89477b9e0eb5c Author: Sven Eckelmann sven@narfation.org Date: Tue Mar 22 12:11:29 2011 +0000
doc: batman-adv/Tweaking: change path to manpage
b331665a0c32008c8e9df011a9f89477b9e0eb5c batman-adv/Tweaking.textile | 127 ++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 59 deletions(-)
diff --git a/batman-adv/Tweaking.textile b/batman-adv/Tweaking.textile index d2e9dbc7..caf1c25a 100644 --- a/batman-adv/Tweaking.textile +++ b/batman-adv/Tweaking.textile @@ -1,178 +1,187 @@ -= Tweaking B.A.T.M.A.N. Advanced =
-{{{ -#!div style="width: 46em; text-align: justify" +h1. Tweaking B.A.T.M.A.N. Advanced
-This document aims to provide a high level overview about the individual 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. +<pre> +<code class="div"> + +This document aims to provide a high level overview about the individual 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. + + ++Note+: Although this document focusses on the "raw" /sys/ configuration interface you always can use batctl for a more convenient access to the settings. + + +h3. Interface handling
-=== Interface handling ===
To better understand the background of the new interface configuration concept (as of batman-adv 2010.0.0), 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). As of 2010.2.0 it is 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.
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.
-{{{ +<pre> ls /sys/class/net/eth0/batman_adv/ iface_status mesh_iface -}}} +</code></pre>
-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. +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. + ++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. You can freely choose the interface name but for the sake of simplicity we continue to use "bat0".
-{{{ +<pre> echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface -}}} +</code></pre>
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: -{{{ +<pre> cat /sys/class/net/eth0/batman_adv/iface_status active -}}} +</code></pre>
To deactivate an interface you have to write "none" into its "mesh_iface" file: -{{{ +<pre> echo none > /sys/class/net/eth0/batman_adv/mesh_iface -}}} +</code></pre> + + +h3. Mesh cloud handling
-=== Mesh cloud handling ===
After having added interfaces to a mesh cloud, batman-adv automatically creates the appropriate batX mesh interface(s). Each of those interfaces receives a special "mesh" subfolder within their standard /sys/class/net/<iface> folder, e.g.
-{{{ +<pre> ls /sys/class/net/bat0/mesh/ aggregated_ogms gw_bandwidth hop_penalty vis_mode bonding gw_mode log_level fragmentation gw_sel_class orig_interval -}}} +</code></pre>
-'''aggregate originator messages''' +*aggregate originator messages*
Available since: batman-adv 2010.0.0
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.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/aggregated_ogms enabled -}}} +</code></pre>
-'''bonding mode''' +*bonding mode*
Available since: batman-adv 2010.1.0
-When running the mesh over multiple !WiFi interfaces per node batman-adv is capable of optimizing the traffic flow to gain maximum performance. Per default it operates in the "interface alternating" mode (which is suitable for most situations) that switches the !WiFi interface with each hop to avoid store & forward. Alternatively, batman-adv can be switched into "bonding mode" in which batman-adv is using all interfaces at the same time to send & receive data. However, this mode is only recommended in special one-hop cases. You can read about our [wiki:2010-06-13-wbm2010-bracciano alternate/bonding test results] to see what suits you best. +When running the mesh over multiple WiFi interfaces per node batman-adv is capable of optimizing the traffic flow to gain maximum performance. Per default it operates in the "interface alternating" mode (which is suitable for most situations) that switches the WiFi interface with each hop to avoid store & forward. Alternatively, batman-adv can be switched into "bonding mode" in which batman-adv is using all interfaces at the same time to send & receive data. However, this mode is only recommended in special one-hop cases. You can read about our [[2010-06-13-wbm2010-bracciano|alternatebonding test results]] to see what suits you best.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/bonding disabled -}}} +</code></pre>
-'''fragmentation''' +*fragmentation*
Available since: batman-adv 2010.2.0
Batman-adv has a built-in layer 2 fragmentation for unicast data flowing through the mesh which will allow to run batman-adv over interfaces / connections that don't allow to increase the MTU beyond the standard Ethernet packet size of 1500 bytes. When the fragmentation is enabled batman-adv will automatically fragment over-sized packets and defragment them on the other end. Per default fragmentation is enabled and inactive if the packet fits but it is possible to deactivate the fragmentation entirely.
-__Note__: Although the fragmentation is rather handy it comes with a severe performance penalty (as every fragmentation does), therefore it should be avoided to make use of this feature whenever possible. ++Note+: Although the fragmentation is rather handy it comes with a severe performance penalty (as every fragmentation does), therefore it should be avoided to make use of this feature whenever possible.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/fragmentation enabled -}}} +</code></pre>
-'''gateway bandwidth''' +*gateway bandwidth*
Available since: batman-adv 2011.0.0
-The [wiki:batman-adv-gateways internet gateway support] allows each gateway to also announce its available internet bandwidth. Clients looking for the most suitable gateway to connect to receive this bandwidth announcement and can make use of it while choosing their gateway. Per default a bandwidth of 2048KBit/512KBit is assumed. Details regarding the syntax of the bandwidth setting can be found in the [http://downloads.open-mesh.org/batman/manpages/batctl.8.html batctl manpage]. +The [[batman-adv-gateways|internet gateway support]] allows each gateway to also announce its available internet bandwidth. Clients looking for the most suitable gateway to connect to receive this bandwidth announcement and can make use of it while choosing their gateway. Per default a bandwidth of 2048KBit/512KBit is assumed. Details regarding the syntax of the bandwidth setting can be found in the "batctl manpage":http://downloads.open-mesh.org/batman/manpages/batctl.8.html.
-__Note__: If a batman-adv node has not activated the gateway server mode this setting has no effect. ++Note+: If a batman-adv node has not activated the gateway server mode this setting has no effect.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/gw_bandwidth 2048KBit/512KBit -}}} +</code></pre>
-'''gateway mode''' +*gateway mode*
Available since: batman-adv 2011.0.0
A batman-adv node can either run in server mode (sharing its internet connection with the mesh) or in client mode (searching for the most suitable internet connection in the mesh) or having the gateway support disabled entirely (which is the default setting). Gateways can tweak the announced internet bandwidth via the gw_bandwidth sysfs file whereas clients can configure the manner in which batman-adv chooses its gateway via the gw_sel_class sysfs file.
-__Note__: Please read the [wiki:batman-adv-gateways internet gateway documentation] to understand its interaction with DHCP. ++Note+: Please read the [[batman-adv-gateways|internet gateway documentation]] to understand its interaction with DHCP.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/gw_mode off -}}} +</code></pre>
-'''gateway selection class''' +*gateway selection class*
Available since: batman-adv 2011.0.0
-If multiple batman-adv gateways are available a batman-adv client node selects its best gateway based on certain criteria such as link quality / announced bandwidth / etc. The selection algorithm can be modified to best serve the requirements. The gateway selection class of '20' is the default value. All available gateway selection classes are thoroughly explained in the [http://downloads.open-mesh.org/batman/manpages/batctl.8.html batctl manpage]. +If multiple batman-adv gateways are available a batman-adv client node selects its best gateway based on certain criteria such as link quality / announced bandwidth / etc. The selection algorithm can be modified to best serve the requirements. The gateway selection class of '20' is the default value. All available gateway selection classes are thoroughly explained in the "batctl manpage":http://downloads.open-mesh.org/batman/manpages/batctl.8.html.
-__Note__: If a batman-adv node has not activated the gateway client mode this setting has no effect. ++Note+: If a batman-adv node has not activated the gateway client mode this setting has no effect.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/gw_sel_class 20 -}}} +</code></pre>
-'''hop penalty''' +*hop penalty*
Available since: batman-adv 2011.0.0
The hop penalty setting allows to modify batman-adv's preference for multihop routes vs. short routes. The value is applied to the TQ of each forwarded OGM, thereby propagating the cost of an extra hop (the packet has to be received and retransmitted which costs airtime). A higher hop penalty will make it more unlikely that other nodes will choose this node as intermediate hop towards any given destination. On the hand, a lower hop penalty will result in longer routes because retransmissions are not penalized. The default hop penalty of '10' is a reasonable value for most setups and probably does not need to be changed. However, mobile nodes could choose a value of 255 (maximum value) to avoid being chosen as a router by other nodes.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/hop_penalty 10 -}}} +</code></pre>
-'''log level''' +*log level*
Available since: batman-adv 2010.1.0 (if debugging has been compiled-in)
-The standard warning and error messages which help to setup & operate batman-adv are sent to the kernel log. However, batman-adv also offers extended logs that can be used to understand and/or debug the routing protocol. Keep in mind that it is necessary to activate debugging at compile time before you can use these facilities (consult [http://www.open-mesh.org/browser/trunk/batman-adv/README the README file] to learn how to set the compile option). Per default, the logging is deactivated (log level: 0), Enable log level '1' to log messages related to routing / flooding / broadcasting. Log level '2' only shows messages related to route or hna added / changed / deleted. Switch to log level '3' to get all log messages. +The standard warning and error messages which help to setup & operate batman-adv are sent to the kernel log. However, batman-adv also offers extended logs that can be used to understand and/or debug the routing protocol. Keep in mind that it is necessary to activate debugging at compile time before you can use these facilities (consult "the README file":http://www.open-mesh.org/browser/trunk/batman-adv/README to learn how to set the compile option). Per default, the logging is deactivated (log level: 0), Enable log level '1' to log messages related to routing / flooding / broadcasting. Log level '2' only shows messages related to route or hna added / changed / deleted. Switch to log level '3' to get all log messages.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/log_level 0 -}}} +</code></pre>
-'''originator interval''' +*originator interval*
Available since: batman-adv 2010.0.0
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.
-{{{ +<pre> cat /sys/class/net/bat0/mesh/orig_interval 1000 -}}} +</code></pre>
-'''visualizing the topology''' +*visualizing the topology*
Available since: batman-adv 2010.0.0
-The vis_mode and vis_data files provide a system to visualize the batman-adv network. The [wiki:VisAdv visualizing the 2nd layer] and [wiki:VisOutput vis output] documents describes this system in detail, therefore no in-depth explanation is given here. [[BR]] +The vis_mode and vis_data files provide a system to visualize the batman-adv network. The [[VisAdv|visualizing the 2nd layer] and [wikiVisOutput vis output]] documents describes this system in detail, therefore no in-depth explanation is given here. +
The default vis mode is "client"
-{{{ +<pre> cat /sys/class/net/bat0/mesh/vis_mode client -}}} +</code></pre>
which needs te be changed to "server" before the topology data can be read from the "vis_data" file.
-}}} +</code></pre>