I use python to create a custom mininet topology. To know the topology in detail is not important for the question.
I use ryu as controller. Especially I use the app "ofctl_rest.py". This controller does not install rules in the switch on its own. You have to issue rest - commands to establish rules. In every rest request (rule) you have to specify an outgoing port. To specify this port I need information about the topology of the network.
I need to know which link is connected to a port. I need to know which interface the port runs on. Also helpful would be to know the foreign interface, foreign switch/host, and foraign port of the actual port. How can I retrieve this information???
Please help me. I am really frustrated right now, because I do not know how to figure it out.
Inside the mininet CLI you can use the
net
command to find out about the topology. Thenodes
command will show you a list of nodes. You can also use thedump
command to display the interface details.For information on the 'hosts', such as they are, you can run normal linux commands on each host, e.g.
will run
ifconfig
on hosth1
, showing you some of the network configuration for that host.Given that you seem to be running mininet from a custom script, you could start the CLI at the end of your script (if that's possible) e.g.
Otherwise, you can use the mininet python APIs to find much of the information.
dump*
functions in mininet.util will print out lots of information.topo.links()
will give you a list of the links in the topology.topo.linkinfo()
might give you some extra info.For flow information you can either run
ovs-dpctl
, ovs-ofctl etc. outside of mininet (in a normal shell), or run the equivalents without theovs-
prefix inside the mininet CLI.