本文整理汇总了Python中mininet.net.Mininet.useExternalProgram方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.useExternalProgram方法的具体用法?Python Mininet.useExternalProgram怎么用?Python Mininet.useExternalProgram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.useExternalProgram方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: topology
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import useExternalProgram [as 别名]
def topology():
"Create a network."
net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )
print "*** Creating nodes"
car = []
for x in range(0,20):
car.append(x)
for x in range(0,20):
car[x] = net.addVehicle( 'car%s' % x, wlans=2, ip='10.0.0.%s/8' % (x+1) )
bs1 = net.addBaseStation( 'BS1', ssid= 'new-ssid1', mode= 'g', channel= '1' )
bs2 = net.addBaseStation( 'BS2', ssid= 'new-ssid2', mode= 'g', channel= '6' )
bs3 = net.addBaseStation( 'BS3', ssid= 'new-ssid3', mode= 'g', channel= '11' )
c1 = net.addController( 'c1', controller=Controller )
print "*** Associating and Creating links"
for x in range(0,20):
net.addMesh(car[x], ssid='mesh')
net.addLink(bs1, bs2)
net.addLink(bs1, bs3)
print "*** Starting network"
net.build()
c1.start()
bs1.start( [c1] )
bs2.start( [c1] )
bs3.start( [c1] )
"""Available Options: sumo, sumo-gui"""
#Put your sumocfg file in /mininet/sumo/data
net.useExternalProgram('sumo-gui', config_file='map.sumocfg')
"""Routing"""
#net.meshRouting('custom')
print "*** Running CLI"
CLI( net )
print "*** Stopping network"
net.stop()