Visualizing the 2nd layer¶
In batman-adv, the vis-support is already built-in. It uses the batman-adv's protocol layer which is dealing with most of the things automatically. So compared to the layer 3 batmand, there is no need to install additional programs and no need for a client to choose and know a vis-server's ip-address. Basically you only have to activate the vis-output, fetch it and convert it to a desired format (i.e. with the help of the graphviz-tools).
It is also recommended to use/install batctl as configuring any batman-adv related option is a lot more comfortable with it. However, you can still get and set everything in the sysfs on your own in /sys/class/net/bat0/mesh. Have a look at the README file in case you might be interested in that.
Usage with batctl - the comfortable way¶
Activating the vis-output¶
To declare one or more batman-adv nodes in your mesh as a vis-server for fetching the topology data, just type:
batctl vm server
Every other node then automatically becomes a vis-client and sends its local view to the closest vis-server (the one with the highest TQ value that is). If there is more than one vis-server in the network, then those are additionally synchronising their information.
So usually the number of vis-servers should be kept as low as possible to reduce the bandwidth consumption. If you are experiencing an inaccurate vis-output because of a bottleneck between two mesh regions, you might want to try running a vis-server in each of those.
Fetching the vis-output¶
On a vis-server, just enter
batctl vd dot
batctl vd json
to get a textual output which describes the network topologie's graph. The first one is showing the output in dot-file format which is a common graph description language, supported by a lot of (grahp) visualising tools. The second format, the json-format, is a common format for textual data structures. If you just want to create a graphic with the current tools available, then the dot-format is probably what you're looking for. If you want to program your own applications, you might be better off with the json output (or the raw output being described below).
Generating 2D graphs - dot to picture¶
The vis-output can easily be converted to a picture with the graphviz-tools. Entering a command like
batctl vd dot | fdp -Tpng > batman-adv-vis-example.png
would directly generate such a nice png on a B.A.T.M.A.N.-Adv vis-server (the example dot-file can be found here : batman-adv-vis-example.dot )
- Ellipses: Every BATMAN-node's and host's interface can be found in here labeled with the according interface's MAC-address.
- Boxes: interfaces belonging to one BATMAN-node
- double circled interfaces: the primary interface of a BATMAN-node (which is known to other BATMAN-nodes only, except direct neighbours)
- Ellipses with an HNA-arrow: mesh clients (this can be a BATMAN-node itself with its bat0 interface or computers/devices being bridged into the mesh)
- Arrows with numbers: the transmit quality (in the form 1/TQ) from one BATMAN-node's interface to another BATMAN-node's interface