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

