BTW, it would be much nicer if one could get the router IDs of all neighbours instead of only their link-local IP addresses. But I am not sure if those are even exposed in the protocol messages? The problem is that without the router IDs you need to keep track of all the link-local IPs of all the nodes in order to reconstruct the full topology.

As you guessed, it is not easy, and not even possible in general, to associate a given link-local IP with a Router-ID. Since babeld is a routing daemon, and since this information is not needed for routing, babeld doesn't even attempt to guess -- it leaves it to whoever is listening on the monitoring interface.

Let me explain. A Router-ID is used for identifying the originator of a route; if a route goes through 42 hops, the associated Router-ID identifies the router that is 42 hops away. On the other hand, neighbours are identified by pairs of the form (interface, link-local address). The two notions are distinct for a very good reason: if a router has multiple radios, it counts as multiple neighbours, but it still has just a single Router-ID -- otherwise the loop-avoidance mechanism wouldn't reliably eliminate loops that go through different interfaces.

Please squint at the following tpology:

  (A1) (B1) (B2)

   *    *     *
   |     \   /
   |      \ /
   A       B

Here, A is a router with a single radio A1, B has two radios B1 and B2 tuned at the same frequency (for example an omni and a directional antenna, or two sector antennas). If all radios hear each other, A's neighbour table looks as so:

  B1 through A1, cost=256
  B2 through A1, cost=321

which is why the link-quality estimator is able to distinguish between B1 and B2 and choose the better of the two. Interestingly enough, B's neighbour table will be as follows:

  A1 through B1
  A1 through B2
  B1 through B2
  B2 through B1

but the latter two will be discarded by the loop-avoidance mechanism -- which only looks at Router-IDs, and hence can detect that B1-B2 is a loop. (Yes, Virginia, there is such a thing as a one-hop loop.)

So how do you guess the Router-ID associated with a link-local address? Any route announced with a refmetric of 0 will carry the Router-ID you're looking for. If there are no such routes, you're out of luck -- if the router is not originating any routes, it's not announcing its Router-ID, and the information is simply not available.

-- Juliusz

_______________________________________________
Babel-users mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Reply via email to