Beruflich Dokumente
Kultur Dokumente
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/279800363
M Tech Thesis
CITATIONS READS
0 4,994
1 author:
Bikram Ballav
Institute of Technical Education and Research
16 PUBLICATIONS 4 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Bikram Ballav on 21 August 2015.
Dissertation
Master of Technology
CSE
by
Bikram Ballav
Regd. No : 1361012004
Department of CSE
Institute of Technical Education and Research
Siksha ’O’ Anusandhan University
2015
Dissertation Approval Certificate
(External Examiner)
I declare that this written submission represents my ideas in my own words and
where others ideas or words have been included, I have adequately cited and ref-
erenced the original sources. I also declare that I have adhered to all principles
of academic honesty and integrity and have not misrepresented or fabricated or
falsified any idea/data/fact/source in my submission. I understand that any vio-
lation of the above will cause for disciplinary action by the Institute and can also
evoke penal action from the sources which have thus not been properly cited or
from whom proper permission has not been taken when needed.
(Signature)
Bikram Ballav
Regd No 1361012004
Acknowledgment
Bikram Ballav
Redg No 1361012004
Abstract
1 Introduction 1
1.1 Motivation behind this Thesis: . . . . . . . . . . . . . . . . . . . . . 4
1.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Organization of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . 6
1
4.1.4 Impersonation Attack . . . . . . . . . . . . . . . . . . . . . 23
4.1.5 Sink Hole Attack . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.6 Worm Hole Attack . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.7 Sybil Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.8 Selective Forwarding Attack . . . . . . . . . . . . . . . . . . 24
4.2 Motivation and Challenges behind security . . . . . . . . . . . . . . 24
6 Network Simulator 33
6.1 NS Network Simulator . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.2 Tcl Language in NS . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.3 Trace File Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1 NAODV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.2 BAODV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.3 NZEEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.4 BZEEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Introduction
In this new era of communication, the advent of mobile computing has revolu-
tionized our information society. The proliferation of new, powerful, efficient and
compact communicating devices like personnel digital assistants (PDAs), pagers,
laptops and cellular phones, having extraordinary processing power paved the way
for advance mobile connectivity. We are moving from the Personal Computer age
to the Ubiquitous Computing age in which a user utilizes, at the same time, sev-
eral electronic platforms through which he can access all the required information
whenever and wherever needed. The nature of ubiquitous devices makes wireless
networks the easiest solution for their interconnection and, as a consequence, the
wireless arena has been experiencing exponential growth in the past decade .
Among the numerous applications and services run by mobile devices, net-
work connections and corresponding data services are the most demanding ones
[1]. Currently, most of the connections among the wireless devices are achieved
via fixed Infra-structure based service provider, or private networks. While infra-
structure based networks provide a great way for mobile devices to provide network
services, it takes time and potentially high cost to set up the necessary infrastruc-
ture. There are, many situations where user required networking connections are
not available in a given geographic area, and providing the needed connectivity
and network services in these situations becomes a real challenge [2].
For all these reasons, combined with significance advances in technology and
standardization, new alternative ways to deliver mobile connectivity have been
emerging. These are focused around having the mobile devices connect to each
other in the transmission range through automatic configuration, setting up an ad
hoc mobile network that is both flexible and powerful.
AWireless Sensor Network (WSN) is a collection of relatively inexpensive
computational nodes that measure local environmental conditions like tempera-
ture, sound, pressure etc and forward such information to a base station for ap-
propriate processing [2]. WSN is somehow similar to ad hoc mobile network in
1
the sense that both are resource constrained, like the battery power, computation
capacity, communication range and memory. WSNs nodes (WNs) can sense the
environment, can communicate with neighboring nodes, and can, in many cases,
perform basic computations on the data being collected.
challenges:
Sensor nodes are deployed randomly in the application area, as a result of that,
the WSN has usually varying degrees of node density along its area. The probably
difference of node density among some regions of the network and the energy con-
straint of the sensor nodes cause nodes slowly die making the network less dense
[1].
Also it is quite common to deploy WSNs in harsh environment, what makes
many sensors faulty [3]. For that reason, these networks need to be fault-tolerant
so that the need for maintenance is minimized. Typically the network topology
is changing dynamically. The solution for this problem is to implement routing
protocols that perform efficiently and utilizing the less amount of energy as possible
for the communication among nodes.
2
Applications of WSN :
WSNs support a wide range of useful applications, ranging from environmental
sensing to vehicle tracking, from perimeter security to inventory management, and
from habitat monitoring to battlefield management. With WSNs one can monitor
and control factories, offices, homes, vehicles, cities, the ambiance, and the envi-
ronment etc. For example, one can detect structural faults (e.g., fatigue-induced
cracks) in ships, aircraft,and buildings. Also applications like Volcanic eruption,
earthquake detection, and tsunami alerting that generally require Wireless Nodes
deployed in remote, even difficult-to-reach locations [2].
3
nodes consist of a radio transceiver and a microcontroller powered by a battery.
As well as some kind of sensor for detecting light, heat, humidity, temperature,
etc and a mobilizer to move , that depends on application itself.
Challenges:
Broadly speaking there are two sets of challenges in MSN; hardware and en-
vironment [4].The main hardware constraints are limited battery power and low
cost requirements.The limited power means that it’s important for the nodes to be
energy efficient.For low cost requirement low complexity algorithms are used.The
major environmental factors are the shared medium and varying topology.The
shared medium dictates that channel access must be regulated in some way.This
is often done using a medium access control (MAC) scheme, such as carrier sense
multiple access (CSMA), frequency division multiple access (FDMA) or code di-
vision multiple access (CDMA).The varying topology of the network comes from
the mobility of nodes, which means that multihop paths from the sensors to the
sink are not stable. For routing purpose Ad-hoc protocols are preferred as they are
able to work in mobile environments, where WSN protocols often aren’t suitable.
Applications of MSN:
The advantage of allowing the sensors to be mobile increases the number of
applications beyond those for which static WSNs are used. Sensors can be attached
to people for health monitoring, which may include heart rate, blood pressure etc.
Animals can have sensors attached to them in order to track their movements for
migration patterns, feeding habits or other research purposes. Sensors may also
be attached to unmanned aerial vehicles (UAVs) for surveillance or environment
mapping [4].
4
approaches are required to address the issues raised due to unpredictable move-
ments of nodes.Frequent movements in MSN result in path breakage.Whenever
routing of packet is disrupted due to a path break, we need to reroute the data
through alternative path or the packets will be dropped, resulting in loss or de-
layed data delivery [5].For this we instantly need to repair the route or use any
backup path if available.Currently there is no standard for MSN, so often proto-
cols from MANETs are borrowed, such as Ad hoc On-Demand Distance Vector
Routing (AODV), Dynamic Source Routing (DSR) and Greedy Perimeter State-
less Routing (GPSR) these three protocols are standard for MSN.
Since there is no fixed topology in these networks, one of the greatest challenges is
routing data from its source to the destination. Generally these routing protocols
draw inspiration from two fields; WSN and mobile ad hoc networks (MANETs).
WSN routing protocols provide the required functionality but cannot handle the
high frequency of topology changes. Whereas, MANET routing protocols can deal
with mobility of the network [4].
Protocols designed specifically for MSN are almost always multihop and modifica-
tions of existing protocols.Most of these protocols assume a trusted and cooperative
environment. However, in the presence of malicious nodes, the networks are vul-
nerable to various kinds of attacks.This thesis work is based on one of the security
attack known as Black hole attack and how it affect zone based energy efficient
routing protocols.
In this thesis, we investigate the effect of Black hole attack on zone based energy
efficient routing protocol called ZEEP. This thesis details the working principles
of Black hole attack and analyses its effect in the presence of quality of service pa-
rameters that involves packet delivery ratio,throughput and energy consumption.
The extensive simulations performed over Black-hole affected ZEEP(BZEEP) proved
that BZEEP gives high packet delivery ratio, with less energy consumption by the
network,thereby increasing the network lifetime when compared to the Black-hole
affected Ad-hoc On Demand Distance Vector routing (BAODV) protocol.The sim-
ulations are performed over Network Simulator version 2.35(NS2.35).
1.2 Objective
The goal of this thesis is two-fold.
(i) It aims towards implementing and analyzing the effect of routing attack for
energy efficient routing protocols.
(ii) The results of simulation has shown that Black hole affected Zone based en-
ergy efficient routing protocol (BZEEP) has a better performance compared
to the black hole affected famous on demand based routing protocol Ad hoc
5
on demand distance vector routing protocol (BAODV) in terms of energy
consumption and packet delivery ratio of the network.
6
Chapter 2
7
2.1.1 Design Constraints
Although WSNs share many commonalities with wired and ad hoc networks, they
also exhibit a number of unique characteristics which set them apart from existing
networks. Meeting these design requirements presents a distinctive and unique set
of challenges [6].
These challenges can be attributed to multiple factors, including severe energy
constraints, limited computing and communication capabilities, the dynamically
changing environment within which sensors are deployed, and unique data traffic
models and application-level quality of service requirements.
1.Network Scale and Time-Varying Characteristics: There is a need for
self-organize sensor nodes to adjust their behavior constantly in response to their
current level of activity.Furthermore, sensor nodes may be required to adjust their
behavior in response to the erratic and unpredictable behavior of wireless con-
nections caused by high noise levels and radio-frequency interference, to prevent
severe performance degradation of the application supported.
2.Resource Constraints: Sensor nodes are designed with minimal complexity for
large-scale deployment at a reduced cost.Energy is a key concern in WSN, which
must achieve a long lifetime while operating on limited battery reserves.Multi-hop
packet transmission over wireless networks is a major source of power consump-
tion.The requirements of these applications are such that a predetermined level of
sensing and communication performance constraints must be maintained simulta-
neously.Therefore, a question arises as to how to design scalable routing algorithms
that can operate efficiently for a wide range of performance constraints and design
requirements.The development of these protocols is fundamental to the future of
WSN [7].
3.Sensor applications Data Models: The data model describes the flow of
information between the sensor nodes and the data sink.These models are highly
dependent on the nature of the application in terms of how data are requested and
used [4].
The need to support a variety of data models increases the complexity of the rout-
ing design problem. Optimizing the routing protocol for an applications specific
data requirements while supporting a variety of data models and delivering the
highest performance in scalability, reliability, responsiveness, and power efficiency
becomes a huge design and engineering problem .
And not only these there are many more routing challenges and design issues exist
like Node/Link Heterogeneity , Fault Tolerance , Scalability ,Network Dynam-
ics,Transmission media , Connectivity , Coverage , Data aggregation , Quality of
service etc.
8
2.1.2 WSN Applications
• military sensing
• physical security
• air traffic control
• traffic surveillance
• video surveillance
9
• industrial and manufacturing automation
• process control
• inventory management
• distributed robotics
• weather sensing
• environment monitoring
• national border monitoring
• building and structures monitoring etc.
10
2.2.3 Dis-advantages:
The introduction of mobility in WSN is a very challenging task due to path break-
age and node failure. Also frequent location changes can lead to drain of energy
and increase of collisions.
11
been developed recently to address the energy efficiency issue.In wireless networks
routing protocols normally specified in following three types:
12
Chapter 3
• The devices used in MSN are resource constrained, they have a low processing
speed, a low storage capacity and a limited communication bandwidth.
• Moreover, the network has to operate for long periods of time, but the nodes
are battery powered, so the available energy resources limit their overall
13
operation. To minimize energy consumption, most of the device components,
including the radio, should be switched off most of the time.
The main design goal of MSN is not only to transmit data from a source to a des-
tination, but also to increase the lifetime of the network [9]. This can be achieved
by employing energy efficient routing protocols.
Depending on the applications used, different architectures and designs have been
applied in MSN.The performance of a routing protocol depends on the architecture
and design of the network, and this is a very important feature of MSN. However,
the operation of the protocol can affect the energy spent for the transmission of
the data.
All these factors are important and should be considered when developing
protocols for MSN. The communication of the sensor nodes is the major component
of the energy consumption.
I.The potential task of the protocols is not only to find the lowest energy path
from a source to a destination, but also to find the most efficient way to extend
the networks lifetime.
III.The Shortest Path routing schemes figure out the shortest path from any
given node to the destination node. If the cost, instead of the link length, is asso-
ciated with each link, these algorithms can also compute the minimum cost routes.
14
then routing data on the minimum-cost paths can overload wireless links close to
the base station. Therefore, a routing protocol must take into consideration the
wireless channel bandwidth limitation,otherwise,it might route the packets over
highly congested links and paths.
V.The efficient Dijkstra algorithm, which has polynomial complexity, and the
Bellman-Ford algorithm, which finds the path with the least number of hops are
the two very well known and well-defined algorithms for shortest path routing.
15
3.2 Types of Zone Based Energy Efficient Rout-
ing Protocols
3.2.1 Zone Routing Protocol (ZBR)
Zone Based Routing (ZBR) : The zone based routing scheme that is modified from
Adhoc Ondemand Distance Vector Routing protocol [11].The goal of this protocol
is to develop a routing protocol that offer reliability, improved error control mech-
anism, better link repair with low overhead in MSN [5].
PROTOCOL OPERATION:
In ZBR,after observing an event the member nodes transmit data to their respec-
tive zone head, which is always one hop neighbor of all member nodes. Zone head
performs the aggregation depending on the type of application and transmit the
aggregated or individual data to the base station. Route discovery, maintenance
and consistent availability of route for reliable data delivery are the core responsi-
bility of the zone head.
The protocol is divided into three phases which are individually addressed in the
following sections.
Mobility Factor and Zone Head Selection: Depending on the remaining
energy and the ratio of number of timesa node change it’s zone with respect to
total number of moves it perform during t seconds is used to calculate the Mobil-
ity factor for ZBR protocol.Each node keeps track of its mobility and records the
number of movements it has made and the energy spent in these movements.
Here, a move is considered as the change in location of node without a pause,
irrespective of the distance, destination and direction.A node may change its zone
as a result of a movement and joins a new zone as a member.
The zone head selection procedure starts with each node broadcasting its Mobility
factor( M.F). This broadcast is intended for the members of the same zone and is
discarded by others. Initially each node keeps its own M.F as the zone head M.F.
Once a broadcast is received, the node compares the zone head M.F with the one
received. If the received value is lower than the value already kept, the zone head
M.F and zone head identifier are appropriately updated.
At the end of the broadcast phase, each node has the knowledge of the node with
least mobility factor and hence the node is considered as a zone head.
The lowest values of M.F ensures that the node will serve as zone head for longer
duration and if participating in the route towards the base station the route will
be stable for maximum period of time[5].
Route Maintenance: This section describes the format of enhanced route re-
quest, route reply and the process of route creation and preservation for ZBR
protocol.
16
1) Route Request:
A zone head broadcast a Route request (RREQ) packet when it determines that
it needs a route to the base station and does not have any route.The broadcast
continues in the network until the request reaches the base station.The entire
network is devided into number of zones , each zone have a Zone ID and each
node have Node ID,these are unique.Each zone have a zone head which also have
a Node ID.
2)Route Reply:
When a node in the neighborhood receives a RREQ, it discards the RREQ if it is
not the zone head.Only the zone head of the respective zone upon receiving the
RREQ verifies that it has not received the same RREQ before.Thus reducing the
number of route requests in the network.
It then creates a reverse route to the sender of RREQ and rebroadcast the RREQ
or otherwise unicast a route for the destination back to the originator if it has a
route to the destination that is not expired.
The base station creates a reverse route with the sender and then generates a
Route reply(RREP) and unicast it toward the originator zone.
3) Route Creation:
When a zone head gets a request it then broadcast that request to it’s neighbour
zone heads by setting the hop count to zero. Neighboring zone heads receives
the RREQ, establish the reverse route with sending zone head, increment the hop
count and rebroadcast the RREQ as they have no route to the base station. The
RREQ is broadcasted in the entire network. Contrary to the normal operation of
AODV[11], this RREQ is of no concern to the member nodes. Only zone head are
the one responsible for receiving and replaying the RREQ making sure that same
RREQ is not accepted more than once. This reduces the amount of route requests
produced in the entire network.
The RREQ reaches the base station through the closest zone head to the base
station. The reverse route for The base station in turn caches nearest zone head
as the next hop in reverse route for sending zone head and generate the RREP
message.
In case the zone head from any zone had moved out to a different zone, it had
immediately been replaced by another node which had the least mobility factor at
that time. So as long as there is only one node in the zone, it is the zone head and
it is responsible for responding to the control packet. This fact concludes that the
movement in zone has no effect on the underlying routing information.
This scheme also helps in efficient topology maintenance.Since the zone head is
responsible for routing and route management as few zone members can be in
sleep state to conserve energy[5].
17
3.2.2 Zone Based Energy Efficient Routing Protocol (ZEEP)
In case of ZEEP also Mobility Factor is calculated to select the zone head.The
goal of this protocol is to reduce the number of control packets than ZBR.It has
two phases.
18
If a node with more remaining energy and lesser mobility factor is seen in
comparison to the current zone head, then this node becomes the new zone head.
The process of zone head selection is repeated periodically.
Phase 2. Packet Forwarding– Each node in the network,including zone
head and base station possesses a unique identifier and is named as Node ID. Each
node will keep track of its mobility factor; number of zone changes it made, the
zone size, and a zone table[10]. This table maps the zone ids and the corresponding
locations to which they are attached and a zone head. A maximum of 10 entries
is present in a zone table.
When a source node is ready to send the data it initially checks whether it is a
zone head or not.If it is not a zone head it sends a control packet to corresponding
zone head.That zone head send control packet to it’s nearest zone head towards
destination.
Once this control packet is received by the base station it sends acknowledge-
ment back to the source by considering the distance factor. Once the acknowl-
edgement is received by the source, the source starts sending the data. The base
station acknowledges for each and every packet.If the source node does not receive
any acknowledgement for the data packet it stops sending the data and sends
the control packet periodically until the control packet is delivered. This helps in
maintaining consistent path towards the base station[10].
19
Chapter 4
Due to their own nature a variety of attacks are possible in Wireless Networks.
These security attacks can be classified according to different criteria, such as
the domain of the attackers, or the techniques used in attacks[12].These security
attacks can be roughly classified by the following criteria:
• passive or active
• internal or external
• stealthy or non-stealthy
20
Figure 4.1: Security attacks in WSN [16]
21
dentiality paradigm. In a wireless environment it is normally impossible to detect
this kind of attack, as it does not produce any new traffic in the network.
Active Attacks:Active attacks may either be directed to disrupt the normal op-
eration of a specific node or target the operation of the whole network.
The action of an active attacker includes injecting packets to invalid destinations
into the network, deleting packets, modifying the contents of packets, and im-
personating other nodes which violates availability, integrity, authentication, and
non-repudiation paradigm.
Contrary to the passive attacks, active attacks can be detected and eventually
avoided by the legal nodes that participate in an ad-hoc network.
22
4.1.4 Impersonation Attack
Due to lack of authentication in ad-hoc networks, only MAC or IP addresses
uniquely identify hosts[16]. These addresses are not adequate to authenticate the
sender node. Therefore non repudiation is not provided for ad-hoc network proto-
cols. MAC and IP spoofing are the simplest methods to pretend as another node
or hide in the network. Malicious nodes achieve impersonation only by changing
the source IP address in the control message. Another reason for impersonation is
to persuade nodes to change their routing tables pretending to be a friendly node,
such as attacks against routing table.
One of the interesting impersonations is Man-in-the-middle attack[16]. Malicious
node performs this attack by combining spoofing and dropping attacks. Physi-
cally, it must be placed as the only node within the range for destination, in the
middle of the route or victim node must be prevented from receiving any other
route information to the destination.
Malicious node may also change the routing tables of the victim node to redirect
its packets, using attacks against the routing table. At this point, malicious node
waits for an RREQ message to the destination node from source node[18]. When
source node sends an RREQ message, malicious node drops the RREQ and replays
a spoofed RREP message to source node as if it is coming from the destination
node.
At the same time, malicious node sends a RREQ message to the destination node
and drops the RREP message from the destination node. By doing this; malicious
node manages to establish a route both to the source and the destination node and
attacker controls the communication between the source and destination. If the
communication is encrypted or entails an authentication as to MAC or IP address,
malicious node can easily get the up layer communication.
23
between the two of them[17].
24
Chapter 5
25
Figure 5.1: Black hole Attack in AODV protocol
26
network. And we call this problem is a Black-hole problem[23].In this way the
malicious node3 can easily misroute a lot of network traffic to itself, and could
cause an attack to the network with very little efforts on its part.
27
node must increase the destination sequence number sufficiently to convince the
source node that the route provided is sufficiently enough. Based on this analysis,
the authors propose a statistical based anomaly detection approach to detect the
black-hole attack, based on differences between the destination sequence numbers
of the received RREPs. The key advantage of this approach is that it can detect
the attack at low cost without introducing extra routing traffic, and it does not
require modification of the existing protocol. However, false positives are the main
drawback of this approach due to the nature of anomaly detection.
In [26], authors proposed two solutions to Black-hole attack .The first solution
to the black hole problem is to disable the ability to reply in a message of an
intermediate node, so all reply messages should be sent out only by the destination
node. This method can avoid the black hole problem and implement a secured
AODV protocol.
But there are two associated disadvantages. First, the routing delay is greatly
increased, especially for a large network. Second, a malicious node can take further
action such as fabricate a reply message on behalf of the destination node. The
source node cannot identify if the reply message is really from the destination
node or fabricated by the malicious node. In this case, the method may not be
adequate.
The second solution use one more route to the intermediate node that replays
the RREQ message to check whether the route from the intermediate node to the
destination node exists or not. If it exists, we can trust the intermediate node
and send out the data packets. If not, we just discard the reply message from
the intermediate node and send out alarm message to the network and isolate the
node from the network.
28
Figure 5.2: Calculation of Mobility Factor (M.F) for ZEEP to select Zone Head
Figure 5.2 gives you an idea about how to calculate the MF.For each node we
need to calculate the MF then for each zone compare the MF of each node with
other ones.The node which have Less MF will be the zone head (ZH).After selecting
ZH we can send the packet to base station by first create the route through control
packet then sending data packet along the path.
Now in case of Black-Hole Attack in ZEEP protocolthe malicious node show
it’s remaining energy high above than other nodes in it’s zone.For that it’s MF is
low than compared to remaining nodes in the zone.When a malicious node enter
the zone it enter as a normal node then show it’s MF and compare with ZH.
it’s obvious that this node have less MF than current ZH.This makes malicious
29
node current ZH.After becoimg the ZH it can able to communicate with source
node. Now if this malicious ZH is in the route of data packets send by source node
towards base station. It capture those packets and drop them.
Figure 5.3: Black hole affected path Vs Normal path in case of ZEEP protocol
Figure 5.3 shows you the black-hole affected path and normal route to send
30
the data packets.That blackhole affected path does not exist in reality.Malicious
ZH show this path to source zone head so that it can send it’s data packets along
this malicious node.
Figure 5.4: Drop of packets due to black hole attack on ZEEP protocol
Now in figure 5.4 you can see how the packets are dropping when packets
are passing through malicious ZH.This phenomenon affect the effectiveness of the
whole network.
31
Due to this attack the data packets can not reach the destination and packet de-
livery ratio along with throughput affected very much.Mobility cause path breaks
but black hole attck grasp all packets in the network causes energy waste and
dying of whole network.
Though ZEEP provide better packet overhead and causes longer route maintenance
due to dynamic forwarding ,it can affect badly due to black-hole attack.Harm the
throughput of whole network and eventually result in delay in delvery or packet
loss or dying of network.
32
Chapter 6
Network Simulator
33
Figure 6.1: Network Animator or NAM to show output for NS 2.35
At the simulation layer NS uses OTcl (Object oriented Tool Command Lan-
guage) programming language to interpret user simulation scripts. OTcl language
is in fact an object oriented extension of the Tcl Language. The Tcl language is
fully compatible with the C++ programming language. At the top layer, NS is an
interpreter of Tcl scripts of the users, they work together with C++ codes.
34
being interpreted, NS creates two main analysis reports simultaneously. One of
them is NAM (Network Animator) object that shows the visual animation of the
simulation. The other is the trace object that consists of the behavior of all objects
in the simulation. Both of them are created as a file by NS. Former is .nam file
used by NAM software that comes along with NS. Latter is a .tr file that includes
all simulation traces in the text format[29].
NS project is normally distributed along with various packages (ns, nam, tcl,
otcl etc.) named as all-in-one package, but they can also be found and downloaded
separately. In this study we have used version 2.29 of ns all-in-one package and
installed the package in the Windows environment using Cygwin. After version 2,
NS is commonly using a NS-2 and in our thesis we shell refer to it as NS-2. We
have written the .tcl files in text editor and analyzed the results of the .tr file using
cat, awk, wc and grep commands of Unix Operating System. The implementation
phase of the Black hole behavior to the AODV protocol is written using C++.
The first field in figure 6.2 is an event.It gives you four possible symbols ’+’ ’-’ ’r’
’d’.These four symbols correspond respectively to enqueued, dequeued, received
and dropped.
The second field gives the time at which the event occurs.
The third field gives you the input node of the link at which the event occurs .
The fourth field gives you the the output node at which the event occurs.
The fifth field shows the information about the packet type.i.e whether the packet
is UDP or TCP.
The sixth field gives the packet size.
The seventh field give information about some flags.
The eight field is the flow id(fid) for IPv6 that a user can set for each flow in a tcl
script.It is also used for specifying the color of flow in NAM display .
The ninth field is the source address.
35
The tenth field is the destination address.
The eleventh field is the network layer protocol’s packet sequence number.
The last field shows the unique id of packet.
36
Chapter 7
37
7.2 Simulation Parameters and Measured Met-
rics
To take accurate results from the simulations, we used UDP protocol. The source
node keeps on sending out UDP packets, even if the malicious node drops them,
while the node finishes the connection if it uses TCP protocol. Therefore, we could
observe the connection flow between sending node and receiving node during the
simulation. Furthermore we were able to count separately the sent and received
packets since the UDP connection is not lost during the simulation[29]. If we had
used TCP protocol in our scenarios we could not count the sent or received packets
since the node that starts the TCP connection will finish the connection after a
while if it has not received the TCP ACK packet.
We generate a small size network that has 10 nodes and create a UDP connection
between Node 1 and Node 2, and attach CBR (Constant Bit Rate) application
that generates constant packets through the UDP connection. CBR packet size is
chosen to be 512 bytes long, data rate is set to 1 Mbyte. Duration of the scenarios
is 20 seconds and the CBR connections started at time equals to 1.0 seconds and
continue until the end of the simulation, in a 79 x 659 meter flat space. We
manually defined appropriate positions of the nodes to show the data flow and
also introduce a movement to Node 8 and Node 4 to show the changes of the data
flow in the network.
38
Figure 7.1: NAODV
39
Figure 7.2: BAODV
Simulation of Normal ZEEP protocol Here node 0 is the source node and node
2 is destination node , packets are passing through node 1 which is intermediate
one.
40
Figure 7.3: NZEEP
41
Figure 7.4: BZEEP
42
receiving nodes
MAC value of the trace level information in the Field 4, to filter MAC level.
source address and destination address values of the source and destination address
information in Field 5, to count the packets that goes from the sending node to
the receiving node .
cbr value of the packet type information in the Field 5, to filter CBR packets. To
filter this information we used grep command of UNIX reading the file generated
by cat command and gave its output to wc (word count) command of UNIX as an
input to count how much information is filtered and wrote the result to a new file.
For example; to count CBR packets sent by Node 0 (sending node) the command
grep s 0 MAC — 0.0 1.0 cbr is used.
On the other hand, to count CBR packets received by Node 1 (receiving node),
grep r 1 MAC — 0.0 1.0 cbr is used. These commands are applied for all nodes in
the all simulations and are written as a batch file.
43
Chapter 8
8.1.2 Throughput
It is defined as total number of packets received by the destination. It is a measure
of effectiveness of a routing protocol. There is two representations of throughput
one is the amount of data transferred over the period of time expressed in kilobits
per second (Kbps). The other is the packet delivery percentage obtained from a
ratio of the number of data packets sent and the number of data packets received.
44
8.2 Analysis of result
First Graph :
From the first graph in figure 8.1 it is clear that black hole affected ZEEP
provide better packet delivery ratio than Black hole affected AODV .
Second Graph: From the second graph in figure 8.2 it is clear that black hole
affected ZEEP provide better throughput than Black hole affected AODV .Red
lines indicate BAODV where green line indicate BZEEP.
45
Figure 8.2: BAODV Vs BZEEP wrt throughput
Third Graph:
46
Figure 8.3: BZEEP Vs NZEEP wrt throughput
From the third graph in figure 8.3 it is clear that Normal ZEEP provide better
throughput than Black hole affected ZEEP.
Fourth Graph:
From the fourth graph in figure 8.4 it is clear that NAODV provide better
47
throughput than Black hole affected AODV .
Fifth Graph:
From the fifth graph in figure 8.5 we get the idea that Normal AODV provide
better packet delivery ratio than Black hole affected AODV.
Sixth Graph:
48
From the sixth graph in figure 8.6 we conclude that black Normal ZEEP provide
better packet delivery ratio than Black hole affected ZEEP.
Energy Conservation:
Total energy consumption of the network is evaluated on the basis of total amount
of control packets and data packets generated and successfully delivered. Energy
consumed also depends on the amount of energy spent during zone creation,
clustering, and leader selection in the algorithm.The Constant Bit Rate or
CBR flow is not continuous and varies with respect to time.The results are con-
sidered for both the protocols in the same scenario. As observed from the seventh
graphs, it is clearly seen that the total energy consumption of the network, whether
the nodes are stationary or mobile in ZEEP, is considerably less when compared
to AODV.
Seventh Graph:
From the seventh graph in figure 8.7 based on energy conservation parameter,
it is clear that Normal AODV consume more energy than Normal ZEEP .
49
Chapter 9
9.1 Conclusion
From the above graphs for simulation results has shown that ZEEP has a better
performance compared to AODV protocol in terms of energy consumption of the
network. Black hole affected ZEEP(BZEEP) provide better packet delivery ratio
and throughput than black hole affected AODV(BAODV).That means the effect
of black hole attack is more severe in case of AODV protocol than energy efficient
routing protocols.
50
Bibliography
[4] Getsy S Sara and D. Sridharan, Routing in mobile wireless sensor network:
a survey, Springer, Aug. 2013.
[5] Faisal Bashir Hussain, Usama Ahmed, ”Energy Efficient Routing Protocol
for Zone Based Mobile Sensor Networks ”, IEEE 2011, pp.1081-1086.
51
[10] J R Srivastava, TSB Sudarshan ,ZEEP: Zone based Energy Efficient Rout-
ing Protocol for Mobile Sensor Networks , IEEE International Conference
on Advances in Computing, Communications and Informatics (ICACCl) ,
2013 .
[12] Ray Hunt, Network Security: The Principles of Threats, Attacks and In-
trusions, part1 and part 2 ,” APRICOT, 2004.
[16] Chris Karlof, David Wagner, Secure Routing in Wireless Sensor Networks:
Attacks and Countermeasures, AdHoc Networks (elsevier), Page: 299-302,
year 2003.
[17] Zia, T.; Zomaya, A., Security Issues in Wireless SensorNetworks, Systems
and Networks Communications (ICSNC) Page(s):40 40, year 2006.
[20] D. Johnson, D. Maltz and J. Broch, DSR the Dynamic Source Routing Pro-
tocol for Multihop Wireless Ad Hoc Networks. Ad Hoc networking, Chapter
5, page 139-172. Addison-Wesley, 2001.
[21] Deng, H., Li, W., Agrawal, D., ”Routing Security in Wireless Ad Hoc Net-
works” IEEE Communication Magazine (October 2002) pp. 70-75.
[22] Al-Shurman, M., Yoo, S., Park, S., ”Black hole Attack in Mobile Ad Hoc
Networks”, ACM Southeast Regional Conference (2004) pp. 96-97.
52
[23] Semih Dokurer , Y. M. Erten , Can Erkin Acar., Performance analysis of
ad-hoc networks under black hole attacks IEEE Southeast conference , 2007
.
[25] S. Lee, B. Han, and M. Shin, Robust Routing in Wireless Ad Hoc Networks,
2002 Intl. Conf. Parallel Processing Wksps., Vancouver, Canada, Aug. page
18-21, 2002.
[29] http://www.isi.edu/nsnam/ns/.
53