Hi,
I have a 3 node network and I have enabled spanning tree on all the 3
nodes. You can think of them getting connected as a triangle. Once all the
configuration is done and STP has settled, I do not see the right STP state
values when I dump the port states using ovs-ofctl's "dump-ports-desc"
I am attaching a mininet script I used to setup this network.
Essentially following commands are executed on any port.
ovs-vsctl set Bridge bos0 stp_enable=true
ovs-vsctl set Bridge bos0 other_config:stp-priority=0x7800
ovs-ofctl mod-port bos0 bos0-eth1 stp
ovs-vsctl set Port bs0-eth1 other_config:stp-path-cost=10
ovs-ofctl mod-port bos0 bos0-eth1 up
I see that all ports are setting down to a STP state as per protocol. I had
enabled logs in ofproto_port_set_state() to see STP state transitions. So,
I expected to see the STP state to be reflected in the following command.
vdasari@mininet:~$ sudo ovs-ofctl dump-ports-desc bos0
OFPST_PORT_DESC reply (xid=0x2):
1(bos0-eth1): addr:76:41:b5:8c:58:87
config: 0
*state: 0 *current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
2(bos0-eth2): addr:06:ca:ba:ad:11:bc
config: 0
*state: 0 *current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
LOCAL(bos0): addr:66:4b:66:9b:1a:4b
config: 0
*state: 0 *speed: 0 Mbps now, 0 Mbps max
The port state should have been "forwarding" or "blocking".
On debugging this issue further, I found that, ofproto's STP state bits are
getting updated correctly because of following call stack:
#0 ofproto_port_set_state (port=0x82395c0, state=OFPUTIL_PS_STP_FORWARD)
at ../ofproto/ofproto.c:2267
#1 0x0806d659 in update_stp_port_state (ofport=0x82395b8)
at ../ofproto/ofproto-dpif.c:1866
#2 0x0806da37 in stp_run (ofproto=0x822c628) at
../ofproto/ofproto-dpif.c:1969
#3 0x0806c1ba in run (ofproto_=0x822c630) at ../ofproto/ofproto-dpif.c:1286
#4 0x0805d51f in ofproto_run (p=0x822c630) at ../ofproto/ofproto.c:1429
#5 0x08050ece in bridge_run__ () at ../vswitchd/bridge.c:2275
#6 0x08051032 in bridge_run () at ../vswitchd/bridge.c:2326
#7 0x08055a99 in main (argc=4, argv=0xbffff224) at
../vswitchd/ovs-vswitchd.c:118
but the same STP state is getting overwritten by following call stack, at a
later point in time:
#0 ofport_modified (port=0x822c290, pp=0xbfffefb4) at
../ofproto/ofproto.c:2244
#1 0x0805f887 in update_port (ofproto=0x821f090, name=0x8200958
"atl0-eth2")
at ../ofproto/ofproto.c:2423
#2 0x0805d867 in ofproto_run (p=0x821f090) at ../ofproto/ofproto.c:1495
#3 0x08050ece in bridge_run__ () at ../vswitchd/bridge.c:2275
#4 0x08051032 in bridge_run () at ../vswitchd/bridge.c:2326
#5 0x08055a99 in main (argc=4, argv=0xbffff224) at
../vswitchd/ovs-vswitchd.c:118
This is the reason why, I am seeing the "state to be 0".
I could have gone further, but I am stuck understanding the "seq_read()"
logic in ofproto_run(). Not sure why and how is it supposed to be used.
I am using Ubuntu 13.10, kernel: 3.11.0-15-generic, OVS: 2.1.90. Any
pointers in isolating or fixing this issue would be helpful.
Thanks,
-Vasu
#!/usr/bin/python
from mininet.cli import CLI
from mininet.util import quietRun
from mininet.topo import Topo
from mininet.node import Controller, RemoteController, OVSSwitch
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.util import irange,dumpNodeConnections
from mininet.log import setLogLevel, info
def MyTopology():
"Create a topology of 8 switches, and two hosts"
info( '*** Creating Network\n')
net = Mininet( controller=RemoteController )
info( '*** Adding controller\n' )
# net.addController( 'maestro', controller=RemoteController, ip="127.0.0.1",port=6633)
net.addController( 'maestro' )
info( '*** Adding Switches\n' )
sfo = net.addSwitch('sfo0')
bos = net.addSwitch('bos0')
atl = net.addSwitch('atl0')
# Network links
info( '*** Adding Inter Switch links\n' )
net.addLink (sfo, bos)
net.addLink (sfo, atl)
net.addLink (bos, atl)
info( '*** Starting Network\n')
net.start()
def dumpConnections( node ):
"Helper function: dump connections to node"
info( ' Switch ', node.name )
info( '\n' )
node.cmd( 'ovs-vsctl set Bridge ', node.name, 'stp_enable=true')
node.cmd( 'ovs-vsctl set Bridge ', node.name, 'other_config:stp-priority=0x7800')
for intf in node.intfList():
node.cmd( 'ovs-ofctl mod-port ', node.name, intf, 'stp' )
node.cmd( 'ovs-vsctl set Port ', intf, 'other_config:stp-path-cost=10')
node.cmd( 'ovs-ofctl mod-port ', node.name, intf, 'up' )
for node in net.switches:
dumpConnections( node )
info( '\n' )
for node in net.switches:
node.cmd( 'ovs-ofctl dump-ports-desc ', node.name)
info( '\n' )
info( '*** Running CLI\n')
CLI( net )
info( '*** Stopping Network\n')
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
MyTopology()
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss