You are on page 1of 6

Black Hole and Selective Forwarding Attack Detection and

Prevention in WSN
Ms. MeghanaShinde Prof. D. C. Mehetre
Department of Computer Engineering Department of Computer Engineering
KJCOEMR Pune KJCOEMR Pune
meghanashinde19@gmail.com dcmehetre@gmail.com

Abstract: A wireless sensor network is vast domain which The routing of data packets from a source to a sink through the
is used to while sensing information in various range of network is of more interest for the researchers in WSN
applications. The information which is sensed is further domain. Limitation of energy resources is a major impact, as
carried to base station for processing. While processing of energy is an important fundamental component in designing of
this information, security of the routed data is very the routing protocols. Furthermore, to lessen superfluous
important and is challengeable in WSN. This has occurred transmissions of the same data the coalition of sensed data
because in unattended environments WSN is implemented. needs to be considered in WSN routing protocols. In
Researchers have worked on various problem such as preference, most of the current routing protocols endeavor at
robustness, energy consumption, security etc. from an metrics like as reliability, robustness, responsiveness and
ancient period of time. However current paper focuses preserving energy. However, the non-forbearance of possible
more on the routing which is secured as well as security obstacles in the area of routing can be perilous
trustworthy pattern. Here we have used the concept of because in almost all application areas in which WSNs are
active trust routing scheme to defend various kind of used, sensor nodes are deployed in an inimical or unfavorable
attacks during routing of the data packets. Such attacks environments, providing the opportunity for antagonist to
mainly consist of black hole attack, Denial of service attack launch certain attacks against sensor nodes. Specifically, the
and selective forwarding attack. The system also protects arresting and negotiating of nodes is an imperative issue
the data by hiding during routing by using ECC because it is easy for adversaries to access the sensors
algorithm, which provides the security. Experimental substantially.
results prove that the, proposed system improves the
security along with prolong network lifetime and low Secure Routing:
energy utilization and more efficiency throughout the Routing is one thing that extricates WSN from other networks.
network lifetime. Secure routing has to be done to ignore signal spoofing,
implanting of concoct message into the network, alteration of
messages while transmission, weave formation of loops,
Keywords: Active trust, secure routing, attack prevention, data bypass redirection of shortest path. System fault, error data
encryption. may also cause the network collapse. Secure routing has to be
done to surmount the attacks and information loss. Secure
I. INTRODUCTION
routing through the trusted node is one of the ways to avoid
the attacks mentioned above [10]. Secure routing protocol
Over few last decades, the popularity of a topic and is more have to consider the sensor network limitation such as limited
prone to be important for civil and military applications are memory, energy, resource constrained.
increasing. Due to the advancement in fields like micro-
electronics, integrated electronics that are extremely enhanced Trusted Node:
energy accumulators, in the last few time of span, the To ensure the trustworthiness of the node trust has to build up
development of sensor nodes was so much intensified that the between nodes. Trusted node refers to the node which operates
magnitude of sensor nodes got below average, whereas the normally, that is sensing and forwarding packets to proper
valuation of per sensor went down contemporaneously. The destination without any information loss. To find the trust
main motive behind this was that the sensor nodes should node as well as recognizing of malicious node many types of
form a jointly together to observe events in erratic schemes are used, some of them are discussed here. In Trust
environments by acting in a self-compositely, self-harmonize based method, Trust values can be estimated from the
ad hoc manner, i.e. without the need of human intervention. reputation along with behavior of the node.
As the fact presents and notifies that the sensor’s energy, in
most cases is dependent on a battery which should be alive for
the lifetime of sensor’s, is determinant limited, the sensor Routing attacks in WSN:
nodes are restricted in their gauge power, memory and There are different types of attacks possible by malicious
transmission range. nodes to damage the network and make the network unreliable

978-1-5386-4008-1/17/$31.00 ©2017 IEEE  ƒ‰‡ͳ


