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