Intruder Detection in WSN using GSA & Fuzzy Logic

Page 1

IJSRD - International Journal for Scientific Research & Development| Vol. 4, Issue 05, 2016 | ISSN (online): 2321-0613

Intruder Detection in WSN using GSA & Fuzzy Logic Jyoti1 Navneet Verma2 1 M.Tech Scholar 2Assistant professor 1,2 GEC Panipat Abstract— There is lots of detection and defense mechanisms to eliminate the intruder that carry out the black hole attack. In this paper we have used multiple base station approach to prevent the black hole attack. Since, black hole doesn’t let go the data which passes through its region, so best solution is that data should avoid the path of black hole. On this basis we used multiple base station concept in this thesis which considers the message delivered if any of base station received that. The positions of base stations are optimized with the gravitational search algorithm (GSA) and fuzzy logic, so that all base stations are at minimum distance from the nodes and nodes have to spend less energy in transferring data packets to base station. Key words: WSN, GSA & Fuzzy Logic I. INTRODUCTION Wireless Sensor Networks have emerged as an important new area in wireless technology. In the near future, the wireless sensor networks are expected to consist of thousands of inexpensive nodes, each having sensing capability with limited computational and communication power which enable us to deploy a large-scale sensor network. A wireless network consisting of tiny devices which monitor physical or environmental conditions such as temperature, pressure, motion or pollutants etc. at different areas. Such sensor networks are expected to be widely deployed in a vast variety of environments for commercial, civil, and military applications such as surveillance, vehicle tracking, climate and habitat monitoring, intelligence, medical, and acoustic data gathering. The key limitations of wireless sensor networks are the storage, power and processing. These limitations and the specific architecture of sensor nodes call for energy efficient and secure communication protocols. The feasibility of these inexpensive sensor networks is accelerated by the advances in MEMS (Micro Electromechanical Systems) technology, combined with low power, low cost digital signal processors (DSPs) and radio frequency (RF) circuits. They consists of a radio transceiver, microcontroller, power supply, and the actual sensor. The sensing circuitry measures ambient condition related to the environment surrounding the sensor and transforms them into an electric signal. Processing such a signal reveals some properties about objects located and/or events happening in the vicinity of the sensor. The sensor sends such collected data, usually via radio transmitter, to a command center (sink) either directly or through a data concentration center (a gateway). Normally sensor nodes are spatially distributed throughout the region which has to be monitored; they self-organize in to a network through wireless communication, and collaborate with each other to accomplish the common task. Basic features of sensor networks are self-organizing capabilities, dynamic network topology, limited power, node failures and mobility of nodes, short-range broadcast communication and multihop routing, and large scale of deployment . The strength of wireless sensor network lies in their flexibility and scalability.

The key challenge in sensor networks is to prevent form external intruder attacks which either disturb the whole network or change the information to be transferred in the sensor network. Our work is targeting this problem by using GSA optimization and fuzzy logic. In next sections gravitational search algorithm is discussed followed by its use in our work along with fuzzy logic to detect the intruder. Section 4 discusses the results of proposed work and section 5 concludes the discussion of this paper. II. GRAVITATIONAL SEARCH ALGORITHM GSA was introduced by Rashedi et al. in 2009 and is intended to solve optimization problems. The population-based heuristic algorithm is based on the law of gravity and mass interactions. The algorithm is comprised of collection of searcher agents that interact with each other through the gravity force. The agents are considered as objects and their performance is measured by their masses. The gravity force causes a global movement where all objects move towards other objects with heavier masses. The slow movement of heavier masses guarantees the exploitation step of the algorithm and corresponds to good solutions. The masses are actually obeying the law of gravity as shown in Equation (4.1) and the law of motion in Equation (4.2). F = G (M1M2 / R2) 4.1 a = F/M (2) 4.2 Based on Equation (4.1), F represents the magnitude of the gravitational force, G is gravitational constant, M1 and M2 are the mass of the first and second objects and R is the distance between the two objects. Equation (4.1) shows that in the Newton law of gravity, the gravitational force between two objects is directly proportional to the product of their masses and inversely proportional to the square of the distance between the objects. While for Equation (4.2), Newton’s second law shows that when a force, F, is applied to an object, its acceleration, a, depends on the force and its mass, M. In GSA, the agent has four parameters which are position, inertial mass, active gravitational mass, and passive gravitational mass [1]. The position of the mass represents the solution of the problem, where the gravitational and inertial masses are determined using a fitness function. The algorithm is navigated by adjusting the gravitational and inertia masses, whereas each mass presents a solution. Masses are attracted by the heaviest mass. Hence, the heaviest mass presents an optimum solution in the search space. The steps of GSA are as follows: A. Step 1: Agents Initialization: The positions of the N number of agents are initialized randomly. đ?‘‹đ?‘– = đ?‘Ľđ?‘–1 , đ?‘Ľđ?‘–đ?‘‘ , ‌ . . đ?‘Ľđ?‘–đ?‘› đ?‘“đ?‘œđ?‘&#x; đ?‘– = 1,2 ‌ ‌ , đ?‘ (4.3)

