NS-3的安装和实例运行
Installation libraries:
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev ia32-libs NetAnim wireshark python-pygoocanvas python-pygraphviz python-dev qt4-default p7zip-full bzr cmake mercurial git cvs python-kiwi python-gnome2 python-gnome2-desktop python-rsvg
sudo apt install build-essential autoconf automake libxmu-dev python-pygraphviz cvs mercurial bzr git cmake p7zip-full python-matplotlib python-tk python-dev python-kiwi python-gnome2 python-gnome2-desktop qt4-dev-tools qt4-qmake qt4-qmake qt4-default gnuplot-x11 wireshark
Download ns-allinone-3.xxx from nanam
Copy it in a folder(preferably the home folder, /home/folder_Name)
Execute these commands from the home folder
tar jxvf ns-allinone-3.xxx
cd ns-allinone-3.xxx
Execute this command for building ns3
./build.py –enable-examples –enable-tests
(u will wait a few minutes)
Run a simple example
cd ns-allinone-3.xxx/ns-3.xxx/
./waf –run hello-simulator
(u will see “hello simulator” in the terminal)
To run examples in ns3. All the files can be executed within a folder called ~ns-3.xxx/scratch/
U need to copy the .cc or .py files from the examples folder to the ~ns-3.xxx/scratch/
Once copied u can run the examples, using
cd ns-allinone-3.xxx/ns-3.xxx/
./waf –run scratch/file
(No extension for .cc files,就是说不要带后缀名)
./waf –pyrun scratch/file.py