mininet / mininet

Emulator for rapid prototyping of Software Defined Networks

Home Page:https://mininet.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Floodlight is unable to recognize the switch and connect to Mininet

dat-adi opened this issue · comments

Describe the bug
Upon running the Floodlight controller, and attempting to connect it to a Mininet-wifi instance, there are failures as the FL controller is unable to recognize the switch provided in the Mininet instance despite explicit definition.

The CLI command for Mininet succeeds in integrating almost all of the time.
The CLI command for Mininet-wifi succeeds in integrating both 50% of the time.
The script defined to connect both fails 100% of the time.

CLI Command,

sudo mn --wifi --switch=ovsk,protocols=OpenFlow13 \
	--controller=remote,ip=10.0.2.7,port=6653

Script,

#!/usr/bin/python

from mininet.net import Mininet
from mininet.node import Controller, OVSKernelSwitch, RemoteController
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel, info

import subprocess

def emptyNet(controller_ip, controller_port):
	net = Mininet(controller=RemoteController, build=False)
	c1 = net.addController('c1', controller=RemoteController, link=TCLink, switch=OVSKernelSwitch, ip=controller_ip, port=controller_port)
	h1 = net.addHost('h1', ip='10.0.0.1')
	h2 = net.addHost('h1', ip='10.0.0.2')
	s1 = net.addSwitch('s1', protocols=["OpenFlow15"])

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

	net.build()
	c1.start()
	s1.start([c1])

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

def getControllerIP():
	guest_ip = subprocess.check_output("/sbin/ifconfig enp0s3 | grep 'inet' | cut -d: -f2 | awk '{print $2}'", shell=True)
	split_ip = guest_ip.decode('utf8').strip().split('.')
	return '.'.join(split_ip)

if __name__ == "__main__":
	setLogLevel('info')
	controller_ip = getControllerIP()
	emptyNet(controller_ip, 6653)

To Reproduce
Steps to reproduce the behavior:

  1. Copy the script into the local environment.
  2. Run the floodlight controller, and run the script using,
sudo python script.py
  1. Test the pingall command to see it fail, and check the logs of the FL controller.
  2. Notice that the switch is not recognized and a connection is not established.

Expected behavior
The mininet switch and the controller should be able to establish a connection with one another, and the pingall command should work successfully.

Screenshots
CLI-run mininet instance,
connection_by_cli

Script-run mininet instance,
connection_by_script
There has been no recognition of the switch, and it goes back to LLDP packet detection afterward.

Desktop:

Floodlight Version [master]
OS: [Lubuntu]
Mininet-Wifi VM

Additional context
I am currently attempting this in a Mininetwifi-VM, whose VM image can be found here.
Another issue that I faced which causes the 50% failure rate in Mininet-wifi is the following, I wonder if I should raise another issue for this or whether it relates to this issue.
image

This may not be an issue of the Mininet instance being at fault, but more of the station being unable to detect the AP that it's supposed to associate itself too. Closing this issue.