CCDKP / ospf-to-graphviz

OSPF network visualisation script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ospf-to-graphviz

This script passively listens to OSPFv2 multicast traffic, and generates a graphviz diagram representing the network. Because it only listens and does not participate in the OSPF protocol, it takes about half an hour to learn about the network.

Prerequisites

python-netaddr python-dpkt python-libpcap

The script has been tested under Python2.7

Usage

ospf-to-graphviz.py mynetwork.dot

After a while, convert the .dot file for viewing with something like this:

dot -Tpng mynetwork.dot >mynetwork.png

The output file will be rewritten when an OSPF update is received, so you can keep converting the file every time it changes to see the diagram converge on your network topology. This should be complete after LSRefreshTime (30mins).

Limitations

Only OSPFv2 is supported. Only LS Update messages are analysed. Only Router LSAs, Network LSAs and External LSAs are handled at present. For Router LSAs, only transit networks, stub networks and point to point networks are handled.

Acknowledgements

This code is based on a Python recipe by Ferdy Riphagen: http://code.activestate.com/recipes/576664-ospf-multicast-sniffer/

Originally written by Michael Procter: https://github.com/mhp/ospf-to-graphviz

About

OSPF network visualisation script


Languages

Language:Python 100.0%