![]() | 1 | initial version |
Hi,
I want to do one test to let two hosts with different vlan can communicate with each other. SDN controller is use onenflowplugin module.
here is the step:
step 1: create network mn --custom vlantopo.py --topo mytopo --mac --controller=remote,ip=10.56.212.53,port=6633 --switch ovsk,protocols=OpenFlow13
-------vlantopo.py begin-------------------------------------
class MyTopo( Topo ): "Simple topology example."
def __init__( self ):
"Create custom topo."
# Initialize topology
Topo.__init__( self )
vh1 = self.addHost('vh1', cls=VLANHost, vlan=100, ip='10.0.100.2/24',defaultRoute='via 10.0.100.254')
vh2 = self.addHost('vh2', cls=VLANHost, vlan=101, ip='10.0.101.2/24',defaultRoute='via 10.0.101.254')
vh11 = self.addHost('vh11', cls=VLANHost, vlan=100, ip='10.0.100.3/24',defaultRoute='via 10.0.100.254')
vh12 = self.addHost('vh12', cls=VLANHost, vlan=101, ip='10.0.101.3/24',defaultRoute='via 10.0.101.254')
h1Host = self.addHost('h3',ip='10.0.1.2/24',defaultRoute='via 10.0.1.254')
h2Host = self.addHost('h4',ip='10.0.1.3/24',defaultRoute='via 10.0.1.254')
leftSwitch = self.addSwitch( 's1' )
rightSwitch = self.addSwitch( 's2' )
# Add links
self.addLink( h1Host, leftSwitch )
self.addLink( h2Host, rightSwitch )
self.addLink( vh1, leftSwitch )
self.addLink( vh2, leftSwitch )
self.addLink( vh11, rightSwitch )
self.addLink( vh12, rightSwitch )
self.addLink( leftSwitch, rightSwitch )
topos = { 'mytopo': ( lambda: MyTopo() ) }
-------vlantopo.py end-------------------------------------
step 2: check the network
mininet> dump <host h3:="" h3-eth0:10.0.1.2="" pid="22505"> <host h4:="" h4-eth0:10.0.1.3="" pid="22507"> <vlanhost vh1:="" vh1-eth0.100:10.0.100.2="" pid="22509"> <vlanhost vh2:="" vh2-eth0.101:10.0.101.2="" pid="22511"> <vlanhost vh11:="" vh11-eth0.100:10.0.100.3="" pid="22513"> <vlanhost vh12:="" vh12-eth0.101:10.0.101.3="" pid="22515"> <ovsswitch{'protocols': 'openflow13'}="" s1:="" lo:127.0.0.1,s1-eth1:none,s1-eth2:none,s1-eth3:none,s1-eth4:none="" pid="22520"> <ovsswitch{'protocols': 'openflow13'}="" s2:="" lo:127.0.0.1,s2-eth1:none,s2-eth2:none,s2-eth3:none,s2-eth4:none="" pid="22523"> <remotecontroller{'ip': '10.56.212.53',="" 'port':="" 6633}="" c0:="" 10.56.212.53:6633="" pid="22496"> mininet> vh1 ip r s default via 10.0.100.254 dev vh1-eth0.100
step 3: one host ping another host.
mininet>h3 ping –c 1 vh1
result: fail due to not config the gateway.
step 4: config the subnet gateway. config the sugnet gateway in the controller. gateway IP address/mask is 10.0.1.254/24 and 10.0.100.254/24.
step5: do ping test again. mininet>h3 ping –c 1 vh1 result: fail due to flow entry don't handle the vlan tag.
here is the flow entry:
OFPSTFLOW reply (OF1.3) (xid=0x2): cookie=0xa, duration=1099.058s, table=0, npackets=1913, nbytes=142650, sendflowrem priority=0 actions=CONTROLLER:65535 cookie=0x0, duration=866.952s, table=0, npackets=0, nbytes=0, priority=1,ip,nwdst=10.0.1.2 actions=setfield:00:00:00:00:00:01->ethdst,output:1 cookie=0x0, duration=690.363s, table=0, npackets=2, nbytes=196, priority=1,ip,nwdst=10.0.100.2 actions=setfield:00:00:00:00:00:03->eth_dst,output:2
question:
is there any way that we can do in controller to let these two host can communicate each other ?
i only know that i can do it after update flow rule with CLI command to handle the vlan tag:
"table=0,priority=4,ip,nwdst=10.0.100.2, actions=moddldst:00:00:00:00:00:03,
modvlanvid:100,2"
"table=0,priority=3,dlvlan=100,ip,nwdst=10.0.1.2,actions=moddldst:00:00:00:00:00:01,
stripvlan,1"
Br, weiguo
© 2014 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a trademark of The OpenDaylight Project, Inc.
Linux Foundation is a registered trademark of The Linux Foundation.
Linux is a registered trademark of Linus Torvalds.
Please see our brand guidelines, trademark guidelines, terms of service and privacy policy.