Mininet Host talking to the NCTUNS hosts


       Based on Mininet host talking to Internet and NCTUNS Distributed Network Emulator, this technical report was written. With combination of Mininet and NCTUNS, the Mininet host can talk to NCTUNNS host.



Mininet on VM1:

1.       Add an additional interface to the VM and set it to NAT.



2.           Bring up this additional interface, i.e. eth1 in my case.


3.          Prepare the following script (


from import Mininet

from mininet.node import Controller

from mininet.cli import CLI

from import Intf

from mininet.log import setLogLevel, info


def myNetwork():


    net = Mininet( topo=None,



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



    info( '*** Add switches\n')

    s1 = net.addSwitch('s1')

    Intf( 'eth1', node=s1 )


    info( '*** Add hosts\n')

    h1 = net.addHost('h1', ip='')


    info( '*** Add links\n')

    net.addLink(h1, s1)


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


    #h1.cmdPrint('dhclient '+h1.defaultIntf().name)




if __name__ == '__main__':

    setLogLevel( 'info' )




4.         Run the script.


5.       Open xterm for h1 and get a IP with dhclient command.



6.       We have to know the external IP address for eth1 interface. So I ping NCTUNS VM2 ip address from h1 and use wireshark to capture packets.

(on VM2)


(on VM1: ping


(on VM2: external ip is


7.       Create an emulation topology in NCTUNS.




Clock has to set as fast as the real-world clock.



8.       Do some settings on VM2.


9.       Set the route on VM1.



10.   Run the NCTUNS.


11.   On VM1: h1 ping (host 4 on NCTUNS) It works. (Mininet host can talk to the host on NCTUNS)


Dr. Chih-Heng Ke

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