本文整理汇总了Python中mininet.node.OVSSwitch.start方法的典型用法代码示例。如果您正苦于以下问题:Python OVSSwitch.start方法的具体用法?Python OVSSwitch.start怎么用?Python OVSSwitch.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.node.OVSSwitch
的用法示例。
在下文中一共展示了OVSSwitch.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start( self, *args, **kwargs ):
OVSSwitch.start( self, *args, **kwargs )
OVSBridgeSTP.prio += 1
self.cmd( 'ovs-vsctl set-fail-mode', self, 'standalone' )
self.cmd( 'ovs-vsctl set Bridge', self,
'stp_enable=true',
'other_config:stp-priority=%d' % OVSBridgeSTP.prio )
示例2: emptyNet
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def emptyNet():
net = Mininet(topo=None, build=False)
c0 = Controller('c0', inNamespace=False)
h1 = Host('h1')
h2 = Host('h2')
#intf1 = Intf("h1-eth1")
#intf2 = Intf("h2-eth1")
s1 = OVSSwitch('br0', inNamespace=False)
Link(h1, s1)
Link(h2, s1)
c0.start()
s1.start([c0])
net.start()
#s1.cmd('ovs-vsctl set bridge br0 protocols=OpenFlow13')
CLI(net)
net.stop()
h1.stop()
h2.stop()
s1.stop()
c0.stop()
示例3: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
# Call superclass constructor
OVSSwitch.start(self, controllers)
# Set OpenFlow VersionsHost
self.configureOpenFlowVersion()
# Set Switch IP address
if self.switchIP is not None:
self.cmd('ifconfig', self, self.switchIP)
示例4: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start( self, controllers ):
# make sure controllers contains only a ControllerCluster
assert len( controllers ) == 1
ccluster = controllers[ 0 ]
assert type( ccluster ) == ControllerCluster
controller_list = ccluster.clist( self.name )
# TODO: manage order of controllers to control mastership
OVSSwitch.start( self, controllers=controller_list )
示例5: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start( self, controllers ):
return OVSSwitch.start( self, [ cmap[ self.name ] ] )
示例6: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
if self.custom_ctrl is not None:
return OVSSwitch.start(self, [self.custom_ctrl])
else:
return OVSSwitch.start(self, controllers)
示例7: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start( self, controllers ):
assert len( controllers ) == 1
c0 = controllers[ 0 ]
assert type( c0 ) == ONOSCluster
controllers = c0.clist()
OVSSwitch.start( self, controllers )
示例8: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
# This switch should always have no controllers
OVSSwitch.start(self, [])
示例9: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
print(self.name)
return OVSSwitch.start(self, [_controllers[_translation[self.name]]])
示例10: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
return OVSSwitch.start(self, controllers)
示例11: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
print "%s : %s" % (self.name, str(cmap.get(self.name, [])))
return OVSSwitch.start(self, cmap.get(self.name, []))
示例12: Host
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
#!/usr/bin/python
from mininet.topo import Topo
from mininet.node import Host, OVSSwitch, Controller
from mininet.link import Link
h1 = Host('h1')
h2 = Host('h2')
s1 = OVSSwitch('s1', inNamespace=False)
c0 = Controller('c0', inNamespace=False)
Link(h1,s1)
Link(h2,s1)
h1.setIP('10.1/8')
h2.setIP('10.2/8')
c0.start()
s1.start([c0])
print h1.cmd('ping -c1', h2.IP())
s1.stop()
c0.stop()
示例13: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
self.init_map(controllers[1:])
return OVSSwitch.start(self, [self.map[self.name]])
示例14: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start( self, controllers ):
print "starting ", self.name
return OVSSwitch.start( self, [ cmap[ self.name ] ] )
示例15: start
# 需要导入模块: from mininet.node import OVSSwitch [as 别名]
# 或者: from mininet.node.OVSSwitch import start [as 别名]
def start(self, controllers):
my_num = int(self.name[1:]) - 1
return OVSSwitch.start(self, [controllers[my_num % len(controllers)]])