I don't know of an OSPF module, and if there was one in circulation suitable for use I would expect it to be at CPAN.It would be an intriguing project to develop though. A good starting point would be Net::BGP, especially the use of an event loop and callbacks on receipt of relevant packets. That would cover the need for code to be constantly on the lookout for hellos and LSAs.
You don't state what you are looking for an OSPF module to do: simply monitoring and parsing OSPF packets shouldn't be too horrible to implement. Writing a module to act as a DR/BDR could be rather tricker.
VGhpcyBtZXNzYWdlIGludGVudGlvbmFsbHkgcG9pbnRsZXNz
| [reply] |
| [reply] |
OSPF and BGP are very different. The reason I suggested Net::BGP as a starting point is that it implements event driven code based on receipt of routing packets.This is a bit off topic, so I won't go into too much detail, but OSPF is a multicast connectionless protocol - route updates are sent to a multicast address (224.0.0.5). BGP is connection oriented - routers are configured with relationships to each other, and unicast updates over TCP. When I was first learning both OSPF and BGP I wrote some brief notes on each, which you can see here. (I make no warranty as to their accuracy). For your purposes I would suggest starting by sniffing some OSPF LSAs from the wire, using tcpdump/ethereal/some other packet sniffer listening to 224.0.0.5, and (referring to the OSPF rfcs where necessary) writing some code to parse and interpret them.
VGhpcyBtZXNzYWdlIGludGVudGlvbmFsbHkgcG9pbnRsZXNz
| [reply] |
| [reply] |
Very long time ago, we used to monitor some test OSPF deployments through ethereal. Somehow, we managed to get ethereal to sniff and parse OSPF packets into a text file (I can't recall now, how), which gave us a pretty nice text representation of the OSPF packets seen at the network interfaces. It was then just a matter of patience to grep the relevant parts out of the test file, of course by using Perl.
This is a big and ugly hack, but it worked for us pretty nicely... Also, you can use tcpdump too, but it does not give you so verbose and nicely formatted output...
| [reply] |
you use 'tethereal' the text based version of ethereal. then add the -V flag and presto. one of my most favorite reverse engineering tools...
| [reply] |