Hello can you guide me to install NS2.29

537 views
Skip to first unread message

thành nguyễn trọng

unread,
Apr 24, 2023, 7:32:45 AM4/24/23
to Network Simulator 2 (NS2)
Hello sir
can you guide me to install NS2.29. Thank

knudfl

unread,
Apr 24, 2023, 9:37:44 AM4/24/23
to Network Simulator 2 (NS2)
Hi.

ns-2.29 install : Depends what the purpose is, some patches are for an old 32bit OS only.
Examples ......
6LoWPAN-for-ns229NIST.patch
6LoWPAN_ns229.patch
arq-Tx_ns229-files.tar.gz
byzantine-attacks_2_ns229.patch
cbrp-2007_ns229.patch
DSR-ocean_ns229.patch
DTRR-mmApp_ns229.patch
fastbroadcast_ns229.patch
fastbroadcast-ns229.patch.tar.gz
mannasim+nist+pmip6_ns229.patch.gz
mannasim-patched-ns229.tar.bz2
mmApp-DTRR-1_ns229.patch
nrlsensorsim_ns229.patch
NS-MIH-MULTI-CRITERIA-ns229.tar.bz2
OBAMP-ODMRP-3_ns229.patch
ODMRP_ns229.patch
Reverse-aodv_ns229.patch
RIMAC-0.0.2_ns229.patch
sip_r104-adds-to-r29__ns229.tar.gz
sip-svn.r29__ns229.patch
TCP-jersey-westwood_ns229.patch
TCP-jersey-westwood_ns229.tar.gz
zmac-drand_ns229.3.patch

thành nguyễn trọng

unread,
Apr 24, 2023, 11:01:50 AM4/24/23
to Network Simulator 2 (NS2)
To install reverse protocol AODV. reverse AODV support on ubuntu version 22.04??


Vào lúc 16:37:44 UTC+3 ngày Thứ Hai, 24 tháng 4, 2023, knudfl đã viết:
Message has been deleted
Message has been deleted

knudfl

unread,
Apr 24, 2023, 1:03:02 PM4/24/23
to Network Simulator 2 (NS2)
"RAODV", Ubuntu 22.04 ...... issue 2 : The 'Reverse-aodv_ns229.patch' was forgotten.

cd Downloads/
sudo apt install ./gcc41-c++_4.1.2-16_amd64.deb
https://drive.google.com/drive/folders/1xVEATaYAwqvseBzYxKDzJoZ4-Hc_XOJm?usp=share_link

Reverse AODV, the build .....
tar xvf ns-allinone-2.29.3.tar.gz
cd ns-allinone-2.29/
patch -p0 < ns229_gcc41.patch
https://drive.google.com/file/d/18r593CNXhgZw-obouuJwUYOqga9oAoTU/view?usp=sharing
patch -p0 < Reverse-aodv_ns229.patch
https://drive.google.com/file/d/0B7S255p3kFXNYjI0aVF4YXdWeDA/view?usp=sharing&resourcekey=0-XmOuW7xOvMrLLVlb-Bng0A

export CC=gcc41 CXX=g++41 && ./install
cd ns-2.29/
cp ns ns-Reverse-aodv
sudo cp ns-Reverse-aodv /usr/local/bin/
------- Simulation ex ------
ns-Reverse-aodv simulation.tcl
ns-Reverse-aodv R-aodv.tcl
https://drive.google.com/file/d/1ccWGMMLbDNkk2M8OCOh2zaSmifQuowHc/view?usp=share_link

-
Message has been deleted

thành nguyễn trọng

unread,
Apr 24, 2023, 1:52:17 PM4/24/23
to Network Simulator 2 (NS2)
hi sir
Is NS2.29 version with NS2.35 the same. Does Reverse AODV support on NS2.35?


Vào lúc 20:03:02 UTC+3 ngày Thứ Hai, 24 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 24, 2023, 2:36:07 PM4/24/23
to Network Simulator 2 (NS2)
?  "Is NS2.29 version with NS2.35 the same."?     What do you mean ??

You can have as many ns-allinone-2.xx as you want, installed at the same time  ....

"Does Reverse AODV support on NS2.35?"      No.  For good reasons there is only a patch for ns-2.29. The old code does not work with ns-2.35 .
Message has been deleted

