Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


OpenDayLight showing disconnected nodes after random topology generation in Mininet

asked 2017-03-30 10:26:46 -0800

AhmedAyman gravatar image

updated 2017-03-30 10:29:57 -0800

I wrote a python module to generate a random topology in Mininet and using Boron SR2 release as a remote controller. I observe inconsistent behavior from the controller side. Sometimes the correct topology is shown in the GUI, and other times it just shows disconnected switches. I clean Mininet between runs using:

sudo mn -c

During normal circumstances, the pingAll() command works perfectly and it is shown correctly in the OpenDayLight's GUI. When I run my module again, the pings fail totally (or pings correctly between only some hosts).

In the cases where the controller shows disconnected switches, I check the randomly generated topology from Mininet using links command, it shows that the switches and hosts are correctly connected.

I went to the extend to do the following between the module runs:

  • Clean Mininet using sudo mn -c
  • Shutting down the controller
  • Checking any processes running on ports 6633 & 6653 using sudo netstat -ap | grep :6633 & sudo netstat -ap | grep :6653 and killing them using sudo kill -9 <PID>
  • Starting up a clean controller using ./karaf clean
  • Installing the required features: feature:install odl-restconf odl-l2switch-switch odl-mdsal-apidocs odl-dlux-all odl-openflowplugin-flow-services-ui

Nonetheless, the strange behavior is still persistent. I do not understand why sometimes the controller fails (although Mininet shows correct connections). I read lots of issues posted and both documentations for OpendayLight and Mininet, but still cannot solve this problem.

The following is the python module I use for the topology creation and connecting the remote controller:

from scapy.all import *
from math import ceil
from mininet.topo import Topo
from import Mininet
from mininet.node import CPULimitedHost
from import TCLink
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.node import RemoteController
from mininet.log import setLogLevel, info
from mininet.cli import CLI
from random import randint
import random
import threading
import time
from multiprocessing import Process
import os
from HTTPTraffic import HTTPTraffic

def simpleTest():
    "Create and test a simple random network"

    net = Mininet( autoSetMacs = True )

    c0 = RemoteController( 'c0', ip='', port=6633 )

    # taking input number of hosts, switches, subnets, how many GW switches between edge subnets and core subnet
    hosts = raw_input("Enter number of HOSTS: ")
    switches = raw_input("Enter number of SWITCHES: ")
    R = raw_input("Enter REDUNDANCY CONSTANT: ")
    Subnets = raw_input("Enter number of SUBNETS: ")
    CorePercent = raw_input("Enter CORE SUBNET PERCENTAGE: ")

    s =int(switches)
    CorePercentInt = float(CorePercent)
    R_Int = int(R)
    SubnetsInt = int(Subnets)

    sCore = ceil(s * CorePercentInt)
    sGW = ceil(R_Int * (SubnetsInt-1))
    sEdge = s - sCore -sGW

    sCoreStr = str(sCore)
    sEdgeStr = str(sEdge)
    sGWStr = str(sGW)
    sCoreStr = str(sCore)

    sCoreInt = int(sCore)    
    sEdgeInt = int(sEdge)
    sGWInt = int(sGW)

    print ('Total number of switches: ' + switches )
    print ('Number of Core switches: ' + sCoreStr  )
    print ('Number of Edge switches: ' + sEdgeStr )

    # creating Core Switches and naming them
    for i in range (sCoreInt):
        net.addSwitch( 's%s' %(i+1))

    # creating Edge switches and naming them            
    for z in range (sEdgeInt):
        net.addSwitch( 's%s' %(z+1+sCoreInt))

    # creating GW switches and naming them

    for ...
edit retag flag offensive close merge delete


I am not sure if the whole question is visible, as the "more" button at the end is not responding from my side. Please let me know if you cannot see it fully either.

AhmedAyman ( 2017-03-31 02:29:39 -0800 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-31 04:23:23 -0800

AhmedAyman gravatar image

For now I found a patch solution. I killed any java processes between runs. This solved the problems but it is just a patch. I hope this is useful for anyone experiencing the same issue.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-03-30 10:26:46 -0800

Seen: 153 times

Last updated: Mar 31 '17