One OLSR implementation 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 (it is almost GPL).
Benjamin Henrion created a Docker version that allows quick testing with OLSRd
https://github.com/zoobab/olsrd-in-docker
This demo simply wants to show how to run OLSRd image and see how to inspect the packet traffic and how to test a protocol using Docker.
We first execute 3 nodes in 3 different terminals:
docker run --privileged --name olsr1 zoobab/olsrd-in-docker
docker run --privileged --name olsr2 zoobab/olsrd-in-docker
docker run --privileged --name olsr3 zoobab/olsrd-in-docker
--privileged
: This flag gives the container full access to the host system's devices and resources, effectively removing many of the isolation aspects of Docker containers. This is used when the container needs to interact with the host system in ways that are otherwise restricted, such as manipulating the network stack or accessing hardware directly.
You’ll get something similar to:
*** olsr.org - 0.9.5-git_0000000-hash_0942e9bfb09d8a5cf2ca87e2a7d938c6 ***
Build date: 2017-12-16 09:53:16 on builds-02.infra.lede-project.org
<http://www.olsr.org>
Debug level: 0
IpVersion: 4
Clear screen enabled
Noint set to 1
Hysteresis enabled
Hysteresis Scaling: 0.50
Hysteresis UpperThr: 0.80
Hysteresis LowerThr: 0.30
Link quality level 0
Pollrate 0.05
NIC Changes Pollrate 3.00
setting ifs_in_curr_cfg = 0
IPv4 broadcast/multicast : AUTO
Mode : mesh
IPv6 multicast : ::
HELLO emission/validity : 0.00/0.00
TC emission/validity : 0.00/0.00
MID emission/validity : 0.00/0.00
HNA emission/validity : 0.00/0.00
Autodetect changes : no
Parsing file: "/etc/olsrd/olsrd.conf"
If you use the dps
wrapper script (https://github.com/zoobab/docker-ps-showips), you can display the IP of the containers:
$ ./dps.sh
IP ADDRESS CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
172.17.0.4 a75ac7bc97c0 zoobab/olsrd-in-docker "olsrd -nofork" 26 minutes ago Up 26 minutes olsr3
172.17.0.3 8b0efb0f4cbf zoobab/olsrd-in-docker "olsrd -nofork" 26 minutes ago Up 26 minutes olsr2
172.17.0.2 fa782b368175 zoobab/olsrd-in-docker "olsrd -nofork" 26 minutes ago Up 26 minutes olsr1
We connect to node olsr2
docker exec -it olsr2 /bin/sh
We can check what the content of /etc/olsrd/olsrd.conf
using the command: cat /etc/olsrd/olsrd.conf
to get:
DebugLevel 0
IpVersion 4
ClearScreen yes
AllowNoInt yes
UseHysteresis yes
HystScaling 0.50
HystThrHigh 0.80
HystThrLow 0.30
LinkQualityLevel 0
Pollrate 0.05
NicChgsPollInt 3.0
Interface "eth0" {}
This file could be edited to try other configurations. See https://manpages.ubuntu.com/manpages/focal/en/man5/olsrd.conf.5.html
Then, you can check that all the hosts are in the routing table: route -n