There are several OLSR implementation for Linux, but not all of them support IPv6. You should know how to enable and use IPv6 on Linux. Peter Bieringer has written an excellent Linux IPv6 HOWTO.
There is one OLSR implementation that is becoming the "standard" and most widely used. It goes by the descriptive name "OLSRd" (old Unik-OLSR).
OLSRd is an implementation based on the INRA C code, but has been almost completely rewritten, so there is not much left of the original INRA code (that mean it almost GPL). OLSRd also is under very rapid development, and if you report in a bug, it is usually fixed in a matter of hours.
OLSRd fully comply to the OLSR RFC, support for plugins, and it has an optional GUI interface (to see what's going on). The implementation also has a informative "up-to-date" web-page with links to mailing lists and papers.
There are up-to multiple new releases of OLSRd each month, so check the OLSRd web-site for the newest release.
The latest release as of this writing is 0.4.3, but by the time you read this there is almost certain a new release. Fetch the latest release from http://www.olsr.org/index.cgi?action=download.
Unpack, compile and install the source code:
# tar jxvf uolsrd-x.y.z # cd unik-olsrd-x.y.z # make # make install
The olsrd gets installed to /usr/bin/ and a default config file, olsrd.conf can be found under /etc
Check out the /etc/olsrd.conf config file, and change values to fit your system. All values in this file can be overridden with command line options to olsrd. The main options to change are:
# Debug level(0-9) # If set to 0 the daemon runs in the background DEBUG 1 # IP version to use (4 or 6) IPVERSION 6 # A list of whitespace separated interface names INTERFACES eth1
Later on, when you know OLSRd is configured correctly, you may set "DEBUG" to 0 to make it run in the background. You may then also add it to your init scripts. But to test that everything first, set this to at least 1 (setting this higher will produce a lot more info messages on APM, forwarding, parsing of the config file etc.)
When OLSRd is installed and configured, it can be started as root with:
All the settings in /etc/olsrd.conf can be overridden by command line options:
# olsrd -i eth1 -ipv6 -d 1
Would start olsrd listening on interface eth1 using IPv6 and with debug messages.
We start olsrd:
# olsrd -i eth1 -d 1 -ipv6 *** UniK olsrd-0.4.3 *** hello interval = 2.00 hello int nonwireless: = 4.00 tc interval = 5.00 polling interval = 0.10 neighbor_hold_time = 6.00 neighbor_hold_time_nw = 12.00 topology_hold_time = 15.00 tos setting = 16 hna_interval = 15.00 mid_interval = 5.00 Willingness set to 3 - next update in 20.000000 secs Using IP version 6 Using multicast address ff05::15 ---- Interface configuration ---- eth1: Address: fec0:106:2700::10 Multicast: ff05::15 Interface eth1 set up for use with index 0 Main address: fec0:106:2700::10 NEIGHBORS: l=linkstate, m=MPR, w=willingness Thread created - polling every 0.10 seconds neighbor list: 11:43:17.214807 neighbor list: 11:43:19.194967 neighbor list: 11:43:21.395046 neighbor list: 11:43:23.604800 neighbor list: 11:43:25.694875
Another thing worth noticing, is that an entry is added to our routing table:
# route -A inet6 Destination: Next Hop Flags Metric Ref Use Iface ... ff05::15/128 ff05::15 UAC 0 1 1 eth1 ...
This is the IPv6 multicast address OLSR is using to talk to other nodes running OLSR.
There is no point in using OLSRd on only one node, so we add some nodes. You will then see the "neighbor list" gets updated:
neighbor list: 12:55:14.733586 neighbor list: 12:55:18.803585 Willingness for fec0:106:2700::11 changed from 0 to 3 - UPDATING neighbor list: 12:55:22.763585 fec0:106:2700::11:l=0:m=0:w=3[2hlist:] neighbor list: 12:55:26.833589 fec0:106:2700::11:l=1:m=0:w=3[2hlist:] Willingness for fec0:106:2700::12 changed from 0 to 2 - UPDATING neighbor list: 12:55:30.903585 fec0:106:2700::12:l=0:m=0:w=2[2hlist:] fec0:106:2700::11:l=1:m=0:w=3[2hlist:] neighbor list: 12:55:34.863585 fec0:106:2700::12:l=0:m=0:w=2[2hlist:] fec0:106:2700::11:l=1:m=0:w=3[2hlist:] neighbor list: 12:55:39.153586 fec0:106:2700::12:l=1:m=0:w=2[2hlist:fec0:106:2700::11:] fec0:106:2700::11:l=1:m=0:w=3[2hlist:fec0:106:2700::12:] neighbor list: 12:55:43.443605 fec0:106:2700::12:l=1:m=0:w=2[2hlist:fec0:106:2700::11:] fec0:106:2700::11:l=1:m=0:w=3[2hlist:fec0:106:2700::12:]
You will also see the routing table is updated with the new hosts:
# route -A inet6 Destination: Next Hop Flags Metric Ref Use Iface ... fec0:106:2700::11/128 :: UH 1 0 0 eth1 fec0:106:2700::12/128 :: UH 1 0 0 eth1 ...
The real beauty of OLSR is when you add a bunch of nodes and move them around. You can still reach each one of them either directly (if they are close), or through other nodes.
When every node can reach every other node, it's no fun. Let's start moving the nodes, so that node "A" and "B" are out of (radio) range of each other. So when we move node "A" far enough away so that it can't hear node "C", all traffic must go through node "B":
Tip: Instead of physically moving the nodes around, you can use ip6tables. You can drop all packet using the MAC-address. You just need to block on one node:
# ip6tables -A INPUT -m mac --mac-source XX:XX:XX:XX:XX:XX -j DROP
The output from OLSRd on host A is then:
neighbor list: 13:22:35.693587 fec0:106:2700::11:l=1:m=1:w=3[2hlist:fec0:106:2700::12:] neighbor list: 13:22:40.093588 fec0:106:2700::11:l=1:m=1:w=3[2hlist:fec0:106:2700::12:] neighbor list: 13:22:44.053594 fec0:106:2700::11:l=1:m=1:w=3[2hlist:fec0:106:2700::12:] neighbor list: 13:22:48.233594 fec0:106:2700::11:l=1:m=1:w=3[2hlist:fec0:106:2700::12:] neighbor list: 13:22:52.193605 fec0:106:2700::11:l=1:m=1:w=3[2hlist:fec0:106:2700::12:]
The routing table also gets updated. For node A to reach node C it must go through node B:
# route -A inet6 Destination: Next Hop Flags Metric Ref Use Iface ... fec0:106:2700::11/128 :: UH 1 1 0 eth1 fec0:106:2700::12/128 fec0:106:2700::11 UGH 2 0 0 eth1 ...
" In order to provide this capability of injecting external routing information into an OLSR MANET, a node with such non-MANET interfaces periodically issues a Host and Network Association (HNA) message, containing sufficient information for the recipients to construct an appropriate routing table."
" An example of such a situation could be where a node is equipped with a fixed network (e.g., an Ethernet) connecting to a larger network as well as a wireless network interface running OLSR." --- RFC3626: OLSR, section 12 (page 51).
To have one node, act as a gateway and send out HNA messages, you must change the HNA6 in /etc/olsrd.conf:
# HNA IPv6 routes # syntax: netaddr prefix # Example Internet gateway HNA6 :: 0
When you start OLSRd, you will see the node is sending out HNA messages periodically:
... Sending HNA (48 bytes)... ...
When the other nodes receives a HNA message, they update their routing table:
# route -A inet6 Destination: Next Hop Flags Metric Ref Use Iface ... ::/0 fec0:106:2700::1 UG 1 0 0 eth1 ...
You may also have multiple nodes in a MANET to act as gateways (sending out HNA messages). Each mobile node then use the nearest gateway.
As of version 0.4.3 OLSRd also support plugins. Plugins may be used to add extended functionality in a MANET. If only a subset of the nodes knows how to interpret the messagetype, it will be forwarded by all the nodes by the "default forwarding algorithm" (see section 3.4.1 in the OLSR RFC). This way certain nodes may add special functionlity into OLSR.
As of this writing, two example plugins is included in the OLSRd release. One of these plugins add routing based on powerstatus. If one node has low battery, it can set its willingness lower and traffic may be routed through other nodes.
OLSRd also has an optional GUI, which can show a list of available nodes and grab packets. To compile the GUI front end, you must have GTK2. In unik-olsrd-x.y.z directory do:
# cd front-end # make # make install
Remember to start OLSRd with the -ipc switch or set IPC-CONNECT yes in /etc/olsrd.conf to enable the GUI to chat with OLSRd.
To see some examples of the use of GUI, check out http://www.olsr.org/index.cgi?action=gui
There is also other OLSR implementations, none have gained as much popularity as OLSRd, and none of them (except QOLSR?) are fully RFC compliant.
INRIA was one of the first(?) implementation of OLSR http://hipercom.inria.fr/olsr/#code. Their web-site has not been updated for quite a while, and the OLSR code you can download only complies to draft-ietf-manet-olsr-03.txt (it's now an RFC). There is suppose to be another more up-to-date version of INRIA olsr, but I have not found it. INRIA OLSR does not support IPv6.
The "US Naval Research Laboratory" (NRL) also has an OLSR implementation. It is written in C++, and has IPv6 support. http://pf.itd.nrl.navy.mil/projects/olsr/
CRCOLSR is a implementation based on the French INRIA code. It is is supposed to be maintained by "Communication Research Center" (CRC) in Canada. But as of this writing, there have been no new releases since April 3, 2003. http://pf.itd.nrl.navy.mil/projects/olsr/