| QuaggaWiki | Main »
Ospf Api |
OSPF APIOn this page... (hide) 1. DisclaimerThe OSPF daemon contains an API for application access to the LSA database. This API was created by Ralph Keller, originally as patch for Zebra. Some time ago the code has merged with Quagga. Unfortunately, the page containing documentation of the API is no longer online. This page is an attempt to recreate documentation for the API (with lots of help of the WayBackMachine) 2. IntroductionThis page describes an API that allows external applications to access the link-state database (LSDB) of the OSPF daemon. The implementation is based on the OSPF code from the Quagga (formerly Zebra) routing protocol suite and is subject to the GNU General Public License. The OSPF API provides you with the following functionality:
Opaque LSAs, which are described in RFC 2370 , allow you to distribute application-specific information within a network using the OSPF protocol. The information contained in opaque LSAs is transparent for the routing process but it can be processed by other modules such as traffic engineering (e.g., MPLS-TE). 3. ArchitectureThe following picture depicts the architecture of the Quagga/Zebra protocol suite. The OSPF daemon is extended with opaque LSA capabilities and an API for external applications. The OSPF core module executes the OSPF protocol by discovering neighbors and exchanging neighbor state. The opaque module, implemented by Masahiko Endo, provides functions to exchange opaque LSAs between routers. Opaque LSAs can be generated by several modules such as the MPLS-TE module or the API server module. These modules then invoke the opaque module to flood their data to neighbors within the flooding scope. The client, which is an application potentially running on a different node than the OSPF daemon, links against the OSPF API client library. This client library establishes a socket connection with the API server module of the OSPF daemon and uses this connection to retrieve LSAs and originate opaque LSAs. The OSPF API server module works like any other internal opaque module (such as the MPLS-TE module), but listens to connections from external applications that want to communicate with the OSPF daemon. The API server module can handle multiple clients concurrently. ( Picture is unfortunately missing ) One of the main objectives of the implementation is to make as little changes to the existing Zebra code as possible. 4. Installation & ConfigurationDownload Quagga and unpack Configure your quagga version (note that --enable-opaque-lsa also enables the ospfapi server and ospfclient). % sh ./configure --enable-opaque-lsa % gmake This should also compile the client library and sample application in ospfclient. Make sure that you have enabled opaque LSAs in your configuration. Add the ospf opaque-lsa statement to your ospfd.conf: ! -*- ospf -*- ! ! OSPFd sample configuration file ! ! hostname xxxxx password xxxxx router ospf router-id 10.0.0.1 network 10.0.0.1/24 area 1 neighbor 10.0.0.2 network 10.0.1.2/24 area 1 neighbor 10.0.1.1 ospf opaque-lsa <============ add this statement! 5. Protocol and Message FormatsIf you are developing your own client application and you don't want to make use of the client library (due to the GNU license restriction or whatever reason), you can implement your own client-side message handling. The OSPF API uses two connections between the client and the OSPF API server: One connection is used for a synchronous request /reply protocol and another connection is used for asynchronous notifications (e.g., LSA update, neighbor status change). Each message begins with the following header: ![]() The message type field can take one of the following values:
The synchronous requests and replies have the following message formats: ![]() The origin field allows to select according to the following types of origins:
The reply message has on of the following error codes
The asynchronous notifications have the following message formats: ![]() 6. Original Acknowledgments from Ralph KellerI would like to thank Masahiko Endo, the author of the opaque LSA extension module, for his great support. His wonderful ASCII graphs explaining the internal workings of this code, and his invaluable input proved to be crucial in designing a useful API for accessing the link state database of the OSPF daemon. Once, he even decided to take the plane from Tokyo to Zurich so that we could actually meet and have face-to-face discussions, which was a lot of fun. Clearly, without Masahiko no API would ever be completed. I also would like to thank Daniel Bauer who wrote an opaque LSA implementation too and was willing to test the OSPF API code in one of his projects. |
| Page last modified on June 22, 2007 |