当前位置: 首页>>代码示例>>Python>>正文


Python Mininet.startTerms方法代码示例

本文整理汇总了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()
开发者ID:wjianwei126,项目名称:sdn-p2p,代码行数:34,代码来源:r03921079_PA3.py

示例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()
开发者ID:kelvinzou,项目名称:MiddleboxSessionProtocol,代码行数:15,代码来源:custopo.py

示例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()
开发者ID:iwaseyusuke,项目名称:ryu-book,代码行数:32,代码来源:spanning_tree.py


注:本文中的mininet.net.Mininet.startTerms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。