How to run in OpenNet?



 Please refer to,, and for more information.



1. Please follow the instructions of "Use OpenNet VM image" to download the OpenNet 1.1 VM image.


2. Start the OpenNet VM.


3. Input "nctuopennet" for password. a terminal to download the qt4 and qt4-devel to compile netansim. (Please refer to for more information)



5. Open another terminal to start a pox controller for packet forwarding and then run OpenNet.



6. Open another terminal to run NetAnim


click the open file button.


choose the wifi-wired-bridged4.xml.


Then it shows core dumped.


7. How to solve the above problem? I referred to!topic/ns-3-users/cWwz-zK8MLs. Then modify the to




This example shows how to create an empty Mininet object

(without a topology object) and add nodes to it manually.


import sys

import os



import mininet.node

import mininet.cli

import mininet.log

import mininet.ns3


from import Mininet, MininetWithControlNet

from mininet.node import Controller, RemoteController

from mininet.cli import CLI

from mininet.log import setLogLevel, info                     

from mininet.ns3 import *       


import ns.core


import ns.wifi

import ns.csma

import ns.wimax

import ns.uan

import ns.netanim


nodes = [ { 'name': 'h1', 'type': 'host', 'ip': '', 'position': (0.0, 10.0, 0.0), 'velocity': (2.5, 0, 0) },

           { 'name': 'h2', 'type': 'host', 'ip': '', 'mobility': setListPositionAllocate(



             createListPositionAllocate(x1=150,y1=30,z1=0)) },

          { 'name': 's1', 'type': 'switch', 'position': (0.0, 0.0, 0.0) },

          { 'name': 's2', 'type': 'switch', 'position': (120.0, 0.0, 0.0) },

          { 'name': 's3', 'type': 'switch', 'position': (60.0, 60.0*(3**0.5), 0.0) },

          { 'name': 's4', 'type': 'switch', 'position': (60.0, -60.0*(3**0.5), 0.0) },

          { 'name': 's5', 'type': 'switch', 'position': (-120.0, 0.0, 0.0) },

          { 'name': 's6', 'type': 'switch', 'position': (-60.0, 60.0*(3**0.5), 0.0) },

          { 'name': 's7', 'type': 'switch', 'position': (-60.0, -60.0*(3**0.5), 0.0) },



wifiintfs = [ {'nodename': 'h1', 'type': 'sta', 'channel': 1, 'ssid': 'ssid'},

              {'nodename': 'h2', 'type': 'sta', 'channel': 11, 'ssid': 'ssid'},

              {'nodename': 's1', 'type': 'ap', 'channel': 1, 'ssid': 'ssid'},

              {'nodename': 's2', 'type': 'ap', 'channel': 6, 'ssid': 'ssid'},

              {'nodename': 's3', 'type': 'ap', 'channel': 11, 'ssid': 'ssid'},

              {'nodename': 's4', 'type': 'ap', 'channel': 11, 'ssid': 'ssid'},

              {'nodename': 's5', 'type': 'ap', 'channel': 6, 'ssid': 'ssid'},

              {'nodename': 's6', 'type': 'ap', 'channel': 11, 'ssid': 'ssid'},

              {'nodename': 's7', 'type': 'ap', 'channel': 11, 'ssid': 'ssid'},



csmalinks = [ {'nodename1': 's1', 'nodename2': 's2'},

              {'nodename1': 's1', 'nodename2': 's3'},

              {'nodename1': 's1', 'nodename2': 's4'},

              {'nodename1': 's1', 'nodename2': 's5'},

              {'nodename1': 's1', 'nodename2': 's6'},

              {'nodename1': 's1', 'nodename2': 's7'},



def getWifiNode( wifinode, name ):

    for n in wifinode:   

        if == name:

            return n

    return None


def WifiNet():


    "Create an Wifi network and add nodes to it."


    net = Mininet()


    info( '*** Adding controller\n' )

    net.addController( 'c0', controller=RemoteController, ip='', port=6633 )


    wifi = WifiSegment(standard = ns.wifi.WIFI_PHY_STANDARD_80211g)

    wifinodes = []


    for n in nodes:

        nodename = n.get('name', None)

        nodetype = n.get('type', None)

        nodemob = n.get('mobility', None)

        nodepos = n.get('position', None)

        nodevel = n.get('velocity', None)

        nodeip = n.get('ip', None)

        if nodetype is 'host':

            addfunc = net.addHost

            color = (255, 0, 0)

        elif nodetype is 'switch':

            addfunc = net.addSwitch

            color = (0, 0, 255)


            addfunc = None

        if nodename is None or addfunc is None:


        node = addfunc (nodename, ip=nodeip)

        mininet.ns3.setMobilityModel (node, nodemob)

        if nodepos is not None:

            mininet.ns3.setPosition (node, nodepos[0], nodepos[1], nodepos[2])

        if nodevel is not None:

            mininet.ns3.setVelocity (node, nodevel[0], nodevel[1], nodevel[2])

        wifinodes.append (node)

        #anim.UpdateNodeDescription (node.nsNode, nodename+'-'+str(node.nsNode.GetId()))

        #anim.UpdateNodeColor (node.nsNode, color[0], color[1], color[2])


    for wi in wifiintfs:

        winodename = wi.get('nodename', None)

        witype = wi.get('type', None)

        wichannel = wi.get('channel', None)

        wissid = wi.get('ssid', None)

        wiip = wi.get('ip', None)

        if witype is 'sta':

            addfunc = wifi.addSta

        elif witype is 'ap':

            addfunc = wifi.addAp


            addfunc = None

        if winodename is None or addfunc is None or wichannel is None:


        node = getWifiNode (wifinodes, winodename)

        tb = addfunc (node, wichannel, wissid)


    for cl in csmalinks:

        clnodename1 = cl.get('nodename1', None) 

        clnodename2 = cl.get('nodename2', None)

        if clnodename1 is None or clnodename2 is None:


        clnode1 = getWifiNode (wifinodes, clnodename1)

        clnode2 = getWifiNode (wifinodes, clnodename2)

        if clnode1 is None or clnode2 is None:


        CSMALink( clnode1, clnode2, DataRate="100Mbps")


    rv = os.path.isdir("/tmp/pcap")

    if rv is False:





    rv = os.path.isdir("/tmp/xml")

    if rv is False:


    anim = ns.netanim.AnimationInterface("/tmp/xml/wifi-wired-bridged4.xml")

    anim.EnablePacketMetadata (True)


    info( '*** Starting network\n' )




    info( 'Testing network connectivity\n' )

    wifinodes[0].cmdPrint( 'ping -c 3' )


    CLI( net )


    info( '*** Stopping network\n' )


    info( '*** mininet.ns3.stop()\n' )


    info( '*** mininet.ns3.clear()\n' )


    info( '*** net.stop()\n' )     


if __name__ == '__main__':

    setLogLevel( 'info' )




Then re-run the and NetAnim.



Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan