Beruflich Dokumente
Kultur Dokumente
More
Next Blog
surajpatilworld
Thursday, 19 February 2015
About Me
suraj patil
Follow
Adding a malicious node is ns2 using aodv protocol. The node which is declared as malicious will
simply drop the router packet (DROP_RTR_ROUTE_LOOP).
Two files have to be modified.
1. aodv.h
2. aodv.cc
aodv.h file changes
Declare a boolean variable malicious as shown below in the protected scope in the class AODV
105
Blog Archive
2015 (6)
February (5)
awk scripts for analysis of trace files in
ns2
bool malicious;
1. Initialize the malicious varible with a value "false". Declare it inside the constructor as shown
below
AODV::AODV(nsaddr_t id):Agent(PT_AODV)...
{
.......
malicious = false;
}
2. Add the following statement to the aodv.cc file in the "if(argc==2)" statment.
if(strcmp(argv[1], "malicious") == 0) {
malicious = true;
return TCL_OK;
}
3. Implement the behavior of the malicious node by setting the following code in the
rt_resolve(Packet *p) function. The malicious node will simply drop the packet as indicated below.
if(malicious==true)
{
drop(p,DROP_RTR_ROUTE_LOOP);
}
Once done, recompile ns2 as given below
Open Terminal -> Go to ~ns-2.35/ directory and type the command make to compile
$ cd /home/pradeep/ns-allinone-2.35/ns-2.35/
$ make clean
$ make
# it will take time to compile
$ sudo make install
Once the compilation is done, Check the malicious behavior using the Tcl Script by setting any
one node as malicious node. The command to set the malicious node is
$ns at 0.0 "[$n(1) set ragent_] malicious"
The variable referred for node2 is n1 (set n(1) [$ns node])
you can disable the packet dropping by adding # before above line
#$ns at 0.0 "[$n(1) set ragent_] malicious"
aodv.tcl file
converted by Web2PDFConvert.com
#======================================================================
# Define options
#======================================================================
set val(chan)
Channel/WirelessChannel ;# channel type
set val(prop)
Propagation/TwoRayGround ;# radio-propagation model
set val(ant)
Antenna/OmniAntenna ;# Antenna type
set val(ll)
LL
;# Link layer type
set val(ifq)
Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen)
50
;# max packet in ifq
set val(netif)
Phy/WirelessPhy
;# network interface type
set val(mac)
Mac/802_11
;# MAC type
set val(nn)
6
;# number of mobilenodes
set val(rp)
AODV
;# routing protocol
set val(x)
800
set val(y)
800
converted by Web2PDFConvert.com
Labels: blackhole attack in aodv routing protocol, blackhole attack in ns2, malicious node in aodv protocol
34 comments:
Deepalakshhmi sridharan 1 March 2015 at 03:26
i use the above code but is not working 4 me.pls help asap.this is so urgent
i get the following error
num_nodes is set 6
INITIALIZE THE LIST xListHead
ns: _o44 malicious:
(_o44 cmd line 1)
invoked from within
"_o44 cmd malicious"
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 "_o44" line 2)
(SplitObject unknown line 2)
invoked from within
"_o44 malicious"
Reply
Replies
Abdullah Mukhtar 15 April 2015 at 05:02
i have also facing these type of error... if anyone have solution to these type of error
plz help us..,,,,plz share ur code for this specific email idshahir.mukhtar@gmail.com
suraj patil
Refer this
https://www.youtube.com/watch?v=ca-yFicgDZs
suraj patil
suraj patil
the above code has been tested by me and its working. Just follow the steps exactly given
above. I have provided a video tutorial also for that. I hope itll help you.
Reply
converted by Web2PDFConvert.com
Nice post dear. I like it Omni ceiling mount antenna & gps antenna manufacturers & 4G
antenna manufacturers
Reply
Their is a another post in my blog related to protocol cloning. Refer that blog.
Reply
converted by Web2PDFConvert.com
Reply
converted by Web2PDFConvert.com
files aodv.cc and aodv.h. Now, to apply these changes I have run a **make** command inside
ns-allinone-2.35/ns-2.35 folder and getting the following error message:
In file included from aodv/aodv_logs.cc:31:0:
./aodv/aodv.h:53:18: fatal error: list.h: No such file or directory
#include
^
compilation terminated.
make: *** [aodv/aodv_logs.o] Error 1
How will I solve this?
Reply
Replies
Mona Sayed 4 December 2015 at 05:47
I changed the type of cache of DSR from mobicache to linkcache and then compiled
ns2.35 . it gives me the following error:
dsr/linkcache .cc: fatal error: list.h: no such file or directory.
Please if you find a solution send it to me : elexten1@yahoo.com
suraj have you got any suggestions to solve this error?
please help me . Thanks in advance
Reply
converted by Web2PDFConvert.com
Newer Post
Home
Older Post
converted by Web2PDFConvert.com