for transmission and proper functioning [9]. Some of such able to sense the nodal trust after that it is also able to stop
kinds of attacks are given below: doubtful nodes. The developed system is also highly energy
1. Wormhole Attack efficient; it makes use of silt energy for procreation of
It is an attack on which the messages are Tunneling as multiple detection routes. At last they have conducted test runs
well as replicating from one location to another through to verify the results.
alternative low latency links, that join two or more points
(nodes) of the WSN by using strong communication In paper [2] authors have designed an algorithm as well as
resources than normal nodes and establishing better real built up for the dynamic formation of cluster heads as well as
communication channels (called tunnel). This nodes work clusters depending on distance of the nodes from cluster node
fully invisible. utilizing genetic algorithm as well as trust of the sensor nodes.
2. Sinkhole Attack Cluster data is forwarded to every of the nodes as well as then
This attack Attract or draw the all possible network traffic real-time routing occurs.
to a compromised node by placing a malicious node
closer to the base station and enabling selective In paper [3] authors have implemented system for the purpose
forwarding. of detection of the sinkhole attack inside the WSN. The
3. Selective Forwarding Attack designed system is light weight system. Also the novel
In this attack, a compromised node refuses to forward message digest algorithm which has high complexity as well
some of the packets in its outstanding buffer, such as as has few collision resistant is designed for identifying the
manage information or data packets in order to cut off the sinkhole attacks. The system designed is capable of finding
packets propagation. the sinkhole at the time when digest forwarded in the trustable
4. Black hole Attack route as well as new route are different.
In the network, a black hole is an attack in which
malicious node attracts all the traffic. By advertising that In paper [4] authors have worked on muting security in WSN.
it has the shortest path in the network. So, it produce a They have noticed that, none of the sensor network protocols
symbolic black hole with the malicious node or the acknowledge the security in grant. After this observation they
adversary at the center. This black hole drops all the have found and given few security goals for routing in sensor
packets it receives from the other nodes. network, which gives the possible ways of attacks on ad-hoc
5. Grey hole Attack as well as peer-to-peer network, will be adapted in potent
This attack is similar to the black hole attack except that attacks in protest with sensor networks. Also, implemented
the malicious node selectively or randomly two classes of new type of attacks against sensor network
forwards/drops only some of data packets that they are known as sinkholes as well as HELLO Roods.
routed through it, at random intervals to secure from its
forged/artificial path. In paper [5] authors proposed a system for finding as well as
6. Denial of Service Attack monitoring the selective forwarding attack in WSN. The
A Denial of Service (DoS) attack is one that attempts to selective forwarding attack can be detected in network layer
avoid the victim from being able to use all or part of without any great amount of efforts. In this sort of attack the
his/her network connection. DoS attack permit an attacked node work in the similar way as the different nodes
adversary to sabotage, rattle, or destroy a network, and present in the network but it may try to change or drop the
also to scale down network’s capability to lend a service. private data before the sending the packet to other sensor
nodes. The system developed in this paper provides guaranty
Contributions of proposed system are: for the data while transferring between nodes.
• Data is encrypted using ECC.
• Data is verified at each node while data sending using In paper [6] authors have developed a new multipath
SHA. transmitting system. The built-up system is utilized as a
• Generate hash of encrypted data and then send defense technique against selective forwarding attack. In
encrypted data with its hash value. Again calculates proposed system at the time of routing if a node senses a
hash from received data and cross check this packet drop; the packet is forwarded via alternate route.
calculated hash value with received, if hash matched Because of the resending technique reliability of the routing
then only data is accepted. mechanism is maximized.
• Each node also checks data trust that is type of data.
In paper [7] authors are making use of unmanned aerial
vehicles (UAVs) for finding the black hole attacks inside
II. LITERTURE SURVEY WSN. In black hole attack a faulty node which shows that the
route to the destination is shortest and feasible one hence they
In paper [1] authors have enforced a new security as well as attract more traffic and drops all the packets. In proposed
trust routing system which depends on active detection. The system UAV is utilized for verifying nodes as well as
developed system has High successful routing security,
anticipation as well as scalability. The Active Trust system is

 Third International Conference on Computing, Communication, Control And Automationƒ‰‡ʹ


