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.