Repository : ssh://git@open-mesh.org/doc
On branches: batman-adv-doc,master
commit a6b4c4b5aca31a9921c64da6cf20fa5cb68bcbf5 Merge: d2e3bbdd a6035b8f Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Sun Jan 25 20:29:44 2009 +0100
Merge 'batmand-howto' into master
a6b4c4b5aca31a9921c64da6cf20fa5cb68bcbf5 .gitignore | 7 + COPYING | 339 +++++++++++ Makefile | 3 + batman.docbook | 10 +- batman_adv.docbook | 11 + batman_iv_only.docbook | 5 +- batmand.docbook | 428 ++++++++++++++ bookinfo.docbook | 4 + copyright.docbook | 10 + images/Makefile | 3 +- images/{hop_penalty4.dia => announce_networks.dia} | 427 +++++++------- images/multiple_announces.dia | 617 +++++++++++++++++++++ images/{hop_penalty6.dia => multiple_clients.dia} | 399 +++++++------ references.docbook | 8 + usage.docbook | 13 - 15 files changed, 1862 insertions(+), 422 deletions(-)
diff --cc .gitignore index 00000000,fbcfa227..b8e8991e mode 000000,100644..100644 --- a/.gitignore +++ b/.gitignore @@@ -1,0 -1,7 +1,7 @@@ + *.pdf + *.ps + *.fo + *.html + *~ -img/*.eps -img/*.png ++images/*.eps ++images/*.png diff --cc Makefile index f838a75e,6c17d159..158d98e7 mode 100644,100755..100644 --- a/Makefile +++ b/Makefile @@@ -1,14 -1,15 +1,17 @@@ + #! /usr/bin/make -f + # -*- makefile -*- + -SOURCE = batmand_howto.docbook copyright.docbook installing.docbook \ - references.docbook articleinfo.docbook troubleshooting.docbook \ - usage.docbook -INPUT = batmand_howto.docbook - -all: $(INPUT:.docbook=.pdf) $(INPUT:.docbook=.html) - -$(INPUT:.docbook=.pdf): $(SOURCE) img -$(INPUT:.docbook=.html): $(SOURCE) img +default: all +all: batman_doc +.PHONY: clean images batman_doc batman_iv_only_doc +.SUFFIXES: .docbook .fo .ps .pdf .html +batman_doc: batman.pdf batman.html +batman_iv_only_doc: batman_iv_only.pdf batman_iv_only.html + +batman_iv_only.html: Makefile *.docbook images +batman_iv_only.pdf: Makefile *.docbook images +batman.html: Makefile *.docbook images +batman.pdf: Makefile *.docbook images
.docbook.fo: xmlto fo $< diff --cc batman.docbook index 509b27ab,00000000..645a003c mode 100644,000000..100644 --- a/batman.docbook +++ b/batman.docbook @@@ -1,22 -1,0 +1,24 @@@ +<?xml version="1.0" encoding="UTF-8" ?> - <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" - "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" ++<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" ++ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" +[ +<!ENTITY bookinfo SYSTEM "bookinfo.docbook"> +<!ENTITY introduction SYSTEM "introduction.docbook"> +<!ENTITY batman_iv SYSTEM "batman_iv.docbook"> +<!ENTITY batman_adv SYSTEM "batman_adv.docbook"> - <!ENTITY usage SYSTEM "usage.docbook"> ++<!ENTITY batmand SYSTEM "batmand.docbook"> ++<!ENTITY copyright SYSTEM "copyright.docbook"> +]> + +<book id="batman_book" lang="en"> + +&bookinfo; +&introduction; +&batman_iv; +&batman_adv; - &usage; ++&batmand; + ++©right; +</book> + + diff --cc batman_adv.docbook index a59fda39,00000000..9559075b mode 100644,000000..100644 --- a/batman_adv.docbook +++ b/batman_adv.docbook @@@ -1,332 -1,0 +1,343 @@@ +<?xml version="1.0" encoding="UTF-8" ?> +<chapter id="batman_adv"> +<title>B.A.T.M.A.N. Advanced - Layer 2 Meshing</title> +<sect1 id="bat_adv_intro"> +<title>Introduction</title> + <para> + TODO: check packet types, introduction, ... + </para> + <para> + Layer 2 in the OSI Model, the Link Layer, gives a lot of new possibilities: we have worldwide unique identifiers. + you can use IPv4, IPv6 or even IPX or DHCP, every Layer 3-protocol. A virtual interface is provided (bat0), which + can be considered as a usual ethernet device (probably with a little more packet loss ;) ). The frames sent on the wire/air + will be much shorter because we save the IP and UDP header. + </para> + <para> + Of course there are still a few issues: There is no TTL or ICMP, so the protocol has to check on endless loops itself. + There are no lowlevel debug-tools on Layer2, so we have to write our own toolchain to have things like ping and traceroute. + </para> +</sect1> +<sect1 id="batman_adv_packet_types"> +<title>Packet Types</title> +<sect2 id="Batman_adv_packet_types_intro"> + <title>Introduction</title> + <para> + B.A.T.M.A.N. Advanced assumes a standard Ethernet header as described below. The Linux kernel allows us to + talk Ethernet via raw sockets (SOCK_RAW). + </para> + <table> + <title>Ethernet embedding</title> + <tgroup cols="9"> + <colspec colnum="1" colname="colB" colwidth="1*"/> + <colspec colnum="2" colname="col0" colwidth="1*"/> + <colspec colnum="3" colname="col1" colwidth="1*"/> + <colspec colnum="4" colname="col2" colwidth="1*"/> + <colspec colnum="5" colname="col3" colwidth="1*"/> + <colspec colnum="6" colname="col4" colwidth="1*"/> + <colspec colnum="7" colname="col5" colwidth="1*"/> + <colspec colnum="8" colname="col6" colwidth="1*"/> + <colspec colnum="9" colname="col7" colwidth="1*"/> + <thead><row> + <entry>+</entry> + <entry>00</entry> + <entry>01</entry> + <entry>02</entry> + <entry>03</entry> + <entry>04</entry> + <entry>05</entry> + <entry>06</entry> + <entry>07</entry> + </row> + </thead> + <tbody> + <row> + <entry colname="colB">00-07</entry> + <entry namest="col0" nameend="col5">Destination MAC</entry> + <entry namest="col6" nameend="col7">Source MAC</entry> + </row> + <row> + <entry colname="colB">08-15</entry> + <entry namest="col0" nameend="col3">Source MAC</entry> + <entry namest="col4" nameend="col5">Ethernet Type</entry> + <entry colname="col6"> Batman Type</entry> + <entry colname="col7"> (...)</entry> + </row> + + </tbody> + </tgroup> + </table> + <para> + <itemizedlist> + <listitem><para> Destination MAC - The MAC of the neighbour or broadcast</para></listitem> + <listitem><para> Source MAC - The MAC of the Network Interface the packet is sent out</para></listitem> + <listitem><para> Ethernet Type - The Batman Ethertype (0x0842)</para></listitem> + <listitem><para> Batman Type - The different messages (unicast, broadcast, originator, message system) are distinguished in this field, as described in the next secionts</para></listitem> + </itemizedlist> + + The Destination MAC is set according to the embedded Ethernet Frame (if there is any), so inner Broadcasts are also + Broadcasts outside, and Unicast Frames are Unicast outside. The inner Frame has the real Destination/Source MAC of the + virtual Interface which is to receive/send the Frame. The outer Frame contains only the Destination/Source from the router + which eventually pass on the frame. + </para> +</sect2> +<sect2 id="Batman_adv_packet_types_0"> + <title>Batman Type 0 - Originator</title> + <para> + Originator packets are the routing protocol messages used to built up the mesh. + They're identified with the value 0 in the batman type field as the first field of the Ethernet payload. + + </para> + <table> + <title></title> + <tgroup cols="9"> + <colspec colnum="1" colname="colB" colwidth="1*"/> + <colspec colnum="2" colname="col0" colwidth="1*"/> + <colspec colnum="3" colname="col1" colwidth="1*"/> + <colspec colnum="4" colname="col2" colwidth="1*"/> + <colspec colnum="5" colname="col3" colwidth="1*"/> + <colspec colnum="6" colname="col4" colwidth="1*"/> + <colspec colnum="7" colname="col5" colwidth="1*"/> + <colspec colnum="8" colname="col6" colwidth="1*"/> + <colspec colnum="9" colname="col7" colwidth="1*"/> + <thead><row> + <entry>+</entry> + <entry>00</entry> + <entry>01</entry> + <entry>02</entry> + <entry>03</entry> + <entry>04</entry> + <entry>05</entry> + <entry>06</entry> + <entry>07</entry> + </row> + </thead> + <tbody> + <row> + <entry colname="colB">08-15</entry> + <entry namest="col0" nameend="col5">(Ethernet header ..)</entry> + <entry colname="col6">Batman Type</entry> + <entry colname="col7">Version</entry> + </row> + <row> + <entry colname="colB">16-23</entry> + <entry colname="col0">Flags</entry> + <entry colname="col1">TTL</entry> + <entry namest="col2" nameend="col7">Originator MAC</entry> + </row> + <row> + <entry colname="colB">24-31</entry> + <entry namest="col0" nameend="col1">Seqno</entry> + <entry colname="col2">Gateway Info</entry> + <entry namest="col3" nameend="col7">(Ethernet padding ...)</entry> + </row> + + </tbody> + </tgroup> + </table> + <para> + <itemizedlist> + <listitem><para> Batman Type - value 0, this is an Originator packet.</para></listitem> + <listitem><para> Version - value 2, only this version is accepted.</para></listitem> + <listitem><para> Flags - some Flags which are used in the algorithm: + <itemizedlist> + <listitem><para>0x80 - Unidirectional Link</para></listitem> + <listitem><para>0x40 - Directlink</para></listitem> + </itemizedlist> + </para></listitem> + <listitem><para> TTL - Time to Live, decremented on each Hop. If 0, the packet is dropped. </para></listitem> + <listitem><para> Originator MAC - The MAC address of the node which originally released the packet. </para></listitem> + <listitem><para> Seqno - The Sequence Number, the Originator increases this number with each new packet. </para></listitem> + <listitem><para> Gateway Info - reserved, classification of the gatway capabilities and quality (connection to the internet).</para></listitem> + </itemizedlist> + </para> + </sect2> +<sect2 id="Batman_adv_packet_types_1"> + <title>Batman Type 1 - Message System</title> + <para> + There is no ICMP (we just missed by one layer ;) ), so there is something like "light ICMP", + to make debugging applications like ping traceroute possible. + + </para> + <table> + <title></title> + <tgroup cols="9"> + <colspec colnum="1" colname="colB" colwidth="1*"/> + <colspec colnum="2" colname="col0" colwidth="1*"/> + <colspec colnum="3" colname="col1" colwidth="1*"/> + <colspec colnum="4" colname="col2" colwidth="1*"/> + <colspec colnum="5" colname="col3" colwidth="1*"/> + <colspec colnum="6" colname="col4" colwidth="1*"/> + <colspec colnum="7" colname="col5" colwidth="1*"/> + <colspec colnum="8" colname="col6" colwidth="1*"/> + <colspec colnum="9" colname="col7" colwidth="1*"/> + <thead><row> + <entry>+</entry> + <entry>00</entry> + <entry>01</entry> + <entry>02</entry> + <entry>03</entry> + <entry>04</entry> + <entry>05</entry> + <entry>06</entry> + <entry>07</entry> + </row> + </thead> + <tbody> + <row> + <entry colname="colB">08-15</entry> + <entry namest="col0" nameend="col5">(Ethernet header ..)</entry> + <entry colname="col6">Batman Type</entry> + <entry colname="col7">message type</entry> + </row> + <row> + <entry colname="colB">16-21</entry> + <entry colname="col0">Code</entry> + <entry namest="col1" nameend="col7">(Ethernet padding ...)</entry> + </row> + + </tbody> + </tgroup> + </table> + <para> + <itemizedlist> + <listitem><para> Batman Type - value 1, this is a message system packet.</para></listitem> + <listitem><para> Message Type - same as in ICMP: + <itemizedlist> + <listitem><para>0 - Echo Reply</para></listitem> + <listitem><para>8 - Echo Request</para></listitem> + <listitem><para>11 - TTL Exceeded</para></listitem> + </itemizedlist> + </para></listitem> + <listitem><para> Code - distinction of some messages types. Only value 0 so far.</para></listitem> + </itemizedlist> + </para> + </sect2> +<sect2 id="Batman_adv_packet_types_2"> + <title>Batman Type 2 - Unicast</title> + <para> + Packets received from the virtual Interface are encapsulated and sent in B.A.T.M.A.N.-Frames. + </para> + <table> + <title></title> + <tgroup cols="9"> + <colspec colnum="1" colname="colB" colwidth="1*"/> + <colspec colnum="2" colname="col0" colwidth="1*"/> + <colspec colnum="3" colname="col1" colwidth="1*"/> + <colspec colnum="4" colname="col2" colwidth="1*"/> + <colspec colnum="5" colname="col3" colwidth="1*"/> + <colspec colnum="6" colname="col4" colwidth="1*"/> + <colspec colnum="7" colname="col5" colwidth="1*"/> + <colspec colnum="8" colname="col6" colwidth="1*"/> + <colspec colnum="9" colname="col7" colwidth="1*"/> + <thead><row> + <entry>+</entry> + <entry>00</entry> + <entry>01</entry> + <entry>02</entry> + <entry>03</entry> + <entry>04</entry> + <entry>05</entry> + <entry>06</entry> + <entry>07</entry> + </row> + </thead> + <tbody> + <row> + <entry colname="colB">08-15</entry> + <entry namest="col0" nameend="col5">(Ethernet header ..)</entry> + <entry colname="col6">Batman Type</entry> + <entry colname="col7">TTL</entry> + </row> + <row> + <entry colname="colB">16-21</entry> + <entry namest="col0" nameend="col7">(Payload ...)</entry> + </row> + + </tbody> + </tgroup> + </table> + <para> + <itemizedlist> + <listitem><para> Batman Type - value 2, this is a unicast packet.</para></listitem> + <listitem><para> TTL - Time to Live, decremented on each Hop. If 0, the packet is dropped. </para></listitem> + <listitem><para> Payload - The encapsulated Ethernet Frame, received from the virtual interface</para></listitem> + </itemizedlist> + </para> + </sect2> +<sect2 id="Batman_adv_packet_types_3"> + <title>Batman Type 3 - Broadcast</title> + <para> + Broadcast packets received from the virtual Interface are encapsulated and sent in B.A.T.M.A.N.-Frames. + + </para> + <table> + <title></title> + <tgroup cols="9"> + <colspec colnum="1" colname="colB" colwidth="1*"/> + <colspec colnum="2" colname="col0" colwidth="1*"/> + <colspec colnum="3" colname="col1" colwidth="1*"/> + <colspec colnum="4" colname="col2" colwidth="1*"/> + <colspec colnum="5" colname="col3" colwidth="1*"/> + <colspec colnum="6" colname="col4" colwidth="1*"/> + <colspec colnum="7" colname="col5" colwidth="1*"/> + <colspec colnum="8" colname="col6" colwidth="1*"/> + <colspec colnum="9" colname="col7" colwidth="1*"/> + <thead><row> + <entry>+</entry> + <entry>00</entry> + <entry>01</entry> + <entry>02</entry> + <entry>03</entry> + <entry>04</entry> + <entry>05</entry> + <entry>06</entry> + <entry>07</entry> + </row> + </thead> + <tbody> + <row> + <entry colname="colB">08-15</entry> + <entry namest="col0" nameend="col5">(Ethernet header ..)</entry> + <entry colname="col6">Batman Type</entry> + <entry colname="col7">(reserved)</entry> + </row> + <row> + <entry colname="colB">16-21</entry> + <entry namest="col0" nameend="col5">Originator MAC</entry> + <entry namest="col6" nameend="col7">Seqno</entry> + </row> + <row> + <entry colname="colB">22-31</entry> + <entry namest="col0" nameend="col7">(Payload ...)</entry> + </row> + + + </tbody> + </tgroup> + </table> + <para> + <itemizedlist> + <listitem><para> Batman Type - value 2, this is a unicast packet.</para></listitem> + <listitem><para> Originator MAC - The MAC address of the node which originally released the packet. </para></listitem> + <listitem><para> Seqno - sequence number, the Originator increases this number with each new packet. </para></listitem> + </itemizedlist> + There is a sequence number and originator MAC to prevent flooding. Each packet is only rebroadcasted once, and there is a Flood history to keep + track of already received broadcasts. + </para> + </sect2> + + + +</sect1> ++ ++<sect1> ++ <title>Usage</title> ++ <para> ++ TODO Compilation, Installation of batman-adv-kernelland, batman-adv-userspace, battool ++ TODO Usage batman-adv-userspace: debug output, command line options ++ TODO Usage batman-adv-kernelland: insmod, proc files, log files, visualization ++ ++ TODO Setup: exmaple setups (e.g. bridging over AP and Adhoc, ...) ++ </para> ++</sect1> +</chapter> diff --cc batman_iv_only.docbook index 9a95b6bb,00000000..f43f2b6d mode 100644,000000..100644 --- a/batman_iv_only.docbook +++ b/batman_iv_only.docbook @@@ -1,18 -1,0 +1,17 @@@ +<?xml version="1.0" encoding="UTF-8" ?> - <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" - "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" ++<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" ++ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" +[ +<!ENTITY bookinfo SYSTEM "bookinfo.docbook"> +<!ENTITY introduction SYSTEM "introduction.docbook"> +<!ENTITY batman_iv SYSTEM "batman_iv.docbook"> +<!ENTITY batman_adv SYSTEM "batman_adv.docbook"> - <!ENTITY usage SYSTEM "usage.docbook"> +]> + +<book id="batman_book" lang="en"> + +&batman_iv; + +</book> + + diff --cc batmand.docbook index 00000000,faf6ddae..e984afd9 mode 000000,100644..100644 --- a/batmand.docbook +++ b/batmand.docbook @@@ -1,0 -1,356 +1,428 @@@ -<?xml version="1.0" encoding="utf-8"?> ++<?xml version="1.0" encoding="UTF-8" ?> ++<chapter> ++<title>B.A.T.M.A.N. - Layer 3 Meshing</title> ++ ++<section> ++ <title>Installing from source</title> ++ <section> ++ <title>Pre-requirements</title> ++ <itemizedlist> ++ <listitem><para>Compile environment and libraries.</para> ++ <orderedlist> ++ <listitem><para>gcc</para></listitem> ++ <listitem><para>libc6-dev</para></listitem> ++ <listitem><para>build-essential</para></listitem> ++ <listitem><para>binutils</para></listitem> ++ <listitem><para>makedev</para></listitem> ++ <listitem><para>GNU make</para></listitem> ++ <listitem><para>libpthread</para></listitem> ++ </orderedlist></listitem> ++ <listitem><para>Download the B.A.T.M.A.N. daemon code from the website ++ <ulink url="http://www.open-mesh.net/wiki/Download" /></para></listitem> ++ </itemizedlist> ++ </section> ++ <section> ++ <title>Compiling</title> ++ <para>All you have to do is untar and make, then you will see the executable ++ file called <emphasis>batmand</emphasis>.</para> ++ <programlisting><userinput>$ wget \ ++http://downloads.open-mesh.net/batman/stable/sources/batman/batman-0.3.tar.g... ++$ tar xzvf batman-0.3.tar.gz ++$ cd batman-0.3 ++$ make</userinput></programlisting> ++ <para>If you want reduce the size of executable file, just strip it by ++ executing:</para> ++ <programlisting><userinput>$ strip batmand</userinput></programlisting> ++ <para>Note that if you want to help us finding a bug in the daemon, please ++ don't strip it.</para> ++ </section> ++ <section> ++ <title>Installing</title> ++ <para>Copy <emphasis>batmand</emphasis> to a location somewhere in your ++ path, for example</para> ++ <programlisting><userinput>$ cp batmand /usr/sbin/</userinput></programlisting> ++ <para>Or start it right from the directory where you compiled it</para> ++ <programlisting><userinput>$ ./batmand</userinput></programlisting> ++ </section> ++</section> ++ + <section> + <title>Usage</title> + <para>If you execute batmand -h or -H, you will see the help page, in the + following we will explain all parameters and how to work with them in a mesh + network.</para> + <section> + <title>SYNOPSIS</title> - <command>batmand</command> - <arg choice="opt"><replaceable>options</replaceable></arg> - <arg choice="req"><replaceable>interface</replaceable></arg> - <arg choice="opt" rep="repeat"><replaceable>interface</replaceable></arg> ++ <cmdsynopsis> ++ <command>batmand</command> ++ <arg choice="opt"><replaceable>options</replaceable></arg> ++ <arg choice="req"><replaceable>interface</replaceable></arg> ++ <arg choice="opt" rep="repeat"><replaceable>interface</replaceable></arg> ++ </cmdsynopsis> + </section> + <section> + <title>DESCRIPTION</title> + <para>You can start batmand without specifying options, but you have to + choose at least one interface batmand runs on.</para> - <userinput>$ batmand eth1</userinput> ++ <programlisting><userinput>$ batmand eth1</userinput></programlisting> + <para>If you have more interfaces, then you just add them behind the first. + </para> - <userinput>$ batmand eth1 eth2 eth3</userinput> ++ <programlisting><userinput>$ batmand eth1 eth2 eth3</userinput></programlisting> + <para>The B.A.T.M.A.N. daemon can also run on alias interfaces. Note that we + use alias interfaces to separate B.A.T.M.A.N. routing protocol and olsr + routing protocol.</para> - <userinput>$ batmand eth1:test1 eth2:test2 eth3:test3</userinput> ++ <programlisting><userinput>$ batmand eth1:test1 eth2:test2 eth3:test3</userinput></programlisting> + <para>Note that the B.A.T.M.A.N. daemon will take the ip address and the + broadcast address from the given interfaces.</para> + <para>Note also that you have to check whether your essid, channel or wifi + mode is correct or not.</para> + <section> + <title><option>-a</option> add announced network(s)</title> + <para>The daemon announces the availability of a connection to another + network. This option can be used multiple times and can be used to add + networks dynamically while the daemon is running. The parameter has to be + in the form of ip-address/netmask.</para> + <para>For example, if you are the node A, and you can connect to + <emphasis>other network</emphasis>, then you can execute -a to announce + the gateway.</para> + <figure> + <title>Announce A as gateway to B</title> + <mediaobject> - <imageobject><imagedata fileref="img/announce_networks.eps" format="EPS" scale="50" /></imageobject> - <imageobject><imagedata fileref="img/announce_networks.png" format="PNG" /></imageobject> ++ <imageobject><imagedata fileref="images/announce_networks.eps" format="EPS" scale="50" /></imageobject> ++ <imageobject><imagedata fileref="images/announce_networks.png" format="PNG" /></imageobject> + </mediaobject> + </figure> + <para>If the other nodes in the B.A.T.M.A.N. network want to connect to + node B after receiving the announce network information form node A, then + they will know they can use node A as gateway to reach node B. Now, you + know what a announced network is, but executing this command is wrong: + </para> - <userinput>$ batmand -a 192.168.100.101 eth1</userinput> ++ <programlisting><userinput>$ batmand -a 192.168.100.101 eth1</userinput></programlisting> + <para>Because you have to specify the netmask parameter and different + netmask parameters cause different results. Let's make a example:</para> - <userinput>$ batmand -a 192.168.100.101/32 eth1</userinput> ++ <programlisting><userinput>$ batmand -a 192.168.100.101/32 eth1</userinput></programlisting> + <para>In this case, it means that node A can only connect to node B, + because your parameter is /32.</para> - <userinput>$ batmand -a 192.168.100.101/24 eth1</userinput> ++ <programlisting><userinput>$ batmand -a 192.168.100.101/24 eth1</userinput></programlisting> + <para>In this case, it means that node A can connect to the whole + 192.168.100.x network, because your parameter is /24. So, if you use + different netmask values, then the results are different.</para> + <figure> + <title>Two announced networks</title> + <mediaobject> - <imageobject><imagedata fileref="img/multiple_announces.eps" format="EPS" scale="50" /></imageobject> - <imageobject><imagedata fileref="img/multiple_announces.png" format="PNG" /></imageobject> ++ <imageobject><imagedata fileref="images/multiple_announces.eps" format="EPS" scale="50" /></imageobject> ++ <imageobject><imagedata fileref="images/multiple_announces.png" format="PNG" /></imageobject> + </mediaobject> + </figure> + <para>Node A can announce more than one network. To announce two networks + execute the following command:</para> - <userinput>$ batmand -a 192.168.100.101/24 -a 192.168.200.201/24 eth1</userinput> ++ <programlisting><userinput>$ batmand -a 192.168.100.101/24 -a 192.168.200.201/24 eth1</userinput></programlisting> + <para>Note that node A has to have a route to connect the node or network. + </para> + </section> + <section> + <title><option>-A</option> delete announced network(s)</title> + <para>Delete networks to the daemons list of available connections to + another network(s). This option can be used multiple times and can only be + used while the daemon is running. The parameter has to be in the form of + ip-address/netmask.</para> + </section> + <section> + <title><option>-b</option> run connection in batch mode</title> + <para>The debug information are updated after a period of time by default, + so if you use "-b" it will execute once and then stop.</para> + <programlisting><userinput>$ batmand eth1 + $ batmand -b -c -d 1</userinput></programlisting> + <para>In this case, it means run debug level 1 once.</para> + <para>Note that -b can only be used with -c and debug level 1 & 2. + </para> + </section> + <section> + <title><option>-c</option> connect via unix socket</title> + <para>The B.A.T.M.A.N. daemon offers a unix socket interface to which you + can connect. First, you have to create a B.A.T.M.A.N. daemon on your host, + then use -c to connect to its interface. Note you can create as many + client sockets as you like. Deploy it without any arguments to get the + current configuration even if changed at runtime.</para> + <figure> + <title>Multiple clients connected to B.A.T.M.A.N. interface</title> + <mediaobject> - <imageobject><imagedata fileref="img/multiple_clients.eps" format="EPS" scale="50" /></imageobject> - <imageobject><imagedata fileref="img/multiple_clients.png" format="PNG" /></imageobject> ++ <imageobject><imagedata fileref="images/multiple_clients.eps" format="EPS" scale="50" /></imageobject> ++ <imageobject><imagedata fileref="images/multiple_clients.png" format="PNG" /></imageobject> + </mediaobject> + </figure> + <programlisting><userinput>$ batmand eth1 + $ batmand -c -d 1</userinput></programlisting> + <para>In this case, you ask the daemon to output debug level 1 in your + current shell. The B.A.T.M.A.N. daemon will update the information after a + period of time.</para> + <para>Note that if you use -c flag, then you only can use -d + to see the debug level.</para> + </section> + <section> + <title><option>-d</option> <replaceable>debug level</replaceable></title> + <para>The debug level can be set to five values.</para> + <variablelist> + <varlistentry> + <term>0</term> - <listitem>debug disabled (default)</listitem> ++ <listitem><para>debug disabled (default)</para></listitem> + </varlistentry> + <varlistentry> + <term>1</term> - <listitem>list neighbors</listitem> ++ <listitem><para>list neighbors</para></listitem> + </varlistentry> + <varlistentry> + <term>2</term> - <listitem>list gateways</listitem> ++ <listitem><para>list gateways</para></listitem> + </varlistentry> + <varlistentry> + <term>3</term> - <listitem>observe batmand</listitem> ++ <listitem><para>observe batmand</para></listitem> + </varlistentry> + <varlistentry> + <term>4</term> - <listitem>observe batmand (very verbose)</listitem> ++ <listitem><para>observe batmand (very verbose)</para></listitem> + </varlistentry> + <varlistentry> + <term>5</term> - <listitem>memory debug / cpu usage</listitem> ++ <listitem><para>memory debug / cpu usage</para></listitem> + </varlistentry> + </variablelist> + <para>Note that debug level 5 can be disabled at compile time.</para> + <para>For example, you can run in normal start:</para> - <userinput>$ batmand -d 1 eth1</userinput> ++ <programlisting><userinput>$ batmand -d 1 eth1</userinput></programlisting> + <section> + <title>Level 1</title> + <para>just lists the neighbors in your B.A.T.M.A.N. network.</para> + <screen> + Originator Router (#/128): Potential routers... [B.A.T.M.A.N. 0.2, + MainIF/IP: eth2 105.131.131.175, UT: 0d 0h 3m] + 105.131.83.2 105.131.1.3 ( 71): 105.131.1.3 ( 71) + 105.131.1.2 105.131.1.2 ( 52): 105.131.1.2 ( 52) + 105.131.56.10 105.131.1.4 ( 25): 105.131.1.4 ( 25),105.131.1.6 ( 15),... + 105.131.131.70 105.131.131.70 (121): 105.131.131.70 (121)</screen> + <itemizedlist> - <listitem>In the first line, we will see the version of the - B.A.T.M.A.N. daemon, main interface, main IP, and uptime.</listitem> - <listitem>In the first column, we can see those IPs which we can - reach.</listitem> - <listitem>In the second column, we can see those IPs which we sent our ++ <listitem><para>In the first line, we will see the version of the ++ B.A.T.M.A.N. daemon, main interface, main IP, and uptime.</para></listitem> ++ <listitem><para>In the first column, we can see those IPs which we can ++ reach.</para></listitem> ++ <listitem><para>In the second column, we can see those IPs which we sent our + packets to when we want to reach the IP of the first column. The + number in the parenthesis indicates the link quality of the - connection and the #/128 shows the maximum number of packets. ++ connection and the #/128 shows the maximum number of packets.</para> + </listitem> - <listitem>In the third column, we can see those IPs which ++ <listitem><para>In the third column, we can see those IPs which + are one hop neighbors and rebroadcasted packets from + the originator. The B.A.T.M.A.N. daemon will choose the + router with the best link quality from the potential - router list.</listitem> ++ router list.</para></listitem> + </itemizedlist> + <para>In this case, 105.131.1.2 is a one hop neighbor of + 105.131.131.175, because the 105.131.1.2 is originator, + router and potential router at the same time. If + 105.131.131.175 wants to exchange data with the + 105.131.83.2, then it will sent its packets to the + 105.131.1.3, because it is the router for this + destination.</para> + </section> + <section> + <title>Level 2</title> + <para>just lists gateways in the B.A.T.M.A.N. + network.</para> + <screen> + Gateway Router (#/128) + 105.131.83.5 105.131.41.1 ( 57), gw_class 11 ->6 MBit, reliability: 0 + 105.131.41.5 105.131.41.1 ( 53), gw_class 11 ->6 MBit, reliability: 0 + </screen> + <itemizedlist> - <listitem>In the first column, we can see those IPs which - are our gateways.</listitem> - <listitem>In the second column, we can see those IPs which ++ <listitem><para>In the first column, we can see those IPs which ++ are our gateways.</para></listitem> ++ <listitem><para>In the second column, we can see those IPs which + we sent our packets to when we want to reach the IP of + the first column. The number in the parenthesis + indicates the link quality of the connection and the + #/128 shows the maximum number of packets. The gw_class means + gateway class of the gateway and 11 ->6 MBit means + how much bandwidth the gateway owner wants to share. + The reliability means how good the quality of the + internet connection is. In this case, 0 means this is the + best quality. The reliability number will increase if - the quality is poor.</listitem> ++ the quality is poor.</para></listitem> + </itemizedlist> + </section> + <section> + <title>Level 3</title> + <para>has more information about the neighbors, or shows + the error message when you have an incorrect command. Note + that if there is no neighbor in the B.A.T.M.A.N. network, + then it will display nothing.</para> + </section> + <section> + <title>Level 4</title> + <para>has so many information about the B.A.T.M.A.N. + network, for example, how many packets you sent, and sent + to where, or how many packets you got, and received from + where etc.</para> + </section> + </section> + <section> + <title><option>-g</option> <replaceable>gateway class</replaceable></title> + <para>The gateway class is used to tell other nodes in the + network your available internet bandwidth. Just enter any + number (optionally followed by "kbit" or "mbit") and the + daemon will guess your appropriate gateway class. Use "/" to + seperate the down- and upload rates. You can omit the upload + rate and batmand will assume an upload of + <inlineequation> + <mathphrase>download / 5</mathphrase> + </inlineequation>. + </para> + <itemizedlist> - <listitem>5000</listitem> - <listitem>5000kbit</listitem> - <listitem>5mbit</listitem> - <listitem>5mbit/1024</listitem> - <listitem>5mbit/1024kbit</listitem> - <listitem>5mbit/1mbit</listitem> ++ <listitem><para>5000</para></listitem> ++ <listitem><para>5000kbit</para></listitem> ++ <listitem><para>5mbit</para></listitem> ++ <listitem><para>5mbit/1024</para></listitem> ++ <listitem><para>5mbit/1024kbit</para></listitem> ++ <listitem><para>5mbit/1mbit</para></listitem> + </itemizedlist> + <para>You only can set the value in a normal start</para> - <userinput>$ batmand -g 5mbit/1024 -d 3 eth1</userinput> ++ <programlisting><userinput>$ batmand -g 5mbit/1024 -d 3 eth1</userinput></programlisting> + <para>Note that if you use debug level 3, then you will know + whether you succeed setting the gateway class or not.</para> + </section> + <section> + <title><option>-o</option> <replaceable>originator interval in ms</replaceable></title> + <para>A node transmits broadcast messages (we call them + originator message or OGM) to inform the neighboring nodes + about it's existence. Originator interval is the time to wait + after sending one message and before sending the next + message. The default value is 1000 ms (1 second). In a mobile + network, you may want to detect network changes very quickly, + so you need to send message very often, for example, use a + value of 500 ms. In a static network, you can save bandwidth + by using a higher value. This option is only available in + daemon mode.</para> - <userinput>$ batmand -o 2000 eth1</userinput> ++ <programlisting><userinput>$ batmand -o 2000 eth1</userinput></programlisting> + <para>In this case, batmand will wait 2 second until sending + the next OGMs.</para> + </section> + <section> + <title><option>-p</option> <replaceable>preferred gateway</replaceable></title> + <para>Set the internet gateway by yourself.</para> + <para>Note that this automatically switches your B.A.T.M.A.N. + daemon to "internet search modus" with "-r 1" unless "-r" is + given. If the preferred gateway is not found the gateway + selection will use the current routing class to choose a + gateway.</para> - <userinput>$ batmand -r 3 -d 3 -p 192.168.1.1 eth1</userinput> ++ <programlisting><userinput>$ batmand -r 3 -d 3 -p 192.168.1.1 eth1</userinput></programlisting> + <para>In this case, you set 192.168.1.1 as your preferred + gateway, so all of your internet packets will be sent to the + 192.168.1.1.</para> + </section> + <section> + <title><option>-r</option> <replaceable>routing class</replaceable></title> + <para>The routing class can be set to four values - it + enables "internet search modus". The daemon will choose an + internet gateway based on certain criteria (unless "-p" is + specified):</para> + <variablelist> + <varlistentry> + <term>0</term> - <listitem>set no default route (default)</listitem> ++ <listitem><para>set no default route (default)</para></listitem> + </varlistentry> + <varlistentry> + <term>1</term> - <listitem>use fast connection</listitem> ++ <listitem><para>use fast connection</para></listitem> + </varlistentry> + <varlistentry> + <term>2</term> - <listitem>use stable connection</listitem> ++ <listitem><para>use stable connection</para></listitem> + </varlistentry> + <varlistentry> + <term>3</term> - <listitem>use fast-switch connection</listitem> ++ <listitem><para>use fast-switch connection</para></listitem> + </varlistentry> + <varlistentry> + <term>XX</term> - <listitem>use late-switch connection</listitem> ++ <listitem><para>use late-switch connection</para></listitem> + </varlistentry> + </variablelist> + <section> + <title>Level 1</title> + <para>B.A.T.M.A.N tries to find the best available + connection by watching the uplinks throughput and the link + quality.</para> + </section> + <section> + <title>Level 2</title> + <para>B.A.T.M.A.N compares the link quality of the internet + node and chooses the one with the best connection.</para> + </section> + <section> + <title>Level 3</title> + <para>B.A.T.M.A.N compares the link quality of the internet + node and chooses the one with the best connection but + switches to another gateway as soon as a better connection + is found.</para> + </section> + <section> + <title>Level XX</title> + <para>B.A.T.M.A.N compares the link quality of the internet + node and chooses the one with the best link quality but + switches to another gateway as soon as this gateway has a + TQ value which is XX better than the currently selected + gateway.</para> + <para>XX ist a number between 3 and 256</para> - <userinput>$ batmand -r 3 -d 3 eth1</userinput> ++ <programlisting><userinput>$ batmand -r 3 -d 3 eth1</userinput></programlisting> + <para>In this case, the B.A.T.M.A.N. daemon will choose the + best statistic internet connection for you. Note that if + you use debug level 3, then you will know whether you + succeeded setting the routing class or not.</para> + </section> + </section> + <section> + <title><option>-s</option> <replaceable>visualization server</replaceable></title> + <para>Since no topology database is computed by the protocol + an additional solution to create topology graphs has been + implemented, the vis server. B.A.T.M.A.N. daemons may send + their local view about their single-hop neighbors to the vis + server. It collects the information and provides data in a + format similar to OLSR's topology information output. + Therefore existing solutions to draw topology graphs + developed for OLSR can be used to visualize mesh-clouds using + B.A.T.M.A.N.</para> + </section> + <section> + <title><option>--policy-routing-script</option></title> + <para>This option disables the policy routing feature of + batmand - all routing changes are send to the script which + can make use of this information or not. Firmware and package + maintainers can use this option to tightly integrate batmand + into their own routing policies. This option is only + available in daemon mode.</para> + </section> + </section> + </section> ++ ++<section> ++ <title>Troubleshooting</title> ++ <section> ++ <title>Why the B.A.T.M.A.N. daemon doesn't reload the setting after I fixed ++ the main IP?</title> ++ <para>You have to restart the B.A.T.M.A.N. daemon after you modified any ++ network configuration, otherwise the B.A.T.M.A.N. daemon won't use the new ++ settings.</para> ++ <programlisting><userinput>$ killall batmand ++$ batmand eth1</userinput></programlisting> ++ </section> ++ <section> ++ <title>Why I can't connect to the Internet after setting the default ++ gateway?</title> ++ <para>You have to use NAT on your gateway or firewall if you use the -r or ++ -p options to set default route.</para> ++ <programlisting><userinput>$ iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE</userinput></programlisting> ++ <para>Note that you don't set the default route by yourself.</para> ++ </section> ++</section> ++ ++</chapter> diff --cc bookinfo.docbook index 902ed474,00000000..6750bcd7 mode 100644,000000..100644 --- a/bookinfo.docbook +++ b/bookinfo.docbook @@@ -1,35 -1,0 +1,39 @@@ +<?xml version="1.0" encoding="UTF-8" ?> +<bookinfo> +<title>B.A.T.M.A.N. advanced</title> +<authorgroup> +<author> +<firstname>Simon</firstname> +<surname>Wunderlich</surname> +</author> +<author> +<firstname>Marek</firstname> +<surname>Lindner</surname> +</author> ++<author> ++<firstname>Wesley</firstname> ++<surname>Tsai</surname> ++</author> +</authorgroup> + +<date>2008</date> +<releaseinfo>0.1 draft</releaseinfo> + +<abstract> +<para> + This Document should give detailed information about the B.A.T.M.A.N. advanced + algorithm, data types, packets and implementation. + This is a DRAFT, do not refer or cite to this document. +</para> +</abstract> + +<keywordset> +<keyword>b.a.t.m.a.n.</keyword> +<keyword>batman</keyword> +<keyword>mesh</keyword> +<keyword>wifi</keyword> +<keyword>wlan</keyword> + +</keywordset> + +</bookinfo> diff --cc copyright.docbook index 00000000,fac94e0d..4ec2dffb mode 000000,100644..100644 --- a/copyright.docbook +++ b/copyright.docbook @@@ -1,0 -1,10 +1,10 @@@ + <?xml version="1.0" encoding="utf-8"?> -<section> ++<chapter> + <title>Copyright</title> + <para>This work is licensed under the GNU General Public License; + you can redistribute it and/or modify it under the terms of the + GNU General Public License as published by the Free Software + Foundation; version 2 of the License. To view a copy of this + license, visit <ulink url="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" /> or write to the Free Software Foundation, Inc., 51 Franklin + Street, Fifth Floor, Boston, MA 02110-1301 USA.</para> -</section> ++</chapter> diff --cc images/Makefile index 405b892f,00000000..e42d0324 mode 100644,000000..100644 --- a/images/Makefile +++ b/images/Makefile @@@ -1,48 -1,0 +1,49 @@@ +GP_IMAGES=asym_penalty.gp +DIA_IMAGES=asymetry.dia tq.dia eq.dia eq_alt1.dia eq_alt2.dia eq_alt3.dia rq.dia \ + hop_penalty1.dia hop_penalty2.dia \ + hop_penalty3.dia hop_penalty4.dia hop_penalty5.dia hop_penalty6.dia \ + asym_link1.dia asym_link2.dia tq_prop.dia \ + echo_cancel1.dia echo_cancel2.dia \ - tq_prop_best1.dia tq_prop_best2.dia tq_prop_best3.dia ++ tq_prop_best1.dia tq_prop_best2.dia tq_prop_best3.dia \ ++ announce_networks.dia multiple_announces.dia multiple_clients.dia +TEX_IMAGES=compute_tq.tex tq_prop_calc.tex +PNG_IMAGES= $(DIA_IMAGES:.dia=.png) +PNG_IMAGES+=$(GP_IMAGES:.gp=.png) +PNG_IMAGES+=$(TEX_IMAGES:.tex=.png) +EPS_IMAGES= $(DIA_IMAGES:.dia=.eps) +EPS_IMAGES+=$(GP_IMAGES:.gp=.eps) +EPS_IMAGES+=$(TEX_IMAGES:.tex=.eps) + +.PHONY: clean +.SUFFIXES: .dia .png .eps .gp + +default: all +all: $(EPS_IMAGES) $(PNG_IMAGES) + +.gp.png: + gnuplot $< +.gp.eps: + gnuplot $< + +.dia.png: + /usr/bin/dia -e $@ $< +.dia.eps: + /usr/bin/dia -e $@ $< +.tex.eps: + rm -f file_tmp.* + cp $< file_tmp.tex + latex file_tmp.tex + dvips file_tmp.dvi + ps2eps -l file_tmp.ps + mv file_tmp.eps $@ + rm -f file_tmp.* + +.tex.png: + rm -f file_tmp.* + cp $< file_tmp.tex + latex file_tmp.tex + dvips -x 3000 -y 3000 -E file_tmp.dvi + convert file_tmp.ps $@ + rm -f file_tmp.* +clean: + rm -f *.png *.eps diff --cc images/multiple_announces.dia index 00000000,f4e450dd..f4e450dd mode 000000,100644..100644 --- a/images/multiple_announces.dia +++ b/images/multiple_announces.dia