978-1-5386-4008-1/17/$31.00 ©2017 IEEE 2017 (ICCUBEA)
Sequential Probability Ratio Test technique as a dynamic III. SYSTEM DESCRIPTION
threshold system for avoiding malicious nodes.
A. System Overview
In paper [8] authors implemented a method which is Figure 1 depicts the overall description of trustable secure
depending on two cluster heads inside a cluster. In the routing scheme in WSN. This system consists of active
detection phase the base station finds the faulty node. And in detection routing protocol and data routing protocol. This
removal phase the faulty node is deleted by the base station. system detects and prevents the black hole attack, selective
Authors also provided some feature scope to improve the forwarding attack and data type attack. Initially network is
system. deployed by entering the number nodes. After that source and
destination is selected by user. According to figure 1, node 0
and 12 are source and destination.

Figure 1. Trustable Secure Routing

Black Hole Attack Detection and Prevention:


After network generation, all possible multiple number of
paths are computed from source to destination. Through each
path, Detection Packet (DP) is sent. Detection packet contains
following information:

DP = {Source ID, Destination ID, Path length} …….. (1)

Here, path length is the number of hopes to destination node.

After receiving DP, each node in path sends the Feedback


Packet (FP) to source node.

FP = {Source ID, Destination ID, Path length} ………. (2)

Then source node compares this FP with DP. If suppose node


is attacker node, it will make path length==0, which means
that it is the destination node. But source nod already have the
ID of destination node. If the Destination Node ID in DP ==
Destination Node ID in FP, and Path length ==0, then and
only then node is genuine node, otherwise it is black hole
attacker node. If such case occurs, system discards this path to
destination node. In this way, black hole attack is prevented.

Fig. 2. Flow of System

978-1-5386-4008-1/17/$31.00 ©2017 IEEE  ƒ‰‡͵


2017 Third International Conference on Computing, Communication, Control And Automation (ICCUBEA)
Trustable Route Selection: 4. For each encrypted packet, generate Hash using
In this approach, we calculate the threshold value for each SHA-1 Hashing Algorithm.
path and path with minimum threshold value is treated as most 5. Send encrypted packet and its respective hash value
secure path for data routing. For this, initially, each node has through selected trustful routing path.
its own Trust value, which is calculated using following 6. At each receiving node in path, hash is calculated for
equation: received encrypted packet.
If new hash is = = received hash, then data is protected. It is
­°C AB = ¦ w {ΔBA (ti ) | ∧ BA (ti ).(h i / w)},.....w ≠ 0 not affected by attacker.
NodeTust = ® i =1
B. Proposed Routing Algorithm
°̄0,......w = 0
1. Source selects any one node from its neighbors.
2. Check its distance from sink and trust. If trust is
……3)
greater and distance is less then send information of
Also for each node, distance to destination node is calculated.
packet size to that node.
For each node threshold value is computed with following
3. Otherwise select another node from neighbor list and
equation:
்௥௨௦௧ repeat step 2.
݄ܶ‫†Ž‘Š•‡ݎ‬ே௢ௗୣ ൌ ஽௜௦௧௔௡௖ୣ…..(4) 4. Process continuous until path up to sink is detected.
Then for each path, threshold is calculated by using following 5. Source sends data packets through path.
equation: 6. Each node checks size of data packet. If size of
received packet is not equal to the size stored earlier
݄ܶ”‡•Š‘Ž†௉௔௧௛ ൌ ෍ ݄ܶ”‡•Š‘Ž†ே௢ௗ௘ then its previous node will send data to next node by
௙௢௥௡௢ௗୣ୭୲୭୬ discarding current node.
(5) 7. If node = = sink then data routed successfully
This is the sum of all node’s threshold value in that path. otherwise repeat step 6.
Finally, path with minimum threshold value is considered as
the most trusted and secure path for data routing. IV. RESULTS AND DISSCUSSION
A. Experimentl Setup
Selective Forwarding and Data Type Attack Detection and
Prevention: The system is built using Java framework (version jdk 6)on
After route selection, Packet information is sent through this Windows platform. The NetBeans (version 6.9) is used as a
path. It contains: development tool. For network creation system used Jungtool.
The system doesn’t require any specific hardware to run; any
PI = {Type of Data, Size of Data} ………(6) standard machine is capable of running the application.
B. Performance Measures
When any node receives the data packet, it verify the data with
packet information. If the type of data is not matched, then it
1. Energy Consumption:
is found that data type attack is happened on its previous node.
Energy Consumption of the sensing device must be minimum
In this case, node drop that packet and forward remaining
and sensor nodes must be energy efficient because limited
packets to next node.
energy resource determines their lifetime.
In selective forwarding attack, size of data is not matched with
Energy consumption formula for sending a k-bit message to a
size of data in data packet. So node recovers this data from
distance d:
previous node of attacker node. Because of this, packet loss
ratio is minimum in proposed system.
ETx(k , d) = Eelec * k + ∈amp + k * d 2
Data Security:
To protect the information, system makes use of ECC where,
algorithm. By using this algorithm, data is encrypted before ETx is energy consumed while data sending
actual routing. After encryption original data is protected from Eelec is energy of transmitter
unauthorized entities. amp is amplifier energy, k is constant, d is distance.
To check the data integrity at node SHA1 Hashing method is
used. Energy consumption formula for receiving a k-bit message:

