Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2

Security is one of the most important problems in Mobile Ad hoc Network (MANETs) because of

dynamically changing topologies, without centralized coordination system and bandwidth constraint. There

are different types of attack such as Denial of service (DoS), wormhole, replay, masquerade, black hole etc.

The goal of attacks is usually to disrupt the operation of the network or to affect the network performance.

In this paper, we measured multiple black hole attacks simultaneously in Network Simulator 2 (NS2) in

terms of throughput, energy efficiency and data packet delivery. We also proposed a simple solution for

detection and avoidance black hole attacks. Our simulation results show that the more attackable nodes

in network simultaneously, the lower the energy efficiency network performance and if AODV routing

protocol with detection and avoidance mechanism (dam) of black hole attack nodes is deployed in network, the performance of network can be better about 35% in comparison AODV without avoidance.

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 1

Trang 1

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 2

Trang 2

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 3

Trang 3

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 4

Trang 4

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 5

Trang 5

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 6

Trang 6

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2 trang 7

Trang 7

pdf 7 trang xuanhieu 760
Bạn đang xem tài liệu "Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

Tóm tắt nội dung tài liệu: Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2

Detection and avoidance mechanism of black hole attack on AODV routing protocol in manet using NS2
onsist of two stages: counter will be selected.
Route discovery stage: Route Maintenance Stage:
 In this stage, all nodes in network will 
 broadcast a HELLO message periodically to 
 inform its working state and receive it from all 
 active neighbors. If node does not receive HELLO 
 message from a neighbor, then it will notify the 
 source with an RERR packet and entire routes based 
 on the node is invalidated. Sources can recovery a 
 new route by performing route discovery stage or 
 drop node in its routing table.
 Figure 1. Broadcasting of RREQ message Messages in AODV:
 Figure 1 illustrates the source node S needs There are four control messages which are used 
a route to send data to destination D, first it finds by AODV described as below:
this in the routing table, if there is a good enough, Routing Request (RREQ): This message is used 
it will use this route, otherwise, it will broadcast whenever the source node need discovery the better 
of RREQ to its neighbors (A, C and G) specified route to the destination for data transmission.
for certain destination D. An intermediate node 
receives RREQ message, it will check its routing 
table for route to destination. If it found, it will send Figure 3. Format of RREQ message
RREP message through the reverse route path (e.g. Routing Reply (RREP): used by node, if it is 
H node), which is established by RREQ, towards the destination, or has a fresh route enough to the 
the source and it will ignore this RREQ message if destination, at that time it will unicast route reply 
it is processed already. Otherwise, the intermediate message (RREP) back to the source. 
node will update its routing table for a fresh route 
toward source node and rebroadcast RREQ message 
to these neighbors, this process is repeated until the Figure 4. Format of RREP message
RREQ message is received by the destination node Route Error Message (RERR): All nodes monitor 
D [5]. their own neighborhood and broadcast this message 
 whenever it detects a broken link with adjacent 
 neighbor due to out of network or mobility. RERR 
 has format as shown in Figure 5.
 Figure 5. Format of RERR message
 2.2. Black Hole Attack
 A black hole attack in which a black hole node 
 Figure 2. Sending of RRER message will refuse to forward data packets to the following 
 At destination D, after receiving RREQ node in the route connected between source and 
message, it will send RREP message to source D by destination. To process its attacks, the black hole 
unicast the single reverse path as shown in Figure node fakes that it has fresh enough routes for data 
Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology 41
ISSN 2354-0575
transmission to all destinations requested by all in RREP message. But with attackable node, it 
the source nodes and absorbs the network traffic. will immediately respond an RREP message that it 
In Figure 6, by using the routing AODV protocol, includes path with the smallest sequence number. 
when the source node S broadcasts the RREQ With the behavior of black hole attack node above, 
message for finding any paths to the destination D, we can modify the working of AODV routing 
the black hole node immediately responds with an protocol in received RREP message for avoiding 
RREP message that it includes path with the highest attackable black hole node, which is illustrated in 
sequence number. This message is seen as if it is Figure 7 bellow:
sending from the destination or a node which has 
a fresh enough route to the destination. After black 
hole node assumes that the destination is behind it 
by sending RREP with a single path, it discards the 
other RREP packets coming from other nodes.
 When the source received the RREP, which is 
