LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-21-2017, 08:38 AM   #1
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Rep: Reputation: Disabled
Unhappy detect and perevent of blackhole attack using AODV protocol in manet in NS2


As part of my research paper,I want to implement blackhole attack in manet using AODV protocol in NS2 and perevent it.
i use mohittahiliani mohita patch file to detect of blackhole but i cant perevent it.
How can I configure the perevent of blackhole attack? Which files should be changed to improve AODV protocol? Can i implement it using ns2? Please help me with this..
 
Old 05-21-2017, 03:23 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
There is an idsAODV patch for the Mohit Tahiliani blackholeaodv:
idsAODV-for-M-blackholeaodv_ns235.patch
Link https://drive.google.com/file/d/0B7S...ew?usp=sharing

idsAODV info https://www.google.com/webhp?hl=all&...l=en&q=idsaodv

ns2 idsAODV
. https://groups.google.com/forum/?fro...dv%7Csort:date
. http://www.linuxquestions.org/questions/tags/idsaodv/

Not much idsAODV result with the simple "Mohit Tahiliani blackholeaodv", if I remember right.
( See https://groups.google.com/forum/?fro...dv%7Csort:date )

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

The older (advanced) blackholeaodv is ``blackholeaodv2013-ns235_1.patch´´
https://drive.google.com/file/d/0B7S...ew?usp=sharing
.. and the connected idsAODV : idsAODV-2-for-blackhole2013-patched_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing

The examples:
1) for the 2005 - 2013 blackhole code: blackholeaodv2005~2013-examples-05.17.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

2) idsAODV, idsAODV-examples-05.17.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

-
 
1 members found this post helpful.
Old 05-22-2017, 01:38 AM   #3
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
#2

thank you sir.im new in ns2. please tell me how can Configure idsAODV-for-M-blackholeaodv_ns235.patch

Last edited by neda_71; 05-22-2017 at 02:35 AM.
 
Old 05-22-2017, 04:45 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3.

A patch is a text file : You can read the file. See line 3: ns-2.35/
And you can apply the patch to the application it is meant for.

Assume ns-2.35 patched with the "Mohit Tahiliani blackholeaodv" :
Code:
cd ns-allinone-2.35/
patch -p0 < idsAODV-for-M-blackholeaodv_ns235.patch
./install
cd ns-2.35/
sudo make install

Example, setting up nine different `ns-allinone-2.35´, to compare the functions
Code:
/usr/local/bin/ns
/usr/local/bin/ns235-orig

/usr/local/bin/ns235-blackh
/usr/local/bin/ns235-blackhole-idsaodv

/usr/local/bin/ns235-blackh-Mohit
/usr/local/bin/ns235-blackh-M-idsaodv

/usr/local/bin/ns235-malicious

/usr/local/bin/ns235-rushing-attack
/usr/local/bin/ns235-r-attack_idsaodv
I.e. you can have as many ns-allinone-2* as you want, installed at the same time.
But do never add any *PATH text to .bashrc . Not required.


-

Last edited by knudfl; 05-22-2017 at 05:23 AM.
 
Old 05-22-2017, 06:02 AM   #5
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Unhappy

thank you.
i used "sudo make install" but have problem !!!!!!


os@ubuntu:~/ns-allinone-2.35/ns-2.35$ sudo make install
[sudo] password for os:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make install; ) done
make[1]: Entering directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest'
/usr/bin/install -c -m 555 -o bin -g bin setdest /usr/local/bin
/usr/bin/install -c -m 555 -o bin -g bin calcdest /usr/local/bin
make[1]: Leaving directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/dec'
/usr/bin/install -c -m 555 -o bin -g bin dec-tr-stat /usr/local/bin
make[1]: Leaving directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/epa'
/usr/bin/install -c -m 555 -o bin -g bin epa-tr-stat /usr/local/bin
make[1]: Leaving directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/nlanr'
/usr/bin/install -c -m 555 -o bin -g bin nlanr-tr-stat /usr/local/bin
make[1]: Leaving directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/ucb'
/usr/bin/install -c -m 555 -o bin -g bin ucb-tr-stat /usr/local/bin
make[1]: Leaving directory `/home/os/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/ucb'
os@ubuntu:~/ns-allinone-2.35/ns-2.35$
[/CODE]
how can solve it?
 
Old 05-22-2017, 06:34 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5

