welcome to the ns2 world
Baiklah disini saya akan memulai
sharing tentang ns2, yang dimulai dengan proses intalasi..
ns2 bisa di instal di OS windows
maupun linux, akaan tetepi jika kita instal di windows kita perlu menyeting
environtment menjadi environtment lnux dengan menambahkan cigwin.
untuk instsalasi ns2 yang secara
langsung download dengan command : apt-get install ns2
maka package yang terdownload by
default adalah package yang terbaru yaitu versi 2.35
Selanjutnya jika kita membutuhkan
package yang versinya lebih lama maka kita perlu instal manual. Disini saya mencoba mendokumentasikan
apa yang telah saya lakukan setelah beberapa hari berjibaku untuk instal. Kami
butuh instalasi ns2 versi .31 karena akan mensimulasikan program HMIPv6.
kenapa harus ns2.31 ? karena
notabene source code + patchnya memang support pada versi tsb
langkah-langkah urutnya adlah sbb:
1. download source nya di link
http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.31/
ingat cari yang allinone dengan
ekstensi *.tar.gz
2. ekstrak dengan perintah :
#
tar -xzvf ns-allinone-2.31.tar.gz
atau dengan mengklik kanan di hasil
instalernya (biasanya saya memindahkan hasil download ke folder home/)
3. masuk ke folder hasil ekstrak
dengan command :
#
cd ns-allinone-2.31
4. instal dependensi yang dibutuhkan
dengan mengetikkan :
#
apt-get install build-essential autoconf automake libxmu-dev
5. lalu install :
# ./install
6. Jika jika muncul error
ld: libotcl.so: hidden
symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
solusinya adalah masuk ke folder otcl-1.13
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
solusinya adalah masuk ke folder otcl-1.13
lalu ganti configurasi SHLIB_LD="ld -shared" menjadi SHLIB_LD="gcc -shared" yang ada di Linux*) kemudian simpan, lalu ketikkan perintah
#
./install
7. Jika terdapat pesan seperti ini
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
tk8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
otcl: /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13
tclcl: /home/nurhay/Documents/ns-allinone-2.31/tclcl-1.19
ns: /home/nurhay/Documents/ns-allinone-2.31/ns-2.31/ns
nam: /home/nurhay/Documents/ns-allinone-2.31/nam-1.13/nam
gt-itm: /home/nurhay/Documents/ns-allinone-2.31/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns
----------------------------------------------------------------------------------
Please put /home/nurhay/Documents/ns-allinone-2.31/bin:/home/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/unix:/home/nurhay/Documents/ns-allinone-2.31/tk8.4.14/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13, /home/nurhay/Documents/ns-allinone-2.31/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/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/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.31; ./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.
nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$ ns
The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install ns2
nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
tk8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
otcl: /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13
tclcl: /home/nurhay/Documents/ns-allinone-2.31/tclcl-1.19
ns: /home/nurhay/Documents/ns-allinone-2.31/ns-2.31/ns
nam: /home/nurhay/Documents/ns-allinone-2.31/nam-1.13/nam
gt-itm: /home/nurhay/Documents/ns-allinone-2.31/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns
----------------------------------------------------------------------------------
Please put /home/nurhay/Documents/ns-allinone-2.31/bin:/home/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/unix:/home/nurhay/Documents/ns-allinone-2.31/tk8.4.14/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13, /home/nurhay/Documents/ns-allinone-2.31/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/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/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.31; ./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.
nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$ ns
The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install ns2
nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$
maka ubahlah ~/.bashrc dengan cara
sbb
#gedit
~/.bashrc
kemudian copy source code ini dengan catatan bahwa /your/path/ns-allinone-2.31 diganti dengan letak folder dmana anda menginstal misalnya /home/nuha/ns-allinone-2.31
kemudian copy source code ini dengan catatan bahwa /your/path/ns-allinone-2.31 diganti dengan letak folder dmana anda menginstal misalnya /home/nuha/ns-allinone-2.31
#LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LI B:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/your/path/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LI B:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/your/path/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
#
PATH
XGRAPH=/your/path/ns-allinone-2.31/bin:/your/path/ns-allinone-2.31/tcl8.4.14/unix:/your/path/ns-allinone-2.31/tk8.4.14/unix
NS=/your/path/ns-allinone-2.31/ns-2.31/
NAM=/your/path/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
XGRAPH=/your/path/ns-allinone-2.31/bin:/your/path/ns-allinone-2.31/tcl8.4.14/unix:/your/path/ns-allinone-2.31/tk8.4.14/unix
NS=/your/path/ns-allinone-2.31/ns-2.31/
NAM=/your/path/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
8. ketiikan untuk membuat
perubahan
# source ~/.bashrc
9. cek keberhasilan instalasi dengan
mengetikkan
#
ns
%
jika tanda % muncul maka instalasi
berhasil
jika perlu maka silahkan di validasi
# cd ns-2.31
./validate
jika perlu maka silahkan di validasi
# cd ns-2.31
./validate
depok 19 april 2013
referensi
http://www.edaboard.com/thread118830.html
http://alkautsarpens.wordpress.com/
http://ramakrishnamundugar.blogspot.com/2012/10/installing-ns-231-in-ubuntu-1204.html
http://webingineer.wordpress.com/2010/08/15/installing-network-simulator-2-on-debian-gnulinux/
0 komentar:
Posting Komentar