thành nguyễn trọng

unread,
Apr 24, 2023, 4:10:55 PM4/24/23
to Network Simulator 2 (NS2)

hi sir
If I want to compare 3 protocols IDSAODV, RAODV, Blackhole AODV, all must be done on NS2.29?
How to install black hole AODV in NS2.29?

Vào lúc 21:36:07 UTC+3 ngày Thứ Hai, 24 tháng 4, 2023, knudfl đã viết:
Message has been deleted
Message has been deleted
Message has been deleted

knudfl

unread,
Apr 24, 2023, 8:47:40 PM4/24/23
to Network Simulator 2 (NS2)
You should avoid posting pictures of text. Pictures can be hard to read.
My comments : I guess you know how to copy-paste a text.
And :   Images with text will often not be read.
___________________________________________

"Checking for unistd.h" :        You are supposed to install the ns2 prerequisites !
sudo apt install g++ autoconf libtool libxmu-dev
( unistd.h is provided by the important libc6-dev which is installed when you do sudo apt install g++)

On Tuesday, April 25, 2023 at 1:36:58 AM UTC+2 nguyent...@gmail.com wrote:
when i use this command i get an error:   export CC=gcc41 CXX=g++41 && ./install  loi2.png

Vào lúc 02:22:11 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, thành nguyễn trọng đã viết:
i use ubuntu version 22.04

Vào lúc 02:06:21 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, thành nguyễn trọng đã viết:
hi sir
When I execute this command I get an error:  patch -p0 < ns229_gcc41.patch
lôi.png
Vào lúc 20:03:02 UTC+3 ngày Thứ Hai, 24 tháng 4, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
Apr 25, 2023, 4:23:34 AM4/25/23
to Network Simulator 2 (NS2)
hi Sir, I have 2 questions that I hope you can answer, the 1st question is an error running the command: export CC=gcc41 CXX=g++41 && ./install, The second question is how to install blackhole AODV, IDSADODV on NS2.29.

