NS3官网:http://www.nsnam.org/
click下载:https://github.com/kohler/click
NS3讨论小组:https://groups.google.com/forum/#!forum/ns-3-users 最好翻墙看
NS3安装具体可以参考:http://www.nsnam.org/docs/release/3.17/tutorial/singlehtml/index.html
NS3安装预先设置Ubuntu环境:
1 |
./bulid.py check |
缺什么安装什么 apt-get install g++ 等等等…
下面这些你可以参考注释安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
sudo apt-get install build-essential sudo apt-get install gcc g++ python python-dev //C++和python安装,必装 sudo apt-get install mercurial //NS3代码维护使用的源码版本控制管理系统 sudo apt-get install bzr //运行python绑定ns-3-dev需要bazaar这个组件 sudo apt-get install libgtk2.0-0 libgtk2.0-dev //基于GTK的配置系统 sudo apt-get install gdb valgrind //调试工具 sudo apt-get install doxygen graphviz imagemagick //文档生成器 sudo apt-get install texlive texlive-pdf texlive-latex-extra //文档生成器,从源代码中生成说明文档 sudo apt-get install texinfo dia texlive-extra-utils texi2html //ns-3手册和tutorial编写查看工具 sudo apt-get install flex bison //仿真必需的词法分析器和语法分析生成器,必装 sudo apt-get install libgoocanvas-dev //部分移动场景仿真的可视化测试需要这个组件 sudo apt-get install tcpdump //读取pcap的packet traces,即包嗅探器 sudo apt-get install sqlite sqlite3 libsqlite3-dev //支持统计特性的数据库软件 sudo apt-get install libxml2 //xml的配置存储软件 sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas //Gustavo's ns-3-pyviz的可视化软件 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
Checking for 'gcc' (c compiler) : /usr/bin/gcc Checking for 'g++' (c++ compiler) : /usr/bin/g++ Checking for compilation flag -Wl,--soname=foo... support : ok Checking for program python : /usr/bin/python Checking for python version : (2, 7, 3, 'final', 0) Checking for library python2.7 in LIBDIR : yes Checking for program /usr/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python-config Checking for header Python.h : yes Checking for compilation flag -fvisibility=hidden... support : ok Checking for compilation flag -Wno-array-bounds... support : ok Checking for pybindgen location : ../pybindgen-0.16.0.825 (given) Python module pybindgen : ok Checking for pybindgen version : 0.16.0.825 Checking for types uint64_t and unsigned long equivalence : no Checking for types uint64_t and unsigned long long equivalence : yes Checking for the apidefs that can be used for Python bindings : gcc-ILP32 Checking for internal GCC cxxabi : complete Python module pygccxml : not found Checking boost includes : not found Checking boost includes : not found Checking for click location : not found Checking for program pkg-config : /usr/bin/pkg-config Checking for 'gtk+-2.0' >= 2.12 : yes Checking for 'libxml-2.0' >= 2.7 : not found Checking for type uint128_t : not found Checking for type __uint128_t : not found Checking high precision time implementation : cairo 128-bit integer Checking for header stdint.h : yes Checking for header inttypes.h : yes Checking for header sys/inttypes.h : not found Checking for header sys/types.h : yes Checking for header sys/stat.h : yes Checking for header dirent.h : yes Checking for header stdlib.h : yes Checking for header signal.h : yes Checking for header pthread.h : yes Checking for header stdint.h : yes Checking for header inttypes.h : yes Checking for header sys/inttypes.h : not found Checking for library rt : yes Checking for header netpacket/packet.h : yes Checking for header sys/ioctl.h : yes Checking for header net/if.h : yes Checking for header linux/if_tun.h : yes Checking for header netpacket/packet.h : yes Checking for NSC location : not found Checking for 'sqlite3' : yes Checking for header linux/if_tun.h : yes Python module gtk : ok Python module goocanvas : not found Python module pygraphviz : not found Checking for program sudo : /usr/bin/sudo Checking for program valgrind : /usr/bin/valgrind Checking for 'gsl' : not found Checking for compilation flag -Wno-error=deprecated-d... support : ok Checking for compilation flag -Wno-error=deprecated-d... support : ok Checking for compilation flag -fstrict-aliasing... support : ok Checking for compilation flag -fstrict-aliasing... support : ok Checking for compilation flag -Wstrict-aliasing... support : ok Checking for compilation flag -Wstrict-aliasing... support : ok Checking for program doxygen |
click部分
进入click目录,例如我的:进入NS的目录,例如我的是 /usr/src/click
1 2 |
./configure --enable-userlevel --disable-linuxmodule --enable-nsclick make |
NS3部分
进入NS的目录,例如我的是 /usr/src/ns-allinone-3.17/ns-3.17 (下面第一行参数中注意click的目录)
1 2 |
./waf configure --enable-examples --with-nsclick=/usr/src/click ./waf build |
完成可以运行check检查是否成功
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
./waf check Waf: Entering directory `/usr/src/ns-allinone-3.17/ns-3.17/build' Waf: Leaving directory `/usr/src/ns-allinone-3.17/ns-3.17/build' 0 of 0 tests passed (0 passed, 0 skipped, 0 failed, 0 crashed, 0 valgrind errors ) *** Note: ns-3 tests are currently disabled. Enable them by adding *** "--enable-tests" to ./waf configure or modifying your .ns3rc file. 'check' finished successfully (2.932s) Modules built: antenna aodv applications bridge buildings click config-store core csma csma-layout dsdv dsr emu energy fd-net-device flow-monitor internet lte mesh mobility mpi netanim (no Python) network nix-vector-routing olsr point-to-point point-to-point-layout propagation spectrum stats tap-bridge test (no Python) tools topology-read uan virtual-net-device wifi wimax Modules not built (see ns-3 tutorial for explanation): brite openflow visualizer |