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