1.前期Ubuntu14.0.4上面进行以下安装
apt-get install gcc g++ python
apt-get install gcc g++ python python-dev
apt-get install qt4-dev-tools
apt-get install mercurial
apt-get install bzr
apt-get install cmake libc6-dev libc6-dev-i386 g++-multilib
apt-get install gdb valgrind
apt-get install gsl-bin libgsl0-dev libgsl0ldbl
apt-get install flex bison libfl-dev
apt-get install tcpdump
apt-get install sqlite sqlite3 libsqlite3-dev
apt-get install libxml2 libxml2-dev
apt-get install libgtk2.0-0 libgtk2.0-dev
apt-get install vtun lxc
apt-get install uncrustify
apt-get install doxygen graphviz imagemagick
apt-get install texlive texlive-extra-utils texlive-latex-extra
apt-get install python-sphinx dia
apt-get install python-pygraphviz python-kiwipython-pygoocanvas libgoocanvas-dev
apt-get install libboost-signals-dev libboost-filesystem-dev
apt-get install openmpi-bin openmpi-common openmpi-doclibopenmpi-dev
2.选用简单方式tarball方式安装
cd
mkdir tarballs
cd tarballs
wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
tar xjf ns-allinone-3.22.tar.bz2
3.
cd ns-allinone-3.22
./build.py
. 4.到ns-3.22 目录下执行:
./waf -d optimized configure;
./waf --enable-sudo configure
./waf configure --enable-examples --enable-tests
./waf build 时间比较长
./test.py 时间长
5.运行自带的AODV 协议
在ns-3.22目录下执行
./waf –run aodv
之后系统仿真输出结果:
Creating 10 nodes 100 mapart.
Starting simulation for 10 s...
PING 10.0.0.10 56(84) bytes of data.
64 bytes from 10.0.0.10:icmp_seq=0 ttl=56 time=176 ms
64 bytes from 10.0.0.10:icmp_seq=1 ttl=56 time=7 ms
64 bytes from 10.0.0.10:icmp_seq=2 ttl=56 time=7 ms
64 bytes from 10.0.0.10:icmp_seq=3 ttl=56 time=7 ms
--- 10.0.0.10 ping statistics---
10 packets transmitted, 4received, 60% packet loss, time 9999ms
rtt min/avg/max/mdev =7/49.25/176/84.5 ms
成功安装ns-3.22