transmitted by black hole node, it starts to send out 
its data packets to the black hole with trusting that 
these packets can reach the destination D but black 
hole node will discard all data packet here. 
 Figure 7. Detection and avoidance mechanism of 
 black hole attack in AODV
 2.4. Implementing Code for Detection and 
 Figure 6. A single black hole attack in MANET Avoidance of Black Hole Attack in AODV Protocol
 In Figure 6, node B is a black hole node and To implement code for detection and avoidance 
as a result, all the data packets through node B are black hole attack in AODV routing protocol, we use 
simply consumed or lost and this process make the NS2 (Network Simulator) version 2.35 with steps 
performance will be decreased or lack of energy. bellow:
Node B could be said that it is a form of destruction Step 1: Create “damAODV” base on AODV 
in the network, and we call it as the black hole routing protocol in “ns-allinone-2.35/ns-2.35” 
attack node [6, 7]. directory as shown in Figure 8, we change all files 
 in “aodv” directory by “damaodv” such as “aodv.
2.3. Proposed Detection and Avoidance Mechanism cc” by “damaodv.cc”, “aodv.h”, etc.
 To detect and avoid black hole attack in 
AODV routing protocol, we can consider the 
working of AODV and behavior of black hole 
attack node. In route discovery stage, after the 
source node propagate RREQ to its neighbors in 
order to obtain desired shortest and fresh path to 
destination. An intermediate node receives RREQ 
message, it will check its routing table for route 
to destination or rebroadcast RREQ message, 
continuously. Therefore, it will take some time for Figure 8. Creating the “damaodv” base on AODV 
finding the path in routing table and the hop count routing protocol
42 Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology
 ISSN 2354-0575
Step 2: Change in the “\makefile”, which is in ns- Step 7: The end.
2.35 with the lines as shown in Figure 9.
 Figure 9. Adding in the “\makefile” at the 
 “ns2.35” directory
Step 3: Initialize in the “ns-agent.tcl” and “ns-
mobilenode.tcl” file, which is in ns-2.35/tcl/lib with 
the lines as shown in Figure 10 and 11.
Figure 10. Adding in the agent for “damaodv” agent
Step 4: Add “damaodv” routing agent in “tcl\lib\ns-
lib.tcl” file with some lines where protocol agents Figure 13. Adding RREP saving mechanism in the 
are coded that is presented in Figure 11 and 12. “damAODV” protocol
 3. Simulation Parameters
 To evaluate the performance of routing 
 protocols affect of multiply black hole attacks, we 
 use the network simulator ns-2 (v.2.35) [8, 9] with 
 the parameters in the simulation scenarios that are 
 described in Table I, [10].
Figure 11. Adding “damaodv” for processing at nodes
 Table I. The Arrangement off Channels
 Parameters Values
 Topology area 1000 m × 1000 m
 Numbers of nodes 10, 20, 30, 40, 50
 Antenna type Omni Antenna
 AODV, blackholeAODV, 
 Routing protocol
 damAODV
 Packet size 512 bytes
 Simulation time 500 seconds
 Figure 12. Adding “damaodv” protocol agen in Transmission range (m) 250
 the “tcl\lib\ns-tcl.tcl” file. Traffic type CBR, TCP
 Data rate 10 (kbps)
Step 5: Modify code in the “rrep_insert()”, and 
 Initial energy 5 (Joules)
“rrep_remove()” function as shown in Figure 13.
 Idle power 712e-6 (Watt)
Step 6: Run the command to compile in the terminal 
 Receiving power 0.3 (Watt)
window of Linux.
 Transmission power 0.6 (Watt)
 make clean
 Sleep power 144e-9 (Watt)
 make
Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology 43
ISSN 2354-0575
4. Performance Metrics
4.1. Throughput 
 Throughput express the total count of data 
