def topology(): "Create a network." net = Mininet_wifi(controller=Controller, switch=OVSKernelSwitch) info("*** Creating nodes\n") 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) info("*** Configuring wifi nodes\n") net.configureWifiNodes() info("*** Associating...\n") net.addLink(ap1, sta1) net.addHoc(sta1, ssid='adhoc1') net.addHoc(sta2, ssid='adhoc1') info("*** Starting network\n") net.build() c0.start() ap1.start([c0]) info("***Addressing...\n") sta1.setIP('192.168.10.1/24', intf="sta1-wlan1") sta2.setIP('192.168.10.2/24', intf="sta2-wlan0") info("*** Running CLI") CLI_wifi(net) info("*** Stopping network\n") net.stop()
def topology(autoTxPower): "Create a network." net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference) info("*** Creating nodes\n") if autoTxPower: sta1 = net.addStation('sta1', position='10,10,0', range=100) sta2 = net.addStation('sta2', position='50,10,0', range=100) sta3 = net.addStation('sta3', position='90,10,0', range=100) else: sta1 = net.addStation('sta1', position='10,10,0') sta2 = net.addStation('sta2', position='50,10,0') sta3 = net.addStation('sta3', position='90,10,0') net.propagationModel(model="logDistance", exp=4) info("*** Configuring wifi nodes\n") net.configureWifiNodes() info("*** Creating links\n") 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) info("*** Starting network\n") net.build() info("*** Running CLI\n") CLI_wifi(net) info("*** Stopping network\n") net.stop()
def topology(): "Create a network." net = Mininet_wifi(controller=Controller, accessPoint=OVSAP, enable_wmediumd=True, enable_interference=True) info("*** Creating nodes\n") 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) info("*** Configuring Propagation Model\n") net.propagationModel(model="logDistance", exp=4.5) info("*** Configuring wifi nodes\n") net.configureWifiNodes() info("*** Creating links\n") net.addHoc(sta3, ssid='adhocNet') net.addHoc(sta4, ssid='adhocNet') 'ploting graph' #net.plotGraph(max_x=200, max_y=200) info("*** Starting network\n") net.build() c1.start() ap1.start([c1]) 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) info("*** Running CLI\n") CLI_wifi(net) info("*** Stopping network\n") net.stop()
def topology(): "Create a network." net = Mininet_wifi(link=wmediumd, 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_wifi(net) print "*** Stopping network" net.stop()