本文整理汇总了Python中mininet.node.OVSSwitch类的典型用法代码示例。如果您正苦于以下问题:Python OVSSwitch类的具体用法?Python OVSSwitch怎么用?Python OVSSwitch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OVSSwitch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: emptyNet
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()
示例2: start
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 )
示例3: start
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: batchShutdown
def batchShutdown( cls, switches, **_kwargs ):
"Stop switches in per-server batches"
key = attrgetter( 'server' )
for server, switchGroup in groupby( sorted( switches, key=key ), key ):
info( '(%s)' % server )
group = tuple( switchGroup )
switch = group[ 0 ]
OVSSwitch.batchShutdown( group, run=switch.rcmd )
return switches
示例5: start
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 )
示例6: run
def run():
OVSSwitch.setup()
setLogLevel('debug')
net = Mininet(topo=KeepForwardingSmartDownlinkTestTopo(),
switch=OVSSwitch,
controller=RemoteController)
net.start()
CLI(net)
net.stop()
示例7: run
def run():
OVSSwitch.setup()
setLogLevel('debug')
net = Mininet(
topo=FailoverTestTopo(),
switch=OVSSwitch,
controller=RemoteController)
net.start()
CLI(net)
net.stop()
示例8: batchStartup
def batchStartup( cls, switches ):
result = []
for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb') ):
switchGroup = list( switchGroup )
info( '(%s)' % ovsdb )
result += OVSSwitch.batchStartup( switchGroup, run=ovsdb.cmd )
return result
示例9: batchShutdown
def batchShutdown( cls, switches ):
result = []
for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb') ):
switchGroup = list( switchGroup )
info( '(%s)' % ovsdb )
for switch in switches:
if switch.pid == ovsdb.pid:
switch.pid = None
switch.shell = None
result += OVSSwitch.batchShutdown( switchGroup, run=ovsdb.cmd )
for switch in switchGroup:
switch.ovsdbFree()
return result
示例10: start
def start(self, controllers):
if self.custom_ctrl is not None:
return OVSSwitch.start(self, [self.custom_ctrl])
else:
return OVSSwitch.start(self, controllers)
示例11: stop
def stop( self ):
for intf in self.intfList():
if type( intf ) is TCIntf:
self.dropOVSqos( intf )
OVSSwitch.stop( self )
示例12: __init__
def __init__(self, name, **params):
OVSSwitch.__init__(self, name=name, datapath="kernel", **params)
示例13: __init__
def __init__(self, name, reliability=1.0, **params):
OVSSwitch.__init__(self, name, failMode='secure', datapath='kernel', inband=False, protocols=None, **params)
self.reliability = reliability
self._online = True
self.cmd("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
self.cmd("sysctl -w net.ipv6.conf.default.disable_ipv6=1")
示例14: __init__
def __init__(self, name, vtep, **params):
self.vtep = vtep
OVSSwitch.__init__(self, name, **params)
示例15: start
def start( self, controllers ):
assert len( controllers ) == 1
c0 = controllers[ 0 ]
assert type( c0 ) == ONOSCluster
controllers = c0.clist()
OVSSwitch.start( self, controllers )