openwisp / netdiff

Python library for parsing network topology data (e.g.: OpenVPN, Wireguard, ZeroTier, NetJSON, Dynamic Routing Protocols) and detect changes.
MIT License
80 stars 37 forks source link

[netjson] Add directed graph support for NetJsonParser #72

Closed sredman closed 5 years ago

sredman commented 5 years ago

Lack of support for directed graphs is a problem for NetJsonParser in particular because it is possible to receive a NetJson-formatted file which represents a directed graph, then have that information be lost or, worse, incorrectly parsed. I have been hacking a DiGraph into NetJsonParser objects in my client application for awhile, but maybe it is time for those to be officially supported :)

It should be easily possible to follow the same pattern for the other parsers to allow them to be directed or undirected, but I don't know how to represent directed graphs in other protocols or they even allow directed graphs

sredman commented 5 years ago

Those requested changes have been made. Let me know if there's anything else you would like!

sredman commented 5 years ago

Is the project in which you're using netdiff something you can share some information about? I'm asking just out of curiosity. I thought netdiff was mainly used by django-netjsongraph and openwisp-network-topology, it's good to know it's used also in other contexts.

I am using it in the context of a research project, see: https://gitlab.flux.utah.edu/sredman/Critical-Reroute

The idea of the research project is to try to optimize a network such that some priority traffic is given better service even when the network is overloaded, the context being real-user traffic in a DoS attack or maybe traffic belonging to emergency services in an emergency.

I am using netdiff because it is the best library I could find for reading/writing NetJson-formatted graphs. I have some plans for where I might need to use the 'diff' part too :)

In this context, I am currently just adding a citation for this github repository. Would you like a different citation?

nemesifier commented 5 years ago

@sredman that's really an interesting application!

Since netdiff is a library maintained by OpenWISP, a citation to OpenWISP would help, we could then put a link to your research in the "Research and publications" section of our press page.

Are you already citing NetJSON? That would help too :blush:.

sredman commented 5 years ago

Sounds good. I'll put those two citations in the next publication, slated for "soon" :)

nemesifier commented 5 years ago

Thanks, keep me posted! :) PS: good luck with your research project