Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 不连接主机_Python_Virtual Machine_Sdn_Mininet - Fatal编程技术网

Python 不连接主机

Python 不连接主机,python,virtual-machine,sdn,mininet,Python,Virtual Machine,Sdn,Mininet,我正在开发一个拓扑,拓扑运行并启动,但当在主机之间ping时,它不连接,我的目标是运行udp和tcp流量测试,但我需要主机与其他主机连接 from mininet.net import Mininet from mininet.node import Controller, OVSSwitch from mininet.cli import CLI from mininet.log import setLogLevel def multiControllerNet(): net

我正在开发一个拓扑,拓扑运行并启动,但当在主机之间ping时,它不连接,我的目标是运行udp和tcp流量测试,但我需要主机与其他主机连接

from mininet.net import Mininet
from mininet.node import Controller, OVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel

def multiControllerNet():



    net = Mininet( controller=Controller, switch=OVSSwitch )

    print
    c1 = net.addController( 'c1', port=6633 )
    c2 = net.addController( 'c2', port=6634 )

    print
    s1 = net.addSwitch( 's1' )
    s2 = net.addSwitch( 's2' )
    s3 = net.addSwitch( 's3' )
    s4 = net.addSwitch( 's4' )
    s5 = net.addSwitch( 's5' )
    s6 = net.addSwitch( 's6' )
    s7 = net.addSwitch( 's7' )
    s8 = net.addSwitch( 's8' )

    print
   # hosts1 = [ net.addHost( 'h%d' % n ) for n in (1, 2, 3, 4) ]
    h1 = net.addHost( 'h1' )
    h2 = net.addHost( 'h2' )
    h3 = net.addHost( 'h3' )
    h4 = net.addHost( 'h4' )

    print
    #for h in hosts1:
    net.addLink( s5, h1 )
    net.addLink( s6, h2 )
    net.addLink( s7, h3 )
    net.addLink( s8, h4 )
    net.addLink( s1, s5 )
    net.addLink( s2, s5 )
    net.addLink( s3, s5 )
    net.addLink( s4, s5 )
    net.addLink( s1, s6 )
    net.addLink( s2, s6 )
    net.addLink( s3, s6 )
    net.addLink( s4, s6 )
    net.addLink( s1, s7 )
    net.addLink( s2, s7 )
    net.addLink( s3, s7 )
    net.addLink( s4, s7 )
    net.addLink( s1, s8 )
    net.addLink( s2, s8 )
    net.addLink( s3, s8 )
    net.addLink( s4, s8 )

# net.addLink( s1, s2 )
 #   net.addLink( s2, s3 )
  #  net.addLink( s3, s4 )

    print
    net.build()
    c1.start()
    c2.start()
    s1.start( [ c1, c2 ] )
    s2.start( [ c1, c2 ] )
    s3.start( [ c2, c1 ] )
    s4.start( [ c2, c1 ] )
    s5.start( [ c2, c1 ] )
    s6.start( [ c2, c1 ] )
    s7.start( [ c2, c1 ] )
    s8.start( [ c2, c1 ] )
    net.start()

    print
    CLI( net )

    print
    net.stop()

if __name__ == '__main__':
如果有人能帮助我理解为什么主机没有连接,我无法运行测试来提取值,我将不胜感激