Establish my Network Simulator 2 on Ubuntu

It always take me a long to build even a little teeny tiny thing on Linux. All too often is the README obscure for me to follow and get exactly what I ever need. But it is not a case any more as long as I manager to find out the right item in sources.list for the package I want. The steps are simple as follows.

1. Before proceeding to install NS2 and its packages, please ensure that you have already installed gcc, gdb, g++, and make.
    sudo apt-get install build-essentials
    * I spent a lot of time on finding the sources for build-essentials and finally :
                deb http://fr.archive.ubuntu.com/ubuntu gutsy main
2. TCL / TK

mkdir ns2install
cd ns2install

sudo su

apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev stow

ln -s /usr/include/tcl8.4 /usr/include/tk8.4

ln -s /usr/include/tcl8.4/tcl-private/generic/* /usr/include/tcl8.4/

ln -s /usr/lib/tcl8.4/http2.4 /usr/lib/tcl8.4/http2.3

echo “/usr/local/lib” >> /etc/ld.so.conf

Sources.list  :  I find lots of campus list on http://wiki.ubuntu.org.cn

3. Download all the components required


wget http://jaist.dl.sourceforge.net/sourceforge/otcl-tclcl/otcl-src-1.12.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/otcl-tclcl/tclcl-src-1.18.tar.gz
wget http://jaist.dl.sourceforge.net/sourceforge/nsnam/ns-src-2.30.tar.gz
wget http://jaist.dl.sourceforge.net/sourceforge/nsnam/nam-src-1.12.tar.gz


4. Install  otcl

tar -xzvf otcl-1.12.tar.gz
cd otcl-1.12
./configure --prefix=/usr/local/stow/otcl-1.12 --with-tk=/usr
make
mkdir -p /usr/local/stow/otcl-1.12/bin
mkdir -p /usr/local/stow/otcl-1.12/lib
mkdir -p /usr/local/stow/otcl-1.12/include
make install
cd /usr/local/stow/
stow otcl-1.12
ldconfig

4. Install  tctcl

tar -xzvf tclcl-src-1.18.tar.gz
cd tclcl-1.18
./configure --prefix=/usr/local/stow/tclcl-1.18 --with-tk=/usr
make
mkdir -p /usr/local/stow/tclcl-1.18/include
mkdir -p /usr/local/stow/tclcl-1.18/bin
mkdir -p /usr/local/stow/tclcl-1.18/lib
make install
cd /usr/local/stow/
stow tclcl-1.18
ldconfig

5. Installing NS


tar -xzvf ns-src-2.30.tar.gz
cd ns-2.30
./configure –prefix=/usr/local/stow/ns-2.30 –with-tk=/usr
make
make test
mkdir -p /usr/local/stow/ns-2.30/bin
mkdir -p /usr/local/stow/ns-2.30/man/man1
make install
cd /usr/local/stow
stow ns-2.30

6.  Install NAM

apt-get install libxmu-dev

tar -xzvf nam-src-1.12.tar.gz
cd nam-1.12
./configure –prefix=/usr/local/stow/nam-1.12 –with-tk=/usr
make
mkdir -p /usr/local/stow/nam-1.12/bin
make install
cd /usr/local/stow
stow nam-1.12

apt-get install perl-tk xgraph graphviz

Thats all …. NS2 is done …..you can now start with the tutorials

1. http://www.isi.edu/nsnam/ns/tutorial

2. http://nile.wpi.edu/NS/

3. http://del.icio.us/thesandeep/AdHoc

An Example to test NS-2.30 on your system

download a simple file from here

and open a terminal, type

ns ns-simple.tcl

then the NAM (Network animator) automatically opens up.

(COURTESY: http://wiki.splitbrain.org/ns2 )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值