Steps are as follows:


1. Generate the data at source node.
E Rx (k) = E elec * k
2. Convert data into packets.
3. Encrypt each packet by using ECC Encryption where,
Algorithm. ERx is energy consumed while receiving data.

978-1-5386-4008-1/17/$31.00 ©2017 IEEE  International Conference on Computing, Communication, Control And Automation (ICCUBEA)
2017 Third ƒ‰‡Ͷ
Eelec is energy of transmitter, k is constant. Latency = Time of packets received at Destination node –
2. Packet Delivery Ratio (PDR): Time of packet generated at Source node.
The calculation of Packet Delivery Ratio (PDR) is based on
the received and generated packets as recorded in the trace
file. In general, PDR is defined as the ratio between the
received packets by the destination and the generated packets
by the source. The formula of PDR are as follows:

୘୭୲ୟ୪୬୳୫ୠୣ୰୭୤୮ୟୡ୩ୣ୲ୱୟ୲ୢୣୱ୲୧୬ୟ୲୧୭୬
PDR in %= ୘୭୲ୟ୪୬୳୫ୠୣ୰୭୤୔ୟୡ୩ୣ୲ୱୋୣ୬ୣ୰୲ୣୢୟ୲ୗ୭୳୰ୡୣ
* 100

C. Evaluation Results
The existing system detect only blackhole attack. When
Selective forwarding attack occurred then existing system fail.
In proposed system we detect Selective forwarding attack as Fig.5. Path Length Comparison
well as prevent it by discarding that node. This make system
more secure and consume less energy and enhance the Figure 5 represent the length of routing paths for different size
network lifetime. of network in proposed system and existing system. In
propose system, length of routing path is minimized, so that
the energy consumption gets reduced during data sending.
Path length is nothing but the number of hopes from source to
destination in particular path.

Fig.3. Energy Consumption Comparison

Figure 3 represent the energy consumption for different size of


network in proposed system and existing system. Energy
consumption is minimum in proposed system, because black
hole attacker is detected before actual data routing and also
data is recover after packet drop. Fig. 6 Throughput comparison

Figure 6 represent the throughput of proposed and existing


system. Throughput is the number of packets delivered over
the total simulation time. It is calculated as:
Throughput = [Total number of packets delivered at
destination / Total simulation time] * 100.

Fig.4. Latency Comparison

Figure 4 shows the latency comparison for different size of


network in proposed system and existing system. Latency for
existing system is minimum than proposed one. It is an
expression of how much time it takes for a packet of data to Fig.7. Packet Drop Ratio Comparison
get from one designated point to another.