packets transported to destination nodes of one flow 
(connection) in network during the simulation time 
[8, 9]. 
 (3)
 k
 Throughput_of_ network = ∑(Throughput_of_ flow) j (4)
 j=1 
 th
where Psi is the size of length of the i packet 
 Figure 15. The average throughput
reaching the destination, t1 and t2 are the time 
when first packet sent by source node and the time 
when last packets received by destination node, 
respectively.
4.2. Energy Efficiency
 Energy efficiency is defined as the throughput 
achieved per unit of energy consumed, where the 
throughput represents the number of successfully 
delivered packets.
 Throughput( packets)
 Energy _ efficiency = (5)
 Energy _ consumption(Joules)
4.3. Packet Delivery Ratio (PDR)
 PDR represents the ratio of data packets Figure 16. Energy efficiency
successfully received from all the sent data packets, 
which is computed as below: As illustrated in Figure 16 and 17, the energy 
 (6) efficiency of AODV protocol is analyzed intwo
 scenarios with increased number of nodes. We 
 Where Nr and Ns are the number of data can see that the energy efficiency of network with 
packets received by destination node and the number impact of black hole attack nodes in dropping the 
of data packet sent by source node, respectively. packets to reduce the received packets is obvious.
4.4. Packet Loss Ratio (PLR)
 This measure represents the ratio of number 
packets dropped by nodes due to various reasons, 
the lower value of the packet lost means that the 
better performance of the protocol. PLR is computed 
as below [11]:
 (6)
5. Results and Analysis
 As illustrated in Figure 15, the average 
throughput of AODV routing protocols is analyzed 
in two scenarios with multiply black hole attack 
nodes. We can see that it is the more nodes in the Figure 17. Energy efficiency
network, the higher throughput is.
44 Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology
 ISSN 2354-0575
 In addition, in network if it has the more black In Figure 18 and 19, we illustrate the packet 