when i use this command i get an error:   export CC=gcc41 CXX=g++41 && ./install  
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29$ export CC=gcc41 CXX=g++41 && ./install
============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Build XGraph-12.1
============================================================
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) no
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... missing
checking if malloc debugging is wanted... no
checking for gcc... (cached) gcc41
checking whether the C compiler (gcc41  ) works... yes
checking whether the C compiler (gcc41  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc41 accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc41 -E
checking for X... (cached) libraries , headers
checking for dnet_ntoa in -ldnet... (cached) no
checking for dnet_ntoa in -ldnet_stub... (cached) no
checking for gethostbyname... (cached) yes
checking for connect... (cached) yes
checking for remove... (cached) yes
checking for shmat... (cached) yes
checking for IceConnectionNumber in -lICE... (cached) yes
checking for float.h... (cached) yes
checking for limits.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strcasecmp... (cached) yes
creating ./config.status
creating Makefile
creating autoconf.h
autoconf.h is unchanged
./install: 275: make: not found
Can not create xgraph; But xgraph is an optional package, continuing...
============================================================
* Build CWeb
============================================================
Making cweb
./install: 298: make: not found
cweb failed to make, but it's optional
chmod: cannot access 'cweave': No such file or directory
chmod: cannot access 'ctangle': No such file or directory
ln: failed to create symbolic link 'cweave': File exists
ln: failed to create symbolic link 'ctangle': File exists
============================================================
* Build Stanford GraphBase
============================================================
Making sgb
./install: 327: make: not found
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.2.3 with gcc41.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
./install: 384: make: not found
Zlib make failed, but it's optional Continue ...
============================================================
* Build tcl8.4.11
============================================================
./install: 404: make: not found
loading cache ./config.cache
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... (cached) gcc41
checking whether the C compiler (gcc41  ) works... yes
checking whether the C compiler (gcc41  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc41 accepts -g... (cached) yes
checking for building with threads... no (default)
checking if the compiler understands -pipe... yes
checking how to run the C preprocessor... (cached) gcc41 -pipe -E
checking for sin... (cached) no
checking for main in -lieee... (cached) no
checking for main in -linet... (cached) no
checking for net/errno.h... (cached) no
checking for connect... (cached) yes
checking for gethostbyname... (cached) yes
checking how to build libraries... static
checking for ranlib... (cached) ranlib
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking system version (for dynamic loading)... Linux-5.19.0-40-generic
checking for dlopen in -ldl... (cached) yes
checking for ar... (cached) ar
checking for build with symbols... no
checking for required early compiler flags... (cached) (cached)  _LARGEFILE64_SOURCE
checking for 64-bit integer type... (cached) using long
checking whether byte ordering is bigendian... (cached) no
checking for getcwd... (cached) yes
checking for opendir... (cached) yes
checking for strstr... (cached) yes
checking for strtol... (cached) yes
checking for strtoll... (cached) yes
checking for strtoull... (cached) yes
checking for tmpnam... (cached) yes
checking for waitpid... (cached) yes
checking for strerror... (cached) yes
checking for getwd... (cached) yes
checking for wait3... (cached) yes
checking for uname... (cached) yes
checking for realpath... (cached) yes
checking dirent.h... (cached) no
checking for errno.h... (cached) yes
checking for float.h... (cached) yes
checking for values.h... (cached) yes
checking for limits.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/wait.h... (cached) yes
checking for dlfcn.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for sys/modem.h... (cached) no
checking termios vs. termio vs. sgtty... (cached) termios
checking for fd_set in sys/types... (cached) yes
checking whether struct tm is in sys/time.h or time.h... (cached) time.h
checking for sys/time.h... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking for tm_zone in struct tm... (cached) yes
checking for gmtime_r... (cached) yes
checking for localtime_r... (cached) yes
checking tm_tzadj in struct tm... (cached) no
checking tm_gmtoff in struct tm... (cached) yes
checking long timezone variable... yes
checking for st_blksize in struct stat... (cached) yes
checking for fstatfs... (cached) yes
checking for 8-bit clean memcmp... (cached) yes
checking for memmove... (cached) yes
checking proper strstr implementation... yes
checking for strtoul... (cached) yes
checking for strtod... (cached) yes
checking for strtod... (cached) yes
checking for Solaris2.4/Tru64 strtod bugs... (cached) ok
checking for ANSI C header files... (cached) yes
checking for mode_t... (cached) yes
checking for pid_t... (cached) yes
checking for size_t... (cached) yes
checking for uid_t in sys/types.h... (cached) yes
checking for socklen_t... (cached) yes
checking for opendir... (cached) yes
checking union wait... (cached) no
checking for strncasecmp... (cached) yes
checking for BSDgettimeofday... (cached) no
checking for gettimeofday... (cached) yes
checking for gettimeofday declaration... (cached) present
checking whether char is unsigned... (cached) no
checking signed char declarations... (cached) yes
checking for a putenv() that copies the buffer... (cached) no
checking for langinfo.h... (cached) yes
checking whether to use nl_langinfo... yes
checking for sys/ioctl.h... (cached) yes
checking for sys/filio.h... (cached) no
checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... O_NONBLOCK
creating ./config.status
creating Makefile
creating dltest/Makefile
creating tclConfig.sh
./install: 410: make: not found
tcl8.4.11 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com
Vào lúc 02:36:58 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, thành nguyễn trọng đã viết:
when i use this command i get an error:   export CC=gcc41 CXX=g++41 && ./install  loi2.png

Vào lúc 02:22:11 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, thành nguyễn trọng đã viết:
i use ubuntu version 22.04

Vào lúc 02:06:21 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, thành nguyễn trọng đã viết:
hi sir
When I execute this command I get an error:  patch -p0 < ns229_gcc41.patch
lôi.png
Vào lúc 20:03:02 UTC+3 ngày Thứ Hai, 24 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 25, 2023, 5:29:43 AM4/25/23
to Network Simulator 2 (NS2)
make not found :           sudo apt install build-essential
_____________

About ReverseAODV + idsAODV + blackholeaodv2013 :
No conflicts with the (three) patches ..... A few edits, and a combined patch was made.
$ diff -Naur orig_ns-2.29/ ns-2.29/ > idsAODV+blackholeaodv+RAODV_ns229.patch )

The build is ................................................................
tar xvf ns-allinone-2.29.3.tar.gz
cd ns-allinone-2.29/
patch -p0 < idsAODV+blackholeaodv+RAODV_ns229.patch
https://drive.google.com/file/d/1ya7WEVBl3R26PdjTXRTRS_gzRfBTIUwL/view?usp=sharing


export CC=gcc41 CXX=g++41 && ./install
cd ns-2.29/
cp ns ns229-ids-black2013-RevAODV
sudo cp ns229-ids-black2013-RevAODV /usr/local/bin/
__________________

thành nguyễn trọng

unread,
Apr 25, 2023, 7:27:58 AM4/25/23
to Network Simulator 2 (NS2)
hi sir
Can NS2.29 use gcc-4.8 sir:
export CC=gcc-4.8 CXX=g++-4.8 && ./install

Vào lúc 12:29:43 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 25, 2023, 10:37:51 AM4/25/23
to Network Simulator 2 (NS2)
"Can NS2.29 use gcc-4.8" : No, not as is.
You have a perfectly OK compiler  "gcc41 / g++41", so what is the reason not to use it ? ?

The "2023" version  ns-allinone-2.29.3-2023.tar.xz   is meant for gcc, g++ version 4.8
......... will probably also work with the Ubuntu default g++48 install ?
( Works OK with the RPM version gcc48-c++-4.8.5-1.el6.x86_64.rpm ).

thành nguyễn trọng

unread,
Apr 29, 2023, 4:42:53 AM4/29/23
to Network Simulator 2 (NS2)
hi sir 
I execute this command:  patch -p0 < idsAODV+blackholeaodv+RAODV_ns229.patch
RAODV protocol folder doesn't appear, only blackholeAODV with IDSAODV
hope you help


thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29$ patch -p0 < idsAODV+blackholeaodv+RAODV_ns229.patch
patching file ns-2.29/aodv/aodv.cc
patching file ns-2.29/aodv/aodv.h
patching file ns-2.29/aodv/aodv_packet.h
patching file ns-2.29/aodv/aodv_rqueue.h
patching file ns-2.29/aodv/aodv_rtable.cc
patching file ns-2.29/aodv/aodv_rtable.h
patching file ns-2.29/blackholeaodv/blackholeaodv.cc
patching file ns-2.29/blackholeaodv/blackholeaodv.h
patching file ns-2.29/blackholeaodv/blackholeaodv_logs.cc
patching file ns-2.29/blackholeaodv/blackholeaodv_rqueue.cc
patching file ns-2.29/blackholeaodv/blackholeaodv_rqueue.h
patching file ns-2.29/blackholeaodv/blackholeaodv_rtable.cc
patching file ns-2.29/blackholeaodv/blackholeaodv_rtable.h
patching file ns-2.29/blackholeaodv/blackholeaodv.tcl
patching file ns-2.29/common/packet.h
patching file ns-2.29/idsaodv/idsaodv-1.tcl
patching file ns-2.29/idsaodv/idsaodv.cc
patching file ns-2.29/idsaodv/idsaodv.h
patching file ns-2.29/idsaodv/idsaodv_logs.cc
patching file ns-2.29/idsaodv/idsaodv_rqueue.cc
patching file ns-2.29/idsaodv/idsaodv_rqueue.h
patching file ns-2.29/idsaodv/idsaodv_rtable.cc
patching file ns-2.29/idsaodv/idsaodv_rtable.h
patching file ns-2.29/idsaodv/idsaodv_semih.cc
patching file ns-2.29/idsaodv/idsaodv.tcl
patching file ns-2.29/idsaodv/TextFile
patching file ns-2.29/linkstate/ls.h
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file ns-2.29/linkstate/ls.h.rej
patching file ns-2.29/Makefile.in
patching file ns-2.29/queue/priqueue.cc
patching file ns-2.29/tcl/lib/ns-agent.tcl
patching file ns-2.29/tcl/lib/ns-lib.tcl
patching file ns-2.29/tcl/lib/ns-mobilenode.tcl
patching file ns-2.29/tcl/lib/ns-packet.tcl
patching file ns-2.29/trace/cmu-trace.cc

Vào lúc 17:37:51 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, knudfl đã viết:
Message has been deleted

thành nguyễn trọng

unread,
Apr 29, 2023, 7:49:29 AM4/29/23
to Network Simulator 2 (NS2)
And I have 1 more question, when I execute this command:  export CC=gcc41 CXX=g++41 && ./install 
  I get the following error:

rm -f netview.o; @g++41 -o netview.o -c  -DTCL_TK  -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_11 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  -I. -I/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tclcl-1.17 -I/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/otcl-1.11 -I/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/include -I/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/include  netview.cc
/bin/sh: 1: @g++41: not found
make: *** [Makefile:84: netview.o] Error 127
Nam make failed! Continue ...
See http://www.isi.edu/nsnam/ns-problems.html for problems
ln: failed to create symbolic link 'ns': File exists
Please compile your nam separately.
Please compile your xgraph separately.
Please compile your gt-itm & sgb2ns separately.
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.11: /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/{bin,include,lib}
tk8.4.11: /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/{bin,include,lib}
otcl: /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/otcl-1.11
tclcl: /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tclcl-1.17
ns: /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29/ns

----------------------------------------------------------------------------------

Please put /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/bin:/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tcl8.4.11/unix:/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tk8.4.11/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/otcl-1.11, /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/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 <paths>
    If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tcl8.4.11/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.11
    and tk8.4.11. They are now installed under /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/{bin,include,lib}

After these steps, you can now run the ns validation suite with
cd ns-2.29; ./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.

Vào lúc 17:37:51 UTC+3 ngày Thứ Ba, 25 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 29, 2023, 8:24:26 AM4/29/23
to Network Simulator 2 (NS2)
ns-2.29 : You are not supposed to build or to use the old nam-1.11
I guess you already have a nam from a ns-allinone-2.35 build.

?? Why are you showing the text ... "Please put .... ,,   IMPORTANT NOTICES: You MUST put .."
which says :   The old year ~1999 text ....  The text about setting a *PATH should be ignored.

-

thành nguyễn trọng

unread,
Apr 29, 2023, 9:54:29 AM4/29/23
to Network Simulator 2 (NS2)
hi sir
What is the text of the *PATH setting that should be omitted sir?
example is to use: sudo cp ns-black /usr/local/bin/ ? rather than ./install?
I have a second question: when I run this command:

cd ns-allinone-2.29/
patch -p0 < idsAODV+blackholeaodv+RAODV_ns229.patch
https://drive.google.com/file/d/1ya7WEVBl3R26PdjTXRTRS_gzRfBTIUwL/view
Reverse AODV protocol directory is not created, only blackholeAODV and IDAODV protocol directory is created
Vào lúc 15:24:26 UTC+3 ngày Thứ Bảy, 29 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 29, 2023, 2:11:37 PM4/29/23
to Network Simulator 2 (NS2)
Please see your post from 1:49 PM (6 hours ago) with the text to be ignored :
"(1) You MUST put /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/otcl-1.11, /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/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 <paths>
    If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/tcl8.4.11/library into your TCL_LIBRARY environmental
I still wonder why you show this old text, and then you are asking for a solution ?
-----------------
About Reverse aodv : The patch is a text file with code, please read the file to know that RAODV-Reverse-aodv is editing ns-2.29/aodv code :  I.e. lines starting with a + is the new code. No extra directory "ns-2.29/[XXaodv]/ is added.
-

thành nguyễn trọng

unread,
Apr 29, 2023, 7:13:02 PM4/29/23
to Network Simulator 2 (NS2)
1. Hi sir, when I run this command I get the following error ((I followed your instructions above on simulating and comparing 3 protocols RAODV, IDSAODV and blackholeAODV) : 

thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29$ cd ns-2.29/
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29$ cp ns ns229-ids-black2013-RevAODV
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29$ sudo cp ns229-ids-black2013-RevAODV /usr/local/bin/
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29$ ns
ns229-ids-black2013-RevAODV  nsenter                      nslookup                     nstat                        nsupdate
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29$ ns
ns229-ids-black2013-RevAODV  nsenter                      nslookup                     nstat                        nsupdate
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/ns-2.29$ ns229-ids-black2013-RevAODV
ns:
[code omitted because of length]
: missing close-brace
    while executing
"Simulator instproc create-wireless-node args {
$self instvar routingAgent_ wiredRouting_ propInstance_ llType_ \
macType_ ifqType_ ifqlen_ phyType_ ch..."


2. May I ask one more question, RAODV is edited directly on the original AODV, so it means that the original AODV protocol has been changed and cannot simulate the original AODV
Vào lúc 21:11:37 UTC+3 ngày Thứ Bảy, 29 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 29, 2023, 7:57:07 PM4/29/23
to Network Simulator 2 (NS2)
1.
[code omitted because of length] :   Could be caused by reusing an ns-2.29 with some other added code.
I.e.  the error most often happens with too much surplus options added to tcl/lib/ns-default.tcl .
.... Besides that, it can be caused by using a virtual-machine ....
.... about this subject.

2. ".... means that the original AODV protocol has been changed and cannot simulate the original AODV."
May be. But you are supposed to have an ns-2.35 executable "ns235-orig" and maybe an ns-2.29 "ns229-orig" for testing / comparing simulations. I have ~300 ns2 builds on one OS, so I guess you can have a few.
( https://drive.google.com/file/d/1y5Bf5jkhHONmOUiAAigwsoICc7IAREuv/view?usp=share_link )

thành nguyễn trọng

unread,
Apr 30, 2023, 4:20:15 AM4/30/23
to Network Simulator 2 (NS2)
hi sir, when i run again i get this error, please help.

thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29/ns-2.29$ ns229-ids-black2013-RevAODV
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
    /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/lib/tcl8.4 /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 /usr/local/library /usr/library /usr/tcl8.4.11/library /tcl8.4.11/library /home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/lib/tcl8.4

This probably means that Tcl wasn't installed properly.

Vào lúc 02:57:07 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 30, 2023, 6:33:46 AM4/30/23
to Network Simulator 2 (NS2)
"Can't find a usable init.tcl"
........ ? This seems to be the build directory ? :
/home/thanhca/Downloads/ns-allinone-2.29.3/ns-allinone-2.29/lib/tcl8.4

.......... You are not supposed to move away ns-allinone-2.29/{ lib/{libtcl*, tclConfig.sh, tcl8*/}, bin/tcsh8* }
from the build location.
ns-allinone-2.29/{lib/{libtcl*, tclConfig.sh, tcl8*/}, bin/tcsh8*}  matters.
Everything else can be deleted.

Solution:
 Move things back in place, or do a new build in "default" = /home/thanhca/ns2/raodv/ns-allinone-2.29/
Message has been deleted
Message has been deleted

thành nguyễn trọng

unread,
Apr 30, 2023, 7:14:12 AM4/30/23
to Network Simulator 2 (NS2)
Hi sir, can you give me an example of a tcl file of the RAODV protocol, (NS2.29)
Is it the same as the tcl file of the IDSAODV protocol?


Vào lúc 13:33:46 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
Apr 30, 2023, 7:31:14 AM4/30/23
to Network Simulator 2 (NS2)
hi sir, How to solve this error?

thanhca@thanhca-virtual-machine:~/ns-allinone-2.29/ns-2.29$ cp ns ns-Reverse-aodv
thanhca@thanhca-virtual-machine:~/ns-allinone-2.29/ns-2.29$ sudo cp ns-Reverse-aodv /usr/local/bin/
[sudo] password for thanhca:
cp: cannot create regular file '/usr/local/bin/': Not a directory
thanhca@thanhca-virtual-machine:~/ns-allinone-2.29/ns-2.29$ ^C
thanhca@thanhca-virtual-machine:~/ns-allinone-2.29/ns-2.29$

Vào lúc 14:14:12 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, thành nguyễn trọng đã viết:

knudfl

unread,
Apr 30, 2023, 9:22:02 AM4/30/23
to Network Simulator 2 (NS2)
"sudo cp ns-Reverse-aodv /usr/local/bin/" :
You have done this command at least one time before .....
Your text doesn't show what's going on,  so just keep trying till things are working again.

-

thành nguyễn trọng

unread,
Apr 30, 2023, 10:31:43 AM4/30/23
to Network Simulator 2 (NS2)
I have installed many times 3 protocols ReverseAODV+IDSAODV+BlackholeAODV on NS2.29 but still get the following error. I tried to fix the error but it didn't work. Please help and show me how to fix the error



thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29$ cd ns-2.29/
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29/ns-2.29$ cp ns ns229-ids-black2013-RevAODV
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29/ns-2.29$ sudo cp ns229-ids-black2013-RevAODV /usr/local/bin/
[sudo] password for thanhca:
                  
Thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.29/ns-2.29$ ns229-ids-black2013-RevAODV
ns:
[code omitted because of length]
: missing close-brace
    while executing
"Simulator instproc create-wireless-node args {
$self instvar routingAgent_ wiredRouting_ propInstance_ llType_ \
macType_ ifqType_ ifqlen_ phyType_ ch..."

Vào lúc 16:22:02 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
Apr 30, 2023, 4:43:47 PM4/30/23
to Network Simulator 2 (NS2)
Hi sir, can you guide me to simulate reverse AODV and blackholeAODV in NS2.29 in ubuntu 22.04, thank sir


Vào lúc 17:31:43 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, thành nguyễn trọng đã viết:

knudfl

unread,
Apr 30, 2023, 4:55:04 PM4/30/23
to Network Simulator 2 (NS2)
" [code omitted because of length]
: missing close-brace " :   Sorry, there was really a missing " } " in the patch, in tcl/lib/ns-lib.tcl ,
so no build errors, and I didn't test sufficiently that day.

New patch → OK, Ubuntu 22.04 → " RevAODV-idsAODV-blackholeaodv_ns229-2.patch "

thành nguyễn trọng

unread,
May 1, 2023, 6:16:09 AM5/1/23
to Network Simulator 2 (NS2)
Previously my sendest tool used normally (I use version NS2.35), but now when I use it, I get an error that I have to install NS2. Please help
thanhca@thanhca-virtual-machine:~/Downloads/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest$ setdest -v2 -n 9 -s 1 -m 10.0 -M 100.0 -t 100 -P 1 -p 2.0 -x 1000 -y 1000 > scen0000000
Command 'setdest' not found, but can be installed with:
sudo apt install ns2

Vào lúc 23:55:04 UTC+3 ngày Chủ Nhật, 30 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
May 1, 2023, 7:43:38 AM5/1/23
to Network Simulator 2 (NS2)
"..........ns-2.35/indep-utils/cmu-scen-gen/setdest$ setdest" : The command is  ./setdest
...... when 'setdest' is not in a system path.
Examples,  "Install" setdest to a system path:     
                      cd indep-utils/cmu-scen-gen/setdest/
                      sudo cp setdest /usr/local/bin/
.... then it's simply
cd ns-2.35/
sudo make install
Message has been deleted

thành nguyễn trọng

unread,
May 1, 2023, 4:29:50 PM5/1/23
to Network Simulator 2 (NS2)
hi sir, when i do RAODV+blackholeAODV protocol emulation I get the following error. Please help
The patch file I used is yours: RevAODV-idsAODV-blackholeaodv_ns229-2.patch (https://drive.google.com/file/d/19jJu-G5Wq3vl5ufju4Vf04a5gg53OqGN/view?usp=share_link)
error:

num_nodes is set 20
Creating nodes...
INITIALIZE THE LIST xListHead

    (_o3 cmd line 1)
    invoked from within
"_o3 cmd create-blackholeaodv-agent _o411"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o3" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$self create-blackholeaodv-agent $node"
    ("blackholeAODV" arm line 2)
    invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
    (procedure "_o3" line 11)
    (Simulator create-wireless-node line 11)
    invoked from within
"_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o3" line 23)
    (Simulator node line 23)
    invoked from within
"$ns_ node"
    ("for" body line 2)
    invoked from within
"for {set i $val(nnaodv)} {$i < $val(nn)} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;#disable random motion
$ns_ at 0.01 "$nod..."
    (file "bhAODV.tcl" line 57)

Vào lúc 14:43:38 UTC+3 ngày Thứ Hai, 1 tháng 5, 2023, knudfl đã viết:

knudfl

unread,
May 2, 2023, 5:23:52 AM5/2/23
to Network Simulator 2 (NS2)
RAODV_blackholeAODV.tcl

Editing / testing for an hour and a half, I think this works .. can't say for now what did the trick.
$ ns229-ids-black2013-RevAODV 1-RAODV_blackholeAODV.tcl.txt
https://drive.google.com/file/d/1puHXnyE65J_zGcm2tqrLsCWnBxmggqhN/view?usp=share_link

1. I used random scene files cbr-20, scen-20
2. The simulation runs till the trace file is 1.6 GB
Message has been deleted

knudfl

unread,
May 2, 2023, 7:25:30 AM5/2/23
to Network Simulator 2 (NS2)
Sorry, the uploaded version was with $ns_ node-config -adhocRouting blackholeAODV commented out.

knudfl

unread,
May 2, 2023, 7:32:05 AM5/2/23
to Network Simulator 2 (NS2)
May be a primitive version will work with "Reverse aodv"

thành nguyễn trọng

unread,
May 2, 2023, 3:50:05 PM5/2/23
to Network Simulator 2 (NS2)
hi sir
  Does that mean it is possible to install this Reverse AODV protocol with blackholeAODV on this same NS2.35 primitive?


Vào lúc 14:32:05 UTC+3 ngày Thứ Ba, 2 tháng 5, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
May 2, 2023, 4:04:03 PM5/2/23
to Network Simulator 2 (NS2)
hi sir
-Does that mean it is possible to install this Reverse AODV protocol with blackholeAODV on this same NS2.35 primitive?
-Blackhole AODV protocol can work on normal NS2.35 version, but when combined with Reverse AODV I don't know if it works sir?

Vào lúc 22:50:05 UTC+3 ngày Thứ Ba, 2 tháng 5, 2023, thành nguyễn trọng đã viết:

knudfl

unread,
May 2, 2023, 5:54:26 PM5/2/23
to Network Simulator 2 (NS2)
What we know for now, is that Reverse AODV is for ns-2.29 only.
The other protocols, blackhole / malicious and ids may be added to the "ns-2.29 with Reverse AODV". Maybe.

I will have a look at that the next days.
A "blackhole" like the Mohit Tahiliani code can be added to any ns2 version.
Similar code has existed with the name "malicious" for many years.
-

thành nguyễn trọng

unread,
May 2, 2023, 6:11:45 PM5/2/23
to Network Simulator 2 (NS2)
Yes, please help, I am comparing Reverse AODV routing protocols with IDSAODV in black hole attack. Thank you so much

Vào lúc 00:54:26 UTC+3 ngày Thứ Tư, 3 tháng 5, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
May 10, 2023, 4:07:21 PM5/10/23
to Network Simulator 2 (NS2)
Dear Sir,
Have you found a way to simulate Reverse AODV protocol with BlackholeAODV in NS2. Thank you very much, hope you can help

Vào lúc 01:11:45 UTC+3 ngày Thứ Tư, 3 tháng 5, 2023, thành nguyễn trọng đã viết:

knudfl

unread,
May 12, 2023, 7:35:14 AM5/12/23
to Network Simulator 2 (NS2)
Sorry , I got sick ....... may be a solution in a few days ?

Actually you could be able to combine code yourself
Reverse-aodv_ns229.patch
blackhole-MohitTahiliani__ns235.patch
idsAODV-for-M-blackholeaodv_ns235.patch

thành nguyễn trọng

unread,
May 15, 2023, 5:10:32 AM5/15/23
to Network Simulator 2 (NS2)
Dear Sir. Yes, please help.
I want to compare IDSAODV and Reverse AODV protocol in black hole attack (Blackhole AODV), but Reverse AODV and BlackholeAODV cannot run on Ns2.29.
Is it possible to create a separate folder for the Reverse AODV protocol without having to edit the AODV root folder?

Vào lúc 14:35:14 UTC+3 ngày Thứ Sáu, 12 tháng 5, 2023, knudfl đã viết:

thành nguyễn trọng

unread,
May 19, 2023, 4:55:28 AM5/19/23
to Network Simulator 2 (NS2)
hello sir, can you help me?

Vào lúc 14:35:14 UTC+3 ngày Thứ Sáu, 12 tháng 5, 2023, knudfl đã viết:
Reply all
Reply to author
Forward
0 new messages