Hi,
On 2015年07月21日 16:06, Gautam Pathak wrote:
> Dear Team,
>
> I am trying to create a network with two ryu controller.
>
> h1 -- s1 -- s2 -- h2 where s1 is connected to controller c1 and s2 to c2.
> controller c1 in the same vm of mininet where c2 is in another vm.
>
> Initially I used s1 with OF1.3 and run simple_switch_13.py in c1 and s2 with
> with OF1.0 and run simple_switch.py in c2. Both the host are unable to ping
> each other.
>
> Now I am using OF1.0 in both the switches and run simple_switch.py in both
> the controller. Again also both the hosts are unable to ping each other.
>
> Here is my code:
>
> #!/usr/bin/python
>
> from mininet.net <http://mininet.net/> import Mininet
> from mininet.node import Controller, RemoteController
> from mininet.cli import CLI
> from mininet.log import setLogLevel, info
>
> def myNet():
>
>
> FIRST_CONTROLLER_IP='127.0.0.1'
> SECOND_CONTROLLER_IP='192.168.56.102'
>
> net = Mininet( topo=None, build=False)
>
> h1 = net.addHost( 'h1', mac='01:00:00:00:01:00', ip='20.0.1.1' )
> h2 = net.addHost( 'h2', mac='01:00:00:00:02:00', ip='20.0.2.1' )
>
> s1 = net.addSwitch( 's1', listenPort=6634, mac='00:00:00:00:00:01' )
> s2 = net.addSwitch( 's2', listenPort=6634, mac='00:00:00:00:00:02' )
>
> print "*** Creating links"
> net.addLink(h1, s1, )
> net.addLink(h2, s2, )
> net.addLink(s1, s2, )
>
> ryu_ctrl_1 = net.addController( 'c1', controller=RemoteController,
> ip=FIRST_CONTROLLER_IP, port=6633)
>
> ryu_ctrl_2 = net.addController( 'c2', controller=RemoteController,
> ip=SECOND_CONTROLLER_IP, port=6633)
>
>
> net.build()
>
> s1.start( [ryu_ctrl_1] )
> s2.start( [ryu_ctrl_2] )
>
> CLI( net )
> net.stop()
>
> if __name__ == '__main__':
> setLogLevel( 'info' )
> myNet()
>
>
>
>
> Please suggest, whether I am missing something or doing any wrong. Do I need
> to do any configuration in the controller?
How about the following script?
---
from mininet.cli import CLI
from mininet.link import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.log import setLogLevel
if '__main__' == __name__:
setLogLevel('info')
net = Mininet(controller=RemoteController)
# Run on 'xterm c1'
# ryu-manager --ofp-listen-host '127.0.0.1' ryu.app.simple_switch_13
c1 = net.addController('c1', ip='127.0.0.1')
# Run on 'xterm c2'
# ryu-manager --ofp-listen-host '127.0.0.2' ryu.app.simple_switch_13
c2 = net.addController('c2', ip='127.0.0.2')
s1 = net.addSwitch('s1')
s2 = net.addSwitch('s2')
h1 = net.addHost('h1')
h2 = net.addHost('h2')
Link(s1, h1)
Link(s2, h2)
Link(s1, s2)
net.build()
c1.start()
c2.start()
s1.start([c1])
s2.start([c2])
CLI(net)
net.stop()
---
Thanks,
Iwase
>
>
> Best regards,
> Goutam
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel