2
votes

I am working on my own topology in VirtualBox(es) using mininet:

First VirtualBox with mininet is used as controller. I am using POX as controller (ip address: 192.168.57.3):

mininet@mininet-wm:~/pox$ python ./pox.py forwarding.l2_learning

Second VirtualBox with mininet is for my own topology script:

#!/usr/bin/python

"""
This example shows how to create an empty Mininet object
(without a topology object) and add nodes to it manually.
"""

from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.cli import CLI
from mininet.log import setLogLevel, info

def emptyNet():

    "Create an empty network and add nodes to it."

    net = Mininet( controller=RemoteController )

    info( '*** Adding controller\n' )
    net.addController( 'c0', controller=RemoteController,ip="192.168.57.3",port=6633 )

    info( '*** Adding hosts\n' )
    h1 = net.addHost( 'h1', ip='10.0.0.1' )
    h2 = net.addHost( 'h2', ip='10.0.0.2' )
    h3 = net.addHost( 'h3', ip='10.0.0.3' )


    info( '*** Adding switch\n' )
    s1 = net.addSwitch( 's1' )
    s2 = net.addSwitch( 's2' )
    s3 = net.addSwitch( 's3' )

    info( '*** Creating links\n' )
    net.addLink( h1, s1 )
    net.addLink( s1, s2 )
    net.addLink( s2, s3 )
    net.addLink( s1, s3 )
    net.addLink( s3, h3 )
    net.addLink( s2, h2 )

    info( '*** Starting network\n')
    net.start()

    info( '*** Running CLI\n' )
    CLI( net )

    info( '*** Stopping network' )
    net.stop()

if __name__ == '__main__':
    setLogLevel( 'info' )
    emptyNet()

Then I start the mytopology.py

mininet@mininet-wm:~/mininet/examples$ sudo python mytopology.py

Controller is connected, but all pings are dropped .....

*** Ping: testing ping reachability
h1 -> X X
h2 -> X X
h3 -> X X
*** Results: 100% dropped (0/6 received)
mininet>

What is wrong? Please help me. Thank You!

Edit:

Ping is successful without link that make the loop in topology. for e.g.

  info( '*** Creating links\n' )
        net.addLink( h1, s1 )
        net.addLink( s1, s2 )
        net.addLink( s2, s3 )
        net.addLink( s3, h3 )
        net.addLink( s2, h2 )

So you can see that link between S1 and S3 has been removed.

2
Welcome to stackoverflow. I would suggest coming up with the smallest example that reliably reproduces the error condition (i.e. what about just two hosts on the same subnet and a single switch?, does that work?). Also, I would recommend updating your title to something more specific -- e.g. "ICMP echo packets between mininet hosts are dropped". This will increase the usefulness of your question.init_js
@init_js thank you! Check my edited post3DSpaceGen
Before a host can send an icmp ipv4 packet on the LAN, the host needs to learn the mac address associated with that IP. On IPv4 this is done with ARP, which uses broadcast. I would suggest monitoring traffic going in on one of the links, with the loop and two hosts to see what happens. If the switches relay the broadcast, you can imagine in a naïve switch that whatever broadcast packet is sent on one link, comes back from the other side.. Switches have all sorts of fancy configurable loop detection mechanisms. I don't know what mininet offers in that department.init_js

2 Answers

0
votes

I suggest you to try l2_learning with minimum spanning tree protocol to handle the loop

0
votes

Loops create broadcast storms that can't be handled without options like a spanning tree for example. You could use the openflow.spanning_tree --no-flood --hold-down option to easily use a topology with loops.