2.建立New Virtual Machine,用“ubuntu-8.04.1-desktop-i386.iso”安装Ubuntu8.04;(Ubuntu8.04可到http://www.ubuntu.org.cn/products/GetUbuntu下载)。
3.建立VM tools。
4.升级Ubuntu8.04。
5.下载ns-allinone-2.33.tar.gz。(下载地址http://downloads.sourceforge.net/nsnam/ns-allinone-2.33.tar.gz?modtime=1206990403&big_mirror=0)。
6.复制“ns-allinone-2.33.tar.gz”到 /home/”your username”。
7.安装NS2
8.进入终端:输入sudo -i切换到root账号。
apt-get install build-essential
(for gcc and some essential)
apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
(for tcl and tk)
apt-get install libxmu-dev
(for nam)
9.cd /home/”your username”
tar xvfz ns-allinone-2.33.tar.gz
(解压 ns-allinone-2.33.tar.gz)
10.cd ns-allinone-2.33.tar.gz
./install
(安装 ns-allinone-2.33)
11.Wait a while。你将会看到如下信息!
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.18: /home/tnt/ns-allinone-2.33/{bin,include,lib}
tk8.4.18: /home/tnt/ns-allinone-2.33/{bin,include,lib}
otcl: /home/tnt/ns-allinone-2.33/otcl-1.13
tclcl: /home/tnt/ns-allinone-2.33/tclcl-1.19
ns: /home/tnt/ns-allinone-2.33/ns-2.33/ns
nam: /home/tnt/ns-allinone-2.33/nam-1.13/nam
xgraph: /home/tnt/ns-allinone-2.33/xgraph-12.1
gt-itm: /home/tnt/ns-allinone-2.33/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns
Please put /home/tnt/ns-allinone-2.33/bin:/home/tnt/ns-allinone2.33/tcl8.4.18/unix:/home/tnt/ns-allinone-2.33/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/tnt/ns-allinone-2.33/otcl-1.13, /home/tnt/ns-allinone-2.33/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=
(2) You MUST put /home/tnt/ns-allinone-2.33/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.
After these steps, you can now run the ns validation suite with
cd ns-2.33; ./validate
For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.
12.cd ..
gedit .bashrc
在文件最后编辑如下信息
export PATH=$PATH:/home/”your username”/ns-allinone-2.33/bin:/home/”your username”/ns-allinone-2.33/tcl8.4.18/unix:/home/”your username”/ns-allinone-2.33/tk8.4.18/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/”your username”/ns-allinone-2.33/otcl-1.13:/home/”your username”/ns-allinone-2.33/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/”your username”/ns-allinone-2.33/tcl8.4.18/library
13.现在你可以log-out Ubuntu以便重载环境变量。
14.验证NS2。进入终端输入cd /ns-allinone-2.33/ns-2.33,./validate(这可能会花一段时间)。
验证结束你将会看到如下信息:
These messages are NOT errors and can be ignored:
warning: using backward compatibility mode
This test is not implemented in backward compatibility mode
validate overall report: all tests passed
15. sudo apt-get install gawk
(for gawk)
16. sudo apt-get install gnuplot
(for gnuplot)
17.结束。
wally 于 2008-08-01 17:31:02发表:
关键是 怎么用 呵呵 ns还是挺难学的