[Xorp-hackers] XML-RPC for retrieving information on the router

Bruce Simpson bms at incunabulum.net
Thu Nov 5 13:50:37 PST 2009


Hi Luca,

Luca Belforte wrote:
> Hello,
>
> I'm trying to write a XML-RPC process in xorp, to retrieve in XML format
> some "useful" information on the router.
> First of all, i'm interested if someone have already developed a
> module/process who do the same or something similar.
>   

At the moment, we don't have this capability in the community branch. I 
believe there is something similar in the commercial product, though, 
but it is probably specific to how the product's built, rather than 
being a general XML export mechanism.

There is the ongoing Thrift work which could make something like this a 
bit easier, but not until a bit further down the line.

> Secondary, I was searching where the Routing Table are stored, but to be
> honest, I'm a little bit lost, so I'm searching how retrieve the current
> routing table on a router, with a XRL.
>   

If you look at rib/tools/show_routes.cc, you'll see the source of the 
show_routes program, which is used to dump the routing tables.

There's more than RIB, and there's more than one routing table in each 
RIB: (unicast, multicast) * (ipv4, ipv6).
That's urib4, urib6, mrib4, mrib6, normally -- 4 RIBs, and however many 
origin tables, as you have routing protocols, in each.

Broadly, what that tool does is loop over each RIB and address family 
combination, then print the *given* table. Usually this is the RIB's 
final table (what it pushes to the forwarding plane).

The thing is, because retrieval of an entire table is an RPC intensive 
operation, it's split up into a callback interface. What actually 
happens is that the show_routes tool registers itself as accepting 
routes for redistribution, just like a routing protocol module. Then it 
requests redistribution from the RIB for that table; off goes the RIB 
and fires off each route as a client request.

[libxipc afociandos will note this is mostly because the RIB can then 
dispatch each routing table entry in an asynchronous manner -- XRL will 
have pseudo-asynchronous dispatch at the client end of a session, but 
only has synchronous dispatch at the server end of a session. And 
probably also note that this is a candidate for a batch operation.]

What is essentially just a routing table dump, is split up in XORP in 
this way, so as not to block the RIB (or other processes) out from other 
tasks whilst the dump is in progress.

thanks,
BMS



More information about the Xorp-hackers mailing list