3

I want to discover the topology of a network emulated by mininet using POX components. I figured out that I need to write my own component, which is listening to LinkEvents. Something like:

someObject.addListenerByName("LinkEvent", someFunction)

But I don't actually know on what kind of an object i should execute this.

If I execute it as

core.openflow_discovery.addListenerByName("LinkEvent", someFunction)

as stated in the openflow.discovery module, it throws the following error:

AttributeError: 'openflow_discovery' not registered
max
  • 677
  • 1
  • 9
  • 34

2 Answers2

2

It is easier to use pox modules named "gephi" to do this, it should be under misc directory, just add this method to the "gephi_topo.py" in "class GephiTopo":

 def get_gephi_topology (self):
    switchesAndLinksAndHosts=[self.switches,self.links, self.hosts]
    return switchesAndLinksAndHosts

and then use it anywhere in your pox controller like:

topo=gephi_topo.GephiTopo.get_gephi_topology(core.GephiTopo)
switches= topo[0]
links=topo[1]
hosts=topo[2]
Krzysztof Krasoń
  • 26,515
  • 16
  • 89
  • 115
matrix
  • 33
  • 6
1

Fixed it by calling addListenerByName from within launch().

max
  • 677
  • 1
  • 9
  • 34