def topology(autoTxPower): "Create a network." net = Mininet(enable_wmediumd=True, enable_interference=True) print "*** Creating nodes" if autoTxPower: sta1 = net.addStation('sta1', position='10,10,0', range=100) sta2 = net.addStation('sta2', position='90,10,0', range=100) sta3 = net.addStation('sta3', position='170,10,0', range=100) else: sta1 = net.addStation('sta1', position='10,10,0') sta2 = net.addStation('sta2', position='90,10,0') sta3 = net.addStation('sta3', position='170,10,0') net.propagationModel(model="logDistance", exp=4) print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta1, ssid='adhocNet', mode='g', channel=5) net.addHoc(sta2, ssid='adhocNet', mode='g', channel=5) net.addHoc(sta3, ssid='adhocNet', mode='g', channel=5) print "*** Starting network" net.build() print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(enable_wmediumd=True, enable_interference=True) print "*** Creating nodes" sta1 = net.addStation('sta1', position='10,10,0') sta2 = net.addStation('sta2', position='50,10,0') sta3 = net.addStation('sta3', position='90,10,0') print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta1, ssid='adhocNet', mode='g', channel=5) net.addHoc(sta2, ssid='adhocNet', mode='g', channel=5) net.addHoc(sta3, ssid='adhocNet', mode='g', channel=5) print "*** Starting network" net.build() print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta1, ssid='adhocNet', mode='g') net.addHoc(sta2, ssid='adhocNet', mode='g') net.addHoc(sta3, ssid='adhocNet', mode='g') print "*** Starting network" net.build() print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, switch=OVSKernelSwitch) print "*** Creating nodes" sta1 = net.addStation('sta1', wlans=3) # 3 wlan added sta2 = net.addStation('sta2') # 1 wlan added ap1 = net.addAccessPoint('ap1', ssid='ssid_1', mode='g', channel='5') c0 = net.addController('c0', controller=Controller) print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Associating..." net.addLink(ap1, sta1) net.addHoc(sta1, ssid='adhoc1') net.addHoc(sta2, ssid='adhoc1') print "*** Starting network" net.build() c0.start() ap1.start([c0]) print "***Addressing..." sta1.setIP('192.168.10.1/24', intf="sta1-wlan1") sta2.setIP('192.168.10.2/24', intf="sta2-wlan0") print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, link=TCLink, switch=OVSKernelSwitch) print "*** Creating nodes" sta1 = net.addStation('sta1', wlans=3) # 3 wlan added sta2 = net.addStation('sta2') # 1 wlan added ap1 = net.addBaseStation('ap1', ssid="ssid_1", mode="g", channel="5") # 1 wlan added c0 = net.addController('c0', controller=Controller) print "*** Associating..." net.addLink(ap1, sta1) net.addHoc(sta1, ssid='adhoc1', mode='g') net.addHoc(sta2, ssid='adhoc1', mode='g') print "*** Starting network" net.build() c0.start() ap1.start([c0]) print "***Addressing..." sta1.cmd('ifconfig sta1-wlan1 192.168.10.1') sta2.cmd('ifconfig sta2-wlan0 192.168.10.2') print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch ) print "*** Creating nodes" sta1 = net.addStation( 'sta1', wlans=3 ) # 3 wlan added sta2 = net.addStation( 'sta2' ) # 1 wlan added ap1 = net.addBaseStation( 'ap1', ssid="ssid_1", mode="g", channel=5 ) # 1 wlan added c0 = net.addController('c0', controller=Controller) print "*** Associating..." net.addLink(ap1, sta1) net.addHoc(sta1, ssid='adhoc1', mode='g') net.addHoc(sta2, ssid='adhoc1', mode='g') print "*** Starting network" net.build() c0.start() ap1.start( [c0] ) print "***Addressing..." sta1.setIP('192.168.10.1/24', intf="sta1-wlan1") sta2.setIP('192.168.10.2/24', intf="sta2-wlan0") print "*** Running CLI" CLI( net ) print "*** Stopping network" net.stop()
def topology(): """Create a network. sta1 <--> sta2 <--> sta3""" print "*** Connect wmediumd manager" WmediumdManager.connect() print "*** Network creation" net = Mininet() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Configure wmediumd" # This should be done right after the station has been initialized sta1wlan0 = DynamicWmediumdIntfRef(sta1) sta2wlan0 = DynamicWmediumdIntfRef(sta2) sta3wlan0 = DynamicWmediumdIntfRef(sta3) intfrefs = [sta1wlan0, sta2wlan0, sta3wlan0] links = [ WmediumdERRPROBLink(sta1wlan0, sta2wlan0, 0.2), WmediumdERRPROBLink(sta2wlan0, sta1wlan0, 0.2), WmediumdERRPROBLink(sta2wlan0, sta3wlan0, 0.1), WmediumdERRPROBLink(sta3wlan0, sta2wlan0, 0.1) ] for intfref in intfrefs: WmediumdManager.register_interface(intfref.get_intf_mac()) for link in links: WmediumdManager.update_link_errprob(link) print "*** Creating links" net.addHoc(sta1, ssid='adNet') net.addHoc(sta2, ssid='adNet') net.addHoc(sta3, ssid='adNet') print "*** Starting network" net.start() print "*** Running CLI" CLI(net) print "*** Disconnecting wmediumd manager" WmediumdManager.disconnect() print "*** Stopping network" net.stop()
def topology(): """Create a network. sta1 <--> sta2 <--> sta3""" print "*** Network creation" net = Mininet() print "*** Configure wmediumd" sta1wlan0 = StaticWmediumdIntfRef('sta1', 'sta1-wlan0', '02:00:00:00:00:00') sta2wlan0 = StaticWmediumdIntfRef('sta2', 'sta2-wlan0', '02:00:00:00:01:00') sta3wlan0 = StaticWmediumdIntfRef('sta3', 'sta3-wlan0', '02:00:00:00:02:00') intfrefs = [sta1wlan0, sta2wlan0, sta3wlan0] links = [ WmediumdLink(sta1wlan0, sta2wlan0, 15), WmediumdLink(sta2wlan0, sta1wlan0, 15), WmediumdLink(sta2wlan0, sta3wlan0, 15), WmediumdLink(sta3wlan0, sta2wlan0, 15) ] WmediumdConn.set_wmediumd_data(intfrefs, links) WmediumdConn.connect_wmediumd_on_startup() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta1, ssid='adNet') net.addHoc(sta2, ssid='adNet') net.addHoc(sta3, ssid='adNet') print "*** Starting network" net.start() print "*** Running CLI" CLI(net) print "*** Stopping wmediumd" WmediumdConn.disconnect_wmediumd() print "*** Stopping network" net.stop()
def topology(): """Create a network. sta1 <--> sta2 <--> sta3""" print "*** Network creation" net = Mininet() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Configure wmediumd" # This should be done right after the station has been initialized sta1wlan0 = DynamicWmediumdIntfRef(sta1) sta2wlan0 = DynamicWmediumdIntfRef(sta2) sta3wlan0 = DynamicWmediumdIntfRef(sta3) intfrefs = [sta1wlan0, sta2wlan0, sta3wlan0] links = [ WmediumdERRPROBLink(sta1wlan0, sta2wlan0, 0.2), WmediumdERRPROBLink(sta2wlan0, sta1wlan0, 0.2), WmediumdERRPROBLink(sta2wlan0, sta3wlan0, 0.1), WmediumdERRPROBLink(sta3wlan0, sta2wlan0, 0.1) ] WmediumdStarter.initialize(intfrefs, links, use_errprob=True) print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Start wmediumd" WmediumdStarter.start() print "*** Creating links" net.addHoc(sta1, ssid='adNet') net.addHoc(sta2, ssid='adNet') net.addHoc(sta3, ssid='adNet') print "*** Starting network" net.start() print "*** Running CLI" CLI(net) print "*** Stopping wmediumd" WmediumdStarter.stop() print "*** Stopping network" net.stop()
def topology(): """Create a network. sta1 <--> sta2 <--> sta3""" print "*** Network creation" net = Mininet() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Configure wmediumd" # This should be done right after the station has been initialized sta1wlan0 = DynamicWmediumdIntfRef(sta1) sta2wlan0 = DynamicWmediumdIntfRef(sta2) sta3wlan0 = DynamicWmediumdIntfRef(sta3) intfrefs = [sta1wlan0, sta2wlan0, sta3wlan0] links = [ WmediumdLink(sta1wlan0, sta2wlan0, 15), WmediumdLink(sta2wlan0, sta1wlan0, 15), WmediumdLink(sta2wlan0, sta3wlan0, 15), WmediumdLink(sta3wlan0, sta2wlan0, 15)] WmediumdConn.set_wmediumd_data(intfrefs, links) WmediumdConn.connect_wmediumd_on_startup() print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta1, ssid='adNet') net.addHoc(sta2, ssid='adNet') net.addHoc(sta3, ssid='adNet') print "*** Starting network" net.start() print "*** Running CLI" CLI(net) print "*** Stopping wmediumd" WmediumdConn.disconnect_wmediumd() print "*** Stopping network" net.stop()
def topology(): """Create a network. sta1 <--> sta2 <--> sta3""" print "*** Network creation" net = Mininet() print "*** Creating nodes" sta1 = net.addStation('sta1') sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') print "*** Creating links" net.addHoc(sta1, ssid='adNet') net.addHoc(sta2, ssid='adNet') net.addHoc(sta3, ssid='adNet') print "*** Starting network" net.start() print "*** Configure wmediumd" sta1wlan0 = DynamicWmediumdIntfRef(sta1, sta1.defaultIntf()) sta2wlan0 = DynamicWmediumdIntfRef(sta2, sta2.defaultIntf()) sta3wlan0 = DynamicWmediumdIntfRef(sta3, sta3.defaultIntf()) intfrefs = [sta1wlan0, sta2wlan0, sta3wlan0] links = [ WmediumdLink(sta1wlan0, sta2wlan0, 15), WmediumdLink(sta2wlan0, sta1wlan0, 15), WmediumdLink(sta2wlan0, sta3wlan0, 15), WmediumdLink(sta3wlan0, sta2wlan0, 15)] WmediumdConn.set_wmediumd_data(intfrefs, links) WmediumdConn.connect_wmediumd_after_startup() print "*** Running CLI" CLI(net) print "*** Stopping wmediumd" WmediumdConn.disconnect_wmediumd() print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet( ) print "*** Creating nodes" sta1 = net.addStation( 'sta1' ) sta2 = net.addStation( 'sta2' ) sta3 = net.addStation( 'sta3' ) print "*** Creating links" net.addHoc(sta1, ssid='adhocNet', mode='g') net.addHoc(sta2, ssid='adhocNet', mode='g') net.addHoc(sta3, ssid='adhocNet', mode='g') print "*** Starting network" net.build() print "*** Running CLI" CLI( net ) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, link=TCLink, switch=OVSKernelSwitch) print "*** Creating nodes" sta1 = net.addStation("sta1", ip="192.168.0.100") sta2 = net.addStation("sta2") ap1 = net.addBaseStation("ap1", ssid="ssid_1", mode="g", channel="5") c0 = net.addController("c0", controller=Controller) net.addWlan(5) # more 5 wlans available to be used print "*** Associating..." net.addLink(ap1, sta1) # Automaticaly add interface wlan0 in sta1 print "*** Starting network" net.build() c0.start() ap1.start([c0]) print "*** Adding new Interfaces to STAs" station.addWlan(sta1) # add wlan1 in sta1 station.addWlan(sta1) # add wlan2 (unused) in sta1 station.addWlan(sta2) # add wlan0 in sta2 station.addWlan(sta2) # add wlan1 (unused) in sta2 station.addWlan(sta2) # add wlan2 (unused) in sta2 print "***Creating adhoc network" net.addHoc(sta1, "adhoc1", "g", interface="wlan1") net.addHoc(sta2, "adhoc1", "g", interface="wlan0") sta1.cmd("ifconfig sta1-wlan1 192.168.10.1") sta2.cmd("ifconfig sta2-wlan0 192.168.10.2") print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet( ) #wirelessRadios = Number of STAs + APs print "*** Creating nodes" sta1 = net.addStation( 'sta1' ) sta2 = net.addStation( 'sta2' ) sta3 = net.addStation( 'sta3' ) print "*** Creating links" net.addHoc(sta1, 'adhocNet', 'g') #node, ssid, mode net.addHoc(sta2, 'adhocNet', 'g') #node, ssid, mode net.addHoc(sta3, 'adhocNet', 'g') #node, ssid, mode print "*** Starting network" net.build() print "*** Running CLI" CLI( net ) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(enable_wmediumd=True, enable_interference=True) print "*** Creating nodes" sta1 = net.addStation('sta1', position='10,10,0') sta2 = net.addStation('sta2', position='60,10,0') sta3 = net.addStation('sta3', position='100,10,0') sta4 = net.addStation('sta4', position='10,140,0') sta5 = net.addStation('sta5', position='60,140,0') sta6 = net.addStation('sta6', position='100,140,0') print "*** Configuring Propagation Model" net.propagationModel(model="logDistance", exp=4.5) print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addMesh(sta1, ssid='meshNet') net.addMesh(sta2, ssid='meshNet') net.addMesh(sta3, ssid='meshNet') net.addHoc(sta4, ssid='adhocNet') net.addHoc(sta5, ssid='adhocNet') net.addHoc(sta6, ssid='adhocNet') net.plotGraph(max_x=200, max_y=200) print "*** Starting network" net.build() print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet( wirelessRadios=3, waitTime=10 ) #wirelessRadios = Number of STAs + APs #waitTime = Time (sec) necessary to connect STAs in Ad-hoc mode (it depends of each machine) print "*** Creating nodes" sta1 = net.addStation( 'sta1' ) sta2 = net.addStation( 'sta2' ) sta3 = net.addStation( 'sta3' ) print "*** Creating links" net.addHoc(sta1, 'adhocNet', 'g') #node, ssid, mode net.addHoc(sta2, 'adhocNet', 'g') #node, ssid, mode net.addHoc(sta3, 'adhocNet', 'g') #node, ssid, mode print "*** Starting network" net.build() print "*** Running CLI" CLI( net ) print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, link=TCLink, accessPoint=OVSAP, enable_wmediumd=True, enable_interference=True) print "*** Creating nodes" sta1 = net.addStation('sta1', mac='00:00:00:00:00:02', ip='10.0.0.1/8', speed=4) sta2 = net.addStation('sta2', mac='00:00:00:00:00:03', ip='10.0.0.2/8', speed=6) sta3 = net.addStation('sta3', mac='00:00:00:00:00:04', ip='10.0.0.3/8', speed=3) sta4 = net.addStation('sta4', mac='00:00:00:00:00:05', ip='10.0.0.4/8', speed=3) ap1 = net.addAccessPoint('ap1', ssid='new-ssid', mode='g', channel='1', position='45,45,0') c1 = net.addController('c1', controller=Controller) print "*** Configuring Propagation Model" net.propagationModel("logDistancePropagationLossModel", exp=4.5) print "*** Configuring wifi nodes" net.configureWifiNodes() print "*** Creating links" net.addHoc(sta3, ssid='adhocNet') net.addHoc(sta4, ssid='adhocNet') print "*** Starting network" net.build() c1.start() ap1.start([c1]) """uncomment to plot graph""" #net.plotGraph(max_x=200, max_y=200) getTrace(sta1, 'examples/replaying/replayingMobility/node1.dat') getTrace(sta2, 'examples/replaying/replayingMobility/node2.dat') getTrace(sta3, 'examples/replaying/replayingMobility/node3.dat') getTrace(sta4, 'examples/replaying/replayingMobility/node4.dat') replayingMobility(net) print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
sta2 = net.addStation('sta2') sta3 = net.addStation('sta3') net.configureWifiNodes() m = {{wifi_mode}} if m == 1: m = 'a' elif m == 2: m = 'b' elif m == 3: m = 'g' elif m == 4: m = 'n' elif m == 5: m = 'ac' net.addHoc(sta1, ssid='adhocNet', mode=m) net.addHoc(sta2, ssid='adhocNet', mode=m) net.addHoc(sta3, ssid='adhocNet', mode=m) net.build() h1 = net.get('sta1') h2 = net.get('sta3') iperf(h1, h2) net.stop() framework.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, link=TCLink, accessPoint=OVSKernelAP) print "*** Creating nodes" sta1 = net.addStation('sta1', wlans=2) sta2 = net.addStation('sta2', wlans=2) sta3 = net.addStation('sta3', wlans=2) ap1 = net.addAccessPoint('ap1', ssid='ssid-ap1', mode='g', channel='11', position='115,62,0') ap2 = net.addAccessPoint('ap2', ssid='ssid-ap2', mode='g', channel='1', position='57,142,0') c1 = net.addController('c1', controller=Controller) print "*** Configuring wifi nodes" net.configureWifiNodes() sta1.setIP('10.0.0.2/8', intf="sta1-wlan0") sta2.setIP('10.0.0.3/8', intf="sta2-wlan0") sta3.setIP('10.0.0.4/8', intf="sta3-wlan0") sta1.setIP('192.168.10.1/24', intf="sta1-wlan1") sta2.setIP('192.168.10.2/24', intf="sta2-wlan1") sta3.setIP('192.168.10.3/24', intf="sta3-wlan1") net.addHoc(sta1, ssid='adhocNet', mode='g') net.addHoc(sta2, ssid='adhocNet', mode='g') net.addHoc(sta3, ssid='adhocNet', mode='g') print "*** Starting network" net.build() c1.start() ap1.start([c1]) ap2.start([c1]) net.plotGraph(max_x=200, max_y=200) net.associationControl('ssf') net.startMobility(time=0) net.mobility(sta1, 'start', time=1, position='86,188,0') net.mobility(sta2, 'start', time=1, position='78,195,0') net.mobility(sta3, 'start', time=1, position='93,195,0') net.mobility(sta1, 'stop', time=250, position='86,0,0') net.mobility(sta2, 'stop', time=250, position='78,7,0') net.mobility(sta3, 'stop', time=250, position='93,7,0') net.stopMobility(time=250) sleep(10) s1 = net.get('sta1') s2 = net.get('sta2') s3 = net.get('sta3') popens = {} # Python subprocess.Popen objects keyed by Mininet hosts startTime = int(time()) + SYNC_START endTime = startTime + EXPERIMENT_DURATION print "*** Starting %d second experiment in %d second(s) - at Unix epoch: %d..." % ( EXPERIMENT_DURATION, (startTime - int(time())), startTime) popens[s1] = s1.popen(EXECUTABLE_PATH, '-addr=%s' % s1.IP(), '-dsts=%s,%s' % (s2.IP(), s3.IP()), '-start=%d' % startTime) popens[s2] = s2.popen(EXECUTABLE_PATH, '-role=F', '-addr=%s' % s2.IP()) popens[s3] = s3.popen(EXECUTABLE_PATH, '-role=F', '-addr=%s' % s3.IP()) with open(OUTPUT_FILE, 'w') as f: for h, line in pmonitor(popens, timeoutms=500): if h: f.write('<%s>: %s' % (h.name, line)) if time() >= endTime: break popens[s1].send_signal(SIGINT) popens[s2].send_signal(SIGINT) popens[s3].send_signal(SIGINT) f.close() print "*** Ending experiment..." print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()
def topology(): "Create a network." privateDirs = [('/var/log', '/tmp/%(name)s/var/log'), ('/var/run', '/tmp/%(name)s/var/run'), ('/etc/omf-resctl-5.4', '/tmp/%(name)s/etc/omf-resctl-5.4')] #host = partial( Host, # privateDirs=privateDirs ) net = Mininet() print "*** Creating nodes" omf = OMFInventory() #omf EXP controller expc = net.addHost('expc', ip="10.0.0.200", inNamespace=False) xmldoc = minidom.parse('topology.xml') itemlist = xmldoc.getElementsByTagName('node') nodes = [] for s in itemlist: name = s.attributes['name'].value if "." in name: name = name[0:name.index('.')].replace('-', 'x') ifns = s.getElementsByTagName('interface') nRadios = ifns.length sta = net.addStation(name, wlans=nRadios) nodes.append(sta) print "*** Configuring wifi nodes" net.configureWifiNodes() s1 = net.addSwitch("s1", cls=LinuxBridge) net.addLink(s1, expc) for n in nodes: net.addLink(s1, n) i = 0 for s in itemlist: sta = nodes[i] ifns = s.getElementsByTagName('interface') #adding interfaces to the node (in adhoc mode) for ifn in ifns: ch = ifn.getElementsByTagName('channel')[0].firstChild.data essid = ifn.getElementsByTagName('essid')[0].firstChild.data mode = ifn.getElementsByTagName('mode')[0].firstChild.data if (mode == "adhoc"): net.addHoc(sta, ip='0.0.0.0', ssid='meshnet', mode="a", channel='%d' % int(ch)) elif (mode == "station"): net.addHoc(sta, ip='0.0.0.0', ssid='meshnet', mode="a", channel='%d' % int(ch)) elif (mode == "master"): net.addHoc(sta, ip='0.0.0.0', ssid='meshnet', mode="a", channel='%d' % int(ch)) else: print "ERROR." abort() omf.addNode(sta.name, i, "10.0.0.%d" % (i + 1), "00:00:00:00:00:00") i += 1 omf.close() print "*** Starting network" net.build() net.start() setIps(nodes) renameInterfaces(nodes) ret = configureAndStartOmf(expc, nodes) pids = ret['omfPids'] logFi = ret['logFiles'] sshPids = StartSshDaemons(nodes) print "*** Running CLI" CLI(net) for p in pids: expc.cmd("kill %d" % p) time.sleep(3) for p in pids: expc.cmd("kill -9 %d" % p) for f in logFi: f.close() StopSshDaemons(expc, sshPids) expc.cmd("/etc/init.d/omf-aggmgr-5.4 stop") print "*** Stopping network" net.stop()
def topology(): "Create a network." net = Mininet(controller=Controller, link=TCLink, accessPoint=OVSKernelAP) print "*** Creating nodes" sta1 = net.addStation('sta1', wlans=2) sta2 = net.addStation('sta2', wlans=2) sta3 = net.addStation('sta3', wlans=2) ap1 = net.addAccessPoint('ap1', ssid='ssid-ap1', mode='g', channel='11', position='115,62,0') ap2 = net.addAccessPoint('ap2', ssid='ssid-ap2', mode='g', channel='1', position='57,142,0') c1 = net.addController('c1', controller=Controller) print "*** Configuring wifi nodes" net.configureWifiNodes() sta1.setIP('10.0.0.2/8', intf="sta1-wlan0") sta2.setIP('10.0.0.3/8', intf="sta2-wlan0") sta3.setIP('10.0.0.4/8', intf="sta3-wlan0") sta1.setIP('192.168.10.1/24', intf="sta1-wlan1") sta2.setIP('192.168.10.2/24', intf="sta2-wlan1") sta3.setIP('192.168.10.3/24', intf="sta3-wlan1") net.addHoc(sta1, ssid='adhocNet', mode='g') net.addHoc(sta2, ssid='adhocNet', mode='g') net.addHoc(sta3, ssid='adhocNet', mode='g') print "*** Starting network" net.build() c1.start() ap1.start([c1]) ap2.start([c1]) net.plotGraph(max_x=200, max_y=200) net.associationControl('ssf') net.startMobility(time=0) net.mobility(sta1, 'start', time=1, position='86,188,0') net.mobility(sta2, 'start', time=1, position='78,195,0') net.mobility(sta3, 'start', time=1, position='93,195,0') net.mobility(sta1, 'stop', time=250, position='86,0,0') net.mobility(sta2, 'stop', time=250, position='78,7,0') net.mobility(sta3, 'stop', time=250, position='93,7,0') net.stopMobility(time=250) sleep(10) """ print "*** Starting test..." s1 = net.get('sta1') s2 = net.get('sta2') s2.sendCmd('./rcv.py') sleep(1) s1.sendCmd('./send.py') sleep(1) s2.waitOutput() s1.waitOutput() s1.cmd('kill %send.py') s2.cmd('kill %rcv.py') print "*** Ending test..." """ print "*** Starting test..." s1 = net.get('sta1') s2 = net.get('sta2') s3 = net.get('sta3') po2 = s2.popen('./rcv.py', s2.IP(), '%s.out' % s2.name) po3 = s3.popen('./rcv.py', s3.IP(), '%s.out' % s3.name) sleep(1) po1 = s1.popen('./send.py') sleep(5) po1.send_signal( SIGINT ) po2.send_signal( SIGINT ) po3.send_signal( SIGINT ) print "*** Ending test..." print "*** Running CLI" CLI(net) print "*** Stopping network" net.stop()