unable to connect two L3 network

asked 2015-05-10 22:17:54 -0800

weiguo.jiang gravatar image

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-eth0:10.0.1.2="" h3:="" pid="22505"> <host h4-eth0:10.0.1.3="" h4:="" pid="22507"> <vlanhost pid="22509" vh1-eth0.100:10.0.100.2="" vh1:=""> <vlanhost pid="22511" vh2-eth0.101:10.0.101.2="" vh2:=""> <vlanhost pid="22513" vh11-eth0.100:10.0.100.3="" vh11:=""> <vlanhost pid="22515" vh12-eth0.101:10.0.101.3="" vh12:=""> <ovsswitch{'protocols': 'openflow13'}="" lo:127.0.0.1,s1-eth1:none,s1-eth2:none,s1-eth3:none,s1-eth4:none="" pid="22520" s1:=""> <ovsswitch{'protocols': 'openflow13'}="" lo:127.0.0.1,s2-eth1:none,s2-eth2:none,s2-eth3:none,s2-eth4:none="" pid="22523" s2:=""> <remotecontroller{'ip': '10.56.212.53',="" 'port':="" 10.56.212.53:6633="" 6633}="" c0:="" pid="22496"> mininet> vh1 ip r s default via 10.0.100.254 dev vh1-eth0.100</remotecontroller{'ip':></ovsswitch{'protocols':></ovsswitch{'protocols':></vlanhost></vlanhost></vlanhost></vlanhost></host></host>

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 ... (more)

edit retag flag offensive close merge delete