Hi Arslan,

As you said, you can create a new port (like "ovs-vsctl add-port" command) by 
using the APIs
of OVSBridge, but your problem seems not be able to be solved with this APIs.

Your question is "How to create a new link between s1 and h2", right?
This is matter of usage of Mininet, I guess.
To create a new link between them, you need to create interfaces on both nodes 
(OVS and Linux
Host), but creating a new interface (veth) on Linux is the out-side of OpenFlow 
and Ryu (it
should be done on Mininet side).

If you want to create topology like;
  h1---s1---s2---h2
       |         |
       +---------+
Please try the following script.
(Mininet CLI (mn) command does not provide enough options for creating a 
complex topology.)

====
#!/usr/bin/env python

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


def main():
    # h1 ---s1---s2---h2
    #       |         |
    #       +---------+
    net = Mininet(controller=RemoteController)

    net.addController('c0')

    s1 = net.addSwitch('s1')
    s2 = net.addSwitch('s2')

    h1 = net.addHost('h1')
    h2 = net.addHost('h2')

    net.addLink(s1, h1)
    net.addLink(s2, h2)
    net.addLink(s1, h2)

    net.addLink(s1, s2)

    net.start()
    CLI(net)
    net.stop()


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

Thanks,
Iwase


On 2017年10月27日 21:48, Arslan wrote:
Dear All,

I am trying to add an interface in the mininet topology through Ryu controller however being a beginner, I am not sure how can I do it.

Description of what I want to do:  Consider this linear topology

h1----s1----s2----h2

In this topology, I would like to make a connection of h2 to s1 so that the traffic from h1 to h2 doesn't go through s2.

What I have found till now is I can use, /class OVSBridge(object) /which can be found here https://github.com/osrg/ryu/blob/master/ryu/lib/ovs/bridge.py#L92

However, I don't know which function in this class are more appropriate to do this. A precise example will be highly appreciated. Thank you all

Regards

Arslan



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to