$ cd ns-2.35/
$ sudo make install : Will copy these executable files to /usr/localbin/ :
ns
calcdest
dec-tr-stat
epa-tr-stat
nlanr-tr-stat
setdest
ucb-tr-stat
.. and the man page `ns-2.35/ns.1´ to /usr/local/man/man1/

And that's what post #5 is showing. No errors. Nothing to solve.

P.S. : You are missing the word "[CODE]" at the output text begin.

-
 
Old 05-22-2017, 08:01 AM   #7
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Question idsaodv

i have the ns-2.35 patched with blackholeaodv2013-ns235_1.patch :
AND add idsAODV with "idsAODV-2-for-blackhole2013-patched_ns235.patch"
https://drive.google.com/file/d/0B7S...ew?usp=sharing

Else :
tar xvf ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < blackholeaodv2013-ns235_1.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
patch -p0 < idsAODV-2-for-blackhole2013-patched_ns235.patch
./install
cd ns-2.35/
cp ns ns235-blackhole+idsaodv
sudo cp ns235-blackhole+idsaodv /usr/local/bin/
Simulation : $ ns235-blackhole+idsaodv idsaodv.tcl
couldn't read file "idsaodv.tcl": no such file or directory
why? i have idsaodv.tcl in idsaodv see picture..
Attached Thumbnails
Click image for larger version

Name:	idsaodv.png
Views:	57
Size:	195.5 KB
ID:	25072  
 
Old 05-22-2017, 10:13 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #7. No idsaodv.tcl .

Default is : cd ns-2.35/idsaodv/ && ns235-blackhole+idsaodv idsaodv-1.tcl
I.e. the old idsaodv.tcl was edited (bug fixed), new name = idsaodv-1.tcl

Please always use the 'pwd' command to decide your location.
I.e. it won't do just to have a file.tcl : Usually the simulation command is to be run in the folder with the simulation.tcl .

Besides that, you can copy the file idsaodv-1.tcl to the other examples.
( Forgot to add a copy there, sorry.)

-
 
Old 05-23-2017, 08:01 AM   #9
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Re #8

thank you.
os@ubuntu:~/ns-allinone-2.35/ns-2.35$ cd idsaodv/ && ns235-blackhole+idsaodv idsaodv-1.tcl
invalid command name "Agent/rtProto/""
while executing
"Agent/rtProto/" set dport_ 0"
(file "idsaodv-1.tcl" line 24)
but what should i do next ?
Attached Thumbnails
Click image for larger version

Name:	pws.png
Views:	40
Size:	146.4 KB
ID:	25086  
 
Old 05-23-2017, 08:38 AM   #10
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thank you sir for your help. I just have a something to ask about:``idsAODV´´ + blackholeAODV.
my"thesis.pdf" http://www.dokurer.net/files/documents/thesis.pdf
( Or http://acikarsiv.atilim.edu.tr/eng/b...0/172.pdf?show )
... is about ``idsAODV´´ + blackholeAODV.


Code:
cd ns-allinone-2.34/
patch -p0 < idsAODV+blackholeaodv_ns234.patch
https://drive.google.com/file/d/0B7S255p3kFXNMTZjNE0xV3QxRW8/view?usp=sharing
patch -p0 < ns234_gcc49.patch
./install
cd ns-2.34/
cp ns ns234-idsAODV-blackhole
sudo cp ns234-idsAODV-blackhole  /usr/local/bin/
ns234-idsAODV-blackhole  blackholeaodv__idsAODV__dokurer.tcl
i have problem when used "ns234-idsAODV-blackhole blackholeaodv__idsAODV__dokurer.tcl"
os@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns234-idsAODV-blackhole blackholeaodv__idsAODV__dokurer.tcl
num_nodes is set 20
Creating nodes...
INITIALIZE THE LIST xListHead

(_o433 cmd line 1)
invoked from within
"_o433 cmd addr"
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 "_o433" line 2)
(SplitObject unknown line 2)
invoked from within
"_o433 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" 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 14)
(Simulator create-wireless-node line 14)
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 "$node_(..."
(file "blackholeaodv__idsAODV__dokurer.tcl" line 63)
os@ubuntu:~/ns-allinone-2.34/ns-2.34$

Simulation : ns234-idsAODV-blackhole blackholeaodv__idsAODV__dokurer.tcl
... is fail, the files sim1forBlackHole.nam and sim1forBlackHole.tr are created.

please help me too solve it.
help me to perevent black hole attak.
Attached Thumbnails
Click image for larger version

Name:	34-1.png
Views:	41
Size:	105.1 KB
ID:	25088   Click image for larger version

Name:	34-2.png
Views:	33
Size:	107.6 KB
ID:	25089  
 
Old 05-23-2017, 09:17 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #8, #9 : Images with text, please don't attach any. Will not be read.
If text is attached it must be as text.txt :
Create an empty file any-name.txt → copy/paste text to the file → attach.

#8: About idsaodv.tcl, idsaodv-1.tcl : Looks more like a configuration file.
Just forgot what is was. Seems like two year since last time I handled it ...

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

#9: blackholeaodv__idsAODV__dokurer.tcl :
No issues here with $ 'ns235-blackhole-idsaodv'.
! The output you got is with an executable 'ns' with no idsaodv, no blackhole !
I.e. ``ns-orig blackholeaodv__idsAODV__dokurer.tcl´´ will output those errors.

Please make sure that you start with a new unpacked ns-allinone-2.34.tar.gz .
Or use ns-allinone-2.35_gcc482.tar.gz .

And please specify your OS: Like CentOS 7, Ubuntu 16.04 - amd64, etc.
There are a few issues with the ns2 hostile { Cygwin, Ubuntu }.


-

Last edited by knudfl; 05-23-2017 at 09:22 AM.
 
Old 05-23-2017, 01:14 PM   #12
neda_71
Member
 
Registered: Jul 2016
Location: Oregon, USA
Distribution: Lubuntu 14.04, ns2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Re #10

is use "ns-orig blackholeaodv__idsAODV__dokurer.tcl" and "idsaodv.tcl" ," idsaodv-1.tcl " but cant confige them.

i used CentOS 7, vmware 12.1.1 ubuntu 10
please send file that used for detect and perevent of blackhole attack.
please SEND ME Code FOR CONFIGE FILE

knudfi thank u very much, God Blesse you ...I wish you all the best.

Last edited by neda_71; 05-23-2017 at 01:35 PM.
 
Old 05-23-2017, 02:55 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #12.
Quote:
please SEND ME Code FOR CONFIGE FILE
? What do you mean ? No "CONFIG FILE" or similar is to be used.


Quote:
I used CentOS 7, vmware 12.1.1 ubuntu 10
? Is the main OS CentOS 7 ? With a virtual "ubuntu 10" ? Which Ubuntu version ?

And if CentOS 7, why not use CentOS 7 for all ns2 ?
CentOS 7 is much more ns2 friendly than any contemporary Ubuntu OS.

Deciding Ubuntu version :
Code:
cat /etc/issue
 
Old 05-23-2017, 05:11 PM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #12.

If you have root access to CentOS 7, you can install the small rpm packages idsAODV_ns, nam, xgraph.
Download links ...
idsAODV_ns-2.35-2.el7.x86_64.rpm https://drive.google.com/file/d/0B7S...ew?usp=sharing
nam-1.15-1.SL7.x86_64.rpm https://drive.google.com/file/d/0B7S...ew?usp=sharing
xgraph-12.1-1.pclos2013.x86_64.rpm https://drive.google.com/file/d/0B7S...ew?usp=sharing
( Three Packages : total package size = 6.6MB ).

Installing packages ...
Code:
cd Downloads/
su [enter root password]
yum install ./idsAODV_ns-2.35-2.el7.x86_64.rpm
yum install ./nam-1.15-1.SL7.x86_64.rpm
yum install ./xgraph-12.1-1.pclos2013.x86_64.rpm
idsAODV_ns provides /usr/local/bin/ns235-idsAODV-el7

Run the examples :
Code:
cd ex_idsAODV-05.17/
ns235-idsAODV-el7 2paires-idsaodv.tcl
ns235-idsAODV-el7 Aska123-f__Black-idsAODV-tcl2.tcl
ns235-idsAODV-el7 blackholeaodv__idsAODV__dokurer.tcl
ns235-idsAODV-el7 Clustering-moc_v1__idsAODV.tcl
etc. etc., but please avoid idsaodv.tcl, idsaodv-1.tcl : Not usable, see post #11.


-

Last edited by knudfl; 05-24-2017 at 03:21 AM.
 
  


Reply

Tags
aodv-ns2, blackhole, blackhole-m, blackholeaodv, idsaodv, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Detection and Prevention of Blackhole Attack, Wormhole Attack in MANET Using ACO in ns2 neda_71 Linux - Software 5 08-13-2016 02:43 PM
Detection and Prevention of Blackhole Attack, Wormhole Attack in MANET Using ACO in ns2 neda_71 Linux - Virtualization and Cloud 1 07-30-2016 06:15 AM
blackhole attack implementation using AODV protocol in manet in NS2 liya Ravi Linux - Networking 3 02-16-2015 12:14 AM
How to assign Trust value in NS2 for simulating Blackhole attack in AODV in MANET? Rashmi Narahari Linux - Newbie 4 02-17-2014 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration