Ubuntu下NS-3的安装

来源:互联网 发布:win8网络连接受限制 编辑:程序博客网 时间:2024/05/16 08:17

网上查了很多资料,大抵都是从原版的wiki页http://www.nsnam.org/wiki/index.php/Installation翻译过来的,总体概括起来,安装过程分为以下几部分。

1. 准备工作

需在命令行执行以下操作:

  • minimal requirements for Python (release): This is the minimal set of packages needed to work with Python bindings from a released tarball.
 sudo apt-get install gcc g++ python python-dev
  • Mercurial is needed to work with ns-3 development repositories.
 sudo apt-get install mercurial
  • Running python bindings from the ns-3 development tree (ns-3-dev) requires bazaar
 sudo apt-get install bzr
  • Debugging:
 sudo apt-get install gdb valgrind 
  • GNU Scientific Library (GSL) support for more accurate WiFi error models
 sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
  • The Network Simulation Cradle (nsc) requires the flex lexical analyzer and bison parser generator:
 sudo apt-get install flex bison libfl-dev
  • To install gcc-3.4 for some Network Simulation Cradle (nsc) stacks:
 sudo apt-get install g++-3.4 gcc-3.4
  • To read pcap packet traces
sudo apt-get install tcpdump
  • Database support for statistics framework
sudo apt-get install sqlite sqlite3 libsqlite3-dev
  • Xml-based version of the config store (requires libxml2 >= version 2.7)
sudo apt-get install libxml2 libxml2-dev
  • A GTK-based configuration system
 sudo apt-get install libgtk2.0-0 libgtk2.0-dev
  • To experiment with virtual machines and ns-3
 sudo apt-get install vtun lxc
  • Support for utils/check-style.py code style check program
sudo apt-get install uncrustify
  • Doxygen and related inline documentation:
 sudo apt-get install doxygen graphviz imagemagick sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
  • The ns-3 manual and tutorial are written in reStructuredText for Sphinx (doc/tutorial, doc/manual, doc/models), and figures typically in dia:
 sudo apt-get install python-sphinx dia 

Note: Sphinx version >= 1.12 required for ns-3.15. To check your version, type "sphinx-build". To fetch this package alone, outside of the Ubuntu package system, try "sudo easy_install -U Sphinx".

  • Support for Gustavo Carneiro's ns-3-pyviz visualizer
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
  • Support for openflow module (requires some boost libraries)
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
  • Support for MPI-based distributed emulation
sudo apt-get install openmpi*

2. 下载安装NS-3

第一次可以使用build.py脚本

cd

mkdir repos

cd repos

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

./download.py

./build.py

想要自己配置,则需要使用waf

./waf -d debug --enable-sudo --enable-tests --enable-examples configure

./waf

3. 测试

./test.py