Mininet-WiFi Installation Under Ubuntu



Mininet-WiFi is a fork of Mininet (http://mininet.org/) which allows the using of both WiFi Stations and Access Points. Mininet-WiFi only add wifi features and you can work with it like you were working with Mininet.

1 Installation

The installation of Mininet-WiFi is quiet easy under Ubuntu System. Only a few steps is needed.

step 1: $ sudo apt-get install git
step 2: $ git clone https://github.com/intrig-unicamp/mininet-wifi
step 3: $ cd mininet-wifi
step 4: $ sudo util/install.sh -Wnfvl

If the installation is success, using the command "sudo mn --wifi" can start it.

2 Getting started

2.1 Using CLI (command line)

 Just a simple command:
                                  sudo mn --wifi
If you see this, congratulations!
 


If starting the Mininet-WiFi fails, don't worry, please try the following constructions.

  • If it says that "Please shut down the controller which is running on port 6653", just kill the process by using  "sudo kill XXXX". (XXXX is the pid, which is 1115 in the example below.

  • Follow the official manual, stop the network-manager service.
                                   sudo service network-manager stop
  • Try clean up the cache.
    sudo mn -c

2.2 Using Python API

Mininet-WiFi provides Python API which is very convenient. If you know some basics about Python, go ahead!
In this post, you will see how to create a basic network via Python.
The code is as follow, which is part of the official examples.

#!/usr/bin/python

'Example for Start'

from mininet.net import Mininet
from mininet.node import Controller, OVSKernelAP
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel

def topology():

    "Create a network."
    net = Mininet(controller=Controller, link=TCLink, accessPoint=OVSKernelAP)

    print "*** Creating nodes"
    sta1 = net.addStation('sta1', mac='00:00:00:00:00:02', ip='10.0.0.2/8')
    sta2 = net.addStation('sta2', mac='00:00:00:00:00:03', ip='10.0.0.3/8')
    ap1 = net.addAccessPoint('ap1', ssid='ssid-ap1', mode='g', channel='1', position='15,30,0')
    ap2 = net.addAccessPoint('ap2', ssid='ssid-ap2', mode='g', channel='6', position='55,30,0')
    c1 = net.addController('c1', controller=Controller)

    print "*** Configuring wifi nodes"
    net.configureWifiNodes()

    print "*** Creating links"
    net.addLink(ap1, ap2)
    net.addLink(ap1, sta1)
    net.addLink(ap1, sta2)

    print "*** Starting network"
    net.build()
    c1.start()
    ap1.start([c1])
    ap2.start([c1])

    print "*** Running CLI"
    CLI(net)

    print "*** Stopping network"
    net.stop()

if __name__ == '__main__':
    setLogLevel('info')
    topology()

Running this code, you will get in the CLI in the last, and you can do some extra operations to it. More operations about Mininet-WiFi, please pay attention to my future posts.

Comments

  1. This is a really good blog wish more people would read this, you offer some really good suggestions on business wifi installation.Thanks for sharing!

    ReplyDelete

Post a Comment

Popular posts from this blog

How to install Adroid Studio on Window 10