|
1 | | -# OpenNet |
| 1 | +OpenNet |
| 2 | +======= |
2 | 3 | A simulator built on top of Mininet and ns-3 for Software-Defined Wireless Local Area Network (SDWLAN) |
3 | | -http://www.slideshare.net/rascov/20140824-open-net |
| 4 | +http://www.slideshare.net/rascov/20140824-open-net |
4 | 5 |
|
5 | | -## Feature |
| 6 | +Feature |
| 7 | +------- |
6 | 8 | * Complement ns-3 by supporting channel scan behavior on Wi-Fi station (sta-wifi-scan.patch) |
7 | 9 | * Show CsmaLink and SimpleLink in NetAnim (animation-interface.patch) |
8 | | -* Fix runtime error when access PacketMetadata of CsmaLink [Submitted] (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1787, "ns-3 bugzilla issue 1787") |
| 10 | +* Fix runtime error when access PacketMetadata of CsmaLink, [Submitted] (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1787, "ns-3 bugzilla issue 1787") |
9 | 11 |
|
10 | | -## Use OpenNet VM image |
11 | | -* OpenNet 1.1 VM image (Fedora 21) : [Download Link] (http://win.cs.nctu.edu.tw/opennet-1.1.zip) |
12 | | - - user: nctuopennet |
13 | | - - pw: nctuopennet |
| 12 | +Build OpenNet on your own - Use install.sh |
| 13 | +------------------------------------------ |
| 14 | +Support Ubuntu 14.04.1 |
14 | 15 |
|
15 | | -With this VM image, please following the instruction in the "Run OpenNet" section to start the simulation. |
16 | | -OpenNet and corresponding tools can be found under "/home/nctuopennet/workspace". |
| 16 | + $ sudo ./install.sh -a |
17 | 17 |
|
18 | | -The following commands can build the NetAnim in this VM. |
19 | | -Install packages: |
20 | | -<pre> |
21 | | -Ubuntu: |
22 | | -$ apt-get install qt4-dev-tools |
23 | | -Fedora: |
24 | | -$ sudo yum install mercurial qt4 qt4-devel qt-devel qt-config |
25 | | -</pre> |
26 | | -Build the NetAnim: |
27 | | -<pre> |
28 | | -$ cd /home/nctuopennet/workspace/ns-allinone-3.21/netanim-3.105. |
29 | | -$ qmake-qt4 NetAnim.pro (or qmake NetAnim.pro) |
30 | | -$ make |
31 | | -$ ./NetAnim |
32 | | -</pre> |
| 18 | +Run OpenNet |
| 19 | +----------- |
| 20 | +Before using OpenNet, you need to prepare SDN controller by yourself. |
| 21 | +Please try following commands to run the simulation: |
33 | 22 |
|
34 | | -## (RECOMMENDED)Build OpenNet on your own - Use install.sh |
| 23 | + $ sudo ./waf_shell.sh |
| 24 | + # cd $ROOT_PATH/mininet/examples/opennet |
| 25 | + # python wifiroaming.py |
35 | 26 |
|
36 | | -<pre> |
37 | | -./install.sh -a |
38 | | -</pre> |
| 27 | +Run NetAnim |
| 28 | +----------- |
| 29 | +Use NetAnim to open the XML file in the directory /tmp/xml. |
| 30 | +Click "Play Animation" button can start the animation. |
39 | 31 |
|
40 | | -* Support |
41 | | - * CentOS 7 |
42 | | - * Ubuntu 14.04.1 |
43 | | - * Fedora 21 |
| 32 | + $ cd $ROOT_PATH/ns-allinone-$NS3_VERSION/netanim-$NETANIM_VERSION |
| 33 | + $ ./NetAnim |
44 | 34 |
|
45 | | -## (NOT RECOMMENDED) Build OpenNet on your own - Step by step |
46 | | -### Prerequisite |
47 | | -1. Fedora 21 3.17.6-300.fc21.x86\_64 or Ubuntu 14.04.1 3.13.0-43-generic |
48 | | -2. Fetch [Mininet 2.2.0] (https://github.com/mininet/mininet "Mininet") |
49 | | -<pre> |
50 | | -$ git clone https://github.com/mininet/mininet.git |
51 | | -</pre> |
52 | | -3. Fetch [ns-3.22] (http://www.nsnam.org/ns-3-22 "ns-3.22") |
53 | | -<pre> |
54 | | -$ curl -O -k https://www.nsnam.org/release/ns-allinone-3.22.tar.bz2 |
55 | | -$ tar xf ns-allinone-3.22.tar.bz2 |
56 | | -</pre> |
57 | | -4. Install packages for ns-3.22 |
58 | | -<pre> |
59 | | -Fedora: |
60 | | -$ sudo yum install gcc gcc-c++ python python-devel |
61 | | -$ sudo yum install make cmake glibc-devel.i686 glibc-devel.x86\_64 |
62 | | -Ubuntu: |
63 | | -$ sudo apt-get install gcc g++ python python-dev |
64 | | -$ sudo apt-get install make cmake gcc-4.8-multilib g++-4.8-multilib |
65 | | -</pre> |
66 | | -5. Fetch and install [pygccxml] (http://sourceforge.net/projects/pygccxml/files/pygccxml/pygccxml-1.0/pygccxml-1.0.0.zip/download "pygccxml-1.0.0") |
67 | | -<pre> |
68 | | -$ unzip pygccxml-1.0.0.zip |
69 | | -$ cd pygccxml-1.0.0 |
70 | | -$ python setup.py build |
71 | | -$ sudo python setup.py install |
72 | | -</pre> |
73 | | -6. Install gccxml |
74 | | -<pre> |
75 | | -$ git clone https://github.com/gccxml/gccxml.git |
76 | | -$ cd gccxml |
77 | | -$ mkdir gccxml-build |
78 | | -$ cd gccxml-build |
79 | | -$ cmake ../ |
80 | | -$ make |
81 | | -$ sudo make install |
82 | | -$ sudo ln /usr/local/bin/gccxml /bin/gccxml |
83 | | -</pre> |
84 | | -7. Modify pygccxml parser configuration |
85 | | -<pre> |
86 | | -Fedora: |
87 | | -$ sudo sed -e "s/gccxml\_path=''/gccxml\_path='\/usr\/local\/bin'/" -i /usr/lib/python2.7/site-packages/pygccxml/parser/config.py |
88 | | -Ubuntu: |
89 | | -$ sudo sed -e "s/gccxml\_path=''/gccxml\_path='\/usr\/local\/bin'/" -i /usr/local/lib/python2.7/dist-packages/pygccxml/parser/config.py |
90 | | -</pre> |
| 35 | +Reference |
| 36 | +--------- |
| 37 | +* Link modeling using ns-3, [Link] (https://github.com/mininet/mininet/wiki/Link-modeling-using-ns-3 "Link modeling using ns-3") |
91 | 38 |
|
92 | | -### Install OpenNet |
93 | | -1. $mn: Directory of Mininet, $ns: Directory of ns-allinone-3.22, $on: Directory of OpenNet |
94 | | -2. Install, patch and rebuild Mininet |
95 | | -a. Install mininet |
96 | | -<pre> |
97 | | -$ cd $mn |
98 | | -$ git checkout tags/2.2.0 |
99 | | -$ sudo util/install.sh -fnpv |
100 | | -Fedora: |
101 | | -$ sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config |
102 | | -$ sudo systemctl stop firewalld.service |
103 | | -$ sudo systemctl disable firewalld.service |
104 | | -$ sudo setenforce 0 |
105 | | -$ sudo systemctl enable openvswitch.service |
106 | | -$ sudo systemctl start openvswitch.service |
107 | | -</pre> |
108 | | -b. Add ns3.py into mininet |
109 | | -<pre> |
110 | | -$ cp $on/mininet-patch/mininet/ns3.py $mn/mininet |
111 | | -</pre> |
112 | | -c. Replace mininet/node.py with the one in mininet-patch |
113 | | -<pre> |
114 | | -$ cp $on/mininet-patch/mininet/node.py $mn/mininet |
115 | | -</pre> |
116 | | -d. Add WiFi roaming simulation script to example |
117 | | -<pre> |
118 | | -$ cp $on/mininet-patch/examples/wifiroaming.py $mn/examples |
119 | | -</pre> |
120 | | -e. Rebuild Mininet |
121 | | -<pre> |
122 | | -$ sudo util/install.sh -n |
123 | | -</pre> |
124 | | - |
125 | | -3. Install, patch and Build ns-3 |
126 | | -a. Copy patches to the ns-3.22 folder |
127 | | -<pre> |
128 | | -$ cd $ns/ns-3.22 |
129 | | -`$ cp $on/ns3-patch/*.patch .` |
130 | | -</pre> |
131 | | -b. Apply patches |
132 | | -<pre> |
133 | | -$ patch -p1 < animation-interface.patch |
134 | | -$ patch -p1 < netanim-python.patch |
135 | | -$ patch -p1 < sta-wifi-scan.patch |
136 | | -</pre> |
137 | | -c. Patch the wscript for [issue] (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1990) about using ns-3.22 with Ubuntu |
138 | | -<pre> |
139 | | -$ sed -e "s/\['network'\]/\['internet', 'network', 'core'\]/" -i src/tap-bridge/wscript |
140 | | -</pre> |
141 | | -d. Configure ns-3 |
142 | | -<pre> |
143 | | -$ ./waf configure |
144 | | -Make sure |
145 | | -Python Bindings : enabled |
146 | | -Python API Scanning Support : enabled |
147 | | -</pre> |
148 | | -e. Scan python API |
149 | | -<pre> |
150 | | -$ ./waf --apiscan=netanim |
151 | | -$ ./waf --apiscan=wifi |
152 | | -</pre> |
153 | | -f. Build ns-3 |
154 | | -<pre> |
155 | | -$ ./waf build |
156 | | -</pre> |
157 | | - |
158 | | -## Run OpenNet |
159 | | -<pre> |
160 | | -Launch a controller at localhost:6633, |
161 | | -for example, a POX controller installed with Mininet can be running with: |
162 | | -$ sudo python pox.py forwarding.l2_learning |
163 | | - |
164 | | -$ cd $ns/ns-3.22 |
165 | | -$ sudo ./waf shell |
166 | | -$ cd $mn/examples |
167 | | -$ python wifiroaming.py |
168 | | -</pre> |
169 | | - |
170 | | -## Run NetAnim |
171 | | -<pre> |
172 | | -$ cd $ns/netanim-3.105 |
173 | | -$ ./NetAnim |
174 | | - |
175 | | -Use NetAnim to open the XML file in the directory /tmp/xml |
176 | | -Click "Play Animation" button can start the animation |
177 | | -</pre> |
178 | | - |
179 | | -## Reference |
180 | | -* Link modeling using ns-3 [Link] (https://github.com/mininet/mininet/wiki/Link-modeling-using-ns-3 "Link modeling using ns-3") |
0 commit comments