hole attack nodes, the worse energy efficiency delivery ratio for AODV routing protocols in the 
achieve, but if AODV routing protocol with number of black hole attack nodes. Based on results 
detection and avoidance mechanism is deployed shown in Figure 18 and 19, we can obviously 
in network, energy efficiency of network can be observe that if there is not black hole attack in the 
better about 35% in comparison AODV without network, the packet delivery ratio is higher than 
avoidance. about 20% compared to the same protocols. 
 Figure 18. Packet delivery ratio
 Figure 21. Packet loss ratio 
 The percentage of packet loss in different two 
 scenarios are illustrated in Figures 20 and 21 in 
 which in network with black hole attack nodes have 
 packet loss ratio more than original AODV protocol 
 and the more black hole attack nodes, the more 
 packet loss ratio in the same protocol.
 6. Conclusion
 In this paper, we evaluate the performance of 
 the AODV routing protocols with multiply black 
 hole attack nodes simuntaneously and analyzed 
 Figure 19. Packet delivery ratio the energy consumption of nodes in MANET with 
 avoiding black hole attack with AODV routing 
 protocols. Our goal is to detect and avoid impact 
 of black hole attack in AODV routing protocol, 
 which helps the development of security schemes in 
 MANET. Our simulation results show that if AODV 
 routing protocol with detection and avoidance black 
 hole attack nodes in network, the performance of 
 network can be higher about 35% in case of large 
 network (50 nodes deployed in 1000m×1000m 
 area).
 Figure 20. Packet loss ratio 
Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology 45
ISSN 2354-0575
References
 [1]. Fan-Hsun Tseng, Li-Der Chou and Han-Chieh Chao, “A survey of black hole attacks in wireless 
 mobile ad hoc networks”, Human-centric Computing and Information Sciences, 2011, vol 1, pp 1-16.
 [2]. Garima Neekhra, Sharda Patel, Ashok Verma, Ashish Chaurasia, “Effect Of Grayhole Attack 
 With Ids Technique For Aodv Routing Protocol Using Network Simulator”, International Journal of 
 Advanced Research in Computer Engineering & Technology (IJARCET), December 2014, vol 3, pp 
 4184- 4190.
 [3]. K.Madhuri, N.Kasi Viswanath, P.Usha Gayatri, “Performance Evaluation of AODV under 
 Black Hole Attack in MANET using NS2”, International Conference on ICT in Business Industry 
 Government (ICTBIG), November 2016, pp 1-3.
 [4]. Kriti Chadha and Sushma Jain, “ Impact Of Black Hole And Gray Hole Attack In AODV 
 Protocol”, IEEE International Conference on Recent Advances and Innovations in Engineering 
 (ICRAIE), May 2014, pp 1-7.
 [5]. Mehdi Medadian, M.H. Yektaie, A.M Rahmani, “Combat with Black Hole Attack in AODV 
 routing protocol in MANET”, First Asian Himalayas International Conference on Internet, November 
 2009, pp 1-5.
 [6]. Padmalaya Nayak, V. Bhavani and B. Lavanya, “Impact of Black Hole and Sink Hole Attacks on 
 Routing Protocols for WSN”, International Journal of Computer Applications, April 2015, vol 116, 
 pp 42-46.
 [7]. Semih Dokurer, Y. M. Erten and Can Erkin Acar, “Performance analysis of ad-hoc networks 
 under black hole attacks”, IEEE SoutheastCon Proceedings, March, 2007, pp 148-153.
 [8]. T.Sairam Vamsi, E.R. Praveen Kumar, T.Sruthi, “Performance Analysis of Aodv Routing Protocol 
 in Manet under Blackhole Attack”, International Journal of Engineering Research and Applications, 
 May 2019, vol. 9, pp 58-63.
 [9]. Yatin Chauhan, Jaikaran Singh, Mukesh Tiwari, Anubhuti Khare, “Performance Evaluation of 
 AODV based on black hole attack in ad hoc network”, Global Journal of researches in engineering 
 Electrical and electronics engineering, February 2012, Vol. 12, pp 43-47.
 [10]. VINT Project, “The network simulator - NS2,”  (accessed: Sep 5, 
 2019), 1997.
 [11]. Elbasher Elmahdi, Seong-Moo Yoo and Kumar Sharshembiev, “Securing Data Forwarding 
 against Blackhole Attacks in Mobile Ad Hoc Networks”, Jan. 2018, pp 463-467.
 PHÁT HIỆN VÀ TRÁNH TẤN CÔNG HỐ ĐEN TRÊN GIAO THỨC ĐỊNH TUYẾN AODV 
 TRONG MẠNG MANET SỬ DỤNG NS2
Tóm tắt:
 An ninh là một trong những vấn đề quan trọng của mạng di động tùy biến (MANETs) vì đồ hình di 
chuyển động, thiếu thiết bị điều phối trung tâm và dàng buộc về băng thông. Có nhiều kiểu tấn công mất 
an toàn như từ chối dịch vụ, tấn công lỗ sâu, phát lại, tấn công lỗ xám, lỗ đen, v.v. Mục tiêu của cuộc tấn 
công mạng thường làm gián đoạn hoạt động của mạng hoặc ảnh hưởng đến hiệu suất mạng. Trong bài 
báo này, chúng tôi đánh giá hiệu suất của nhiều nút tấn công lỗ đen đồng thời trong giao thức định tuyến 
AODV về thông lượng, hiệu quả sử dụng năng lượng và hiệu suất phân phối gói dữ liệu. Chúng tôi cũng 
đề xuất kỹ thuật phát hiện và tránh tấn công lỗ đen (dam) trong mạng MANET. Các kết quả mô phỏng của 
chúng tôi cho thấy trong mạng có càng nhiều nút tấn công đồng thời thì hiệu suất và hiệu quả năng lượng 
càng thấp và nếu có triển khai kỹ thuật phát hiện và tránh tấn công hố đen thì hiêu năng mạng có thể cải 
tiến được khoảng 35%.
Từ khóa: AODV, Black hole attack, MANET, Network Simulator, Routing Protocols, Security threats. 
46 Khoa học & Công nghệ - Số 27/Tháng 9 - 2020 Journal of Science and Technology

File đính kèm:

  • pdfdetection_and_avoidance_mechanism_of_black_hole_attack_on_ao.pdf