[Babel-users] babeld 1.1.0 Creation of routing entries

Juliusz Chroboczek jch at pps.jussieu.fr
Fri May 27 11:45:02 UTC 2011


> I'm trying to port the babel protocol to TinyOS

Excellent news!  What link layer are you going to be running over?  What's
the hardware?

Is the TinyOS support going to be contributed back to me, or is it
proprietary?  (I have no objection to proprietary derivatives, I just
like to be warned in advance.)  

> I just don't see how the route entries are created at the beginning,
> when there are no route entries at all,

That happens in update_route in route.c.  Let me explain.

A route's metric is computed from two pieces : m = M(c, m') (Section 3.5.2) :

 - the advertised metric (m'), which is sent by the neighbour in an Update
   TLV ;
 - the local link's cost (c), which is computed by the local node from
   data computed from Hello and IHU messages, or from any implementation-
   specific locally available data.

(If you're familiar with RIP, then you'll probably find this confusing,
since RIP updates play the role of both Babel's Hellos and Updates.  If
you're familiar with OSPF, then you'll also find this confusing, since
OSPF's Hellos play the role of both Babel's Hellos and IHUs.)

A route is created upon receiving an Update message (Section 3.5.4);
this is implemented in update_route.

Now the advertised metric m' can only change when an Update is received;
the cost c, however, can change at various times.  Rather than try to
work out which events exactly can cause c to change, babeld takes the
approach of recomputing all of c:s periodically -- that's what happens
in check_neighbours.  (update_neighbour updates one c, and returns
a boolean to indicate whether anything changed; update_neighbour_metric
is responsible for recomputing m and, if desired, switching routes).

(Note that update_neighbour/update_neighbour_metric is also called
whenever a Hello or IHU message is called -- see parse_packet in
message.c.)

You've probably already worked that out, but the structure of the code
is as follows:

  - message.c is about reacting to received packets and sending packets;
  - network.c and neighbour.c are about locally computed data;
  - route.c is about data of global significance.

-- Juliusz



More information about the Babel-users mailing list