def launch(): "Try to clean anything using 6633/tcp before starting the controller" try: import os os.system("sudo fuser -k 6633/tcp") except: pass "Log and colors" import pox.log.color pox.log.color.launch() import pox.log pox.log.launch(format="[@@@bold@@@level%(name)-22s@@@reset] " + "@@@bold%(message)s@@@normal") "Full packets" import pox.misc.full_payload as fp fp.launch() "Component to discover links/topology" import pox.openflow.discovery pox.openflow.discovery.launch(eat_early_packets=True) "Import and start a spanning tree component" import pox.openflow.spanning_tree as spt spt.launch() "Import and start a standard forwarding component" import pox.forwarding.l2_learning as forwarding forwarding.launch() "Start the Forwarding" core.registerNew(Forwarding)
def launch(objective=None, preinstall="{}"): discovery.launch() spanning_tree.launch(no_flood=True, hold_down=True) statistics.launch() topology.launch() multicommodity.launch(objective=objective, preinstall=preinstall) core.registerNew(Controller)
def start_spanning_tree(): global yet_to_do if yet_to_do: print "Searching for forwarding loops with spanning tree..." #pox.openflow.discovery discov.launch() #pox.openflow.spanning_tree --no-flood --hold-down spanning_tree.launch() yet_to_do = False
def launch(filename='results'): discovery.launch() spanning_tree.launch(no_flood=True, hold_down=True) topology.launch() core.registerNew(Controller, filename=filename)
def launch(): pox.openflow.discovery.launch() sp.launch()