本文整理汇总了Python中mininet.net.Mininet.plotHost方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.plotHost方法的具体用法?Python Mininet.plotHost怎么用?Python Mininet.plotHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.plotHost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: topology
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import plotHost [as 别名]
def topology():
"Create a network."
net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )
print "*** Creating nodes"
sta1 = net.addStation( 'sta1', mac='00:00:00:00:00:02', ip='10.0.0.2/8' )
ap1 = net.addBaseStation( 'ap1', ssid= 'new-ssid1', mode= 'g', channel= '1', position='15,30,0' )
ap2 = net.addBaseStation( 'ap2', ssid= 'new-ssid1', mode= 'g', channel= '6', position='55,30,0' )
s3 = net.addSwitch( 's3' )
h4 = net.addHost( 'h4', ip='10.0.0.4/8' )
c1 = net.addController( 'c1', controller=Controller, port=6653 )
net.plotHost(h4, position='35,90,0')
net.plotHost(s3, position='35,80,0')
print "*** Creating links"
net.addLink(ap1, s3)
net.addLink(ap2, s3)
net.addLink(h4, s3)
print "*** Starting network"
net.build()
c1.start()
ap1.start( [c1] )
ap2.start( [c1] )
s3.start( [c1] )
"""uncomment to plot graph"""
net.plotGraph(max_x=100, max_y=100)
net.startMobility(startTime=0)
net.mobility('sta1', 'start', time=1, position='10,30,0')
net.mobility('sta1', 'stop', time=40, position='60,30,0')
net.stopMobility(stopTime=40)
print "*** Running CLI"
CLI( net )
print "*** Stopping network"
net.stop()