All rights reserved by www.ijsrd.com

1707


Intruder Detection in WSN using GSA & Fuzzy Logic (IJSRD/Vol. 4/Issue 05/2016/418)

đ?‘Ľđ?‘–đ?‘‘ represents the positions of the ith agent in the dth dimension, while n is the space dimension. B. Step 2: Fitness Evolution and Best Fitness Computation: For minimization or maximization problems, the fitness evolution is performed by evaluating the best and worst fitness for all agents at each iteration. Minimization problems: đ?‘?đ?‘’đ?‘ đ?‘Ą(đ?‘Ą) = min đ?‘“đ?‘–đ?‘Ą đ?‘—(đ?‘Ą) (4.4) đ?‘—đ?œ–{1,..đ?‘ }

(4.5)

đ?‘¤đ?‘œđ?‘&#x;đ?‘ đ?‘Ą(đ?‘Ą) = max đ?‘“đ?‘–đ?‘Ą đ?‘—(đ?‘Ą) đ?‘—đ?œ–{1,..đ?‘ }

Maximization problems: đ?‘?đ?‘’đ?‘ đ?‘Ą(đ?‘Ą) = max đ?‘“đ?‘–đ?‘Ą đ?‘—(đ?‘Ą)

(4.6)

đ?‘—đ?œ–{1,..đ?‘ }

(4.7)

đ?‘¤đ?‘œđ?‘&#x;đ?‘ đ?‘Ą(đ?‘Ą) = min đ?‘“đ?‘–đ?‘Ą đ?‘—(đ?‘Ą) đ?‘—đ?œ–{1,..đ?‘ }

fit j(t) represents the fitness value of the jth agent at iteration t, best(t) and worst(t)represents the best and worst fitness at iteration t. C. Step 3: Gravitational Constant (G) Computation: Gravitational constant G is computed at iteration t đ??ş(đ?‘Ą) = đ??ş0 đ?‘’ −đ?›źđ?‘Ą/đ?‘‡ (4.8). G0 and đ?›ź are initialized at the beginning and will be reduced with time to control the search accuracy. T is the total number of iterations. D. Step 4: Masses of The Agents’ Calculation: Gravitational and inertia masses for each agent are calculated at iteration t. Mai = Mpi = Mii = Mi, i = l, 2, ....N. (4.9) đ?‘“đ?‘–đ?‘Ą(đ?‘Ą) − đ?‘¤đ?‘œđ?‘&#x;đ?‘ đ?‘Ą(đ?‘Ą) đ?‘šđ?‘– (đ?‘Ą) = đ?‘?đ?‘’đ?‘ đ?‘Ą(đ?‘Ą) − đ?‘¤đ?‘œđ?‘&#x;đ?‘ đ?‘Ą(đ?‘Ą) đ?‘šđ?‘– (đ?‘Ą) đ?‘€đ?‘– (đ?‘Ą) = đ?‘ ∑đ?‘—=1 đ?‘šđ?‘— (đ?‘Ą) Mai and Mpi are the active and passive gravitational masses respectively, while Mii is the inertia mass of the ith agent. E. Step 5: Accelerations of Agents’ Calculation: Acceleration of the ith agents at iteration t is computed. đ?‘Žđ?‘–đ?‘‘ (đ?‘Ą) = đ??šđ?‘–đ?‘‘ (đ?‘Ą)/đ?‘€đ?‘–đ?‘– (đ?‘Ą) (4.10) đ?‘‘ đ??šđ?‘– (đ?‘Ą)is the total force acting on ith agent calculated as: đ??šđ?‘–đ?‘‘ (đ?‘Ą) = ∑đ?‘—∈đ?‘˜đ?‘?đ?‘’đ?‘ đ?‘Ą đ?‘&#x;đ?‘Žđ?‘›đ?‘‘đ?‘— đ??šđ?‘–đ?‘—đ?‘‘ (đ?‘Ą) (4.11) Kbest is the set of first K agents with the best fitness value and biggest mass. Kbest will decrease linearly with time and at the end there will be only one agent applying force to the others. đ??šđ?‘–đ?‘—đ?‘‘ (đ?‘Ą) can be computed as: đ?‘€đ?‘Žđ?‘– (đ?‘Ą) đ??šđ?‘–đ?‘—đ?‘‘ (đ?‘Ą) = đ??ş(đ?‘Ą). (đ?‘€đ?‘?đ?‘– (đ?‘Ą) Ă— + đ?œ€) . (đ?‘Ľđ?‘—đ?‘‘ (đ?‘Ą) đ?‘…đ?‘–đ?‘— (đ?‘Ą) − đ?‘Ľđ?‘–đ?‘‘ (đ?‘Ą))

