HOW TO INSTALL all of the module in ns3-all-in-one

About this problem, I write in my blog before. I just paste it directly. If I have the time, I will write in Eng version.

2015.12.10 真的時候到了要開始跑模擬了,但是發現之前的東西沒辦法把openflow編起來(崩潰),過了一年從Google搜到自己的ns3教學文結果也GG,真的是崩潰。

抓Bake

sudo apt-get install mercurial
cd
mkdir workspace
cd workspace 
hg clone http://code.nsnam.org/bake

設定路徑 在~/workspace/bake底下

export BAKE_HOME=`pwd`
export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib

抓ns-3 在~/workspace/bake底下

./bake.py configure -e ns-allinone-3.24
./bake.py check

check之後發現缺一堆東西,該裝的就裝一裝吧

sudo apt-get install g++ cvs bzr unrar p7zip-full cmake dh-autoreconf -y
./bake.py download
然後ns3的source code與他的快樂module們就抓好了

Build ns3 在~/bake/source/ns-3.24

ns-allinone-3.24裡面一堆module的source code,基本上要全部用waf用make用python編過才能用啊 在那之前先來裝個工具吧

而且還要再裝一堆tool才能編

sudo apt-get install python-dev libgtk2.0-dev libxml2-dev sqlite3 libsqlite3-dev valgrind gsl-bin doxygen gccxml python-pygccxml libgsl0-dev libboost-all-dev flex bison

PyViz的套件要裝不裝隨意

sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 python-gnome2-desktop-dev python-rsvg ipython

編module

編BRITE

在~/workspace/bake/source/BRITE底下 (https://www.nsnam.org/wiki/BRITE_integration_with_ns-3)
make

編Click

在~/workspace/bake/source/click-ns-3.20 (https://www.nsnam.org/docs/release/3.13/models/html/click.html)
 ./configure --enable-userlevel --disable-linuxmodule --enable-nsclick --enable-wifi
 make

編nsc

在~/workspace/bake/source/nsc-0.5.3/nsc
python scons.py -k

oooo

編OpenFlow

在 ~/workspace/bake/source/openflow-ns-3.17
./waf configure
./waf build

編pybindgen

直接用bake抓下來的ns-allinone-3.24裡面的pybindgen壞掉了不能直接編
要去抓另外一個ns-allinone-3.24裡面的檔案
隨便找個地方把檔案給解壓縮了然後把pybindgen拿出來用就好
wget http://www.nsnam.org/release/ns-allinone-3.24.tar.bz2
tar xjf ns-allinone-3.24.tar.bz2
裡面有pybindgen-0.17.0.post41+ngd10fa60我就把它搬進去我的bake底下的source裡面了
mv pybindgen-0.17.0.post41+ngd10fa60 ~/workspace/bake/source/
進去pybindgen-0.17.0.post41+ngd10fa60資料夾裡面
cd pybindgen-0.17.0.post41+ngd10fa60
開始編
./waf configure 
./waf

想知道用什麼參數請打./waf --help | less就可以瀏覽了,按q可以離開

切換到workspace/bake/source/ns-3.24底下開始裝套件囉

有要啟用視覺化套件

./waf --build-profile=debug --enable-examples --enable-tests --with-brite=../BRITE --with-nsclick=../click-ns-3.20 --with-openflow=../openflow-ns-3.17 --with-pybindgen=../pybindgen-0.17.0.post41+ngd10fa60 --enable-mpi --enable-sudo --with-nsc=../nsc-0.5.3 --visualize configure 

沒有要啟用視覺化套件

./waf --build-profile=debug --enable-examples --enable-tests --with-brite=../BRITE --with-nsclick=../click-ns-3.20 --with-openflow=../openflow-ns-3.17 --with-pybindgen=../pybindgen-0.17.0.post41+ngd10fa60 --enable-mpi --enable-sudo --with-nsc=../nsc-0.5.3 configure 

confiugre之後有一些header顯示no的那個我也不知道要怎麼處理啦,就遇到問題再說 了。

開始編檔案

./waf

大功告成辣

========= 2014.12.4 他奶奶的官方版本的step by step小錯誤一堆真的是很煩

稍微紀錄一下 先裝ns3 後裝openflow

以下可能有不work的地方 就sudo一下

env: linuxmint17 xfce

1.先把該升級的升一升吧

$sudo apt-get update

$sudo apt-get upgrade

  1. 裝套件 (強烈建議如果有選擇比較近的更新點最好都切回主要更新伺服器 不然應該是會遇到一大堆衝突) $ sudo apt-get install gcc g++ python gcc g++ python python-dev mercurial bzr gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison libfl-dev g++-3.4 gcc-4.4 tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra python-sphinx dia python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev libboost-signals-dev libboost-filesystem-dev openmpi*

  2. 抓ns3 有兩種方法 用mercurial抓 或者是用tar的 個人prefer用mercurial 但是因為之前裝的過程非常不順利所以兩個都有試過 結論就是都一樣

$mkdir ns3_repos

$cd ns3_repos

$hg clone http://code.nsnam.org/ns-3-allinone

  1. 下載奇怪的東西 我不知道他想幹嘛不過就聽他的吧 tarball法不會有 但是hg法會有 我想應該只是一些零碎的小檔

大概會多出一個什麼ns-3.21之類檔名的資料夾 裡面有很多重要的東西 包含waf

ns3_repos底下執行download.py 跑完之後

$sudo download.py

  1. build ns3 跑有點久 我看大概10分鐘有喔

$sudo ./build.py

  1. 裝waf 我也不知道他幹嘛用的

$sudo ./waf distclean $sudo ./waf configure $sudo ./waf build

  1. 測試一下有沒有裝起來

$sudo cp -rf ../ns-3.21/examples/tutorial/first.py scratch/first.py

$sudo ./waf --pyrun scratch/first.py

有裝好的話應該會看到一堆綠色的字的然後有'build' finished successfully藏在裡面

ns3裝好了 下面繼續裝openflow

  1. 在ns-3.21資料夾底下

$sudo hg clone http://code.nsnam.org/openflow $cd openflow

  1. 在openflow資料夾底下 設定一下

$sudo ./waf configure

$sudo ./waf build

  1. 回到ns-3.21資料夾底下 下面這是我的啦 openflow=的後面要接openflow的絕對路徑 用相對的也不知道會不會怎樣 不管啦 $sudo ./waf configure --enable-examples --enable-tests --with-openflow=/home/hmpai/ns3_repos/ns-allinone-3.21/oepnflow

  2. 最後一步 回到ns-3.21目錄底下 沒意外的話應該是裝好了

$sudo ./waf build

results matching ""

    No results matching ""