[Babel-users] Adding and removing interfaces dynamically in babeld

Juliusz Chroboczek jch at pps.univ-paris-diderot.fr
Wed Feb 10 23:03:50 UTC 2016


Hi,

I've finally done some work on redesigning the local control interface of
babeld.  The interface should be usable both programmatically and by
telnetting by hand, and should be powerful enough to satisfy the needs of
Babelweb (which wants to monitor a running babeld instance in real time)
and of the various tunnel digging interfaces (which want to get a list of
interfaces).

It's almost completely untested.

Here's an example interaction:

    $ telnet ::1 33123
    Trying ::1...
    Connected to ::1.
    Escape character is '^]'.
    BABEL 1.0
    version babeld-1.7.0-15-g336de76-dirty
    host lanthane
    my-id 02:1c:25:ff:fe:cf:79:73
    ok
    dump
    add interface eth0
    add xroute 172.23.36.54/32-::/0 prefix 172.23.36.54/32 from ::/0 metric 0
    add xroute 2001:660:3301:9202::ac17:2436/128-::/0 prefix 2001:660:3301:9202::ac17:2436/128 from ::/0 metric 0
    ok
    interface wlan0
    ok
    dump
    add interface eth0
    add interface wlan0
    add xroute 172.23.36.54/32-::/0 prefix 172.23.36.54/32 from ::/0 metric 0
    add xroute 2001:660:3301:9202::ac17:2436/128-::/0 prefix 2001:660:3301:9202::ac17:2436/128 from ::/0 metric 0
    ok
    quit
    Connection closed by foreign host.

Here's another one:

    $ 


The protocol
************

Connect over TCP to ::1 with the port specified with "-g" on babeld's
command line.

The first line from the server is "BABEL 1.0".  If it says "BABEL 0.0",
it's the old version.  If it says "BABEL 1.whatever", it's a compatible
version.  If it says anything else, drop the connection.

It is followed with lines "version", "host", "my-id", then "ok".

When the client sends a request, the server replies with zero or more
lines of text, followed with one of "ok" (request successful), "bad"
(couldn't handle the request) or "no" (refused to execute the request).
(Error handling is currently somewhat subpar, for example we say "ok" when
attempting to flush a non-existent interface.)

Any config file request is allowed, including "interface", although many
won't work as expected.  For example, you won't be able to get filtering
to work, or to change an interface's parameters.

Additional request are:

  quit
  dump
  monitor
  unmonitor
  flush interface

Anything I've missed?  Do people need "flush neighbour" and "flush route"?


How to use
**********

If you're Babelweb: check that the first line is "BABEL 1.something".
Then issue "monitor", and monitor babeld as usual.

If you're a monitoring interface that performs polling: issue "dump",
parse all add lines until you get "ok".  Bail if you get "no" or "bad".

If you're a tunnel digger: issue "interface foo" when you wish to add an
interface, "flush interface bar" when you wish to flush an interface, and
"dump" when you wish to find out the state of the babeld instance.

If you're Dave: say "nc ::1 33123 | grep '^version '".


Limitations
***********

Cannot change the configuration of an interface (need to flush and
recreate).

The dump doesn't show interface parameters.

Interfaces are not correctly monitored.

Almost completely untested.


-- Juliusz



More information about the Babel-users mailing list