Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ryu not picking up "addLink" event after topology startup #175

Open
Peachmann opened this issue Nov 16, 2022 · 1 comment
Open

Ryu not picking up "addLink" event after topology startup #175

Peachmann opened this issue Nov 16, 2022 · 1 comment

Comments

@Peachmann
Copy link

I'm trying to modify the topology during runtime, adding new switches and links on the fly. I use the gui_topology.py app to monitor the current topology (with --observe-links). If I add and connect switches before net.start() it shows correctly.

If I add a switch and start it up it shows correctly.
If I try to link it, the event is not caught by EventLinkAdd, and not shown.
If I query the current links (nodes, links etc.) in mininet CLI, everything seems to be correct and working (I can ping the new switch, works).

Tried:
Link status up/down, adding links from mininet CLI, removing/readding, adding flows to working links etc.

Simple demonstration below:

from mininet.topo import Topo
from mininet.net import Mininet
from mininet.log import setLogLevel
from mininet.cli import CLI

class TwoSwitchTopo(Topo):

    def build(self):
        s1 = self.addSwitch('s1')
        s2 = self.addSwitch('s2')

        h1 = self.addHost('h1', mac="00:00:00:00:11:11", ip="192.168.1.1/24")
        h2 = self.addHost('h2', mac="00:00:00:00:11:12", ip="192.168.1.2/24")

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

if __name__ == '__main__':
    setLogLevel('info')
    topo = TwoSwitchTopo()
    c1 = RemoteController('c1')
    net = Mininet(topo=topo, controller=c1)
    net.start()

    #sleep(5)
    print("Topology is up, adding new switch and link")

    s3 = net.addSwitch('s3')
    net.addLink(net.getNodeByName('s1'), s3)
    s3.start([c1])

    CLI(net)
    net.stop()

Result:
image

@JimCSuen
Copy link

Hi, I just come up with the same problem.

I solve it by adding the parameter "--observe-links" when I launch my RYU-controller python file, just like what you do when you want to show links on the RYU_GUI_Topology. Finally the EventLinkAdd could be caught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants