batman-adv.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. BATMAN-ADV
  2. ----------
  3. Batman advanced is a new approach to wireless networking which
  4. does no longer operate on the IP basis. Unlike the batman daemon,
  5. which exchanges information using UDP packets and sets routing
  6. tables, batman-advanced operates on ISO/OSI Layer 2 only and uses
  7. and routes (or better: bridges) Ethernet Frames. It emulates a
  8. virtual network switch of all nodes participating. Therefore all
  9. nodes appear to be link local, thus all higher operating proto-
  10. cols won't be affected by any changes within the network. You can
  11. run almost any protocol above batman advanced, prominent examples
  12. are: IPv4, IPv6, DHCP, IPX.
  13. Batman advanced was implemented as a Linux kernel driver to re-
  14. duce the overhead to a minimum. It does not depend on any (other)
  15. network driver, and can be used on wifi as well as ethernet lan,
  16. vpn, etc ... (anything with ethernet-style layer 2).
  17. CONFIGURATION
  18. -------------
  19. Load the batman-adv module into your kernel:
  20. # insmod batman-adv.ko
  21. The module is now waiting for activation. You must add some in-
  22. terfaces on which batman can operate. After loading the module
  23. batman advanced will scan your systems interfaces to search for
  24. compatible interfaces. Once found, it will create subfolders in
  25. the /sys directories of each supported interface, e.g.
  26. # ls /sys/class/net/eth0/batman_adv/
  27. # iface_status mesh_iface
  28. If an interface does not have the "batman_adv" subfolder it prob-
  29. ably is not supported. Not supported interfaces are: loopback,
  30. non-ethernet and batman's own interfaces.
  31. Note: After the module was loaded it will continuously watch for
  32. new interfaces to verify the compatibility. There is no need to
  33. reload the module if you plug your USB wifi adapter into your ma-
  34. chine after batman advanced was initially loaded.
  35. The batman-adv soft-interface can be created using the iproute2
  36. tool "ip"
  37. # ip link add name bat0 type batadv
  38. To activate a given interface simply attach it to the "bat0"
  39. interface
  40. # ip link set dev eth0 master bat0
  41. Repeat this step for all interfaces you wish to add. Now batman
  42. starts using/broadcasting on this/these interface(s).
  43. By reading the "iface_status" file you can check its status:
  44. # cat /sys/class/net/eth0/batman_adv/iface_status
  45. # active
  46. To deactivate an interface you have to detach it from the
  47. "bat0" interface:
  48. # ip link set dev eth0 nomaster
  49. All mesh wide settings can be found in batman's own interface
  50. folder:
  51. # ls /sys/class/net/bat0/mesh/
  52. #aggregated_ogms distributed_arp_table gw_sel_class orig_interval
  53. #ap_isolation fragmentation hop_penalty routing_algo
  54. #bonding gw_bandwidth isolation_mark vlan0
  55. #bridge_loop_avoidance gw_mode log_level
  56. There is a special folder for debugging information:
  57. # ls /sys/kernel/debug/batman_adv/bat0/
  58. # bla_backbone_table log transtable_global
  59. # bla_claim_table originators transtable_local
  60. # gateways socket
  61. Some of the files contain all sort of status information regard-
  62. ing the mesh network. For example, you can view the table of
  63. originators (mesh participants) with:
  64. # cat /sys/kernel/debug/batman_adv/bat0/originators
  65. Other files allow to change batman's behaviour to better fit your
  66. requirements. For instance, you can check the current originator
  67. interval (value in milliseconds which determines how often batman
  68. sends its broadcast packets):
  69. # cat /sys/class/net/bat0/mesh/orig_interval
  70. # 1000
  71. and also change its value:
  72. # echo 3000 > /sys/class/net/bat0/mesh/orig_interval
  73. In very mobile scenarios, you might want to adjust the originator
  74. interval to a lower value. This will make the mesh more respon-
  75. sive to topology changes, but will also increase the overhead.
  76. USAGE
  77. -----
  78. To make use of your newly created mesh, batman advanced provides
  79. a new interface "bat0" which you should use from this point on.
  80. All interfaces added to batman advanced are not relevant any
  81. longer because batman handles them for you. Basically, one "hands
  82. over" the data by using the batman interface and batman will make
  83. sure it reaches its destination.
  84. The "bat0" interface can be used like any other regular inter-
  85. face. It needs an IP address which can be either statically con-
  86. figured or dynamically (by using DHCP or similar services):
  87. # NodeA: ip link set up dev bat0
  88. # NodeA: ip addr add 192.168.0.1/24 dev bat0
  89. # NodeB: ip link set up dev bat0
  90. # NodeB: ip addr add 192.168.0.2/24 dev bat0
  91. # NodeB: ping 192.168.0.1
  92. Note: In order to avoid problems remove all IP addresses previ-
  93. ously assigned to interfaces now used by batman advanced, e.g.
  94. # ip addr flush dev eth0
  95. LOGGING/DEBUGGING
  96. -----------------
  97. All error messages, warnings and information messages are sent to
  98. the kernel log. Depending on your operating system distribution
  99. this can be read in one of a number of ways. Try using the com-
  100. mands: dmesg, logread, or looking in the files /var/log/kern.log
  101. or /var/log/syslog. All batman-adv messages are prefixed with
  102. "batman-adv:" So to see just these messages try
  103. # dmesg | grep batman-adv
  104. When investigating problems with your mesh network it is some-
  105. times necessary to see more detail debug messages. This must be
  106. enabled when compiling the batman-adv module. When building bat-
  107. man-adv as part of kernel, use "make menuconfig" and enable the
  108. option "B.A.T.M.A.N. debugging".
  109. Those additional debug messages can be accessed using a special
  110. file in debugfs
  111. # cat /sys/kernel/debug/batman_adv/bat0/log
  112. The additional debug output is by default disabled. It can be en-
  113. abled during run time. Following log_levels are defined:
  114. 0 - All debug output disabled
  115. 1 - Enable messages related to routing / flooding / broadcasting
  116. 2 - Enable messages related to route added / changed / deleted
  117. 4 - Enable messages related to translation table operations
  118. 8 - Enable messages related to bridge loop avoidance
  119. 16 - Enable messaged related to DAT, ARP snooping and parsing
  120. 31 - Enable all messages
  121. The debug output can be changed at runtime using the file
  122. /sys/class/net/bat0/mesh/log_level. e.g.
  123. # echo 6 > /sys/class/net/bat0/mesh/log_level
  124. will enable debug messages for when routes change.
  125. Counters for different types of packets entering and leaving the
  126. batman-adv module are available through ethtool:
  127. # ethtool --statistics bat0
  128. BATCTL
  129. ------
  130. As batman advanced operates on layer 2 all hosts participating in
  131. the virtual switch are completely transparent for all protocols
  132. above layer 2. Therefore the common diagnosis tools do not work
  133. as expected. To overcome these problems batctl was created. At
  134. the moment the batctl contains ping, traceroute, tcpdump and
  135. interfaces to the kernel module settings.
  136. For more information, please see the manpage (man batctl).
  137. batctl is available on https://www.open-mesh.org/
  138. CONTACT
  139. -------
  140. Please send us comments, experiences, questions, anything :)
  141. IRC: #batman on irc.freenode.org
  142. Mailing-list: [email protected] (optional subscription
  143. at https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n)
  144. You can also contact the Authors:
  145. Marek Lindner <[email protected]>
  146. Simon Wunderlich <[email protected]>