TeachingOSPF is a project mainly written in ..., it's free.
Simple example of OSPF for omnetpp, inet-framework
OSPFv2 Routing
The OSPFv2 module is a cleanroom implementation of the OSPFv2 routing protocol (rfc 2328), programmed by Andras Babos. This work is currently in progress, and there are known bugs, mostly associated with unnumbered interfaces -- they will be corrected in subsequent INET Framework releases.
This example simulation has been used to test the OSPF model during development.
To intall this example create the directory examples/ospfv2/TeachingOSPF in the inet-framework directory