Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
commit a2cacc3c7f89c2955ef54583ff85403b38bd71b7 Author: Marek Lindner mareklindner@neomailbox.ch Date: Sat May 22 08:06:27 2010 +0000
doc: batman-adv/Understand-your-batman-adv-network
a2cacc3c7f89c2955ef54583ff85403b38bd71b7 .../Understand-your-batman-adv-network.textile | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+)
diff --git a/batman-adv/Understand-your-batman-adv-network.textile b/batman-adv/Understand-your-batman-adv-network.textile new file mode 100644 index 00000000..fc09ee70 --- /dev/null +++ b/batman-adv/Understand-your-batman-adv-network.textile @@ -0,0 +1,57 @@ + += 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]] + +__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. + +=== Tables === + +'''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: + +{{{ +<originator> + <TQ (transmit quality) value towards the originator> + <next best hop> + <outgoing iface> + <alternative best next hops> +}}} + +Sample output: +{{{ +cat /sys/kernel/debug/batman_adv/bat0/originators +Originator (#/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 (133) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (133) +}}} + +'''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: + +{{{ +cat /sys/kernel/debug/batman_adv/bat0/transtable_local +Locally retrieved addresses (from bat0) announced via HNA: + * a2:e1:e8:69:cf:bc +}}} + +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: + +{{{ +cat /sys/kernel/debug/batman_adv/bat0/transtable_global +Globally announced HNAs received via the mesh bat0: + * fe:29:b9:c2:93:6a via fe:fe:00:00:02:01 +}}} + +Each line contains the announced mac address and the mac of the batman node announcing it. + + +}}}