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


Python Mininet.interact方法代码示例

本文整理汇总了Python中mininet.net.Mininet.interact方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.interact方法的具体用法?Python Mininet.interact怎么用?Python Mininet.interact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mininet.net.Mininet的用法示例。


在下文中一共展示了Mininet.interact方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runAndInteractTopology

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def runAndInteractTopology():
    "Create network and run simple performance test"
    topo = SpecialTopo(100, 10)
    net = Mininet(topo=topo, host=CPULimitedHost, link=TCLink, controller=RemoteController)
    net.start()
    net.interact()
    net.stop()
开发者ID:ThiagoRRamos,项目名称:SDN-StateMonitor,代码行数:9,代码来源:run_topos.py

示例2: topoTest

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def topoTest():
    "Create network and run simple performance test"
    topo = ITATopo()
    # topo = ITATopo(12, 10)
    net = Mininet(topo=topo, host=CPULimitedHost, link=TCLink)

    net.interact()
开发者ID:vsmontalvao,项目名称:itasdn,代码行数:9,代码来源:ex2.py

示例3: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def main():
    topo = PyRouterTopo(args)
    net = Mininet(topo=topo, link=TCLink, autoSetMacs=True, cleanup=True, listenPort=10001, controller=RemoteController)
    mb = net.get('mb')
    mb.setIP('0.0.0.0') # don't set an IP address on middlebox
    net.staticArp()
    start_webservers(net)
    net.interact()
开发者ID:CarrieBurgess,项目名称:cosc465_project7,代码行数:10,代码来源:start_mininet.py

示例4: StartScripts

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def StartScripts():
	topo = RoundRobinTopo()
	net = Mininet(topo, controller=lambda name:RemoteController(name, deafultIP='127.0.0.1'), listenPort=6633)
	net.start()
	h1, h2, h3 = net.get('h1', 'h2', 'h3')
	#h1.cmd('./wget.sh')
	h1.cmd('python -m SimpleHTTPServer 80 &')
	h2.cmd('python -m SimpleHTTPServer 80 &')
	h3.cmd('python -m SimpleHTTPServer 80 &')
	sleep(5)
	h4, h5, h6 = net.get('h4', 'h5', 'h6')
	h4.cmd('wget -O - 10.0.0.1')
	h4.cmd('wget -O - 10.0.0.2')
	h4.cmd('wget -O - 10.0.0.3')	
	h4.cmd('./randomConnect.sh &')
	h5.cmd('./randomConnect.sh &')
	h6.cmd('./randomConnect.sh &')	
	net.interact()
	net.stop()
开发者ID:mixisbad,项目名称:mininet_topo,代码行数:21,代码来源:roundRobin.py

示例5: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def main():
    topo = PyRouterTopo(args)
    net = Mininet(topo=topo, link=TCLink, cleanup=True)
    setup_addressing(net)
    net.interact()
开发者ID:brojec,项目名称:cosc465_iprouter,代码行数:7,代码来源:start_mininet.py

示例6: __init__

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
    def __init__( self ):

        # Initialize topology
        Topo.__init__( self )

        # Add hosts
        h1 = self.addHost( 'h1' ) # Valid user
        h2 = self.addHost( 'h2' ) # Invalid malicious user
        h3 = self.addHost( 'h3' ) # Invalid DDoS user
        
        s1 = self.addSwitch( 's1', protocols='OpenFlow13')

        # Add links between switches and hosts
        self.addLink( h1, s1 )
        self.addLink( h2, s1 )
        self.addLink( h3, s1 )

if __name__ == '__main__':

    testTopo = TestTopo()
    remoteCtrl = RemoteController( 'ctrl', ip='127.0.0.1', port=6653 )
    net = Mininet( topo=testTopo, controller=remoteCtrl, switch=OVSKernelSwitch, autoSetMacs=True )

    # Connect real interfaces to switch
    Intf( 'brApache', node=net.switches[0] ) # Apache server
    # Intf( 'enp0s3 ', node=net.switches[0] ) # Internet

    net.start()
    net.interact()
开发者ID:Janyell,项目名称:ControllerDDoSProtection-RUNOS-App,代码行数:31,代码来源:topo.py

示例7: build_prox

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
	build_prox(args.prox)
	wait_on_controller()

	mn = Mininet(
		topo=MyTopo(),
		autoSetMacs=True,
		autoStaticArp=True,
		controller=RemoteController,
		switch=OVSKernelSwitch
	)

	mn.start()

	sleep(2) # yuk
	for src in mn.hosts:
		for dst in mn.hosts:
			if src != dst:
				# This is to work around a bug in the version of mininet on the VM
				src.setARP(ip=dst.IP(), mac=dst.intf(None).MAC())
		# Magic for floodlight to map MAC addresses to switch ports
		src.setARP(ip=MAGIC_IP, mac=MAGIC_MAC)
		src.cmd("ping", "-c1", "-W1", MAGIC_IP)

	px = Prox(mn.getNodeByName("prox"), args.plog)
	px.start()
	mn.interact()

	# TODO cleanup threads

# vim: set noet ts=4 sw=4 :
开发者ID:asayler,项目名称:cu-advnets-s13-a2,代码行数:32,代码来源:run.py

示例8: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def main():
    topo = PyRouterTopo(args)
    net = Mininet(topo=topo, link=TCLink, cleanup=True, autoSetMacs=True)
    setup_addressing(net)
    net.staticArp()
    net.interact()
开发者ID:asperlea,项目名称:COSC-465,代码行数:8,代码来源:start_mininet.py

示例9: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def main():
    topo = PySwitchTopo(args)
    net = Mininet(controller=None, topo=topo, link=TCLink, cleanup=True)
    setup_addressing(net)
    net.interact()
开发者ID:jsommers,项目名称:switchyard,代码行数:7,代码来源:switchtopo.py

示例10: main

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def main():
    topo = MyTopo(args)
    net = Mininet(topo=topo, link=TCLink, cleanup=True)
    net.interact()
开发者ID:CarrieBurgess,项目名称:cosc465_project8,代码行数:6,代码来源:start_mininet.py

示例11: StartScripts

# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import interact [as 别名]
def StartScripts():
	topo = SimpleTopo()
	net = Mininet(topo)
	net.start()
	net.interact()
	net.stop()
开发者ID:mixisbad,项目名称:mininet_topo,代码行数:8,代码来源:SimpleNetwork.py


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