4.12

đ??šđ?‘–đ?‘—đ?‘‘ (đ?‘Ą)

is the force acting on agent i from agent j at dth dimension and tth iteration. Rij(t) is the Euclidian distance between two agents i and j at iteration t. G(t) is the computed gravitational constant at the same iteration while đ?œ€ is a small constant. F. Step 6: Velocity and Positions of Agents: Velocity and the position of the agents at next iteration (t+1) are computed based on the following equations:

đ?‘Łđ?‘–đ?‘‘ (đ?‘Ą + 1) = đ?‘&#x;đ?‘Žđ?‘›đ?‘‘đ?‘– đ?‘Ľđ?‘Łđ?‘–đ?‘‘ (đ?‘Ą) + đ?‘Žđ?‘–đ?‘‘ (đ?‘Ą) đ?‘‘ đ?‘Ľđ?‘– (đ?‘Ą + 1) = đ?‘Łđ?‘–đ?‘‘ (đ?‘Ą + 1) + đ?‘Ľđ?‘–đ?‘‘ (đ?‘Ą)

4.13 4.14

G. Step 7: Repeat Steps 2 To 6 Steps 2 to 6 are repeated until the iterations reach their maximum limit. The best fitness value at the final iteration is computed as the global fitness while the position of the corresponding agent at specified dimensions is computed as the global solution of that particular problem. III. PROPOSED WORK GSA tuning to update the base station position In GSA an objective function is required which is to be minimized or maximized as per applications. In our particular case the cost equation 4.15 is to be minimized by GSA optimization and for it takes all nodes positions and iteratively changing base stations position. đ??ľ

đ?‘›

min đ?‘œđ?‘?đ?‘— đ?‘“đ?‘˘đ?‘› = ∑ ∑ đ??ľđ?‘†đ?‘– − đ?‘ƒđ?‘œđ?‘ đ?‘—

4.15

đ?‘–=1 đ?‘—=1

Where B= number of base stations n= number of nodes đ??ľđ?‘†đ?‘– = base station positions đ?‘ƒđ?‘œđ?‘ đ?‘— = nodes position The terms used in GSA algorithm has its counterpart in our problem which are tabulated in table 4.1. Terms in our technical Variable in GSA concept Base station’s position 1 Position of agents co-ordinates Number of dimension of 2* total number of base 2 searching space stations Change in position co3 Update in positions ordinates of BS Table 4.1: Technical counterpart of GSA variables Each agent’s position in GSA is termed as the BS position and value of cast by objective function designed in MATLAB is calculated for each agent. The MATLAB script written for objective function calculation is in table 4.2. In each iteration and for each agent this function will be called in main script and a table in MATLAB will be used which save all values of minimum cost for each set of agents in every iteration. For example if there are 100 iterations and 50 agents are assumed, then initially these 50 agents will be initialized randomly or in other words the execution sequence of tasks will be assigned randomly for 1st iteration. For these 50 agents objective function value is calculated and amongst them minimum cost value (minimum sum of distance between nodes and base station) is saved as best value and now these initial execution sequences will be updated using equations 4.11-4.14 and these new updated values will serve as execution sequence or agent’s positions for next iterations and this process will continue till iterations last. By this way after some iteration a level will be achieved for objective function value beyond which it will not reduce. That is the conversant condition for GSA algorithm and an optimal execution sequence of tasks for our case. A. Fuzzy Logic for Intruder Detection The fuzzy logic controller for the proposed black hole region detection has two real time inputs measured at every sampling

All rights reserved by www.ijsrd.com

1708


Intruder Detection in WSN using GSA & Fuzzy Logic (IJSRD/Vol. 4/Issue 05/2016/418) Nodes Placed in geographical region of 100*100 100 Base 3 88 23

90 59 80 y coordinates of nodes

