unable to connect two L3 network

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

weiguo.jiang gravatar image


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=,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='',defaultRoute='via')
    vh2 = self.addHost('vh2', cls=VLANHost, vlan=101, ip='',defaultRoute='via')

    vh11 = self.addHost('vh11', cls=VLANHost, vlan=100, ip='',defaultRoute='via')
    vh12 = self.addHost('vh12', cls=VLANHost, vlan=101, ip='',defaultRoute='via')

    h1Host = self.addHost('h3',ip='',defaultRoute='via')
    h2Host = self.addHost('h4',ip='',defaultRoute='via')

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

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