The Babel routing daemon
C Roff Other
Clone or download
jech Fix (non-exploitable) buffer-overflow in packet parser.
The check for a TLV going beyond the end of the packet was off by two.
A malformed packet could possibly cause babeld to read two octets beyond
the end of the read buffer.

While technically a buffer overflow, this is most probably not
exploitable, since it is a read-only overflow.  At worst, it would
cause two octets of garbage to be parsed and treated as valid data.
Latest commit 8cbc75d Jun 29, 2018
Permalink
Failed to load latest commit information.
.gitattributes Add .gitattributes. Aug 3, 2011
.gitignore gitignore tags TAGS emacs and vi temp files and bad patch attempts Mar 9, 2017
CHANGES Update CHANGES for 1.8.2. May 12, 2018
LICENCE Update copyright date in LICENCE. Jan 3, 2008
Makefile Use mandoc for generating the HTML manpage. Feb 11, 2016
README Update README with new website address. Apr 8, 2016
babeld.c Remove calls to send wildcard requests. Jan 29, 2018
babeld.h Export reopen_logfile. Feb 14, 2016
babeld.man Remove keep_unfeasible, in compliance with rfc6126bis. Jul 20, 2017
configuration.c Fix parsing of source length in filters. May 11, 2018
configuration.h Add ability to return an error message in the local interface. Feb 12, 2016
disambiguation.c Make disambiguation respect its own header Mar 9, 2017
disambiguation.h Make disambiguation respect its own header Mar 9, 2017
generate-version.sh Avoid spaces in babeld version. Feb 10, 2016
interface.c Remove calls to send wildcard requests. Jan 29, 2018
interface.h Use standard v4mapped encoding for source prefixes. May 23, 2017
kernel.c Fix style. Nov 12, 2015
kernel.h Use standard v4mapped encoding for source prefixes. May 23, 2017
kernel_netlink.c Fix: ignore peer address of point-to-point interfaces. Jan 31, 2018
kernel_socket.c Remove duplicate memset in kernel_interface_operational on BSD. Jul 25, 2017
local.c Maintain unicast Hello history. Jan 22, 2018
local.h Add support for unix-domain local socket Feb 13, 2016
message.c Fix (non-exploitable) buffer-overflow in packet parser. Jun 29, 2018
message.h Send requests when we lose a route. Aug 11, 2017
neighbour.c Take unicast Hellos into account when scheduling neighbours check. Jan 22, 2018
neighbour.h Maintain unicast Hello history. Jan 22, 2018
net.c Add support for unix-domain local socket Feb 13, 2016
net.h Add support for unix-domain local socket Feb 13, 2016
resend.c Use calloc instead of malloc in places where it makes sense. Mar 23, 2016
resend.h Implement source-specific requests. Feb 16, 2015
route.c Merge branch 'send-requests' Jan 22, 2018
route.h Remove keep_unfeasible, in compliance with rfc6126bis. Jul 20, 2017
rule.c Use standard v4mapped encoding for source prefixes. May 23, 2017
rule.h Move the table selection into rule.c. Nov 12, 2015
source.c Make source_compare consistent: also compare src_plen. May 18, 2017
source.h Rework source.c to be in log(n). Dec 14, 2015
util.c Revert "Fix bug allowing the comparison of v4 and v6 prefixes." May 23, 2017
util.h Use standard v4mapped encoding for source prefixes. May 23, 2017
xroute.c Useless initialization (do_filter do the job). Feb 23, 2018
xroute.h Refactor netlink: address import. Nov 12, 2015

README

Babel
=====

Babel is a loop-avoiding distance-vector routing protocol roughly
based on HSDV and AODV, but with provisions for link cost estimation
and redistribution of routes from other routing protocols.


Installation
============

    $ make
    $ su -c 'make install'

If compiling for OpenWRT, you will probably want to say something like

    $ make CC=mipsel-linux-gcc PLATFORM_DEFINES='-march=mips32'

On Mac OS X, you'll need to do

    $ make LDLIBS=''


Setting up a network for use with Babel
=======================================

1. Set up every node's interface
--------------------------------

On every node, set up the wireless interface:

    # iwconfig eth1 mode ad-hoc channel 11 essid "my-mesh-network"
    # ip link set up dev eth1

2. Set up every node's IP addresses
-----------------------------------

You will need to make sure that all of your nodes have a unique IPv6
address, and/or a unique IPv4 address.

On every node, run something like:

    # ip addr add 192.168.13.33/32 dev eth1
    # ip -6 addr add $(generate-ipv6-address -r)/128 dev eth1

You will find the generate-ipv6-address utility, which can generate random
IPv6 addresses according to RFC 4193, on

      https://www.irif.univ-paris-diderot.fr/~jch/software/files/


A note about tunnels and VPNs
-----------------------------

Some VPN implementations (notably OpenVPN and Linux GRE) do not
automatically add an IPv6 link-local address to the tunnel interface.
If you attempt to run Babel over such an interface, it will complain
that it ``couldn't allocate requested address''.

The solution is to manually add the link-local address to the
interface.  This can be done by running e.g.

    # ip -6 addr add $(ahcp-generate-address fe80::) dev gre0


3. Start the routing daemon
---------------------------

Run Babel on every node, specifying the set of interfaces that it
should consider:

    # babeld eth1

If your node has multiple interfaces which you want to participate in
the Babel network, just list them all:

    # babeld eth0 eth1 sit1


4. Setting up an Internet gateway
---------------------------------

If you have one or more Internet gateways on your mesh network, you
will want to set them up so that they redistribute the default route.
Babel will only redistribute routes with an explicit protocol
attached, so you must say something like:

    # ip route add 0.0.0.0/0 via 1.2.3.4 dev eth0 proto static

In order to redistribute all routes, you will say:

    # babeld -C 'redistribute metric 128' eth1

You may also be more selective in the routes you redistribute, for
instance by specifying the interface over which the route goes out:

    # babeld -C 'redistribute if eth0 metric 128' eth1

or by constraining the prefix length:

    # babeld -C 'redistribute ip ::/0 le 64 metric 128' \
             -C 'redistribute ip 0.0.0.0/0 le 28 metric 128' \
             eth1

You may also want to constrain which local routes (routes to local
interface addresses) you advertise:

    # babeld -C 'redistribute local if eth1' -C 'redistribute local deny' \
             -C 'redistribute metric 128' \
             eth1

-- Juliusz Chroboczek