def launch_network(k=4, bw=10, ip_alias=True, fair_queues=False, cli=False): signal.signal(signal.SIGTERM, signal_term_handler) # Cleanup the network cleanup() sh("killall ospfd zebra getLoads.py nc") # Remove tmp files and old namespaces subprocess.call(['rm', '/tmp/*.log', '/tmp/*.pid', '/tmp/mice*']) subprocess.call(['rm', '/var/run/netns/*']) # Flush root namespace mangle table subprocess.call(["iptables", "-t", "mangle" ,"-F"]) subprocess.call(["iptables", "-t", "mangle" ,"-X"]) # Topology topo = FatTree(k=k, sflow=False, ovs_switches=False) # Interfaces if fair_queues: print("*** Using FairQueues at the network interfaces") intf = custom(DCTCIntf, bw=bw) else: print("*** Using normal pFIFO queues at the network interfaces") intf = custom(PrioFifoIntf, bw=bw) # Network net = IPNet(topo=topo, debug=_lib.DEBUG_FLAG, intf=intf) # Save the TopoDB object TopologyDB(net=net).save(cfg.DB_path) # Start the network net.start() # Setup hash seeds setupHashSeeds(topo) # Start intreface collectors startCounterCollectors(topo, interval=1) if ip_alias: setupSecondaryIps(net) if cli: # Start the Fibbing CLI FibbingCLI(net) else: print("*** Looping forever. Press CTRL+C to quit") while True: try: time.sleep(2) except KeyboardInterrupt: print("*** KeyboardInterrupt catched! Shutting down") break net.stop() stopCounterCollectors(topo)
def launch_network(testfile): net = IPNet(topo = Lab1Topo(testfile=testfile),#Lab1ECMPTopo(testfile=testfile),# debug =_lib.DEBUG_FLAG, intf = custom(TCIntf, bw = BW), host = MyCustomHost) TopologyDB(net = net).save(dconf.DB_Path) net.start() FibbingCLI(net) net.stop()
def launch_network(): #signal.signal(signal.SIGINT, signal_handler) #signal.signal(signal.SIGTERM, signal_handler) net = IPNet(topo=SimpleTopo(), debug=_lib.DEBUG_FLAG, intf=custom(TCIntf, bw=BW), host=MyCustomHost) TopologyDB(net=net).save(dconf.DB_Path) net.start() FibbingCLI(net) net.stop()
def launch_network(): net = IPNet(topo=SIGTopo(), debug=_lib.DEBUG_FLAG, intf=custom(TCIntf, bw=BW)) TopologyDB(net=net).save(DB_path) net.start() FibbingCLI(net) net.stop()
def launch_network(): #topo = TestTopo() topo = FatTree(k = 2, extraSwitch=True) intf = custom(TCIntf) #creates nodes and links net = IPNet(topo=topo, debug=_lib.DEBUG_FLAG, intf=intf, switch=LinuxBridge) #just stores the topology in a json object, it does not take into account mulipaths between nodes TopologyDB(net=net).save(DB_path) #start processes(quagga) and maps again the ips net.start() FibbingCLI(net) net.stop()