Code for blackhole attack

161 views
Skip to first unread message

Ramasamy Raja

unread,
Jan 2, 2018, 6:44:26 AM1/2/18
to Network Simulator 2 (NS2)
Hii sir.. I need a aodv.cc and aodv.h file for Blackhole attack in manet.Thankyou sir.

knudfl

unread,
Jan 2, 2018, 9:17:10 AM1/2/18
to Network Simulator 2 (NS2)
Manet : Please use the default "Manet AODV examples", and add the ``blackhole code´´
######### Added for blackholeAODV
set val(nn)      15
set val(nnaodv)  5
set val(brp)     blackholeAODV
##########
.
.
############################### Added for blackholeAODV

# $ns_  node-config  -adhocRouting $val(brp)
for {set i $val(nnaodv) } {$i<$val(nn) } {incr i} {
     
set node_($i) [$ns node]
     $node_
($i) random-motion 0;
     $ns at
0.01 "$node_($i) label \"blackhole node\""
}
##################################################

All examples  https://drive.google.com/drive/folders/0B7S255p3kFXNSmRYb2lGcDRUdWs?usp=sharing
All patches  https://drive.google.com/drive/folders/0B7S255p3kFXNZ2lWZDBRSW40Q00?usp=sharing

BlackholeAODV  Howto
tar xvf ns-allinone-2.35_gcc5.tar.gz
https
://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
cd ns
-allinone-2.35/
patch
-p0 < blackholeaodv2013-ns235_1.patch
./install
cd ns
-2.35/
cp ns ns
-blackholeAODV
sudo cp ns
-blackholeAODV /usr/local/bin/

.............................  Simulation  .......................
$
ns-blackholeAODV aodv-Xgr_blackhole.tcl
....  etc. etc. examples from "blackholeaodv2005~2013-examples-05.17.tar.gz".

keerthiga ravikumar

unread,
Jan 3, 2018, 4:25:59 AM1/3/18
to Network Simulator 2 (NS2)
Sir How to Attach IDS in each node of a MANET?

knudfl

unread,
Jan 3, 2018, 6:14:35 AM1/3/18
to Network Simulator 2 (NS2)
IDS :  There is a patch for the "blackholeaodv2013-ns235_1.patch"  patched ns-2.35 :

idsAODV-2-for-blackhole2013-patched_ns235.patch
https://drive.google.com/file/d/0B7S255p3kFXNT0FjUTBTR21sMzg/view?usp=sharing

idsAODV-examples-05.17.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNQjJlRWVEQVNCQUk/view?usp=sharing
Message has been deleted

keerthiga ravikumar

unread,
Jan 3, 2018, 8:18:45 AM1/3/18
to Network Simulator 2 (NS2)



Sir,It shows some error after executing and .nam and .tr are empty 
Can you please explain the steps.
Thanks in advance. :)
Auto Generated Inline Image 1

knudfl

unread,
Jan 3, 2018, 11:52:21 AM1/3/18
to Network Simulator 2 (NS2)
@keerthiga ravikumar

»» It shows some error «« :   You will have to explain what "it" means.
... Which command was used ?  Please specify ...

Build ns-2.35 + blackholeAODV + idsAODV
tar xvf ns-allinone-2.35_gcc5.tar.gz
https
://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
cd ns
-allinone-2.35/
patch
-p0 < blackholeaodv2013-ns235_1.
patch
patch
-p0 < idsAODV-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 idsaodv2.tcl

keerthiga ravikumar

unread,
Jan 3, 2018, 1:02:39 PM1/3/18
to Network Simulator 2 (NS2)
This is the actual error sir!!

keerthiga@keerthiga-Satellite-C55-C:~/Downloads/ns-allinone-2.35/ns-2.35$ cp ns ns235-blackhole+idsaodv
cp: cannot stat ‘ns’: No such file or directory

knudfl

unread,
Jan 3, 2018, 2:35:08 PM1/3/18
to Network Simulator 2 (NS2)
@keerthiga ravikumar.

»» cannot stat ‘ns’: No such file or directory «« : 
No file 'ns' : You will also have seen an error in the terminal when building ns-2.35 ....

? Which OS are you using ?

keerthiga ravikumar

unread,
Jan 3, 2018, 2:44:48 PM1/3/18
to Network Simulator 2 (NS2)
Ubuntu Sir!!

I got the answer sir. The file name that I have executed has - symbol instead of + symbol in the file name you have mentioned (ns235-blackhole+idsaodv).

Now I got the error as :

/usr/include/X11/Xlib.h:60:19: fatal error: X11/X.h: No such file or directory
 #include <X11/X.h>
Compilation terminated

Apologise for the disturbance sir!!

knudfl

unread,
Jan 3, 2018, 4:38:29 PM1/3/18
to Network Simulator 2 (NS2)
@keerthiga ravikumar.

Repeat :  Which OS are you using ? ?

Prerequisites, ns2: These are the basic packages.
Special compilers for e.g. Ubuntu 17* not included. Be aware that g++-5 or earlier is required.
1.  Fedora, CentOS : # yum install gcc-c++ autoconf automake libtool libXmu-devel
2.  Debian, Mint, Ubuntu :
     $ sudo apt-get update && sudo apt-get install g++ autoconf libtool libxmu-dev xgraph

devil evil

unread,
Mar 2, 2018, 1:22:40 AM3/2/18
to Network Simulator 2 (NS2)
.
.
.
.
Hello sir .. in that above code blackholeAODV code is just mentioned in comments rather than applying it .. can you please help me in implementing blackhole attack in code ???
.
.
.

devil evil

unread,
Mar 2, 2018, 11:48:42 PM3/2/18
to Network Simulator 2 (NS2)

Bro .. can help me with blackhole implementation ????

knudfl

unread,
Mar 3, 2018, 4:09:14 AM3/3/18
to Network Simulator 2 (NS2)
ns-2.35 + blackholeaodv


tar xvf ns-allinone-2.35_gcc5.tar.gz
https
://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
cd ns
-allinone-2.35/

patch
-p0 < blackholeaodv2013-ns235_2.patch
https
://drive.google.com/file/d/0B7S255p3kFXNMk1uX2N5VmtXeTA/view?usp=sharing

./install
cd ns
-2.35/
cp ns ns
-
black
sudo cp ns
-black

-------------- Simulation -------------
ns
-black Aska123-f__Blacktcl2.tcl
Etc. etc. examples from ``blackholeaodv2005~2013-examples-05.17.tar.gz´´
https://drive.google.com/file/d/0B7S255p3kFXNTUlreWIzVGxUXzQ/view?usp=sharing

All ~2500 examples https://drive.google.com/drive/folders/0B7S255p3kFXNSmRYb2lGcDRUdWs?usp=sharing

All patches https://drive.google.com/drive/folders/0B7S255p3kFXNZ2lWZDBRSW40Q00?usp=sharing

----------
Reply all
Reply to author
Forward
0 new messages