ipmininet icon indicating copy to clipboard operation
ipmininet copied to clipboard

Plot

Open Ananas120 opened this issue 5 years ago • 4 comments

Plot example code To test it, i put the topology from the TP in examples/topo_tp.json so you can try the code by running :

from ipmininet.plot_utils import to_graphviz
g = to_graphviz(‘ipmininet/examples/topo_tp.json’, filename = ‘plot_test.gv’)
g.view()
g # if you are in a jupyter notebook, it will show the plot

Ananas120 avatar Oct 19 '20 07:10 Ananas120

I am sceptical about using a json file as an argument Wouldn't it be better to enable users to display the graph from an IPTopo object directly than requiring an additional file from them ?

Also, it would be better not to have hardcoded paths such as the variable _graphviz_path

jadinm avatar Nov 09 '20 20:11 jadinm

Yes indeed, my first target was to do it based on a IPTopo class but i didn’t find the information of AS in the class Furthermore, the « json » idea is also related to my class JSONTopo i created for the project which also take a json file and automatically create the topology (which is far more powerful than hardcode all routers / hosts / AS / ...) but i will post it only at the end of the project

So the idea of this plot was to use the json file to 1) create the topology based on JSONTopo class and 2) plot the topology based on the same json file and 3) based on the JSONTopo class, get many informations about the topology (number of iBGP / eBGP connections, number of links / RR / ...)

Ananas120 avatar Nov 10 '20 07:11 Ananas120

Yes indeed, my first target was to do it based on a IPTopo class but i didn’t find the information of AS in the class Furthermore, the « json » idea is also related to my class JSONTopo i created for the project which also take a json file and automatically create the topology (which is far more powerful than hardcode all routers / hosts / AS / ...) but i will post it only at the end of the project

You can have access to this by using the instance variable topology.overlays Then, you can check the type of the Overlay with isinstance() If this is an AS object, then you have access to what you want :)

jadinm avatar Nov 10 '20 10:11 jadinm

Ok thank you, then i will try to convert a IPTopo to a json file it can be good to visualize the topology etc !
I will not have the time to do it before the end of the project but maybe after when posting the JSONTopo

Ananas120 avatar Nov 11 '20 07:11 Ananas120