本文整理汇总了Python中mininet.net.Mininet.startTerms方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.startTerms方法的具体用法?Python Mininet.startTerms怎么用?Python Mininet.startTerms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.startTerms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: perfTest
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import startTerms [as 别名]
def perfTest():
"Create network and run simple performance test"
#"--- core to aggregation switches"
linkopts1 = {'bw':50, 'delay':'5ms'}
#"--- aggregation to edge switches"
linkopts2 = {'bw':30, 'delay':'10ms'}
#"--- edge switches to hosts"
linkopts3 = {'bw':10, 'delay':'15ms'}
topo = CustomTopo(linkopts1 , linkopts2 , linkopts3 , fanout= 2)
#net = Mininet(topo=topo,host=CPULimitedHost, link=TCLink)
net = Mininet(controller=None,topo=topo)
c = net.addController('c0',controller=RemoteController,ip='127.0.0.1',port=6633)
#net.addNAT().configDefault()
#net.build()
#c.start()
net.start()
net.startTerms()
'''
os.popen('ovs-vsctl add-port s1 eth0')
for i in range(8,16):
h = net.get('h%d'%(i))
h.cmdPrint('dhclient '+h.defaultIntf().name)
CLI(net)
for i in range(8,16):
h = net.get('h%d'%(i))
h.cmdPrint('dhclient -r '+h.defaultIntf().name)
net.stop()
'''
h = net.get('h9')
h.cmd('ifconfig')
CLI(net)
net.stop()
示例2: bootMininet
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import startTerms [as 别名]
def bootMininet():
#create mininet with the topology
host = custom(CPULimitedHost, cpu=0.3)
#link = custom(TCLink, bw=100, delay='5ms')
topo = TestTopo()
#OVSSwitch, KernelSwitch controller= RemoteController,
net = Mininet(topo=topo, controller= partial( RemoteController, ip='127.0.0.1', port=6633 ), host=host, link=TCLink, build=True, autoPinCpus=True )
net.start()
net.startTerms()
print("Background process!")
CLI(net)
net.stop()
示例3: CLI
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import startTerms [as 别名]
c0 = net.addController('c0')
s1 = net.addSwitch('s1')
s2 = net.addSwitch('s2')
s3 = net.addSwitch('s3')
h1 = net.addHost('h1')
h2 = net.addHost('h2')
h3 = net.addHost('h3')
net.addLink(s1, h1)
net.addLink(s2, h2)
net.addLink(s3, h3)
net.addLink(s1, s2)
net.addLink(s2, s3)
net.addLink(s3, s1)
net.build()
c0.start()
s1.start([c0])
s2.start([c0])
s3.start([c0])
net.startTerms()
CLI(net)
net.stop()