Skip to content

A Simulator for Software-Defined Wireless Local Area Network

License

Notifications You must be signed in to change notification settings

EliseuTorres/OpenNet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenNet

A simulator built on top of Mininet and ns-3 for Software-Defined Wireless Local Area Network (SDWLAN)
http://www.slideshare.net/rascov/20140824-open-net

Feature

  • Complement ns-3 by supporting channel scan behavior on Wi-Fi station (sta-wifi-scan.patch)
  • Show CsmaLink and SimpleLink in NetAnim (animation-interface.patch)
  • Fix runtime error when access PacketMetadata of CsmaLink [Submitted] (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1787, "ns-3 bugzilla issue 1787")

Use OpenNet VM image

With this VM image, please following the instruction in the "Run OpenNet" section to start the simulation.
OpenNet and corresponding tools can be found under "/home/nctuopennet/workspace".

Build OpenNet on your own - Use install.sh

./install.sh -a
  • Support
    • CentOS 7
    • Ubuntu 14.04.1
    • Fedora 21

(NOT RECOMMENDED) Build OpenNet on your own - Step by step

Prerequisite

  1. Fedora 21 3.17.6-300.fc21.x86_64 or Ubuntu 14.04.1 3.13.0-43-generic
  2. Fetch [Mininet 2.2.0] (https://github.com/mininet/mininet "Mininet")
$ git clone https://github.com/mininet/mininet.git
  1. Fetch [ns-3.22] (http://www.nsnam.org/ns-3-22 "ns-3.22")
$ curl -O -k https://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
$ tar xf ns-allinone-3.22.tar.bz2
  1. Install packages for ns-3.22
Fedora:
$ sudo yum install gcc gcc-c++ python python-devel
$ sudo yum install make cmake glibc-devel.i686 glibc-devel.x86\_64
Ubuntu:
$ sudo apt-get install gcc g++ python python-dev
$ sudo apt-get install make cmake gcc-4.8-multilib g++-4.8-multilib
  1. Fetch and install [pygccxml] (http://sourceforge.net/projects/pygccxml/files/pygccxml/pygccxml-1.0/pygccxml-1.0.0.zip/download "pygccxml-1.0.0")
$ unzip pygccxml-1.0.0.zip
$ cd pygccxml-1.0.0
$ python setup.py build
$ sudo python setup.py install
  1. Install gccxml
$ git clone https://github.com/gccxml/gccxml.git
$ cd gccxml
$ mkdir gccxml-build
$ cd gccxml-build
$ cmake ../
$ make
$ sudo make install
$ sudo ln /usr/local/bin/gccxml /bin/gccxml
  1. Modify pygccxml parser configuration
Fedora:
$ sudo sed -e "s/gccxml\_path=''/gccxml\_path='\/usr\/local\/bin'/" -i /usr/lib/python2.7/site-packages/pygccxml/parser/config.py
Ubuntu:
$ sudo sed -e "s/gccxml\_path=''/gccxml\_path='\/usr\/local\/bin'/" -i /usr/local/lib/python2.7/dist-packages/pygccxml/parser/config.py

Install OpenNet

  1. $mn: Directory of Mininet, $ns: Directory of ns-allinone-3.22, $on: Directory of OpenNet
  2. Install, patch and rebuild Mininet
    a. Install mininet
$ cd $mn
$ git checkout tags/2.2.0
$ sudo util/install.sh -fnpv
Fedora:
$ sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
$ sudo systemctl stop firewalld.service
$ sudo systemctl disable firewalld.service
$ sudo setenforce 0
$ sudo systemctl enable openvswitch.service
$ sudo systemctl start openvswitch.service

b. Add ns3.py into mininet

$ cp $on/mininet-patch/mininet/ns3.py $mn/mininet

c. Replace mininet/node.py with the one in mininet-patch

$ cp $on/mininet-patch/mininet/node.py $mn/mininet

d. Add WiFi roaming simulation script to example

$ cp $on/mininet-patch/examples/wifiroaming.py $mn/examples

e. Rebuild Mininet

$ sudo util/install.sh -n
  1. Install, patch and Build ns-3
    a. Copy patches to the ns-3.22 folder
$ cd $ns/ns-3.22
`$ cp $on/ns3-patch/*.patch .`

b. Apply patches

$ patch -p1 < animation-interface.patch
$ patch -p1 < netanim-python.patch
$ patch -p1 < sta-wifi-scan.patch

c. Patch the wscript for [issue] (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1990) about using ns-3.22 with Ubuntu

$ sed -e "s/\['network'\]/\['internet', 'network', 'core'\]/" -i src/tap-bridge/wscript

d. Configure ns-3

$ ./waf configure
Make sure
Python Bindings               : enabled
Python API Scanning Support   : enabled

e. Scan python API

$ ./waf --apiscan=netanim
$ ./waf --apiscan=wifi

f. Build ns-3

$ ./waf build

Run OpenNet

Launch a controller at localhost:6633,
for example, a POX controller installed with Mininet can be running with:
$ sudo python pox.py forwarding.l2_learning

$ cd $ns/ns-3.22
$ sudo ./waf shell
$ cd $mn/examples
$ python wifiroaming.py

Run NetAnim

$ cd $ns/netanim-3.105
$ ./NetAnim

Use NetAnim to open the XML file in the directory /tmp/xml
Click "Play Animation" button can start the animation

Reference

About

A Simulator for Software-Defined Wireless Local Area Network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 62.2%
  • Shell 37.8%