Search code examples
network-programmingospfquagga

Implementing ospf topology collector


I need to implement a software module that is able to retrieve the topology of an autonomous system. Looking at the various protocol that are implemented in Cisco routers i concluded that the only two alternatives to obtain topology are smnp and ospf. The first one is a workaround and i don't want to use it, this leads to ospf. I haven't found library in c, java and python that are usable; this one ( http://www.ospf.org/ )is probably the most complete but comes without documentation and i don't have enough time to analyze all the code. So i found quagga that can implement a software ospf router; seems the perfect alternative since it can work with both real network and simulated network in gns3. But it's possible to obtain the ospf routing table from quagga since everything is from command line? This are my conclusions and doubts if someone can suggest something better or help me with the next step it would be appreciated since i'm stuck at the moment.


Solution

  • Use quagga's ospfclient feature. There is already an example provided in the ospfclient directory (see ospfclient.c) which will show you how to retrieve the LSA database from a quagga/ospfd instance. For this solution to work you need to attach a PC to one of your OSPF backbone routers and configure quagga/ospfd on it to successfully learn the routes then you start your ospfclient to retrieve any information you need.