batman-adv.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. [state: 21-11-2010]
  2. BATMAN-ADV
  3. ----------
  4. Batman advanced is a new approach to wireless networking which
  5. does no longer operate on the IP basis. Unlike the batman daemon,
  6. which exchanges information using UDP packets and sets routing
  7. tables, batman-advanced operates on ISO/OSI Layer 2 only and uses
  8. and routes (or better: bridges) Ethernet Frames. It emulates a
  9. virtual network switch of all nodes participating. Therefore all
  10. nodes appear to be link local, thus all higher operating proto-
  11. cols won't be affected by any changes within the network. You can
  12. run almost any protocol above batman advanced, prominent examples
  13. are: IPv4, IPv6, DHCP, IPX.
  14. Batman advanced was implemented as a Linux kernel driver to re-
  15. duce the overhead to a minimum. It does not depend on any (other)
  16. network driver, and can be used on wifi as well as ethernet lan,
  17. vpn, etc ... (anything with ethernet-style layer 2).
  18. CONFIGURATION
  19. -------------
  20. Load the batman-adv module into your kernel:
  21. # insmod batman-adv.ko
  22. The module is now waiting for activation. You must add some in-
  23. terfaces on which batman can operate. After loading the module
  24. batman advanced will scan your systems interfaces to search for
  25. compatible interfaces. Once found, it will create subfolders in
  26. the /sys directories of each supported interface, e.g.
  27. # ls /sys/class/net/eth0/batman_adv/
  28. # iface_status mesh_iface
  29. If an interface does not have the "batman_adv" subfolder it prob-
  30. ably is not supported. Not supported interfaces are: loopback,
  31. non-ethernet and batman's own interfaces.
  32. Note: After the module was loaded it will continuously watch for
  33. new interfaces to verify the compatibility. There is no need to
  34. reload the module if you plug your USB wifi adapter into your ma-
  35. chine after batman advanced was initially loaded.
  36. To activate a given interface simply write "bat0" into its
  37. "mesh_iface" file inside the batman_adv subfolder:
  38. # echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface
  39. Repeat this step for all interfaces you wish to add. Now batman
  40. starts using/broadcasting on this/these interface(s).
  41. By reading the "iface_status" file you can check its status:
  42. # cat /sys/class/net/eth0/batman_adv/iface_status
  43. # active
  44. To deactivate an interface you have to write "none" into its
  45. "mesh_iface" file:
  46. # echo none > /sys/class/net/eth0/batman_adv/mesh_iface
  47. All mesh wide settings can be found in batman's own interface
  48. folder:
  49. # ls /sys/class/net/bat0/mesh/
  50. # aggregated_ogms bonding fragmentation orig_interval
  51. # vis_mode
  52. There is a special folder for debugging informations:
  53. # ls /sys/kernel/debug/batman_adv/bat0/
  54. # originators socket transtable_global transtable_local
  55. # vis_data
  56. Some of the files contain all sort of status information regard-
  57. ing the mesh network. For example, you can view the table of
  58. originators (mesh participants) with:
  59. # cat /sys/kernel/debug/batman_adv/bat0/originators
  60. Other files allow to change batman's behaviour to better fit your
  61. requirements. For instance, you can check the current originator
  62. interval (value in milliseconds which determines how often batman
  63. sends its broadcast packets):
  64. # cat /sys/class/net/bat0/mesh/orig_interval
  65. # 1000
  66. and also change its value:
  67. # echo 3000 > /sys/class/net/bat0/mesh/orig_interval
  68. In very mobile scenarios, you might want to adjust the originator
  69. interval to a lower value. This will make the mesh more respon-
  70. sive to topology changes, but will also increase the overhead.
  71. USAGE
  72. -----
  73. To make use of your newly created mesh, batman advanced provides
  74. a new interface "bat0" which you should use from this point on.
  75. All interfaces added to batman advanced are not relevant any
  76. longer because batman handles them for you. Basically, one "hands
  77. over" the data by using the batman interface and batman will make
  78. sure it reaches its destination.
  79. The "bat0" interface can be used like any other regular inter-
  80. face. It needs an IP address which can be either statically con-
  81. figured or dynamically (by using DHCP or similar services):
  82. # NodeA: ifconfig bat0 192.168.0.1
  83. # NodeB: ifconfig bat0 192.168.0.2
  84. # NodeB: ping 192.168.0.1
  85. Note: In order to avoid problems remove all IP addresses previ-
  86. ously assigned to interfaces now used by batman advanced, e.g.
  87. # ifconfig eth0 0.0.0.0
  88. VISUALIZATION
  89. -------------
  90. If you want topology visualization, at least one mesh node must
  91. be configured as VIS-server:
  92. # echo "server" > /sys/class/net/bat0/mesh/vis_mode
  93. Each node is either configured as "server" or as "client" (de-
  94. fault: "client"). Clients send their topology data to the server
  95. next to them, and server synchronize with other servers. If there
  96. is no server configured (default) within the mesh, no topology
  97. information will be transmitted. With these "synchronizing
  98. servers", there can be 1 or more vis servers sharing the same (or
  99. at least very similar) data.
  100. When configured as server, you can get a topology snapshot of
  101. your mesh:
  102. # cat /sys/kernel/debug/batman_adv/bat0/vis_data
  103. This raw output is intended to be easily parsable and convertable
  104. with other tools. Have a look at the batctl README if you want a
  105. vis output in dot or json format for instance and how those out-
  106. puts could then be visualised in an image.
  107. The raw format consists of comma separated values per entry where
  108. each entry is giving information about a certain source inter-
  109. face. Each entry can/has to have the following values:
  110. -> "mac" - mac address of an originator's source interface
  111. (each line begins with it)
  112. -> "TQ mac value" - src mac's link quality towards mac address
  113. of a neighbor originator's interface which
  114. is being used for routing
  115. -> "HNA mac" - HNA announced by source mac
  116. -> "PRIMARY" - this is a primary interface
  117. -> "SEC mac" - secondary mac address of source
  118. (requires preceding PRIMARY)
  119. The TQ value has a range from 4 to 255 with 255 being the best.
  120. The HNA entries are showing which hosts are connected to the mesh
  121. via bat0 or being bridged into the mesh network. The PRIMARY/SEC
  122. values are only applied on primary interfaces
  123. LOGGING/DEBUGGING
  124. -----------------
  125. All error messages, warnings and information messages are sent to
  126. the kernel log. Depending on your operating system distribution
  127. this can be read in one of a number of ways. Try using the com-
  128. mands: dmesg, logread, or looking in the files /var/log/kern.log
  129. or /var/log/syslog. All batman-adv messages are prefixed with
  130. "batman-adv:" So to see just these messages try
  131. # dmesg | grep batman-adv
  132. When investigating problems with your mesh network it is some-
  133. times necessary to see more detail debug messages. This must be
  134. enabled when compiling the batman-adv module. When building bat-
  135. man-adv as part of kernel, use "make menuconfig" and enable the
  136. option "B.A.T.M.A.N. debugging".
  137. Those additional debug messages can be accessed using a special
  138. file in debugfs
  139. # cat /sys/kernel/debug/batman_adv/bat0/log
  140. The additional debug output is by default disabled. It can be en-
  141. abled during run time. Following log_levels are defined:
  142. 0 - All debug output disabled
  143. 1 - Enable messages related to routing / flooding / broadcasting
  144. 2 - Enable route or hna added / changed / deleted
  145. 3 - Enable all messages
  146. The debug output can be changed at runtime using the file
  147. /sys/class/net/bat0/mesh/log_level. e.g.
  148. # echo 2 > /sys/class/net/bat0/mesh/log_level
  149. will enable debug messages for when routes or HNAs change.
  150. BATCTL
  151. ------
  152. As batman advanced operates on layer 2 all hosts participating in
  153. the virtual switch are completely transparent for all protocols
  154. above layer 2. Therefore the common diagnosis tools do not work
  155. as expected. To overcome these problems batctl was created. At
  156. the moment the batctl contains ping, traceroute, tcpdump and
  157. interfaces to the kernel module settings.
  158. For more information, please see the manpage (man batctl).
  159. batctl is available on http://www.open-mesh.org/
  160. CONTACT
  161. -------
  162. Please send us comments, experiences, questions, anything :)
  163. IRC: #batman on irc.freenode.org
  164. Mailing-list: b.a.t.m.a.n@b.a.t.m.a.n@lists.open-mesh.org
  165. (optional subscription at
  166. https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
  167. You can also contact the Authors:
  168. Marek Lindner <lindner_marek@yahoo.de>
  169. Simon Wunderlich <siwu@hrz.tu-chemnitz.de>