time, named energy consumed and packet loss and one output named trust. The input signals are fuzzified and represented in fuzzy set notations by membership functions. Defining only membership function doesn’t complete fuzzy logic designing. Rule sets for taking decision have to be designed also. A set of 27 rules in our case is designed and table 4.3 represents that. Packet Loss\energy low Medium High Low High High Medium Medium High Medium Low High Low Low Low Table 4.3: Fuzzy logic rules sets

14

27

71 96

70 202

60

31

66 50 Base 2 17 40 86 8 30

52 98 92 89 44 26 51

36 97 50

42 75 70 34

65

41

30

62

6

Base 3 49 30

94 79

5591

78

60

10 83

38

9 19 40 50 60 70 X coordinates of nodes

84 5 72

13 100 3

46 1 80

56

11 12

64 Base 2 100

90

Fig. 5.1: AODV path made form source to base stations Figure 5.2 shows that fitness function is decreasing with iterations and around 500 iterations are done in our work. Minimised Distance between base satation and nodes

Our work is detecting the black hole in the network. We used multiple base stations for this and data packet reached at any base station is considered as successful delivery. The motto of using multiple base stations is to increase delivery rate of packets. We used MATLAB as a tool to simulate the proposed work as it provides an easy to use interface and wide range of functions which can be used directly. Initially a wireless sensor network is simulated in MATLAB using 100 numbers of nodes which are displaced in 100*100 region. The statistics used for simulation of WSN are used in table 5.3 below. Parameters Values Node number 100 Geographical area 100*100 Base station 4 Black hole radius(m) 20,30,40,50 Node’s transmission range 16 m Packet size 64 bytes 4,6,8,10,12,14 Data rate packets/sec Energy consumption per bit in the 50 nJ transmitter or receiver circuitry energy consumption for multipath 0.0015 pJ fading Data aggregation energy 5 nJ consumption Table 5.3: Parameters considered for simulation Initially base stations are placed at four corners of geographical area and source node is chosen randomly amongst given nodes. The black hole node is knowingly assigned to any node other than source node. it will affect all nodes which come under its circular area made by its radius as shown in figure 5.1. If any route passes through black hole affected area which is shown by magenta color in the same figure, data packets will not be transferred further as these will trap into black hole and no packet will move further on that path and a complete loss of data packets will occur. So base stations positions are optimized to avoid this path and new locations are searched using GSA optimization. The minimized objective function plot is shown ii figure 5.2.

73

67

1 1 0 BaseBase 0 10 20

Base 4

40

58

77

10

IV. RESULTS

61

74

29

20

54 85

15

43

33

Base 4 63

90 35 76 39 21 45

SourceNode 4 47 81 24 53

80 28

22

7 8716 18

37 93

82

57 95 68 69 99 48 32 25

GSA Iterations to optimise the base station position 32 GSA 30

28

26

24

22

20

18 0

50

100

150

200

250

300

350

400

450

500

Iteration

Fig. 5.2: fitness function plotting with number of iterations using GSA After optimization network gets new locations for all base stations from which nodes are at minimum distance. A new path for packet transfer is constructed by AODV protocol and that path is usually avoided by black hole radius. we have used fuzzy logic to find out whether route followed is black hole route or not. The energy consumed in transmission and reception of packet is calculated on the basis of distance using radio model for energy consumption and packet loss on the basis of energy is calculated. Figure 5.3 and 5.4 shows the packet loss before and after optimization. These are normalised packet loss. In figure 5.4 for base station 1 and base station 2, packet loss is zero, it means these are nearby source node and not much energy losses are visible.

All rights reserved by www.ijsrd.com

1709


Intruder Detection in WSN using GSA & Fuzzy Logic (IJSRD/Vol. 4/Issue 05/2016/418)

Fig. 5.3: Packet Losses for All Base Stations before Optimization Fig. 5.8: Energy Consumption Bar Graph for 20 M Black Hole Radius V. CONCLUSION In this study, we analyzed effect of the intruder in an AODV Network. For this purpose, we implemented an AODV protocol that behaves as Black Hole in MATLAB. We simulated four scenarios with different black hole radius and different data rates, where each one has100 nodes that use AODV protocol and also simulated the same scenarios after introducing one Black Hole Node into the network. Moreover, we also implemented a solution that attempted to reduce the Black Hole effects in MATLAB using 4 base stations in the geographical region of 100 nodes and simulated the solution using the same scenarios. GSA optimization and fuzzy logic have been used for detection purpose. Fig. 5.4: Packet Losses for All Base Stations after Optimization These losses are checked for a radius of 20 meter. Losses in the packet depend upon the packet size too. Small is the packet size losses are less and larger is size, higher are losses. Figure 5.4 shows the losses for data packets 4 and 6 are zero but as it increases to 8 packets, 0.13 packets are lost or 13% packets are lost, which increases with increase in number of packets and for 14 data packets, it is 100%. Same can be checked with the case with unoptimized base station position. The energy consumption in both proposed and for old base station position is compared in the figure 5.8 below.

