Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit 18be4f0ed471afd7839b40802341a1dabfd5abbc Author: Marek Lindner mareklindner@neomailbox.ch Date: Sat Jan 29 22:07:52 2011 +0000
doc: batman-adv/Understand-your-batman-adv-network
18be4f0ed471afd7839b40802341a1dabfd5abbc .../Understand-your-batman-adv-network.textile | 90 ++++++++++------------ 1 file changed, 39 insertions(+), 51 deletions(-)
diff --git a/batman-adv/Understand-your-batman-adv-network.textile b/batman-adv/Understand-your-batman-adv-network.textile index 1ea1cade..3c56c347 100644 --- a/batman-adv/Understand-your-batman-adv-network.textile +++ b/batman-adv/Understand-your-batman-adv-network.textile @@ -1,119 +1,107 @@ += Understand your B.A.T.M.A.N. Advanced network =
-h1. Understand your B.A.T.M.A.N. Advanced network +{{{ +#!div style="width: 46em; text-align: justify"
+This document assumes you have created a batman-adv network and are interested in finding out how batman routes the traffic from node to node, getting an access to the whole network topology and/or wish understand why batman is doing what it is doing. Batman provides a set of debug tools and debug tables which aim to facilitate this task. Explaining the routing decisions / various routing optimizations are not in the scope of this document. Links to complementary documents will be provided if available.[[BR]]
-<pre> -<code class="div"> +__Note__: Although this document focusses on the "raw" debugfs interface you always can use batctl for a more convenient access to the data. This document assumes debugfs was mounted at /sys/kernel/debug/. Please adjust the given examples if your system mounts the filesystem somewhere else. The batctl tool will automatically mount debugfs whenever you try to access functionality that require it. This document also assumes that you created a mesh cloud "bat0". [wiki:tweaking-batman-adv This page] provides background information on how to handle mesh clouds.
-This document assumes you have created a batman-adv network and are interested in finding out how batman routes the traffic from node to node, getting an access to the whole network topology and/or wish understand why batman is doing what it is doing. Batman provides a set of debug tools and debug tables which aim to facilitate this task. Explaining the routing decisions / various routing optimizations are not in the scope of this document. Links to complementary documents will be provided if available. +=== Tables ===
- -+Note+: Although this document focusses on the "raw" debugfs interface you always can use batctl for a more convenient access to the data. This document assumes debugfs was mounted at /sys/kernel/debug/. Please adjust the given examples if your system mounts the filesystem somewhere else. The batctl tool will automatically mount debugfs whenever you try to access functionality that require it. This document also assumes that you created a mesh cloud "bat0". [[tweaking-batman-adv|This page]] provides background information on how to handle mesh clouds. - - -h3. Tables - - -*originator table* +'''originator table'''
Each batman node maintains a list of all other nodes in the network and remembers in which direction to send the packets if data should be transmitted. The direction manifests itself in the form of the "best next neighbor" which basically is the next step towards the destination. You can retrieve batman's internal originator table by reading the originators file. The printed table begins with a header line with some more or less useful status data, followed by the data. Each line contains information regarding a specific originator:
-<pre> +{{{ <originator> <last-seen> <TQ (transmit quality) value towards the originator> <next best hop> <outgoing iface> <alternative best next hops> -</code></pre> +}}}
Sample output: -<pre> +{{{ cat /sys/kernel/debug/batman_adv/bat0/originators -Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... [B.A.T.M.A.N. adv 0.3.0-alpha, [[MainIF]]/MAC: eth0/fe:fe:00:00:01:01 (bat0)] +Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... [B.A.T.M.A.N. adv 0.3.0-alpha, MainIF/MAC: eth0/fe:fe:00:00:01:01 (bat0)] fe:fe:00:00:02:01 0.360s (133) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (133) -</code></pre> +}}}
-*translation tables* +'''translation tables'''
To let non-batman nodes use the mesh infrastructure easily, batman-adv introduced mac translation tables: When a batman-adv node detects that a client wishes to communicate over the mesh it will store the client's mac address in the local translation table and flood the network with the information that this mac address / client is attached to this batman-adv node. As soon as other nodes wish to send data to the client, they will search the client's mac in the mesh-wide (global) translation table, to find the corresponding batman-adv node. Then the data gets transmitted to the batman node first which then relays it to the client.
The local translation table (mac addresses announced by this host) can be found in the transtable_local file:
-<pre> +{{{ cat /sys/kernel/debug/batman_adv/bat0/transtable_local Locally retrieved addresses (from bat0) announced via HNA: -* fe:fe:00:00:01:01 -</code></pre> - -Every batman node announces at least one mac address - the mac of the batX interface. + * fe:fe:00:00:01:01 +}}}
+Every batman node announces at least one mac address - the mac of the batX interface. [[BR]]
The global translation table (mac addresses announced by other hosts) can be found in the transtable_global file:
-<pre> +{{{ cat /sys/kernel/debug/batman_adv/bat0/transtable_global Globally announced HNAs received via the mesh bat0: -* fe:fe:00:00:01:01 via fe:fe:00:00:02:01 -</code></pre> + * fe:fe:00:00:01:01 via fe:fe:00:00:02:01 +}}}
Each line contains the announced mac address and the mac of the batman node announcing it.
-*Gateway table* +'''Gateway table'''
-The gateway table lists all available batman-adv gateways in this network (see the [[batman-adv-gateways|gateway documentation]] to learn how to use this feature). Each line contains information about a specific gateway: +The gateway table lists all available batman-adv gateways in this network (see the [wiki:batman-adv-gateways gateway documentation] to learn how to use this feature). Each line contains information about a specific gateway:
-<pre> +{{{ <selection symbol> <gateway> <TQ (transmit quality) value towards the gateway> <next best hop> <outgoing iface> <gateway class - announced throughput> -</code></pre> +}}}
For example: -<pre> - Gateway (#/255) Nexthop [outgoingIF]: gw_class ... [B.A.T.M.A.N. adv devel 1886, [[MainIF]]/MAC: eth0/fe:fe:00:00:03:01 (bat0)] +{{{ + Gateway (#/255) Nexthop [outgoingIF]: gw_class ... [B.A.T.M.A.N. adv devel 1886, MainIF/MAC: eth0/fe:fe:00:00:03:01 (bat0)] fe:fe:00:00:01:01 (233) fe:fe:00:00:01:01 [ eth0]: 41 - 2048KBit/512KBit => fe:fe:00:00:02:01 (243) fe:fe:00:00:02:01 [ eth0]: 41 - 2048KBit/512KBit -</code></pre> +}}}
-*Softinterface neighbor table* +'''Softinterface neighbor table'''
-This table is part of the [[bridge-loop-avoidance|bridge loop avoidance]] code and contains all nodes that have been detected as being part of the same bridge. The currently selected 'gateway to the LAN' is marked with the '=>' symbol. +This table is part of the [wiki:bridge-loop-avoidance bridge loop avoidance] code and contains all nodes that have been detected as being part of the same bridge. The currently selected 'gateway to the LAN' is marked with the '=>' symbol.
-<pre> +{{{ cat /sys/kernel/debug/batman_adv/bat0/softif_neigh Softif neighbor list (bat0) => fe:fe:00:00:02:01 (vid: 1) -</code></pre> - - -h3. ICMP +}}}
+=== ICMP ===
Traditional network debugging tools based on the ICMP protocol such as ping or traceroute won't be able to perform their duties as expected. All traffic in the mesh will be transported to the destination transparently, so that higher protocols do not notice the number of hops or the route. This is one of the main reasons why you can roam around without breaking your connection. To provide the same type of diagnosis tools, batman-adv has an own simplified version of ICMP integrated in the protocol. Via debugfs it is possible to inject IMCP packets which behave very similar to their layer3 counterpart. The icmp socket file /sys/kernel/debug/batman_adv/bat0/icmp_socket can't be used with cat/echo directly, since it expects binary data. The batctl tool offers a ping / traceroute like interface that make use of this icmp socket interface. Please read the batctl manpage or the README file to learn how to use it or to see examples.
+=== Logging ===
-h3. Logging - +Batman-adv offers extended logging to understand & debug the routing protocol internals. After you activated debugging at compile time (instructions can be found in [http://www.open-mesh.org/browser/trunk/batman-adv/README the README file]) and the appropriate log level has been set (read about the log levels [wiki:tweaking-batman-adv here]) you can retrieve the logs by simply reading the 'log' file:
-Batman-adv offers extended logging to understand & debug the routing protocol internals. After you activated debugging at compile time (instructions can be found in "the README file":http://www.open-mesh.org/browser/trunk/batman-adv/README) and the appropriate log level has been set (read about the log levels [[tweaking-batman-adv|here]]) you can retrieve the logs by simply reading the 'log' file: - -<pre> +{{{ cat /sys/kernel/debug/batman_adv/bat0/log [ 418] Sending own packet (originator fe:fe:00:00:02:01, seqno 643, TQ 255, TTL 50, IDF off) on interface eth0 [fe:fe:00:00:02:01] [ 418] Received BATMAN packet via NB: fe:fe:00:00:01:01, IF: eth0 [fe:fe:00:00:02:01] (from OG: fe:fe:00:00:02:01, via prev OG: fe:fe:00:00:02:01, seqno 643, tq 245, TTL 49, V 12, IDF 1) [ 418] Drop packet: originator packet from myself (via neighbor) [..] -</code></pre> +}}}
The log is a circular ring buffer and will continue writing messages as soon as they become available.
+=== Visualization ===
-h3. Visualization - - -Despite its decentral nature batman-adv offers an easy way to access topology information that can be visualized. The [[VisAdv|visualization document]] covers the necessary steps in detail. -</code></pre> +Despite its decentral nature batman-adv offers an easy way to access topology information that can be visualized. The [wiki:VisAdv visualization document] covers the necessary steps in detail. +}}}