978-1-5386-4008-1/17/$31.00 ©2017 IEEE  International Conference on Computing, Communication, Control And Automation (ICCUBEA)
2017 Third ƒ‰‡ͷ
Conference on Process Automation, Control and
Out of multiple trusted paths, one trusted path will be selected. Computing, Coimbatore, 2011, pp. 1-6.
Data will be sent through that selected path. But during data
sending in base system, if at any node energy is insufficient [4] Karlof and D. Wagner, "Secure routing in wireless sensor
then whole data will not be reach to the destination, which networks: attacks and countermeasures," Proceedings of
leads to load imbalanced situation. Wherein proposed system
the First IEEE International Workshop on Sensor
if same condition is occurred, data will be sent through
another trusted path and in this way whole data will reach to Network Protocols and Applications, 2003., 2003, pp.
destination. Due to this packet drop ratio in proposed system 113-127.
will be minimum as compared to base system as shown in
figure 7. [5] N. M. Alajmi and K. Elleithy, "A new approach for
detecting and monitoring of selective forwarding attack in
V. CONCLUSION wireless sensor networks," 2016 IEEE Long Island
In WSN, the security is the most challenging problem. In most Systems, Applications and Technology Conference
of the security issues, secure routing, this paper studied (LISAT), Farmingdale, NY, 2016, pp. 1-6.
various types of attacks during routing and also some recent
solutions to provide secure routing. This paper focuses on the [6] P. C. Geethu and A. R. Mohammed, "Defense
black hole attack and selective forwarding. To detect and
mechanism against selective forwarding attack in wireless
prevent such kind of attacks, system makes use of updated
active trust scheme and data routing scheme along with data sensor networks," 2013 Fourth International Conference
type checking during routing. Also system enhance the on Computing, Communications and Networking
privacy of data by encrypting it before actual routing starts, by Technologies (ICCCNT), Tiruchengode, 2013, pp. 1-4.
using ECC algorithm. Experimental results prove that,
proposed system is better that existing one in terms of [7] M. Motamedi and N. Yazdani, "Detection of black hole
security, trustable routing, and network lifetime and energy attack in wireless sensor network using UAV," 2015 7th
consumption. Conference on Information and Knowledge Technology
(IKT), Urmia, 2015, pp. 1-5.
References
[8] P. Dewal, G. S. Narula and V. Jain, "Detection and
[1] Y. Liu, M. Dong, K. Ota and A. Liu, "ActiveTrust: Secure prevention of black hole attacks in cluster based wireless
and Trustable Routing in Wireless Sensor Networks," in sensor networks," 2016 3rd International Conference on
IEEE Transactions on Information Forensics and Computing for Sustainable Global Development
Security, vol. 11, no. 9, pp. 2013-2027, Sept. 2016. (INDIACom), New Delhi, 2016, pp. 3399-3403.

[2] S. Das, Barani S, S. Wagh and S. S. Sonavane, "Energy [9] Kellner, Ansgar, Omar Alfandi, and Dieter Hogrefe. "A
efficient and trustable routing protocol for Wireless survey on measures for secure routing in wireless sensor
Sensor Networks based on Genetic Algorithm (E2TRP)," networks." International Journal of Sensor Networks and
2016 International Conference on Automatic Control and Data Communications 1 (2012): 1-17.
Dynamic Optimization Techniques (ICACDOT), Pune,
[10] Latha, D., and K. Palanivel. "Secure Routing Through
2016, pp. 154-159.
Trusted Nodes in Wireless Sensor Networks–A
[3] S. Sharmila and G. Umamaheswari, "Detection of Survey." International Journal of Advanced Research in
Sinkhole Attack in Wireless Sensor Networks Using Computer Engineering & Technology (IJARCET) 3
Message Digest Algorithms," 2011 International (2014): 8.

2017 Third International Conference on Computing, Communication, Control And Automation (ICCUBEA)
978-1-5386-4008-1/17/$31.00 ©2017 IEEE ƒ‰‡͸

You might also like