REFERENCES [1] Harmandeep Kaur, “A Novel Approach To Prevent Black Hole Attack In Wireless Sensor Network” International Journal For Advance Research In Engineering And Technology, Vol. 2, Issue VI, June 2014. [2] Anurag Singh Tomar, “Optimized Positioning Of Multiple Base Station for Black Hole Attack” International Journal of Advanced Research in Computer Engineering & Technology Volume 3 Issue 8, August 2014. [3] Sowmya K.S, “Detection and Prevention of Blackhole Attack in MANET Using ACO” International Journal of Computer Science and Network Security, VOL.12 No.5, May 2012. [4] Manvi Arya, “BFO Based Optimized Positioning For Black Hole Attack Mitigation in WSN” International Journal of Engineering Trends and Technology (IJETT) – Volume 14 Number 1 – Aug 2014. [5] Yash Pal Singh, “A Survey on Detection and Prevention of Black Hole Attack in AODV- based MANETs” journal of information, knowledge and research in computer engineering, nov 12 to oct 13 ,volume – 02, issue – 02.

All rights reserved by www.ijsrd.com

1710


Intruder Detection in WSN using GSA & Fuzzy Logic (IJSRD/Vol. 4/Issue 05/2016/418)

[6] Kulbhushan, “Fuzzy Logic based Intrusion Detection System against Blackhole Attack on AODV in MANET” IJCA Special Issue on “Network Security and Cryptography” NSC, 2011. [7] Kiran Narang, “Black Hole Attack Detection using Fuzzy Logic” International Journal of Science and Research, Volume 2 Issue 8, August 2013. [8] Rajani Narayan, “Self-optimization and Self-Protection in AODV Based Wireless Sensor Network”International Journal of Computer Science and Mobile Computing, Vol.3 Issue.1, January- 2014, pg. 244-254. [9] Binitha S, “A Survey of Bio inspired Optimization Algorithms” International Journal of Soft Computing and Engineering ISSN: 2231-2307, Volume-2, Issue-2, May 2012. [10] Jaspreet kaur, “BHDP Using Fuzzy Logic Algorithm for Wireless Sensor Network under Black Hole Attack” International Journal of Advance Research in Computer Science and Management Studies Volume 2, Issue 9, September 2014 pg. 142-151. [11] Satyajayant Misra, “Blackhole Attacks Mitigation with Multiple Base Stations in Wireless Sensor Networks”IEEEE, 2011. [12] Poonam Yadav, “ A Fuzzy Based Approach to Detect Black hole Attack”International Journal of Soft Computing and Engineering (IJSCE) ISSN: 2231-2307, Volume-2, Issue-3, July 2012. [13] C.V.Anchugam, “ Detection Approach for Black Hole Attack on AODV in MANETs using Fuzzy Logic System” International Journal of Advanced Information Science and Technology Vol.33, No.33, January 2015. [14] Savita Shiwani, “Detection of Black Hole Attack In MANET Using FBC Technique” International Journal of Emerging Trends & Technology in Computer Science, Volume 2, Issue 2, March – April 2013. [15] Naveen Kumar, “ A Fuzzy Based Approach to Detect Black hole Attack” International Journal of Soft Computing and Engineering ISSN: 2231-2307, Volume2, Issue-3, July 2012. [16] ZHIHUA HU, “FUNDAMENTAL PERFORMANCE LIMITS OF WIRELESS SENSOR NETWORKS”IEEE, 2006. [17] MEENAKSHI SHARMA, “Transmission Time and Throughput analysis of EEE LEACH, LEACH and Direct Transmission Protocol” Advanced Computing: An International Journal Vol.3, No.5, September 2012 [18] Rudranath Mitra, “Secure and Reliable Data Transmission in Wireless Sensor Network: A Survey”International Journal Of Computational Engineering Research,May-June 2012. [19] Sourabh Jain, “ENERGY EFFICIENT MAXIMUM LIFETIME ROUTING FOR WIRELESS SENSOR NETWORK” International Journal Of Advanced Smart Sensor Network Systems , Vol 2, No.1, January 2012. [20] Mahanth K Gowda, “Energy and Throughput Optimized, Cluster Based Hierarchical Routing Algorithm for Heterogeneous Wireless Sensor Networks” Int. J. Communications, Network and System Sciences, 2011, 4, 335-344.

All rights reserved by www.ijsrd.com

1711


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.