Example #1
0
 def start( self, *args, **kwargs ):
     OVSKernelSwitch.start( self, *args, **kwargs )
     OVSBridgeSTP.prio += 1
     self.cmd( 'ovs-vsctl set-fail-mode', self, 'standalone' )
     self.cmd( 'ovs-vsctl set-controller', self )
     self.cmd( 'ovs-vsctl set Bridge', self,
               'stp_enable=true',
               'other_config:stp-priority=%d' % OVSBridgeSTP.prio )
Example #2
0
def add_switch(name, dpid, proto_version):
    if type(dpid) is unicode:
        dpid = dpid.encode('ascii','ignore')

    switch = OVSKernelSwitch(name, protocols=proto_version, inNamespace=False, dpid=dpid)
    switch.start(controllers)
    switches[name] = switch
    logger.debug("==> added switch name={}; dpid={}".format(name,dpid))
Example #3
0
 def add_switch_worker():
     while True:
         name = names.get()
         switch = OVSKernelSwitch(name, protocols='OpenFlow13', inNamespace=False)
         switches[name] = switch
         switch.start(controllers)
         # time to here, 5 switches : 0.88s,  50sw : 2.8 (15),    200 : 22s (33)
         logger.debug("==> added switch name={}".format(name))
         names.task_done()
Example #4
0
	def start( self, controllers ):
		OVSKernelSwitch.start(self, controllers)
		LegacyL2Switch.priority += 1
		self.cmd( 'ovs-vsctl set Bridge', self.name,\
						'stp_enable=true',\
						'other_config:stp-priority=%d' % LegacyL2Switch.priority )
		for intf in self.intfList():
			if 'lo' not in intf.name:
				self.cmd( 'ovs-vsctl set Port %s other_config:stp-path-cost=1' % intf.name)
Example #5
0
 def start(self, controllers):
     OVSKernelSwitch.start(self, controllers)
     LegacyL2Switch.priority += 1
     self.cmd( 'ovs-vsctl set Bridge', self.name,\
         'stp_enable=true',\
         'other_config:stp-priority=%d' % LegacyL2Switch.priority )
     for intf in self.intfList():
         if 'lo' not in intf.name:
             self.cmd('ovs-vsctl set Port %s other_config:stp-path-cost=1' %
                      intf.name)
 def start( self, controllers ):
     return OVSKernelSwitch.start( self, controllers )
 def start( self, controllers ):
     return OVSKernelSwitch.start( self, [ cmap[ self.name ] ] )
 def start(self, controllers):
     return OVSKernelSwitch.start(self, controllers)
Link( s0, s1 )
Link( s0, s2 )
Link( s0, s3 )

h0.setIP( '10.1.0.1/16' )
h1.setIP( '10.1.0.2/16' )
h2.setIP( '10.2.0.1/16' )
h3.setIP( '10.3.0.1/16' )

print h0.cmd('ifconfig')
c0.start()
c1.start()
c2.start()
c3.start()

s0.start( [ c0 ] )
s1.start( [ c1 ] )
s2.start( [ c2 ] )
s3.start( [ c3 ] )

dumpNodeConnections([s0,s1,s2,s3,h0,h1,h2,h3])
temp = l1.intf1
l1.delete()

h0.intfs = {}
h0.ports = {}
h0.nameToIntf = {} 

l1.intf1 = None
#for intf in s1.intfList():
#	if intf.link and intf.link.intf1.name == 'h0-eth0':
Example #10
0
 def start(self, a):
     return OVSKernelSwitch.start(self, [cmap[self.name]])
Example #11
0
Link(s0, s1)
Link(s0, s2)
Link(s0, s3)

h0.setIP('10.1.0.1/16')
h1.setIP('10.1.0.2/16')
h2.setIP('10.2.0.1/16')
h3.setIP('10.3.0.1/16')

print h0.cmd('ifconfig')
c0.start()
c1.start()
c2.start()
c3.start()

s0.start([c0])
s1.start([c1])
s2.start([c2])
s3.start([c3])

dumpNodeConnections([s0, s1, s2, s3, h0, h1, h2, h3])
temp = l1.intf1
l1.delete()

h0.intfs = {}
h0.ports = {}
h0.nameToIntf = {}

l1.intf1 = None
#for intf in s1.intfList():
#	if intf.link and intf.link.intf1.name == 'h0-eth0':
 def start(self, controllers):
     return OVSKernelSwitch.start(self, [cmap[self.name]])