How can I connect my topology to ONOS controller ?

685 views
Skip to first unread message

jkkr

unread,
May 13, 2022, 8:05:18 AM5/13/22
to mininet-wifi-discuss
Hello, all and Dear Ramon.

Please read my questions and give me some help, Thanks :) 

I'm struggling running my customized topology and connect to ONOS controller at the same time. I usually use the command ' sudo mn --controller=remot,ip=127.0.0.1 --custom ~/topology/mytopo.py --topo=topo1 ' in mininet. 
But I don't know how to connect my mininet-wifi topology to ONOS remote controller. I tried 'sudo python mytopo.py --controller=remote, ip=127.0.0.1', but I think it didn't work.

Attached image is my result doing 'sudo python mytopo.py --controller=remote, ip=127.0.0.1' and 'sta1 ping h1'. 

Here are my questions.
1. How to connect my custom topology to ONOS controller? Did I use the right command ? How can I check whether the result is successful? 
2. How can I see my topology GUI in ONOS gui website? Is it also possible to see mininet wifi topology in ONOS GUI? ( mininet topology can be checked in that site, as you know )
3. If it is possible, why can't I see my host1,2,3 and switch in that GUI ? And What are those swith-like thing not connected to anything in the picture? 

following code is mytopo.py .
----------------------------------------code starts -------------------------------
#!/usr/bin/python

'Setting the position of nodes and providing mobility'

import sys

from mininet.node import RemoteController, Controller, OVSKernelSwitch, Host, OVSSwitch
from mn_wifi.net import Station, OVSKernelAP
from mininet.log import setLogLevel, info
from mn_wifi.cli import CLI
from mn_wifi.link import wmediumd
from mininet.link import Intf
from mn_wifi.net import Mininet_wifi
from mn_wifi.wmediumdConnector import interference
from subprocess import call


def topology(args):
    "Create a network."
    net = Mininet_wifi(topo=None,
                       build=False,
                       link=wmediumd,
                       wmediumd_mode=interference
                       )

    info("*** Creating nodes\n")
    h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', ip='10.0.0.1/8') #CN
    h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', ip='10.0.0.2/8') #DNS
    h3 = net.addHost('h3', cls=Host, mac='00:00:00:00:00:03', ip='10.0.0.3/8') #RVS
    s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
    s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
    s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
    ap1 = net.addAccessPoint('ap1', cls=OVSKernelAP, ssid='ap1-ssid', mode='g', channel='1',
                             position='37,70,0')
    ap2 = net.addAccessPoint('ap2', cls=OVSKernelAP, ssid='ap2-ssid', mode='g', channel='1',
                             position='70,70,0')
    ap3 = net.addAccessPoint('ap3', cls=OVSKernelAP, ssid='ap3-ssid', mode='g', channel='1',
                             position='103,70,0')
    sta1 = net.addStation('sta1', mac='00:00:00:00:00:04', ip='10.0.0.4/8', position='30,60,0')
   
    c0 = net.addController(name='c0', controller=RemoteController, 
                           ip='127.0.0.1',
                           protocol='tcp',
                           port=6653)

    info("*** Configuring propagation model\n")
    net.setPropagationModel(model="logDistance", exp=6)

    info("*** Configuring wifi nodes\n")
    net.configureWifiNodes()

    info("*** Associating and Creating links\n")
    net.addLink(s3, ap1)
    net.addLink(s3, ap2)
    net.addLink(s3, ap3)
    net.addLink(s3, s2)
    net.addLink(s2, s1)
    net.addLink(s1, h1)
    net.addLink(s1, h2)
    net.addLink(s1, h3)
    ap1sta1 = {'bw':80 }
    net.addLink(ap1, sta1, **ap1sta1)

    net.plotGraph(max_x=200, max_y=200)


    info("*** Starting network\n")
    net.build()
    c0.start()
    s1.start([])
    s2.start([c0])
    s3.start([c0])
    ap1.start([c0])
    ap2.start([c0])
    ap3.start([c0])

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

    info("*** Stopping network\n")
    net.stop()


if __name__ == '__main__':
    setLogLevel('info')
    topology(sys.argv)
-----------------------------------------code done --------------------------------


If you know anything, please response to this mail. 
Thanks for helping !


그림2.png

Ramon Fontes

unread,
May 13, 2022, 8:14:18 AM5/13/22
to jkkr, mininet-wifi-discuss
Dear,

In which controller is s1 connected?

jkkr

unread,
May 15, 2022, 7:45:44 PM5/15/22
to mininet-wifi-discuss
Dear Ramon.

I added the connection between controller and s1 as you said. That works!

Thank you : )

2022년 5월 13일 금요일 오후 9시 14분 18초 UTC+9에 ramonre...@gmail.com님이 작성:

112-資工B-陳彥宇

unread,
May 26, 2022, 8:29:15 AM5/26/22
to mininet-wifi-discuss
Dear jkkr.
I try to use your topology and i success create a topo, but i don't know what application should I activate in onos controller, would you please tell me what to do ?
Thank you

jkkr 在 2022年5月16日 星期一上午7:45:44 [UTC+8] 的信中寫道:

Rayan

unread,
May 26, 2022, 8:57:56 AM5/26/22
to mininet-wifi-discuss
Hi
The essential apps whaich I use in the ONOS controller are 
 org.onosproject.hostprovider         
 org.onosproject.lldpprovider       
 org.onosproject.openflow-base       
 org.onosproject.openflow   
org.onosproject.mobility
org.onosproject.fwd        
 org.onosproject.openflow-message     
 org.onosproject.ovsdb-base          
 org.onosproject.drivers.ovsdb      
 org.onosproject.influxdbmetrics   


you can activate any app using 
onos> app activate org.onosproject.$YOUR_APP_NAME
   

112-資工B-陳彥宇

unread,
May 26, 2022, 9:49:36 AM5/26/22
to mininet-wifi-discuss
Dear Rayan.
Thank you for your reply. Although I activate those app, it still have some problem that I can't resolve.
there is the screenshot for the ping unreachable, what should I do now?
mininet_wifi_problem.PNG
Rayan 在 2022年5月26日 星期四下午8:57:56 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages