Available via license: CC BY
Content may be subject to copyright.
Considerable Detecon of Black Hole Aack and Analyzing its Performance on
AODV Roung Protocol in MANET (Mobile Ad Hoc Network)
Ashok Koujalagi*
Department of Computer Science, Basaveshwar Science College, Bagalkot, Karnataka, India
*Corresponding author: Ashok Koujalagi, Department of Computer Science, Basaveshwar Science College, Bagalkot, Karnataka, India, E-mail:
koujalagi.ashok@gmail.com
Received date: May 30, 2018; Accepted date: June 14, 2018; Published date: June 22, 2018
Citaon: Koujalagi A (2018) Ulizaon of edge posion for digital image watermarking using discriminant analysis. Am J Compt Sci Inform Technol
Vol.6 No.2:25
Copyright: © 2018 Koujalagi A. This is an open-access arcle distributed under the terms of the Creave Commons Aribuon License, which
permits unrestricted use, distribuon, and reproducon in any medium, provided the original author and source are credited.
Abstract
A Mobile Ad hoc Network is an aggregaon of mobile
terminal that form a volale network with wireless
interfaces. Mobile Ad Hoc Network has no any central
administraon. MANET more vulnerable to aacks than
wired network, as there is no central management and no
clear defence mechanism. Black Hole Aack is one of the
aacks against network integrity in MANET. In this type of
aack all data packets are absorbed by Black Hole node.
There are lots of techniques to eliminate the black hole
aack on AODV protocol in MANET. In this paper a soluon
named Black Hole Detecon System is used for the
detecon of Black Hole aack on AODV protocol in MANET.
The Black Hole Detecon System considered the rst route
reply is the response from malicious node and deleted, then
the second one is chosen using the route reply saving
mechanism as it come from the desnaon node. We use
NS-2.35 for the simulaon and compare the result of AODV
and BDS n soluon under Black Hole aack. The BDS
soluon against Black hole node has high packet delivery
rao as compared to the AODV protocol under Black hole
aack and it’s about 46.7%.The soluon minimize the data
loss and decrease the average Jier 5% and increase the
throughput.
Keywords: MANET; AODV; Blackhole AODV; BdsAODV
Overview to Manet (Mobile Ad Hoc
Network)
Mobile Ad-Hoc Network is an autonomous system where two
or more wireless devices or terminals that has the capability to
communicate with each other without of any centralized
administrator or xed network infrastructure. Mobile nodes can
dynamically form a network to exchange informaon without
the help of any central administraon. MANET are self-organized
networks. In MANET mobile nodes are accountable for
dynamically discovering other nodes to communicate [1]. Here
networks funcons like data forwarding, roung, and network
administraon are carried out synergec by all available nodes.
In Mobile ad hoc network nodes that are in the radio range can
communicate directly, but the nodes that are out of the range
can communicate through the intermediate nodes. Nodes are
free to move randomly while being able to communicate with
each other without the help of an exisng network
infrastructure. Here mobile node operates not only as an anchor
but also as a router for transferring data for other mobile nodes
in the network. MANETs are suitable for the situaons where
any wired or wireless infrastructure is damaged or destroyed [2].
Roung Protocols in Manet
Roung protocol in MANET can be classied into three
categories:
Proacve roung protocol (table-driven roung
protocol)
In this Roung Protocols, in the network each node must keep
up-to-date roung tables. When the network topology changes
every node in the network propagates the update message to
the network to maintain a reliable roung table. The
disadvantages of this roung protocol are that the periodically
updang the network topology increases bandwidth overhead
and many redundant route entries to the specic desnaon
unnecessarily take place in the roung tables. The advantage is
that, if any aacker node joined in network cannot easily aack
the network for geng data. Desnaon Sequenced Distance
Vector (DSDV) and Opmized Link State Roung (OSLR), Wireless
Roung Protocol (WRP), Global State Roung (GSR) are most
familiar types of roung protocols of proacve roung protocol
[3].
Reacve roung protocol (on-demand roung
protocol)
In reacve roung protocol route tables are created when
required and are not maintained periodically. The source node
propagates the route request packet to its neighbors when it
wants to connect to a desnaon node. The neighbors of the
source node receive the broadcasted request packet and
forward the packet to their neighbors unl source node’s
Editorial
iMedPub Journals
http://www.imedpub.com/
DOI: 10.21767/2349-3917.100025 ISSN 2349-3917
Vol.6 No.2:25
2018
© Under License of Creative Commons Attribution 3.0 License | This article is available from: https://www.imedpub.com/computer-science-and-information-
technology/
1
American Journal of Computer Science and Information Technology
ISSN 2349-3917
desnaon is found. Aer receiving the request the desnaon
node sends a route replay packet to the source node through
the shortest path. The path is maintained in the route tables of
the nodes through shortest path unl the route is no longer
needed. This roung protocol is easily aected by the malicious
node. Ad-hoc On-demand Distance Vector (AODV), Dynamic
Source Roung (DSR) is most familiar roung protocols of acve
roung protocol [3].
Hybrid roung protocol
The hybrid roung protocol combine the proacve and
reacve roung protocols. It is discovered using the advantages
of proacve and reacve roung protocols. Hybrid roung
protocol uses the proacve roung protocol in the case of intra-
domain roung and uses the reacve roung protocol in the
case of inter-domain roung. Zone Roung Protocol (ZRP),
Temporally-Ordered Roung Algorithm (TORA) is most familiar
types of roung protocol of hybrid roung protocol [4].
Ad-Hoc On-Demand Distance Vector
(AODV) Roung Protocol
In MANET AODV roung protocol is an on-demand roung
protocol used to nding a route to the desnaon. All mobile
nodes work cooperavely to nding route to the desnaon
using the control messages of roung protocol. In AODV roung
protocol routes are maintained just as long as it is needed.
AODV roung protocol use the desnaon sequence number for
each route entry which is a disnguishable feature from other
roung protocol. In AODV roung protocol the roung table
stores the desnaon address, next-hop address, desnaon
sequence number and lifeme. In this, when a node wishes to
send a packet to some desnaon, it checks its roung table to
determine if it has a pre-established route to the desnaon. If
it has a pre-established route to the desnaon, it forwards the
packet to next node. If it has not a pre-established route to the
desnaon it launches a route discovery process. For
establishing a route to the desnaon the AODV protocol use
the Route Requests (RREQs), Route Replay (RREPs), Route Errors
(RERRs) control messages. The source node broadcasts an RREQ
message when it wants to established a communicaon with the
targeted node. This RREQ message is inseminated from the
source and received by intermediate nodes (neighbors of the
source node). When RREQ is received by an transional node,
this fast check its roung table to nd a fresh route towards the
desnaon that is requested in RREQ. A route reply (RREP)
message is sent towards the source node through the pre-
established reverse route (established when RREQ pass through
intermediate nodes) if such a route is found. If the transional
node cannot able to nd a route, it restore of its roung table
and sends RREQ to its neighbors. This acon is repeated unl
the desnaon nodes receive the RREQ of source node [5].
Figure1 shows the Route Discovery procedure of Ad Hoc On-
Demand Distance Vector Roung where S is the source node and
D is the Desnaon node. Here A, C and B, E are the
intermediate nodes for traveling the RREQ message.
Figure 1: Route Discovery procedure of Ad Hoc On-Demand
Distance Vector Roung Protocol.
Every intermediate node in the network increases the hope
count one by one when the RREQ (Route Request) packet travels
through the network. If a Route Request (RREQ) message is
received in a node with the same RREQ ID or Broadcast ID, the
receiving intermediate node discard the newly received RREQs
with controlling the ID eld of the RREQ message. When the
RREQ and RREP messages are traveled through the network by
the transional nodes, the transional nodes update their
roung tables and save this route entry for 3 seconds. The
ACTIVE_ROUTE_TIMEOUT constant value of AODV protocol is
‘3seconds’ [6].
Black Hole Aack
Mobile Ad Hoc Network using the AODV protocol faces an
aack named Blackhole aack where a malicious node or
Blackhole node consumes the network trac and drops all data
packets. To explain the Black Hole Aack, an example is shown
in the following Figure2. In Figure 2, we assume that Node B is
the malicious node or Black hole node. When Node A broadcasts
the RREQ message for Node D to establish a path for data
transfer, Node B immediately responds to Node A with a false
RREP message showing that it has the highest sequence number
of Node D, as if it is coming from Node D. Node A assumes that
Node D is behind Node B with 1 hop count and discards the
newly received RREP packet come from Node C or E. Node A
then starts to send out all data packet to the node B. Node A is
trusng that these packets will reach Node D but Node B will
drop all data packets. The malicious node or Black hole node
takes all the routes coming up to itself. It stops forwarding any
packet to any other nodes. The network operaon is hampered
as the black hole node B consumes the packets easily [7].
American Journal of Computer Science and Information Technology
ISSN 2349-3917 Vol.6 No.2:25
2018
2This article is available from: https://www.imedpub.com/computer-science-and-information-technology/
Figure 2: A single Black hole aack in Mobile Ad Hoc Network
Implemenng a Roung Protocol in NS to
Simulate Black Hole Behaviour
To give a node the characteriscs of blackhole node we need
to implement a new roung protocol in ns 2.35. Implementaon
of a New MANET unicast Roung Protocol in NS-2 is described in
the reference. [8]. All roung protocols in Network simulator-
2.35 are installed in the directory of “ns-2.35”. We rst duplicate
the AODV protocol in the ns-2.35 directory and change the
name of this directory as “blackholeaodv”. In this blackholeaodv
directory the name of all les that are labeled as “aodv” are
changed to “blackholeaodv” such as blackholeaodv.cc,
blackholeaodv.h, blackholeaodv.tcl etc. All classes, funcons,
variables, and constants names in blackholeaodv directory have
changed but struct names that belong to AODV packet.h le
have not changed.
Figure 3: Adding the “blackholeaodv” protocol agent in the
“\tcl\lib\ns-lib.tcl” le.
To integrate the new blackholeaodv protocol in NS-2.35
simulator, we have changed two les that are used globally in
this simulator. In “\tcl\lib\ ns-lib.tcl” le we rst add the lines
shown in Figure-3, for the agent procedure for blackholeaodv.
Figure 4: Addion in the “\makele” at the ns-2.35 directory
Second le which is in the ns-2.35 directory named
“\makele” where we add the line shown in Figure 4.
In aodv.cc, the “recv” funcon process the packet based on
the type of the packet. If packet type is AODV route conducng
packet such as RREQ, RREP, RERR, it sends the packet to the
“recvAODV” funcon .When the received packet type is data
packet type then AODV protocol sends it to the desnaon
address. In the Figure 5 the rst “if” condion provides the node
to receive data packets if it is the desnaon and the “else”
condion consume all remaining packets as a Black Hole node.
Figure 5: “If” statement for accepng the packets by
desnaon or dropping packets by malicious node.
To generate the black hole behavior we need to make change
in blackholeaodv.cc le by adding the false RREP. The false RREP
message show that it has the highest sequence number and the
sequence number is set to 4294967295 and hop count is set to
1.The Highest sequence number of AODV protocol is
4294967295, 32 bit unsigned integer value [5]. The lines in
Figure 6 are added to aodv.cc le to generate the characteriscs
of black hole node. Aer changing the les then we compiled
the “make” in the terminal window (Cygwin window) to create
object les.
Figure 6: The false RREP of blackhole or malicious node.
Soluon for the Black Hole Aack on
AODV Protocol in Manet
To detect the blackhole aack the “Blackhole Detecon
System” checks the RREPs that come from mulple paths. As the
American Journal of Computer Science and Information Technology
ISSN 2349-3917 Vol.6 No.2:25
2018
© Under License of Creave Commons Aribuon 3.0 License 3
blackhole node immediately send RREP message to the source
without checking its roung table, it is more likely that the rst
RREP comes from the blackhole node. Then the soluon will
discard the rst RREP packet using the route reply saving
mechanism that come from malicious node and choose the
second RREP packet.
Algorithm for Black Hole Detecon
System
•Step1: Source node broad cast route Request (RREQ) packet.
•Step2: Mulple Route Reply of corresponding Route Request
comes to Source node.
•Step3: The Route Reply that comes rst set as the response
from malicious node and removes from the table by using
the RREP saving mechanism.
•Step4: The second Route Reply is choose by RREP saving
mechanism and set it as reply from corresponding
desnaon node. Then the source node delivers the data to
the path through which the second RREP came.
•Step5: Stop.
Implemenng the Black Hole Detecon
System in NS Against the Black Hole
Aack
To implement soluon against Blackhole, we duplicated the
“AODV” protocol, changing it to “bdsAODV” as we did in
“blackholeaodv”. Here for the soluon, we had to change the
receive RREP funcon (recv Reply) and create RREP saving
mechanism. This RREP saving mechanism counts the second
RREP message. At rst, we have changed all les name in the
cloned “aodv” directory to bdsAODV. To integrate the new bds
AODV protocol in NS-2.35 simulator, at First the le “\tcl\lib\ ns-
lib.tcl” is modied where protocol agents are coded that is
presented in Figure 7.
Figure 7: Adding the “proposed” protocol agent in the “\tcl
\lib\ ns-lib.tcl” le.
Second le which is in the ns-2.35 directory named
“\makele” where we add the lines that is in Figure 8. To detect
blackhole aack we create RREP saving mechanism in recv Reply
funcon of bdsAODV.cc le that is presented in Figure 9. In the
RREP saving mechanism the “rrep_insert” funcon is used for
adding RREP messages, “rrep_lookup” funcon is used for
looking any RREP message up if it is exist,“rrep_remove”
funcon removes any record for RREP message that arrived from
dened node and “rrep_purge” funcon is to delete periodically
from the list if it has expired.
Figure 8: Addion in the “\makele” at the ns-2.35 directory.
Figure 9: RREP saving mechanism in the bdsAODV Protocol.
We rst check if the RREP message arrived for itself, if it
arrived for itself then the funcon looks up RREP message if it
has soluon’s receive RREP message funcon is already arrived.
If it did not arrived then it inserts the RREP message for its
desnaon address and returns from the funcon. If the RREP
message is arrived or cached before for the same desnaon
address then the normal RREP funcon is carried out. If the
RREP message is not arrived for itself then the node forwards
the message to its appropriate neighbor. The code blocks
represented in Figure10 shown how the bdsAODV carried out.
American Journal of Computer Science and Information Technology
ISSN 2349-3917 Vol.6 No.2:25
2018
4This article is available from: https://www.imedpub.com/computer-science-and-information-technology/
Figure 10: Receive RREP funcon of the bdsAODV protocol.
Result Analysis
Here we simulate the same tcl script using AODV protocol
without black hole aack, AODV protocol with a single blackhole
aack, bdsAODV soluon with a single blackhole aack. We
simulated our model for 20, 25, 30, 35 and 40 nodes. Then we
compared the Performance Metrics such as the PDR (packet
Delivery Rao), End to End delay, through put and Jier of the
three scenarios.
Simulaon parameters
Table 1: Simulaon parameters
Parameter Definition
Protocol AODV, blackholeAODV, bdsAODV
MAC layer IEEE 802.11
Simulation area 700m*700m
Size of data packet 512 bytes
Traffic sources CBR/UDP
Number of nodes 20, 25, 30, 35, s40
Number of blackhole node 1
Antenna Type Antenna/Omni Antenna
Version NS 2.35
Performance evaluaon
We have been analyzed the result using four performance
metrics. They are the PDR (packet delivery Rao), End to End
Delay, throughput and Jier (Table 1).
Packet delivery rao (PDR): It is the rao of the number of
data packets received by the desnaon to the number of data
packets generated by the sources node. In the Figure 11, PDR
values for 20, 25, 30, 35 and 40 nodes for normal AODV,
blackholeaodv and bds AODV soluon are ploed. Here, it is
shown that PDR of AODV is aected by the malicious node and
the average packet delivery rao for this scenario is about
33.42%. Whereas the PDR of bdsAODV against Black Hole node
has high packet delivery rao compared to blackholeaodv and
it’s about 46.7%.
Figure 11: Packet Delivery Rao (PDR) vs. number of nodes.
End to end delay: The me taken by a packet to travel from
source to desnaon is called the End to End delay. In Figure 12,
the average end to end delay with single Black hole aack is
decreased in the bdsAODV soluon against Black hole aack.
Figure 12: Average End to End Delay vs. Number of nodes.
Throughput: Throughput can be dened as the amount of
data transferred from sender to receiver in a given amount of
me. It is measured in bits per second or packets per second. In
Figure 13, the bdsAODV soluon with single Black Hole aack
has average 5kbs-1 throughput which is greater than the
average throughput of blackholeaodv that is about 3.6 kb/s-1.
American Journal of Computer Science and Information Technology
ISSN 2349-3917 Vol.6 No.2:25
2018
© Under License of Creave Commons Aribuon 3.0 License 5
Figure 13: Throughput vs. number of nodes.
Jier: The variaon in the delay of received packet is called
jier. Low jier or Minimum variaon in the packet arrival me
provides beer performance in network. In blackhole scenario,
the average jier is about 12% whereas in bdsAODV soluon the
average jier is 7% that means it provide beer performance
presented in Figure14.
Figure14 : Average jier vs. number of nodes.
Conclusion
When we simulated the Black hole aack, we saw that the
data loss is occurred and the packet delivery rao was
decreased. Aer that, we simulated the bdsAODV soluon
against black hole aack and saw that the data loss that
occurred due to black hole node was decreased. The soluon
also increased the throughput and decreased the jier. PDR
(Packet Delivery Rao) of AODV is aected bythe Black Hole
node and the average packet delivery rao for this scenario is
about 33.42%. Whereas the PDR of bdsAODV soluon against
Black hole node has high packet delivery rao compared to
blackholeaodv and it’s about 46.7%. The soluon decrease the
average Jier 5% compared to the situaon of Black hole aack.
The advantage of this approach is that for implemenng the BDS
soluon we do not make any modicaon in packet format
hence can work together with AODV protocol. Another
advantage is that the soluon requires minimum modicaon in
AODV protocol.
References
1. Shrivastava P, Kumar S, Shrivastava M (2014) Study of Mobile Ad
hoc Networks. Int J Comp App 86: 0975-8887.
2. Kaur S, Gupta AK (2012) Posion Based Roung in Mobile Ad-hoc
Networks: An Overview. Int J Comp Sci Technol 3: 792-796.
3. Misra P (2006) Roung Protocols for Ad Hoc Mobile Wireless
Networks. hp://www.cse.wustl.edu/~jain/cis788-99/
adhoc_roung/index.html.
4. Kumar A, Reddy L, Hiremath P (2008) Performance Comparison of
Wireless Mobile Ad-Hoc Network Roung Protocols. Int J Comp Sci
Net Security 8.
5. Singh G, Singh J (2012) MANET: Issues and Behavior Analysis of
Roung Protocols. Int J Adv Res Comp Sci Soware Eng 2.
6. Perkins C (2003) (RFC) Request for Comments-3561. Category:
Experimental, Network, Working Group.
7. Deng H, Li W, Agrawal DP (2002) Roung Security in Wireless Ad
Hoc Networks. University of Cincinna, IEEE Communicaon
Magazine.
8. Ros FJ, Ruiz PM (2005) Implemenng a New Manet Unicast
Roung Protocol in NS2. hp://masimum.dif.um.es/nsrt-
howto/pdf/nsrthowto.pdf.
American Journal of Computer Science and Information Technology
ISSN 2349-3917 Vol.6 No.2:25
2018
6This article is available from: https://www.imedpub.com/computer-science-and-information-technology/