歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Fedora 13下NS2.34安裝指南

Fedora 13下NS2.34安裝指南

日期:2017/2/28 15:55:02   编辑:Linux教程

最近在做網絡協議研究,需要用到網絡仿真器NS2,於是在Linux系統(Fedora 13)上安裝之,相對Windows系統安裝比較簡單,但是過程中可能會遇到些小麻煩,先總結如下:

(一)下載NS的安裝包,因為是菜鳥,入門選手,也許門還沒入!所以我們那個實驗書上推薦一次安裝全部套件,一套安裝下來好像要占用個200~300M的磁盤空間。到這個網站下載最新NS-allinone套件,我現在的最新套件是 ns-allinone-2.33 , 壓縮包下載下來也有50M左右。

(二)配置系統環境。其實也不算配置,只是安裝幾個依賴包,沒有這幾個依賴包,我保證你100%不能把NS安裝好。要安裝依賴保,只需執行下面的命令。

#yum install gcc-c++
#yum install libX11-devel
#yum install xorg-x11-proto-devel
#yum install libXt-devel

上面是主程序的編譯環境和依賴包,下面這條命令是nam的依賴包,當然如果你用數據就可以分析一個模擬網絡,你可以NB的不安裝!

#yum install libXmu-devel

(三)正式安裝NS套件。思路: 隨便進一個你的家目錄下,解壓套件的壓縮包,軟後執行安裝命令,最後配置相應的環境變量。(假定我是安裝在/home/mozhu/Public目錄下的)

進入Public目錄:
#cd /home/mozhu/Public

解壓縮安裝包:
#tar xvzf ns-allinone-2.33.tar.gz

進入解壓縮後的文件夾:
#cd/home/mozhu/Public/ns-allinone-2.33

執行裡面的一個安裝文件,系統就自動安裝所有的東西了:
#./install

安裝完之後(得花個大幾分鐘的編譯時間吧),會出現一些信息。如下:

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.18: /home/mozhu/Public/ns-allinone-2.33/{bin,include,lib}
tk8.4.18: /home/mozhu/Public/ns-allinone-2.33/{bin,include,lib}
otcl: /home/mozhu/Public/ns-allinone-2.33/otcl-1.13
tclcl: /home/mozhu/Public/ns-allinone-2.33/tclcl-1.19
ns: /home/mozhu/Public/ns-allinone-2.33/ns-2.33/ns
nam: /home/mozhu/Public/ns-allinone-2.33/nam-1.13/nam
xgraph: /home/mozhu/Public/ns-allinone-2.33/xgraph-12.1
gt-itm: /home/mozhu/Public/ns-allinone-2.33/itm, edriver, sgb2alt, sgb2ns,sgb2comns, sgb2hierns

Please put /home/mozhu/Public/ns-allinone-2.33/bin:/home/mozhu/Public/ns-allinone-2.33/tcl8.4.18/unix:/home/mozhu/Public/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/mozhu/Public/ns-allinone-2.33/otcl-1.13,/home/mozhu/Public/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/mozhu/Public/ns-allinone-2.33/tcl8.4.18/library intoyour 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.htmlAlso search the ns mailing list archive
for related posts.

Copyright © Linux教程網 All Rights Reserved