Sunteți pe pagina 1din 167

Library Declaration Form

S A P E R E - A U D E
University of Otago Library
Authors full name and year of birth: Femi A. Aderohunmu,
(for cataloguing purposes) 17 July 1982
Title of thesis: Energy Management Techniques in Wireless Sensor Networks: Protocol
Design and Evaluation
Degree: Master of Applied Science in Telecommunication
Department: Department of Information Science
Permanent Address: 115 Union Street, Dunedin, NZ
I agree that this thesis may be consulted for research and study purposes and that
reasonable quotation may be made from it, provided that proper acknowledgement of
its use is made.
I consent to this thesis being copied in part or in whole for
i) a library
ii) an individual
at the discretion of the University of Otago.
Signature:
Date:
Energy Management Techniques
in Wireless Sensor Networks:
Protocol Design and Evaluation
Femi A. Aderohunmu
a thesis submitted for the degree of
Master of Applied Science in Telecommunication
at the University of Otago, Dunedin,
New Zealand.
March 2010
Abstract
While wireless sensor networks (WSN) are increasingly equipped to han-
dle more complex functions, in-network processing still requires the battery
powered sensors to judiciously use their constrained energy so as to pro-
long the eective network life time. There are a few protocols using sensor
clusters to coordinate the energy consumption in a WSN. To cope with
energy heterogeneity among sensor nodes, a modied clustering algorithm
is proposed with a three-tier sensor nodes setting. This approach is an im-
provement to the original SEP protocol that used two-tier node setting. The
result showed a better management of energy resource than both LEACH
and SEP.
In addition, two forms of extensions to LEACH algorithm, multi-hop and
dual-hop LEACH algorithms using a concentric circle around the BS, are
presented. The goal of these methods is to analyze the adaptation of dif-
ferent communication modes to the original LEACH protocol that used a
single-hop communication mode among its sensor nodes.
This thesis further carried out a spatial distribution of energy-based com-
parative study of homogeneous and heterogeneous clustered WSN. The
study revealed a new approach for analyzing the performance of wireless
sensor network protocol designs. Simulation has been conducted to evaluate
these new approaches and favorable results are obtained in both homoge-
neous and heterogeneous energy settings.
ii
To Mum and Dad...for your love.
iii
Acknowledgements
The success of this thesis is a result of the valuable contributions of many
people who merit to be mentioned. I wish to thank the Almighty God for
His grace and sustenance upon my life for the successful completion of this
thesis.
I would like to appreciate my supervisors; Dr. Jeremiah D. Deng and
Professor Martin K. Purvis for their patience, directions, constructive com-
ments, intellectual guidance, advice, and constant encouragements espe-
cially when I was confused.
The Otago International Master Award, which was awarded to me through-
out the period of my studentship, was crucial to the successful completion
of this thesis.
I am very grateful to my parents, Ruth and Isaiah for their ceaseless prayers
and all my family members for their invaluable contributions to me. With-
out them this work would never have come into existence.
To Dr. Brendon Woodford, who is always there to help me with debugging
errors in LaTex; I appreciate it. I am grateful to Dr. Mariusz Nowostawski,
with his friendly reminder of my goal for publications and his constructive
comments to my research work. I am thankful to A/Prof. Stephen Crane-
eld, for helping me with useful links to online thesis. And to many others
who have professionally and personally assisted the pursuit of this research
work, I say thank you all.
Am equally grateful to Dr. Georgios Smaragdakis for answering questions
about SEP and to Dr. Constantin Grigorut, who took the pain to proof-
read the draft copy of this thesis.
At the beginning of my research journey I had the pleasure to attend sem-
inars with the HEDC group; this really fashioned my research ideas and
iv
presentation skills, I say a big Thank You.
I wish to thank the following people: all my fellow colleagues both in Infor-
mation Science and Computer Science Departments, most especially Carl,
Bhaskar, Sheetal for their priceless contributions to my codes. Dr. Alvin
Etang (for your support), Sharmila (she is always ready to help), Prajesh
(has enough information to keep a colleague moving), Scout(for her inputs
to my graphics), Yuwei, Rasika, Peter, Toktam, Vivian, Aziz...(for the hard
times we had together). Upal (for all around the world discussions), Amith
and Nazir (for their casual and hilarious jokes).
Critics: I thank the following people for continually distracting me from
my research work; without them my research journey would have been much
longer than expected.....Tosin Samuel, Rahul Tiwari, Mikhail, Dan, Aaron,
Chris....(I enjoyed the time together on soccer eld) and Adeola (for your
friendliness and love). I say to you all this is my thesis! Thank you.
v
Theres two possible outcomes: if the result conrms the hypothesis, then youve made
a discovery. If the result is contrary to the hypothesis, then youve made a discovery.
Enrico Fermi
Knowledge rests not upon truth alone, but upon error also.
Carl Gustav Jung (1875-1961)
vi
Table of Contents
Table of Contents ix
List of Acronyms xiii
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Research Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Background 4
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Key Issues and Challenges of WSN designs . . . . . . . . . . . . 5
2.1.2 Wireless Sensor Network Architecture . . . . . . . . . . . . . . . 6
2.2 Layered Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Network organization Protocol . . . . . . . . . . . . . . . . . . . 8
2.2.2 MAC Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.3 Routing Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Clustered Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.1 Clustering Objectives . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.2 Homogeneous vs. Heterogeneous . . . . . . . . . . . . . . . . . . 11
2.4 LEACH Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1 LEACH Architecture . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.2 Cluster formation process of LEACH . . . . . . . . . . . . . . . 14
2.5 EDACH Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.1 EDACH Architecture . . . . . . . . . . . . . . . . . . . . . . . . 15
2.6 DEEC Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6.1 DEEC Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.7 SEP Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.1 SEP Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.8 EEUC Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8.1 EEUC Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
vii
3 An Extension of SEP and LEACH Models 22
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2 Network Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.1 Path Loss Model . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.2 Data Aggregation Model . . . . . . . . . . . . . . . . . . . . . . 24
3.2.3 Cluster Formation . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Extending SEP and LEACH . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3.1 Simulation Settings . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.2 Analysis of experiment . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.3 Comparing LEACH, SEP and SEP-E . . . . . . . . . . . . . . . 33
3.3.4 Validation of results using t-test . . . . . . . . . . . . . . . . . . 39
3.3.5 Test for the dierences between two means (Unpaired t-test) . . 40
3.3.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4 Communication Modes in Hierarchically Clustered WSN 44
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.2 Single-hop communication mode . . . . . . . . . . . . . . . . . . . . . . 45
4.2.1 Total Energy Dissipation for a Single-hop Mode in a Clustered
WSN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.3 Dual-hop and Multi-hop communication mode . . . . . . . . . . . . . . 47
4.3.1 Total Energy Dissipation in a Dual and Multi-hop Network in a
Clustered WSN . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.4 Assessing dierent communication modes in the design of LEACH Protocol 52
4.4.1 Dual-hop LEACH with Concentric Circle . . . . . . . . . . . . . 54
4.4.2 Multi-hop LEACH with Concentric Circle . . . . . . . . . . . . 56
4.4.3 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5 Assessing Spatial Uniformity of Energy Distribution in Clustered
WSNs 66
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.2 Relevance of grid granularity in WSN . . . . . . . . . . . . . . . . . . . 67
5.3 F-test analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.4 Spatial Energy Distribution in Homogeneous and Heterogeneous Networks 70
5.4.1 Validation and Analysis of Experiments . . . . . . . . . . . . . . 71
5.4.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6 Conclusion and Future Work 78
6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.2 Future Research Direction . . . . . . . . . . . . . . . . . . . . . . . . . 80
References 83
viii
A Source Code for Experiments 88
A.1 MATLAB scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
A.1.1 SEP-E code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
A.1.2 LEACH Heterogeneous code . . . . . . . . . . . . . . . . . . . . 99
A.1.3 SEP code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
A.1.4 Dual-hop code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
A.1.5 Multi-hop code . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
A.1.6 LEACH Homogeneous code . . . . . . . . . . . . . . . . . . . . 133
A.2 t-test Analysis and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . 141
A.2.1 SEP-E vs. LEACH Instability analysis . . . . . . . . . . . . . . 141
A.2.2 SEP-E vs. LEACH Stability analysis . . . . . . . . . . . . . . . 142
A.2.3 SEP-E vs. LEACH Half-live analysis . . . . . . . . . . . . . . . 142
A.2.4 SEP-E vs. SEP Stability analysis . . . . . . . . . . . . . . . . . 143
A.2.5 SEP-E vs. SEP Instability analysis . . . . . . . . . . . . . . . . 143
A.2.6 SEP-E vs. SEP Half-live analysis . . . . . . . . . . . . . . . . . 144
A.3 F-test Analysis and Results . . . . . . . . . . . . . . . . . . . . . . . . 144
A.3.1 SEP-E vs. LEACH Variance analysis-sample 1 . . . . . . . . . . 144
A.3.2 SEP-E vs. LEACH Variance analysis-sample 2 . . . . . . . . . . 145
A.3.3 SEP-E vs. LEACH Variance analysis-sample 3 . . . . . . . . . . 145
A.3.4 SEP-E vs. SEP Variance analysis-sample 1 . . . . . . . . . . . . 146
A.3.5 SEP-E vs. SEP Variance analysis-sample 2 . . . . . . . . . . . . 146
A.3.6 SEP-E vs. SEP Variance analysis-sample 3 . . . . . . . . . . . . 147
A.3.7 SEP vs. LEACH Variance analysis-sample 1 . . . . . . . . . . . 147
A.3.8 SEP vs. LEACH Variance analysis-sample 2 . . . . . . . . . . . 147
A.3.9 SEP vs. LEACH Variance analysis-sample 3 . . . . . . . . . . . 148
A.3.10 SEP-E vs. MLCC Variance analysis . . . . . . . . . . . . . . . . 148
A.3.11 SEP-E vs. DLCC Variance analysis . . . . . . . . . . . . . . . . 149
A.3.12 DLCC vs. LEACH Variance analysis . . . . . . . . . . . . . . . 149
A.3.13 MLCC vs. LEACH Variance analysis . . . . . . . . . . . . . . . 150
A.3.14 DLCC vs. MLCC Variance analysis . . . . . . . . . . . . . . . . 150
ix
List of Tables
3.1 Parameter settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.1 Parameter settings for MLCC, DLCC and LEACH . . . . . . . . . . . 59
4.2 Average lifetime for the sensors when the BS is located inside the sensing
region. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.1 SEP-E vs. LEACH F-test Result-Sample 1 . . . . . . . . . . . . . . . . 75
5.2 SEP-E vs. LEACH F-test Result-Sample 2 . . . . . . . . . . . . . . . . 75
5.3 SEP-E vs. SEP F-test Result . . . . . . . . . . . . . . . . . . . . . . . 75
5.4 DLCC vs. LEACH F-test Result . . . . . . . . . . . . . . . . . . . . . 75
x
List of Figures
2.1 Protocol Stack diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Layered architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Cluster Formation diagram . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 LEACH ow chart diagram . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5 EDACH model diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.6 ICM process advertisement diagram . . . . . . . . . . . . . . . . . . . . 17
2.7 EEUC model diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1 Network Model diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Wireless Sensor Network in clusters . . . . . . . . . . . . . . . . . . . . 27
3.3 Wireless Sensor Network Nodes Status; Live, Half-dead, Dead . . . . . 28
3.4 Performance of SEP-E, SEP, LEACH at Low Heterogeneity . . . . . . . 33
3.5 Performance of SEP-E, SEP, LEACH at Intermediate Heterogeneity . . 34
3.6 Performance of SEP-E, SEP, LEACH at High Heterogeneity . . . . . . 35
3.7 Rate of Energy Dissipation in SEP-E and LEACH . . . . . . . . . . . . 36
3.8 Throughput Graph for SEP-E, SEP and LEACH . . . . . . . . . . . . 36
3.9 SEP-E Versus LEACH stability for 10 trial runs . . . . . . . . . . . . . 37
3.10 SEP-E Versus LEACH instability for 10 trial runs . . . . . . . . . . . . 38
3.11 SEP-E Versus SEP stability for 10 trial runs . . . . . . . . . . . . . . . 38
3.12 SEP-E Versus SEP instability for 10 trial runs . . . . . . . . . . . . . . 39
4.1 Single-hop Network Design . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.2 Dual-hop Network Design . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3 Percentage of nodes within concentric circle R . . . . . . . . . . . . . . 50
4.4 DLCC algorithm Flow chart . . . . . . . . . . . . . . . . . . . . . . . . 55
4.5 MLCC algorithm Flow chart . . . . . . . . . . . . . . . . . . . . . . . . 56
xi
4.6 Performance of DLCC, MLCC and LEACH in the presence of low ho-
mogeneity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.7 Performance of DLCC, MLCC and LEACH in the presence of high ho-
mogeneity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.8 Throughput comparison in the presence of homogeneity for MLCC,
DLCC and LEACH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.9 Stability of DLCC and LEACH for 20 runs . . . . . . . . . . . . . . . . 62
4.10 Stability of MLCC and LEACH for 20 runs . . . . . . . . . . . . . . . . 62
4.11 Stability of DLCC and MLCC for 20 runs . . . . . . . . . . . . . . . . 63
4.12 Instability of DLCC and LEACH for 20 runs . . . . . . . . . . . . . . . 63
4.13 Instability of MLCC and LEACH for 20 runs . . . . . . . . . . . . . . . 64
4.14 Instability of DLCC and MLCC for 20 runs . . . . . . . . . . . . . . . 64
5.1 A 5x5 grid over a eld of sensor nodes . . . . . . . . . . . . . . . . . . 69
5.2 SEP-E vs. LEACH live node distribution at 50% interval . . . . . . . . 73
5.3 Sample of live node distribution at 50% interval . . . . . . . . . . . . . 74
5.4 Homogeneous vs Heterogeneous trend as node diversity increases . . . . 74
xii
List of Acronyms
BS Base Station
WSNs Wireless Sensor Networks
LEACH Low-Energy Adaptive Clustering Hierarchy
DEEC Distributed Energy-Ecient Clustering Algorithm
DLCC Dual-hop LEACH using Concentric Circle
CBR Constant Bit Rate
NEST Network of Embedded Systems
OSI Open System Interconnection
MAC Medium Access Control
MLCC Multi-hop LEACH using Concentric Circle
FEC Forward Error Correction
UNPF Unied Network Protocol Framework
ID Identication
CDMA Code Division Multiple Access
TDMA Time Division Multiple Access
DTROC Distributed TDMA Receiver Oriented Channel
SPIN Sensor Protocols for Information via Negotiation
SAR Sequential Assignment Routing
xiii
EDACH Energy-Driven Adaptive Clustering Hierarchy
EEUC Energy-Ecient Unequal Clustering Mechanism
MICA Crossbow technology
ICM Indicator control message
E[#CH ]Expected number of cluster-heads
c Number of clusters
T
n
Threshold for election as cluster-head
P
opt
Optimal probability of becoming cluster-heads
E
TH
Threshold value for cluster-head election
n Number of sensor nodes
v Power loss factor
E
elec
Energy dissipation per bit for the transceiver circuit
d
CH
transmission distance to cluster-heads
M
bit
Packet size
E(r) Residual energy
R
T
Total round of the network
R Communication radius
r number of rounds
R
T
Total network rounds
E
total
Total energy at the beginning of network operation
E
round
Energy consumed in each round
P
nrm
Probability election as cluster-head for normal nodes
P
int
Probability election as cluster-head for intermediate nodes
xiv
P
adv
Probability election as cluster-head for advanced nodes
m Proportion of advanced node to normal nodes
E
0
Initial energy for normal nodes
R
comp
Maximum competitive radius
d
max
Maximum distance of each node to BS
d
min
Minimum distance of each node to BS
k Packet size
E
Tx
Transmission energy
E
Rx
Reception energy
d
0
Threshold distance for swapping application model
G Set of non-cluster heads
M Length of network eld
E
CH
Energy dissipation by a cluster-head node
E
DA
Data aggregation energy
d
tosink
Transmission distance to sink/BS
E
nonCH
Energy dissipation by a non-cluster head node
E[. ]Expectation (expected value)
E
cluster
Energy dissipation by a cluster
c Number of clusters
k
opt
Optimum number of clusters
E
int
Initial energy for intermediate nodes
E
adv
Initial energy for advanced nodes
n
adv
number of advanced nodes
xv
n
int
number of intermediate nodes
n
nrm
number of normal nodes
T(n
adv
) Threshold for advanced nodes
T(n
int
) Threshold for intermediate nodes
T(n
nrm
) Threshold for normal nodes
B
0
number of non-cluster heads
Ch
2
Level two cluster-heads
Ch
3
Level three cluster-heads
E
sum
Sum of energy dissipation in a dual-hop network
T
delay
Delayed epoch
T
normal
Normal epoch
E(N
th
sum
) Sum of energy dissipation in a multi-hop network
Optimality constant
Energy factor of advanced nodes
constant i.e 3.1415....
Energy factor for intermediate nodes
Assessment coecient
xvi
Chapter 1
Introduction
1.1 Motivation
Wireless Sensor Networks (WSNs) are networks of light-weight sensors that are battery
powered used majorly for monitoring purposes. The advances in micro-electromechanical
technologies have made the improvising of such sensors a possibility. Recently, WSNs
have been heavily researched by several organizations and by the military where we can
nd some of the applications in battle eld surveillance and other security etiquettes.
With the recent issues on climate change, WSNs can be utilized to track changes that
aect the climate using a network of sensors to gather environmental variables such as
temperature, humidity and pressure. One of the numerous advantages of these sensors
is their ability to operate unattended which is ideal for inaccessible areas. However,
while WSNs are increasingly equipped to handle some of these complex functions,
in-network processing such as data aggregation, information fusion, computation and
transmission activities requires these sensors to use their energy eciently in order to
extend their eective network life time. Sensor nodes are prone to energy drainage
and failure, and their battery source might be irreplaceable, instead new sensors are
deployed. Thus, the constant re-energizing of wireless sensor network as old sensor
nodes die out and/or the uneven terrain of the region being sensed can lead to energy
imbalances or heterogeneity among the sensor nodes. This can negatively impact the
stability and performance of the network system if the extra energy is not properly
utilized and leveraged. Several clustering schemes and algorithm such as LEACH [17],
DEEC [27], have been proposed with varying objectives such as load balancing, fault-
tolerance, increased connectivity with reduced delay and network longevity. A balance
of the above objectives can yield a more robust protocol. LEACH protocol and the likes
1
assume a near to perfect system; an energy homogeneous system where a node is not
likely to fail due to uneven terrain, failure in connectivity and packet dropping. But
more recent protocols like SEP [32] considered the reverse, that is energy heterogeneity
where the factors mentioned above is a possibility, which is more applicable to real life
scenario for WSN. Thus, energy heterogeneity should therefore be one of the key factors
to be considered when designing a protocol that is robust for WSN. A good protocol
design should be able to scale well both in energy heterogeneous and homogeneous
settings, meet the demands of dierent application scenarios and guarantee reliability.
Conventional protocol designs do not address these situations. This research explores
existing work done in this area. The goal is to present a modied protocol design that
is more robust and can ensure longer network life-time while taking other performance
measures into consideration. Mathematical modeling and computer simulations are
used for proof of concept and testing.
1.2 Research Objectives
The research objectives of this thesis is to:
1. Design a protocol that can distribute the energy consumption across all nodes
equally.
2. Elect leaders based on the nodes residual energies.
3. Guarantee that additional energies in the network are used eciently and eec-
tively.
4. Ensure that the nodes in the network are adaptive and sensitive to the changing
environment.
5. Finally, to be able to assess the performance of some of these protocols in the
presence of both energy heterogeneity and homogeneity.
1.3 Contributions
The contributions of this thesis are:
1. Developing and validation of algorithms (Chapter 3). This approach is an en-
hancement to the existing SEP (Stable Election Protocol) scheme.
2
2. A dual-hop and multi-hop clustering algorithms using a concentric circle around
the BS in an energy homogeneous system (Chapter 4). These methods are mod-
ications to the original LEACH (Low-Energy Adaptive Clustering Hierarchy)
protocol design. These techniques exploits both layered and clustering techniques
to ensure a better network life-time.
3. A spatial uniformity of energy distribution-based comparative study between a
homogeneous and heterogeneous clustered WSN (Chapter 5). This study revealed
the relationship between energy-diversity of sensor nodes and spatial uniformity
of energy distribution in clustered WSN.
4. A new approach for analyzing the performance of wireless sensor network protocol
designs (Chapter 5). This method complements the results in both Chapter 3
and 4.
1.4 Thesis Outline
This thesis is organized as follows:
In Chapter 2, a detailed discussion of the Wireless Sensor Network (WSN) and
existing work done in the area of interest is presented. Chapter 3 gives the network
model used and clustering techniques of WSN. It further presents the modied protocol
SEP-E and explains the impact of heterogeneity in WSN with an in-depth discussion
of the experiments performed. Chapter 4 provides the mathematical energy model for
Dual-hop and Multi-hop LEACH schemes using both layered and clustering architec-
tural designs. In Chapter 5, a new approach for assessing protocol design performance
in WSNs is presented. A spatial uniformity of energy distribution-based study between
homogeneous and heterogeneous setup in a clustered WSN is also discussed. Chapter
6 concludes the thesis and presents the future direction and implication for WSN.
3
Chapter 2
Background
This chapter gives a review of wireless sensor networks and some existing schemes that
have been employed in these networks. Dierent improvements to energy models of
these schemes based on this thesis are presented thereafter.
2.1 Introduction
Wireless communication technologies continue to grow in diverse areas to provide new
opportunities for networking and services. One fast-moving area is wireless sensor
networks (WSN). With the advances in micro-electro mechanical systems, sensor de-
vices can be built as small as lightweight wire-less nodes. WSN are highly distributed
networks of such kind of sensor nodes, and have been deployed in large numbers to
monitor the environment or production systems. There is a growing need for the nodes
to handle more complex functions in data acquisition and processing, and energy saving
solutions remains a major requirement for these battery-powered sensor nodes. Three
major functions are performed by three sensor subsystems [27] the environment sen-
sor; the data processor that performs local computations on the data sensed; and the
communicator that performs information exchange between neighboring nodes. Each
sensor is usually limited in their energy level, processing power and sensing ability.
However, networks of these sensors give rise to a robust, reliable and accurate net-
work. The sensors can collaborate and cooperate among each other, elect leaders or
heads, gather their data and then transmits a more rened results from the sensing
eld to a central location which might in most of the case be a Base Station (BS), or
more powerful nodes. Lots of studies on WSN have been carried out in [5, 7, 8, 11].
WSN technology is increasingly nding new applications in various areas. One of
the very rst demonstration of wireless sensor network is the Berkleys Smart Dust
4
project at University of California, which showed; it is feasible to have very large num-
ber of almost invisible nodes(dust) communicating wirelessly . Other similar projects
have leveraged on these abilities such as City sense and NEST. Some of the recent
applications of wireless sensor networks include the PermaSense project [37]; used to
investigate Permafrost in Swiss Alps with the objective of building and customizing a
set of wireless measuring units for use in remote areas within a very harsh environmen-
tal monitory conditions. Another application of WSN is in the ColdBlue project [30]
developed at Harvard University, used for medical care and disaster response with the
following multi-objectives; real-time and continuous patients monitoring, collection of
long-term databases of clinical data and home monitoring for elderly patients. The
ZebraNet project at University of Princeton also employed WSN in animal monitor-
ing. The project involved the tracking of Zebras in the eld by gathering dynamic data
about the Zebra positions in order to understand the mobility pattern. The military
applications of sensor nodes include battleeld surveillance and monitoring, guidance
and mapping systems of intelligent missiles, and detection of attack from the enemy
territory. It is worth mentioning that lots of organizations most especially the mili-
tary is heavily funding the research on WSN, basically due to the increasing breach
of communication etiquette by intruders. The applications of WSN are endless, only
limited by human imagination. Throughout the discussions in this thesis Sink and BS
are used interchangeably as they imply the same meaning.
The heavy task and complex functions performed by this network of sensors requires
that the designs should be energy ecient and only processed and concise informa-
tion should be delivered to the base station. The future of pervasive and ubiquitous
computing lies in the successful design of sophisticated and extremely energy ecient
communication protocol for wireless sensor networks.
2.1.1 Key Issues and Challenges of WSN designs
To design an ecient algorithm for wireless sensor network, the following issues must
be considered:
1. Sensor nodes are battery-operated and most often constrained in their energy
due to the inability of recharging the nodes. Hence, one of the most important
bottlenecks in the protocol design is the energy consumption. The design should
be able to balance network life-time and other heuristics for accuracy of results.
5
2. Sensor network should be adaptive and sensitive to the dynamic environment
where they are deployed.
3. Since nodes are battery-powered and communications are radio-based, nodes are
more susceptible to failures. The information collected by individual node should
be aggregated to give more accurate and reliable results. Sensor network should
be reliable and be able to provide relevant data through information gathering
techniques.
4. The hardware design should incorporate methods to conserve energy using low
powered processors and the system software should use minimal power as possible.
5. A sensor network algorithm should be distributed and self-organizing, since WSN
is infrastructure-less.
6. The security of the network should also be considered. An intrusion might defeat
the entire purpose of the network system.
7. Scalability is another important factor to be considered when designing a topology
for WSN. Some applications might require hundreds or thousands of nodes to
monitor a trend intermittently.
8. Sensor network should be able to share communication resources eciently and
support real-time communication while providing a guaranteed quality of service.
All the attributes mentioned above reects the role and importance of specic layers
of the OSI(Open System Interconnection) model in wireless communication, which we
will discuss briey in the next section.
2.1.2 Wireless Sensor Network Architecture
Sensor nodes are normally scattered in a sensing eld, every sensor has the capability
of sensing, processing in form of aggregating and communicating the data to the sink or
base station using various schemes. The underlying protocol scheme in the OSI model
for WSNs includes the application layer, transport layer, network layer, data link layer
and the physical layer. As described in [5], the protocol stack shown in Figure 2.1,
combines power and routing awareness, integrates data with networking protocols to
communicates power eciently through wireless medium, and promotes cooperative
eorts of sensor nodes.
6
The application layer supports dierent application software depending on the task.
The transport layer maintains the data ow, while the network layer does the routing
of data from the transport layer. Depending on the deployment of the sensors, they can
be either mobile or static, if the former then the data link layer, specically the MAC
protocol design must have power control mechanism, forwarding mechanism and should
be able to perform communication condentiality through encryption-decryption tech-
niques. Finally, the task of the physical layer involves modulation and demodulation
of radio carrier stream, forward error-correction (FEC) and performing ecient syn-
chronization between the sender and receiver. In [5], the power, mobility, and task
management planes were proposed to monitor the power, movement, and task dis-
tribution among the sensor nodes. Most often sensor network protocols are designed
with two basic kinds of architectures; the layered and the clustering architectures, these
architectures are discussed in the next sections.
Figure 2.1: Protocol Stack diagram
2.2 Layered Architecture
The design of a layered architecture would normally consist of a base station and sensors
scattered in the eld. The layers of sensor nodes around the base station constitutes
nodes that are in a single hop count to the base station, while nodes that are farther
away can be multiple hop count to the BS depending on the size of the network, this
is shown in Figure 2.2. One of the earliest protocols to complete the implementation
of the layered architecture is the UNPF (Unied Network Protocol Framework) [15],
designed for a multi-hop infrastructure network architecture. The UNPF protocol is
7
unied in the sense that it combines three dierent protocol structures: the network
organization, medium access control (MAC) and the routing protocol to achieve the
objectives of a robust protocol. These schemes are briey described next.
Figure 2.2: Layered architecture
2.2.1 Network organization Protocol
At the beginning of the network organization process, the Base Station (BS) broadcasts
its ID and the timing information to reach any node within a single-hop communica-
tion over a common channel using a known CDMA code. Every node that hears the
broadcast registers the BS ID, in return using a very low power, sends a beacon mes-
sage containing their IDs. The BS wait for these beacon messages, any node it hears is
within a single-hop communication, these nodes forms layer one to the BS. The BS now
broadcasts a control packet with layer one IDs. All the nodes respond with a beacon
signal again. The layer one record the the IDs they hear and this forms layer two, since
they are one hop to layer one [26]. This same pattern follows until the entire network
layer is formed using beacon messages. In case of nodes death, a periodic beacon is
sent to update the rest of the nodes.
8
2.2.2 MAC Protocol
The purpose of the MAC protocol design is to allow the sensor nodes access to com-
munication channel for signaling and data transmission that is collision and error free.
The UNPF use the distributed TDMA receiver oriented channel (DTROC) MAC pro-
tocol in the data transmission phase. In [26], the authors describe how each node is
assigned a reception channel by the BS. DTROC involves channel allocation and chan-
nel scheduling. The channel allocation does the proper assignment of channels to the
nodes and the channel scheduling cares for the sharing of the reception channel by the
neighbors.
2.2.3 Routing Protocol
The goal of layered architectural design is to support multi-hop routing. The packets
are forwarded to nodes closer to the BS and with more residual energy. A simplied
routing scheme unlike in ad hoc networks has been proposed in [19], [34]. The goal
is to achieve a more power ecient protocol. Recently, other protocols [43], [24], [40],
[31] specically designed to accommodate routing and packet forwarding have been
proposed.
2.3 Clustered Architecture
Clustering techniques in wireless sensor networks aims at gathering data among groups
of nodes, which elect leaders among themselves. The leader or cluster-heads has the
role of aggregating the data and reporting the rened data to the BS. The advantages
of this scheme is that it reduces energy usage of each node and communication cost.
One of the earliest work proposing this approach in WSNs is [17] LEACH (Low En-
ergy Adaptive Clustering Hierarchy). Recently, there have been lots of other clustering
techniques which are mostly variants of LEACH protocol with slight improvement and
dierent application scenarios. SEP (Stable Election Protocol)[32], DEEC (Design of a
distributed energy-ecient clustering)[27], EDACH (Energy-Driven Adaptive Cluster-
ing Hierarchy)[20] and EEUC (An Energy-Ecient Unequal Clustering Mechanism)[22]
are all clustering techniques proposed with the objective of minimizing energy usage,
while extending network life time. Clustered sensor network can be classied into two
main types: homogeneous and heterogeneous sensor network. While energy eciency
in WSNs remains a function of uniform distribution of energy among sensor nodes,
9
classifying clustering techniques depends on the objectives in mind.
2.3.1 Clustering Objectives
Various objectives have been pursued by dierent literatures in designing clustering
architecture for WSN. Most objectives are set to meet the application constraints.
This section present three main objectives that are relevant to the focus of this thesis.
1. Maximizing network Life-time: Unlike in cellular networks, where mobile gadgets
(e.g. phones) can easily be recharged constantly after battery drainage, thus
power management in these networks remains a secondary issue. However, WSN
is heavily constrained in this regard, apart from being infrastructure-less system;
their battery power is very limited. Most of the sensor nodes are equipped with
minimal power source; for example the Berkeleys MICA motes are powered by
two AA alkaline batteries. Thus, power eciency will continue to be of growing
concern and will remain one of the main design objectives of WSN. In order
to cope with energy management in WSN, clustering scheme has been pursued,
to extend network life-time and help ease the burden of each node transmitting
directly to BS as in conventional protocols like Direct Transmission [29].
2. Fault-tolerance: The failure of a sensor node should have a minimal eect on the
overall network system. The fact that sensor nodes will be deployed in harsh
environmental conditions, there is tendency that some nodes may fail or be phys-
ically damaged. Some clustering techniques have been proposed to address the
problem of node failure by using proxy cluster-heads, in the event of failure of
the original elected cluster-head or have minimal power for transmission. Some
other literatures e.g. [17, 20] have employed adaptive clustering scheme, to deal
with node failures such as rotating the cluster-head. Tolerating node failure is
one of the other design goals of clustering protocols.
3. Load balancing: Load balancing technique could be another design goal of clus-
tering schemes. It is always necessary not to over burden the cluster-heads as this
may deplete their energies faster. So, it is important to have even distribution
of nodes in each cluster. Especially in cases where cluster-heads are performing
data aggregation or other signal processing task, an uneven characterization can
extend the latency or communication delay to the BS.
10
In the section that follows, this thesis will examine the eects of energy hetero-
geneity compared with energy homogeneity in WSNs, before proceeding to describe
dierent clustering techniques proposed for WSNs.
2.3.2 Homogeneous vs. Heterogeneous
In [25], a comparative study of homogeneous vs. heterogeneous clustered sensor net-
work was carried out. The authors in [42] described the cost-benet of deploying a
heterogeneous system to a homogeneous system. A homogeneous sensor networks can
be dened as a network consisting of identical nodes with same energy level, process-
ing capabilities, and sensing range. On the other hand, heterogeneous sensor network
consist of sensor nodes with dierent abilities, such as dierent energy level, sensing
range and computation power. Most heterogeneous network may have varying level of
the aforementioned abilities depending on the deployment scenario. This thesis con-
siders both energy homogeneous and heterogeneous networks. This thesis examines,
an energy heterogeneous network that has the same kind of sensor nodes abilities but
diers in energy levels.
There may be two main sources of energy heterogeneity; one from the initial settings
of the network where sensors may be deployed to perform dierent tasks and the other
from the operation of the network. A good scenario is if we construct a WSN with
dierent kinds of node to provide various sensing tasks. Say in a habitat we want to
monitor the movement

A

and mating

B

characteristics of dierent animal species.


A sensor network could be deployed to sense and monitor A

s group movement and


some sensors to monitor B

s group mating characteristic. To this end, there would be


a need for sensors with dierent energy levels in the network but most likely with same
processing or computational capacities. On the other hand, if we have a homogeneous
setting by deploying a sensor network with the nodes having same processing capa-
bilities, computational power, and same energy level in an irregular terrain where the
topology might cause some nodes to fail during transmission. In this instance, there is
tendency that some of the nodes will die out faster than the others regardless of using
the best protocol for the homogeneous setting. This results into wastage of residual
energy in the remaining alive nodes. In this case, there may be a need to introduce new
sensors into the network system, which is referred to re-energizing the network system
in this thesis. Once the network is re-energized, it constitutes energy heterogeneity in
the sensor network.
Most real life cases deals with such heterogeneity rather than homogeneity. Thus, with
11
a proper implementation of the right protocol, a mixed deployment of these sensor
nodes in terms of energy level can boost performance, improve the overall network
life-time and reduce cost as much as possible. Some schemes have been proposed to
cater for energy heterogeneity in sensor networks [32]. However, some of the authors
[17, 22, 20] do not consider a case of multi-energy levels or a multi-hop system with
dierent energy levels. This thesis, proposes a more energy ecient network protocol
using a three-tier sensor node settings to cope with energy heterogeneity.
The next section discusses the clustering techniques mentioned in section 2.3, that are
designed for both homogeneous and heterogeneous environment.
2.4 LEACH Protocol
Clustering techniques have been employed to deal with energy management in WSNs.
LEACH is a pioneering work in this respect. LEACH is a clustering-based protocol,
that used a randomized election and rotation of local cluster base station (so-called
cluster-heads for transferring data to the BS or sink node) to evenly preserve the en-
ergy among the sensors in network. The rotation of cluster-head can also be a means of
fault tolerance [4]. The sensors organize themselves into clusters using a probabilistic
approach to randomly elect themselves as heads in an epoch. However, LEACH pro-
tocol is not heterogeneity-aware, in the sense that when there is an energy dierence
to some threshold between these nodes in the network, the sensors die out faster than
a more uniform energy setting [32]. In real life situation it is dicult for the sensors
to maintain their energy uniformly, this results easily to energy imbalance between the
sensor nodes. LEACH assumes that the energy usage of each node with respect to the
overall energy of the system or network is homogeneous. Although, LEACH suggested
a way to cope with heterogeneity if it arises; by setting the probability of becoming a
cluster-head as a function of the nodes energy level relative to the aggregate energy in
the network. The fault in this model is that, it requires the assistance of routing pro-
tocol, to allow each node to know the total energy of the network; which will increase
the overhead of the network [27].
2.4.1 LEACH Architecture
LEACH was developed to monitor remote environment. Since individual nodes data
are often correlated in a micro-sensor network, the end user does not require all the
12
redundant data, rather the end user needs a high-level function of the data that de-
scribes the events occurring in the environment [17]. The motivation behind LEACH
protocol is to correlate data among nodes that are close to each other by using data
aggregation techniques [12] to reduce the amount of raw data, this is mostly done by
the elected cluster-head before transmission to the base station. In LEACH [18] the
following assumptions were used for the propagation model of each node:
1. That each node has the capability to transmit with enough power to reach the
BS.
2. The nodes can use power control to vary the level of transmission power, and
3. Each node has the computational power to support dierent MAC protocols and
performs signal processing functions.
Figure 2.3: Cluster Formation diagram
Figure 2.3 shows the clustering architecture of LEACH, with cluster-heads using
a single hop to reach the BS. The

+

is the cluster member,


is the cluster-heads
and the BS is assumed to be located outside the sensing eld. The non-cluster heads
send their data periodically using a time division multiple access (TDMA) schedule
to the elected cluster-heads, the cluster-head in-turn performs some data compression
and aggregates the data before sending to the BS. However, being a cluster-head node
consumes so much energy than a non-cluster head, hence the need for randomized ro-
tation of the cluster-heads by LEACH. If the cluster-heads were to be xed throughout
the network life-time of the system, there would be a huge waste in residual energy of
the live nodes. Since the cluster-heads would denitely die out rst. LEACH protocol
13
has two phases, the set-up phase and the steady phase. In the set-up phase, clusters
are formed, then followed by a steady state where cluster members send data to their
cluster-heads and then to the BS. A completed set-up and steady-phase makes up a
round; and a series of rounds constitute an epoch [32].
2.4.2 Cluster formation process of LEACH
The set-up phase begins with cluster formation. Suppose there are N nodes in the
network, in order to ensure certain number of cluster k
c
is formed during each round,
each sensor i elects itself at the beginning of the round with a probability P
i
(t) chosen
such that the expected number of cluster head nodes for this round is k
c
[17]:
E[#CH] =
N

i=1
P
i
(t) 1 = k
c
. (2.1)
An indicator function C
i
(t) is dened so that C
i
(t) = 0 if the sensor i is a cluster-
head, otherwise C
i
(t) = 1. A node chooses to become cluster-head in a given round r,
if the probability function below is satised:
P
i
(t) =
_
k
c
Nk
c
[r mod(N/k
c
)]
if C
i
(t) = 1;
0 if C
i
(t) = 0.
(2.2)
From [17], the choice of probability is based on the assumption that every node has the
same level of energy at the beginning of the network and also each node has data to
send in each round. The owchart of LEACH algorithm is presented in Figure (2.4).
To complete the set-up phase, each node send a join-request message after they
receive a broadcast from the elected cluster-heads using a non-persistent CSMA MAC
protocol. The cluster-head creates a TDMA as shown in the LEACH ow chart and
nally the nodes forming each cluster wait for their schedule before transmission. The
steady phase starts immediately after the set-up phase. The cluster-heads gather all
data from their respective cluster members. The cluster-heads performs data aggrega-
tion using signal processing techniques before sending the rened data to the BS in each
round. The idea of the TDMA schedule ensures the ecient use of the bandwidth and
the data aggregation process reduces communication cost and energy, thus, improving
the network life-time. The sections that follows discuss variants to LEACH proto-
col that were proposed as an improvement by extending the network life-time. Most
of these schemes are more of energy management techniques rather than cost-based
models.
14
Figure 2.4: LEACH ow chart diagram
2.5 EDACH Protocol
The objective of [20] is to form more clusters in region relatively far from the BS and
to create a proxy node to replace a cluster-head of low battery power. This is achieved
by using probability model to partition the network area. The motivation behind the
proxy node selection is to help cope with energy deciencies which may arise in any of
the cluster-heads as the network evolves. The entire network could suer drastically in
the event of cluster-head failure, meaning in some instances there might be no reporting
done to the BS.
2.5.1 EDACH Architecture
As in LEACH [17], EDACH was designed for homogeneous settings with a single-hop
communication to the base station. The scheme has two phases: the set-up phase and
self organized data collection and transmission phase. The set-up phase is similar to
that of LEACH except that cluster-heads are formed according to their proximity to
the BS. The entire network is partitioned into three segments as; near, medium and far
15
segment shown in Figure 2.5. During the set-up phase each sensor chooses a random
Figure 2.5: EDACH model diagram
number between 0 and 1 inclusive [18]. If this is lower than the threshold for node
n, T(n), the sensor node becomes a cluster-head. The threshold T(n) is given by:
T(n) =
_
P
opt
1P
opt
[r mod(1/P
opt
)]
if n G;
0 otherwise.
(2.3)
where G is the set of all nodes that has been cluster head for a given round r and P
opt
is
the optimal probability of a node to become cluster-head once every 1/P
opt
rounds. But
the value of P the desired percentage of node which is cluster-head, changes depending
on the segment which the cluster-heads belongs. The P value can be chosen as (1x)P,
P and (1 + x)P, respectively, where 0 < x < 1. This makes the nodes closer to the
BS to have smaller threshold, hence smaller chances of becoming cluster-heads. Once
clusters are formed the second phase of data collection and transmission begins with
the calculation of a threshold value. A new threshold value E
TH
in Eq.(2.6) is used to
decide if the selected cluster-head has enough energy to transmit to the BS, otherwise
a new or proxy cluster-head is re-elected.
k
j
= M
bit
[
n
k
]1

i=1
k
ij
(2.4)
E
CH
(j) = E
elec
k
j
+
amp
k
j
d
2
CH(j)
(2.5)
16
Figure 2.6: ICM advertisement process diagram
E
TH
=
1
k
k

j=1
E
CH(j)
(2.6)
k
j
is length of the aggregated data, d
CH
is the distance from cluster-head to BS, E
CH
(j)
is the energy dissipated by a cluster-head node j and M
bit
is the packet size. When the
energy level of the cluster-head falls below the threshold, a new proxy node is selected.
The cluster-head broadcast an indicator control message (ICM) [20] containing the ID
of the proxy node. Finally, all nodes receiving the ICM send a message conrming
their membership to the proxy node, the ICM process advertisement is shown Figure
2.6.
The problem with this scheme is the overhead cost, in a case where several cluster-
heads or even selected proxy nodes fails, lots of packets will not be transmitted to the
BS. This proves to defeat the entire idea of clustering in WSN. The open research issue
is to develop a robust protocol that would balance and redistribute the energy in the
network, in order to prevent cluster-head from energy deciencies.
2.6 DEEC Protocol
The authors of DEEC [27] proposed a distributed energy-ecient clustering scheme
following the thought of LEACH and SEP. The idea of the protocol is to elect cluster-
heads using probability based approach to estimate the ratio of the residual energy of
17
each node and the average energy of the network. DEEC is more SEP-like in the sense
that, it adapts the rotating epoch of each node to its energy. Recall, that an epoch
is a set of rounds in a network. Eventually, the node with high residual energy will
become cluster-heads than the nodes with low energy. The goal of DEEC is to design
an energy aware algorithm for heterogeneous network.
2.6.1 DEEC Architecture
The architecture of DEEC protocol uses the initial and the residual energy of each
node to select cluster-heads. DEEC estimates the ideal value of the network life-time,
in order to avoid the global knowledge of the network as pointed out earlier. The
equations below show the estimations used in the protocol design. If n
i
is the number
of rounds for a node s
i
to be a cluster-head, to guarantee an average of p
opt
n
in homogeneous network like LEACH, each node s
i
must become cluster-head every
n
i
=
1
p
opt
epoch [27],[17]. But in a heterogeneous network the epoch and the probability
p
i
of becoming cluster-head must be dierent for nodes with high energy level. Thus,
the authors choose the probability p
i
as:
p
i
= p
opt
_
1
E(r) E
i
(r)
E(r)
_
= p
opt
E
i
(r)
E(r)
(2.7)
E
i
(r) is the residual energy of node i at round r and E(r) is the estimated average
energy of the network at round r given as:
E(r) =
1
n
E
total
_
1
r
R
T
_
(2.8)
where R
T
= (E
total
/E
round
); the total round of the network life-time, n is the number of
nodes in the network, E
total
is the total energy at beginning of the network and E
round
is the energy consumed in the network each round.
The rst constraint with the above model is that; the estimated average energy of
the network is inversely proportional and depends on the total round of the network
life-time. This proves to be a drawback in the model estimation of DEEC; as rightly
mentioned by the authors in [27], the value of R
T
might not be stable; this makes the
reference energy E(r) to be too large at the end. Hence, at the end of the network
there will not be a single cluster-head and some nodes will not eventually die out. To
solve these issues the authors adjusted the value of R
T
by a factor of 1.5 times, which
does not show the real life case of a WSN. The second problem is that E
total
and R
T
18
will still need to be known a priori and will have to be broadcast before each epoch
begins; this is not very ideal for WSN.
2.7 SEP Protocol
The authors in SEP [32] were one of the rst to address the impact of energy het-
erogeneity of nodes in WSNs that are hierarchically clustered. Their approach was
to assign weighted probability to each node based on its energy level as the network
evolves. One major characteristic of this approach is that it rotates the cluster-head to
adapt the election probability to suit the heterogeneous settings. The authors exploited
the capabilities of LEACH to develop an adaptive and well distributed model to cater
for extra energy introduced into the network, which is a source of heterogeneity. Under
the model development of SEP, two kinds of nodes with dierent energy levels were
used, constituting a two-level hierarchical WSN in a single-hop setting. The assump-
tion is that the nodes are not mobile and are uniformly distributed over the sensing
region.
2.7.1 SEP Architecture
The rst improvement to LEACH was to extend the epoch of the sensor network
according to the energy increment. Recall, a round is the time interval for all nodes
to send data to their respective cluster-heads; the cluster-heads gathers the data and
report to the BS; this set of rounds constitutes an epoch. If the nodes are homogeneous,
with an optimal percentage p
opt
of nodes n that can become cluster-head in each round,
LEACH guarantees that every node will become cluster-head exactly once every 1/p
opt
rounds (epoch). But the theory cease to hold when LEACH is used in the presence
of heterogeneity. Once the rst node dies out, the instability in the system turns out
to be high and the clustering process becomes unreliable. This is because p
opt
is only
optimal when the population of the network is constant and equal to the initial value
n [32]. To solve the problem of instability, the authors in SEP redened a new epoch
for the sensor network. They used two kinds of nodes: normal nodes and advanced
nodes. The advanced nodes have more energy factor than the normal nodes. The
advanced nodes take up cluster-head position more than the normal nodes during the
same epoch according to SEP model estimation. The new proposed epoch is equal
19
to
1
p
opt
(1 + m). SEP used an election probability based on the initial energy of each
node to elect the cluster-heads by assigning a weight equal to the initial energy of each
node divided by initial energy of the normal nodes. The weighted probabilities for
normal and advanced nodes in SEP were chosen to reect the extra energy introduced
into the network system. The probabilities and the total initial energy are given below
respectively:
P
nrm
= P
opt
/(1 + m),
P
adv
= (P
opt
)(1 + )/(1 + m),
E
total
= nE
o
(1 + m),
(2.9)
where P
nrm
is the weighted probability for the normal nodes and P
adv
is the weighted
probability for the advanced nodes and m is the proportion of the advanced nodes with
times more energy than the normal nodes and nally, E
Total
is the total initial energy
of the network.
2.8 EEUC Protocol
EEUC a distributed competitive algorithm was proposed for periodical data gathering.
Cluster-heads are elected by localized competition. It partitions the nodes into clusters
of unequal sizes; clusters closer to the BS have smaller sizes compared with clusters
farther away. The idea of the scheme for using unequal cluster sizes is to allow cluster-
heads closer to the BS preserve their energy for inter-cluster data forwarding in case of
multi-hop network. While clusters farther away have larger sizes so more aggregation
can be done by these clusters, hence reducing communication cost.
2.8.1 EEUC Mechanism
The design of this protocol was intended for a homogeneous setup and a multi-hop
network. To form clusters in [22], the BS broadcasts a hello message to all nodes.
This enables the nodes to compute the approximate distance to the BS based on the
received signal strength. First, with this method the nodes can know the appropriate
power level to communicate. Secondly, it helps to create an unequal cluster sizes. The
Figure 2.7 shows this scheme.
20
Figure 2.7: EEUC model diagram
Like LEACH and SEP the task of being a cluster-head is rotated among the nodes.
However, the authors of EEUC proposed a more competitive algorithm where cluster-
head selection is primarily based on the residual energy of each node. The cluster-head
selection depends on a competitive range R
comp
given as:
s
i
R
comp
=
_
1 c
d
max
d(s
i
, BS)
d
max
d
min
_
R
0
comp
(2.10)
R
0
comp
is the predened maximum competitive radius, d
max
and d
min
are the maximum
and minimum distance of each node to the BS respectively, d(s
i
, BS) is the distance of
a node s
i
to the BS. c is a constant chosen between the range of 0 and 1. However, the
drawback of this approach is that it does not address the issue of energy heterogeneity
just like LEACH and other LEACH-like protocols.
2.8.2 Summary
This chapter provided the introduction to wireless sensor network with various exam-
ples and potential application areas. Design issues, WSN architectures and dierent
clustering techniques for energy management in WSN were discussed.
21
Chapter 3
An Extension of SEP and LEACH
Models
This chapter presents the network model and cluster formation process for WSN that
are hierarchically clustered. The path loss model, data aggregation model and the
expression for the energy expended are also discussed. The description of the ex-
periments done and analysis of the proposed enhancement to LEACH and SEP are
presented thereafter.
3.1 Introduction
The network model described in this section is similar to the one proposed in LEACH
and other clustering protocols. The dierent path loss models, for communication from
cluster members to cluster-heads and from cluster-heads to BS are briey enumerated.
The intra-cluster and inter-cluster distance is estimated for each node and the energy
model is formulated, as used in [17] and [32].
3.2 Network Model
This thesis considered the radio energy dissipation model as used in [17] and [32]
shown in Figure (3.1). The rst assumption is that the radio model dissipates E
elect
=
50nJ/bit to both the transmitter and receiver circuits. The second assumption is that
both Friss free space (fs) and multi-path (mp) losses rely on the transmitter amplier
model and the respective node distances (d). Therefore, to transmit k bits, the energy
22
Figure 3.1: Network Model diagram
expended E
Tx
is:
E
Tx
(k, d) = E
Txelec
(k) + E
Txamp
(k, d)
=
_
kE
elec
+ k
fs
d
2
if d < d
o
;
kE
elec
+ k
mp
d
4
if d d
o
.
(3.1)
where d
o
is the distance threshold for swapping amplication models, which can be
calculated as d
o
=
_

fs

mp
.
To receive a k-bit message, the radio will expend:
E
Rx
(k) = E
elec
k. (3.2)
It is further assumed that the radio channel is symmetric i.e., the same amount of
energy is required to transmit a k-bit message from node A to B and vice versa.
3.2.1 Path Loss Model
The estimation of path loss is very important in wireless communication networks.
When a signal is sent from a transmitter to a receiver circuitry, the path loss is expressed
as the ratio of the power of transmitted signal to the power of the received signal. This
estimation is always a function of the propagation distance between the transmitter and
receiver. The two kinds of path loss model used in this thesis and existing literatures
for clustered WSN are: multi-path fading and Friss free space models. The former is
used to estimate longer transmission range e.g. transmission from cluster-heads to BS,
23
while the latter is used for shorter transmission from cluster members to their respective
cluster-heads. With the free space model, the energy loss due to channel transmission
is proportional to the square distance separation of the transmitter-receiver circuitry.
It is estimated as v = 2 for a distance d. The multi-path model estimates this channel
transmission loss as v = 4 for a distance d. Some literatures [17], [20] considered the
crossover distance between v = 2 and v = 4, when the position of the BS is outside
the sensing region. However, this thesis did not consider crossover distance since the
position of the sink or BS lies at the center of the sensing region for the experiments
carried out.
3.2.2 Data Aggregation Model
Various kinds of data aggregation techniques have been used in dierent literatures.
In [14] a new data aggregation model that involved data compression was developed,
originally inspired by the authors of [13]. The authors of [39] highlighted dierent data
aggregation schemes: in-network, grid-based and hybrid data aggregation. A discussion
on the impacts of data aggregation in WSN was carried out in [21]. However, the most
commonly used data aggregation such as in LEACH and LEACH-like protocols assumes
a perfect aggregation in which multiple packets are sent from all cluster members
to their respective cluster-head but only a single packet is forwarded to the BS. By
denition, data aggregation is referred to as gathering of multiple data packets by using
spatial correlation to reduce the received data into a single packet. Thus, in the context
of the experiments performed in this thesis, a perfect data aggregation E
DA
model is
assumed as used in LEACH and SEP.
3.2.3 Cluster Formation
This section presents a cluster formation method that used a distributed algorithm as
in [18, 32]. The main idea is for the sensor nodes to elect themselves with respect to
their energy levels autonomously. The goal is to minimize communication cost and
maximize network resources in order to ensure concise information is sent to the sink
or BS. Each node transmits data to the closest cluster-head and this cluster-heads
perform data aggregation. The indicator function of choosing a cluster-head is given in
Eq.(3.3). Assuming an optimal number of clusters c in each round. It is expected that
as a cluster-head, more energy will be expended than being a cluster member. Each
24
node can become a cluster-head with a probability P
opt
and every node must become
cluster-head once every
1
P
opt
rounds. Intuitively, it means we have nP
opt
clusters and
cluster-heads per round. Let the non-elected nodes be a member of set G in the past
1
P
opt
rounds. Each sensor chooses a random number between 0 and 1. If this is lower
than the threshold for node n, T(n), the sensor node becomes a cluster-head. The
threshold T(n) is given by:
T(n) =
_
P
opt
1P
opt
[r mod(1/P
opt
)]
if n G;
0 otherwise.
(3.3)
Assume nodes are uniformly and randomly distributed in an area of M M m
2
.
On average there would be
n
c
nodes per cluster, one cluster-head and
n
c
1 non-cluster
heads. Each cluster-head must dissipate energy receiving k bits of data packet from
associated cluster members and transmitting to the sink. Also, data aggregation prior
to transmission will also cost energy, which per bit is denoted as E
DA
. In total, the
energy dissipated by each cluster-head is:
E
CH
= kE
elec
(
n
c
1) + kE
DA
n
c
+ E
Tx
(k, d
toSink
), (3.4)
where d
toSink
is the distance from cluster-head node to the sink. Let us proceed by
estimating the energy expended by each node as a function of the distance between the
transmitter and the receiver. Using the Eucleadian metric as shown below, the area
occupied by each cluster will be A =
M
2
c
with a node distribution of (x, y)
E[d
2
toCH
] =
_ _
(x
2
+ y
2
)(x, y)dxdy =
_ _
r
2
(r, )rdrd (3.5)
Using Geometry, assuming the area is a circle with radius R = M/

c, and (r, ) is
constant and density is uniform in the cluster area = (1/(M
2
/c)), we can simplify as
follows:
E[d
2
toCH
] =
_
2
=0
_
M/

c
r=0
r
3
drd. (3.6)
E[d
2
toCH
] =
_ _
(x
2
+ y
2
)(x, y)dxdy = M
2
/2c. (3.7)
For non-cluster heads, the energy expended will be to transmit k bits of data to the
respective cluster-heads, while a free space path loss d
2
is adopted since normally
d
toCH
< d
o
in Eq.(3.1):
25
E
nonCH
= kE
elec
+ k
fs
d
2
toCH
, (3.8)
where d
toCH
is the distance from each node to their respective cluster-heads.
The energy dissipated in a cluster per round can be estimated as
E
cluster
E
CH
+
n
c
E
nonCH
(3.9)
And the total energy dissipation in the network per round will be the sum of the energy
dissipated by all clusters, i.e.,
E
total
= cE
cluster
(3.10)
If the average of d
toSink
is greater than d
o
, the total energy can be calculated as:
E
total
= (kE
elec
(
n
c
1) + kE
DA
n
c
+ kE
elec
+ k
mp
d
4
toSink
)
+(kE
elec
+ k
fs
M
2
/2c).
(3.11)
Otherwise, when d
toSink
< d
o
applies, the total energy becomes
E
total
= k
_
2nE
elec
+ nE
DA
+
fs
(cd
2
toSink
+ nd
2
toCH
)
_
. (3.12)
As discussed in [18, 32], the optimal number of clusters can be found by letting
E
total
c
= 0.
c
opt
=
_
n
2
M
d
toBS
. (3.13)
The dierent forms of the E
total
calculation will lead to dierent optimal c settings
depending on the values of d
o
. The optimal probability for becoming a cluster-head
can also be computed as p
opt
=
c
opt
n
.
3.3 Extending SEP and LEACH
The following propositions in this section, introduce the ideas that will lead to
the main results of this chapter. This section discusses the proposed solution as an
extension to both SEP and LEACH protocols by considering three energy levels in
two hierarchy settings, which is the rst improvement to SEP and LEACH. The new
enhanced protocol is refer to as SEP-E. The second improvement is that the mod-
ied scheme optimizes the stable region of the network system by further increasing
the epoch to accommodate the additional energy introduced into the system. In this
approach, new additional node called the intermediate nodes, are introduced into the
26
system with an intention to accommodate and cater for multi-node diversity. Note
that the re-enegization of the network system by deploying new nodes to replace dead
ones can be very important for some application specic settings such as a continuous
data retrieval process.
By intuition, we can proceed by adding another threshold of energy level between the
advanced nodes and the normal nodes. The intermediate node is chosen between
0 20 40 60 80 100
0
20
40
60
80
100
Sink
node
Advanced
node
Normal
node
Intermediate
node
Figure 3.2: Wireless Sensor Network in clusters; this is the setting of
the modied protocol showing dierent types of nodes in three level
hierarchy.
the limits of both the fractions of energy of advanced node as the upper bound and
the normal node as the lower bound. Mathematically, the energy of the intermediate
nodes lies between E
o
< E
int
< E
adv
. As in SEP, the initial energy for normal nodes
is E
o
, and for advanced nodes, E
adv
= (1 + )E
o
. Assuming for intermediate nodes,
E
int
= (1 + )E
o
. For simplicity we set = /2, where and are both the energy
factor of the intermediate nodes and the advanced nodes respectively. Figure 3.2 de-
picts the heterogeneous settings used.
The new heterogeneous setting with the three-tier node energy has no eect on the
spatial density of the network [32]. The probability setting P
opt
remains the same.
However, the total initial energy of the system is increased from nE
o
(1 + m) by the
introduction of intermediate nodes to:
n.E
o
(1 mb) + nmE
o
(1 + ) + nbE
o
(1 + )
= nE
o
(1 + m + b). (3.14)
27
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Node distribution in 100x100 region
Half dead
node
Fulllive
node
Dead node
Figure 3.3: Wireless Sensor Network showing live nodes, half dead
and dead nodes during the sensing process of the network.
Where n is the number of nodes, m is the proportion of advanced nodes to the total
number of nodes n and b is the proportion of intermediate nodes. Proceeding with
similar analysis in [32], the following conditions must be satised.
1. The advanced nodes must be cluster-heads exactly (1 + ) times every
1
P
opt
(1 +
m + b).
2. The intermediate nodes must be cluster-heads exactly (1+) times every
1
P
opt
(1+
m + b).
3. Every normal nodes must also become cluster-heads once every
1
P
opt
(1+m+b).
4. The average number of cluster in the network should be nP
opt
.
This translates into a probability problem which can be solved mathematically. As-
suming P
nrm
, P
int
and P
adv
are the probabilities of becoming normal, intermediate and
advanced nodes respectively, we have:
P
nrm
= P
opt
/(1 + m + b). (3.15)
P
int
= P
opt
(1 + )/(1 + m + b). (3.16)
28
P
adv
= P
opt
(1 + )/(1 + m + b). (3.17)
To guarantee that the sensor nodes must become cluster-heads as assumed above,
we must dene a new threshold for the election processes, Eq.(3.3). The threshold
T(n
nrm
), T(n
int
), T(n
adv
) for normal, intermediate and advanced nodes respectively
becomes:
T(n) =
_
P
nrm
1P
nrm
[r mod(1/P
nrm
)]
if n
nrm
G

;
0 Otherwise,
(3.18)
From above we have n(1 m b) normal nodes, which ensures that our assumption
(1) is exact, where G

is the set of normal nodes that has not become cluster-head in


the past 1/P
nrm
round r. The same analogy follows for the intermediate and advanced
nodes.
T(n
int
) =
_
P
int
1P
int
[r mod(1/P
int
)]
if n
int
G

;
0 Otherwise,
(3.19)
We have nb intermediate nodes, with G

the set of intermediate nodes that has not


become cluster-head in the past 1/P
int
round r. This proves assumption (2) to be
valid.
T(n
adv
) =
_
P
adv
1P
adv
[r mod(1/P
adv
)]
if n
adv
G

;
0 Otherwise,
(3.20)
Similarly, we have nm advanced nodes, with G

as the set of advanced nodes that


has not become cluster-head in the past 1/P
adv
round r. Hence validating assumption
(3), from Eqs. (3.18), (3.19) and (3.20), the average total number of cluster-heads per
round will be:
n(1 mb)P
nrm
+ nbP
int
+ nmP
adv
.
= nP
opt
. (3.21)
Eq.(3.21) agrees with assumption (4) and yields the same optimal number of cluster-
heads per round when compared with the original LEACH and SEP settings. However,
because of the energy heterogeneity setting, energy dissipation is better controlled with
this approach, yielding more desirable results as shown by simulation. In summary,
SEP-E protocol is designed to exploit three energy levels/nodes i.e. advanced nodes,
intermediate nodes and normal nodes in two hierarchy settings to further extend the
eective network lifetime of a clustered WSN.
29
3.3.1 Simulation Settings
Assuming a 100m 100m region of 100 sensor nodes scattered randomly. For the
purpose of testing, MATLAB [1] is used to implement the simulation. To have a fair
comparison with LEACH, let us introduce advanced and intermediate nodes with the
same energy levels as in SEP-E protocol. Likewise, to have a fair comparison with SEP
in two-node scenario, additional energy is introduced so that the total initial energy
of the network system becomes same as in SEP-E and LEACH in three-node settings.
The notion is to be able to assess the performance of these protocols in the presence
of heterogeneity. Specically, we have the following settings:
Let 20% and 30% of the nodes be advanced nodes and intermediate nodes with addi-
tional energy levels: = 3 and = 1.5 respectively. The new heterogeneous epoch
is
1
P
opt
(1 + m + b). Since P
opt
= 0.1 on average there should be 10 nodes becoming
cluster-heads per round. This means by the new heterogeneous epoch there should be,
on average n(1 m b)P
nrm
= 2 normal nodes becoming cluster-heads per round.
Similarly, we should have nbP
int
= 4 intermediate nodes as cluster-heads per round
and nmP
adv
= 4 advanced nodes as cluster-heads per round. Other parameters used
in the simulation are shown in Table 3.1.
Parameter Values
E
elec
50nJ/bit
E
DA
5nJ/bit/message
E
o
0.5J
k 4000
P
opt
0.1

fs
10pJ/bit/m
2

mp
0.0013pJ/bit/m
4
n 100
Table 3.1: Parameter settings
3.3.2 Analysis of experiment
In this section, a brief discussion of the methodologies used to analyses the performance
of the protocols examined in this thesis is presented. Followed by the results of the
experiments using dierent standardized metrics. The denitions of the performance
metrics used are given below:
30
Performance Metrics
Stability period: the period from the start of the network operation and the rst
dead node.
Instability period: the period between the rst dead node and last dead node.
Status: the number of alive and dead nodes per round.
Half-live: the period from the start of the network operation to the time the rst
node uses up half of its energy.
Spatial distribution: the distribution and uniformity of live and dead nodes per
round in the network region under consideration.
Throughput; the rate of data sent from the cluster-heads to the BS over the
network life-time, measured per round per epoch.
Validation of Experiments using t-Test Analysis
The t-test also known as the Students t statistic is one of the most common types of
method used to evaluate the dierence in mean of two groups of data. It is commonly
applied when the test statistic would follow a normal distribution. The t-test can be
used in dierent scenarios, mostly:
1. A test of null hypothesis whether there is a signicant dierence between two
data measured on same condition, has a mean value of zero.
2. To test if the slope of a regression line is signicantly dierent from zero.
3. To verify a one sample location test of whether the mean of a normally distributed
population has a value specied by the null hypothesis.
4. To verify a two sample location test of the null hypothesis whether the means of
two normally distributed samples are equal.
Assumptions of t-test
The t-test statistic is normally of the form T = Z/s, where Z and s rely on the data
being tested. The magnitude of Z tend to be larger when the alternative hypothesis
31
is true. On the other hand s is a scaling factor that determines the distribution of T.
The assumptions of t-test are that:
1. Z and s are independent functions.
2. Z follows a standard normal distribution under the null hypothesis.
3. If we have a p degree of freedom under the null hypothesis, then ps
2
follows a
2
distribution, where p is a positive integer.
In the context of the experiments carried out in this thesis, scenario (1), becomes
the premise of our assessment. The problem formulation is thus to test whether there
exist signicant dierences between the means of the metrics used for the protocols
examined. For instance, if we want to compare two means of independent samples as
we shall see later on, the following condition must be valid:
1. The two groups to be compared should follow a normal distribution, this can be
veried using histogram or Kolmogorov-Smirnov test. Theoretically, the t-test
can be used even if the sample sizes are very small [36](say for n = 10 or smaller
values of n), as long as the variables are normally distributed.
2. The variance of the samples being compared should be statistically insignicant
or should be same statistically. This can be veried using F-test or with a more
robust Levenes test. However, if the samples sizes of the two groups are equal,
the Student t-test is acclaimed to be highly robust to the presence of unequal
variances [3].
3. The two data groups to be compared should be sampled independently, which is
also known as unpaired two-sample t-test. for instance, if we sample 50 subject
from entire population to evaluate performance of a drug for diabetes. If we decide
25 of the subject to be the control group while the other 25 as the treatment
group. In this case we have two independent samples, so we use the unpaired
t-test. Otherwise, if the sample data is dependent on each other, then a dierent
approach is employed. A typical example of dependent sample could be where
subjects are tested prior to treatment say for diabetes, and same subjects are re-
tested after treatment for same diabetes. In this case we use the paired sample
t-test.
32
3.3.3 Comparing LEACH, SEP and SEP-E
This section presents the results of the experiments comparing LEACH, SEP and
SEP-E in three-node heterogeneous settings. The authors in [32] discussed how SEP
exploited the energy imbalance to extend the network life-time. From simulation result
conducted with same parameters used in [18], it was shown by the authors in [32] that
the stable region of SEP is extended compared with that of LEACH using m = 0.2
and = 1 in a two-node setting. The unstable region of SEP is also shorter than that
of LEACH. The same experiment is performed in this thesis but now with higher level
of energy m = 0.2 and = 3. SEP takes full advantage of the heterogeneity compared
with LEACH. Again the stability is better compared with LEACH. Figures 3.5 and
3.4 shows these results. The sensitivities of these protocols to energy variations is also
presented in the gures.
Figure 3.6 shows SEP-E, LEACH and SEP in the presence of energy heterogeneity,
0 1000 2000 3000 4000 5000 6000 7000
0
10
20
30
40
50
60
70
80
90
100
number of rounds
n
u
m
b
e
r

o
f

l
i
v
e

n
o
d
e
s
Live nodes per round


SEP
SEPE
LEACH
Figure 3.4: The performance of SEP-E (m = 0.1, b = 0.2, = 1 and
= 0.5), LEACH(m = 0.1, b = 0.2, = 1 and = 0.5) and SEP
(m = 0.3, b = 0, = 0.7 and = 0),E
total
= 60J in the presence of
low energy heterogeneity.
on average the stability of SEP-E compared with LEACH increased from 995 rounds
to 1450 rounds and the instability reduced from 4585 rounds to 3751 rounds. Also
the stability in SEP-E when compared with SEP increased from 1385 to 1450 rounds,
and the instability is also reduced from 5050 to 3751 rounds. It is worthy of note
33
0 1000 2000 3000 4000 5000 6000 7000
0
10
20
30
40
50
60
70
80
90
100
number of rounds
n
u
m
b
e
r

o
f

l
i
v
e

n
o
d
e
s
Live nodes per round


LEACHHomo
LEACHHeter
SEP
SEPE
Figure 3.5: The performance of SEP-E (m = 0.1, b = 0.2, = 2 and
= 1), LEACH (Homogeneity, m = 0, b = 0, = 0 and = 0),
LEACH (Heterogeneity, m = 0.1, b = 0.2, = 2 and = 1) and SEP
(m = 0.3, b = 0, = 1.3 and = 0), E
total
= 70J.
that when SEP is compared with LEACH in two-node heterogeneous settings, with
small energy dierences between the advanced nodes and normal node, SEP instability
is much lower than LEACH. However, if this energy gap becomes considerably large
between the advanced nodes and normal nodes, the instability of SEP is also increased.
This results into a problem of energy gap with SEP when compared with SEP-E and
LEACH in three-node heterogeneous settings. For instance, if the advanced nodes are
so powerful than the normal nodes, then there is high tendency of all normal nodes
dying out faster than expected, without the death of any advanced nodes. Hence, as the
network evolves, this leaves majority of the advanced nodes with high residual energy.
The eect of this is high instability region of SEP compared with SEP-E and LEACH
in three-node heterogeneous settings as seen in Figure 3.6. To cope with the above
problem, SEP-E exploits the presence of the intermediate nodes to bridge this energy
gap (see numerical solutions in Section 3.3.1), thus reducing the instability period and
further extending the stable period of the network system.
With lower values of energy heterogeneity as seen in Figures 3.4 and 3.5, the stability
region of SEP-E is reduced relative to the energy levels. It can be deduced from Figure
3.6 that SEP-E takes advantage of the extra energy introduced into the system. As
the level of energy heterogeneity increases from Figures 3.43.6, the stability region
34
0 1000 2000 3000 4000 5000 6000 7000 8000
0
10
20
30
40
50
60
70
80
90
100
number of rounds
n
u
m
b
e
r

o
f

l
i
v
e

n
o
d
e
s
Live nodes per round


LEACH
SEPE
SEP
Figure 3.6: The performance of SEP-E (m = 0.2, b = 0.3, = 3 and
= 1.5), LEACH (m = 0.2, b = 0.3, = 3 and = 1.5) and SEP
(m = 0.3, b = 0, = 3.5 and = 0), E
total
= 102.5J in the presence
of high energy heterogeneity.
of SEP-E is improved proportionately better than SEP and LEACH(heterogeneity).
This shows the sensitivity of SEP-E protocol to higher heterogeneity.
Figure 3.5 shows the performance of LEACH in the presence of energy heterogeneity
and homogeneity, it is worth noting that LEACH performs well in the presence of
energy homogeneity which is expected since that was the objective of the authors in
[17]. However, LEACH performs very poorly in the presence of energy heterogeneity
compared to SEP-E. Even though the LEACH(heterogeneity) takes advantage of the
extra energy compared with LEACH in the presence of homogeneity by extending
the stability region, but, the instability in LEACH(heterogeneity) is also extended
signicantly, which negates the overall performance. This is because of the following
reasons: (1) after the death of the rst node LEACH(heterogeneity) becomes very
unstable as there is no guarantee that the highly energized nodes become cluster-heads
more often than the normal nodes; and (2) there is no guarantee that optimal number
of cluster-head would be selected in some rounds.
From Figure 3.7 the rate of energy dissipation for all the nodes in SEP-E is much better
than in LEACH (heterogeneity). This means SEP-E achieves better utilization of the
extra energy introduced into the system compared to LEACH, which is the intended
objective for SEP-E protocol design. The throughput graph in Figure 3.8 shows the
35
0 1000 2000 3000 4000 5000 6000 7000
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
number of rounds
E
n
e
r
g
y

l
e
v
e
l
Rate of energy dissipation per round


LEACH(Advanced node)
SEPE(Intermediate node)
LEACH (Normal node)
SEPE(Advanced node)
LEACH(intermediate node)
SEPE(Normal node)
Figure 3.7: Shows the rate of energy dissipation of SEP-E and LEACH
nodes in the presence of energy heterogeneity. Where m = 0.2, b =
0.3, = 2 and = 1.
0 100 200 300 400 500 600 700 800
0
5
10
15
20
25
30
number of rounds
T
h
r
o
u
g
h
p
u
t

i
n

K
b
i
t
s
Throughput per round per epoch from clusterheads to the Sink/BS


LEACH
SEP
SEPE
Figure 3.8: Shows the data rate from cluster-heads to sink/BS of SEP-
E, SEP and LEACH nodes in the presence of energy heterogeneity.
Where m = 0.2, b = 0.3, = 2 and = 1.
36
data rate from cluster-heads to the BS. The throughput of SEP-E is much better than
that of LEACH and SEP, during the stable region of the network. Although SEP and
LEACH at some period during the unstable region becomes better than SEP-E, in
general the throughput of SEP-E proves to be superior for majority of the network
life-time.
Figure 3.9 summarizes the spread of SEP-E and LEACH stability data in the presence
Figure 3.9: The behavior of SEP-E and LEACH stabilities for 10
trials in the presence of heterogeneity. We have m = 0.2, b = 0.3,
= 3 and = 1.5.
of energy heterogeneity. The stability, instability and half-live of SEP-E, LEACH
and SEP were observed for 10 runs. Figures 3.10, 3.11 and 3.12 further reveals the
performance of SEP-E compared with LEACH and SEP over same number of trials.
Majority of the experimental data for SEP-E falls within some expected range and are
better when compared with LEACH and SEP. It is observed that the nodes in SEP-E
use up half of its energy at an average of 704 rounds compared to LEACH and SEP at
an average of 478 and 631 rounds respectively. Also SEP-Es stability region is more
attened when studied over some number of trials compared with LEACH and SEP.
To sum up, the simulation results for SEP-E reveal a prolonged stability period and
a reduction in the instability region in all trials. Ideally the advanced nodes become
cluster-heads more than both the intermediate and normal nodes. The intermediate
nodes take up the role of cluster-head more frequently than the normal nodes, also as
expected according to the model estimation for SEP-E design. It should be noted that
37
Figure 3.10: The behavior of SEP-E and LEACH instabilities for 10
trials in the presence of heterogeneity. We have m = 0.2, b = 0.3,
= 3 and = 1.5.
Figure 3.11: The behavior of SEP-E and SEP stabilities for 10 trials
in the presence of heterogeneity. We have SEP-E (m = 0.2, b = 0.3,
= 3 and = 1.5) and SEP (m = 0.3, b = 0, = 3.5, = 0, E
total
=
102.5J).
38
Figure 3.12: The behavior of SEP-E and SEP instabilities for 10 trials
in the presence of heterogeneity. We have SEP-E (m = 0.2, b = 0.3,
= 3 and = 1.5) and SEP (m = 0.3, b = 0, = 3.5, = 0, E
total
=
102.5J).
the simulations do not account for the setup time to congure the sensor nodes or the
update process for dead nodes, they however, give an approximation of the network
life-time that can be achieved using these protocols.
3.3.4 Validation of results using t-test
From the experiments carried out to compare the behavior of SEP-E, LEACH and SEP,
using the performance metrics dened above. It can be deduced that the performance
of SEP-E is better compared with both LEACH and SEP. And SEP is also better than
LEACH. But the open research issue is, how statistically signicant these dierences
are in terms of performance using the metrics mentioned above.
Statistical Assumptions of Experiments
In order to exploit the power of Students t-test in validating the results of the protocols
reviewed in this thesis, the following assumptions must be true:
1. The protocols compared should have equal sample sizes and equal variance. In
this case the sample size is set to n = 10 for each group. The variance of each
39
data set is veried using F-test, which showed that the variances between the
protocols are statistically insignicant.
2. The data group of each protocol compared are sampled independently. Thus, we
shall proceed using the unpaired two-sample t-test.
3. The data sample of each protocol are normally distributed, this is veried using
histogram.
The t statistic used to test if there is a dierence in mean for the stability, instability
and half-life of SEP-E compared with that of LEACH and SEP is given below:
t =

X
1


X
2
S
x
1
x
2

2
n
(3.22)
where
S
x
1
x
2
=
_
S
x
1
2 + S
x
2
2
2
To ensure a signicant testing, the degree of freedom used is 2n 2 where n is the
size of each group and S
x
1
x
2
is the pooled standard deviation, 1 and 2 are group one
and two respectively. The expression in the denominator of t is the standard error of
dierence between the two means.
3.3.5 Test for the dierences between two means (Unpaired
t-test)
SEP-E vs LEACH
Here, the performance of SEP-E is compared with LEACH in terms of the mean dif-
ferences in stability, instability and half-live of the network system using the same
parameter settings.
Interpretation:
1. SEP-E(stability) vs LEACH(stability)
mean(diff)= mean(SEP-E(stability) LEACH(stability))
Ho: mean(diff) =0
Ha: mean(diff) >0
Where Ho is the null hypothesis and Ha is the alternative hypothesis.
40
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at the 1
percent level of signicance (p < 0.0001).
2. SEP-E(instability) vs LEACH(instability)
mean(diff)= mean(SEP-E(instability) LEACH(instability))
Ho: mean(diff) =0
Ha: mean(diff) >0
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at the 1
percent (p < 0.0001).
3. SEP-E(half-live) vs LEACH(half-live)
mean(diff)= mean(SEP-E(half-live) LEACH(half-live))
Ho: mean(diff) =0
Ha: mean(diff) >0
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at the 1
percent level of signicance (p < 0.0001)
SEP-E vs SEP
The signicance in mean dierences in terms of stability, instability and half-live for
SEP-E and SEP is tested, using same parameter settings.
Interpretation:
1. SEP-E(stability) vs SEP(stability)
mean(diff)= mean(SEP-E(stability) SEP(stability))
Ho: mean(diff) =0
Ha: mean(diff) >0
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at the 1
percent level of signicance (p = 0.0001).
41
2. SEP-E(instability) vs SEP(instability)
mean(diff)= mean(SEP-E(instability) SEP(instability))
Ho: mean(diff) =0
Ha: mean(diff) >0
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at 1 per-
cent (p = 0.0001).
3. SEP-E(half-live) vs SEP(half-live)
mean(diff)= mean(SEP-E(half-live) SEP(half-live))
Ho: mean(diff) =0
Ha: mean(diff) >0
The alternative hypothesis that the dierence between the two means is greater
than zero cannot be rejected. This dierence is statistically signicant at the 1
percent level of signicance (p < 0.0001)
Remarks
From the above analysis using the Students t-test to validate the results of the experi-
ments of SEP-E, LEACH, and SEP carried out under the same observations, it can be
inferred that SEP-E is more robust than the existing schemes considered in this thesis.
The MedCalc Statistic tool [2] is used for data analysis. See Appendix A.2 for detailed
test data and results.
3.3.6 Summary
In this chapter we discussed the dierent underlying models of WSN: the network
model, path loss model, data aggregation model and energy model are presented. The
proposed protocol SEP-E as an enhancement to existing schemes, LEACH and SEP is
discussed. Finally, the detailed results of the experiments, validation and performance
indices are presented.
From the studies conducted in this chapter, the results revealed that SEP-E extends
signicantly the stability period of the network than both LEACH and SEP. This same
trend is observed for the throughput of SEP-E compared with LEACH and SEP. In
42
addition, SEP-E reduces signicantly the instability region compared with the existing
LEACH and SEP in a clustered heterogeneous WSN. This means SEP-E has a better
control of energy distribution among its sensor nodes than LEACH and SEP. From the
simulation results of SEP-E, it can be deduced that energy-diversity of sensor nodes
i.e. energy-heterogeneity plays a very important role in balancing the overall energy
consumption in a clustered WSN. The behaviors of these protocols will be further
analyzed in Chapter 5 in order to reach a constructive conclusion.
43
Chapter 4
Communication Modes in
Hierarchically Clustered WSN
The quest for better protocol design that can minimize communication cost and energy
usage in WSN has fuelled various researches into employing dierent kinds of commu-
nication modes that promise a better utilization of network resources. This chapter
discusses extensively these dierent communication modes for WSN that are hierar-
chically clustered. A brief review of existing literatures is presented in the following
sections, followed by the contribution of this thesis.
4.1 Introduction
Wireless sensor nodes in a network can be designed to communicate using dierent
types of communication modes. Some literatures [32, 17, 22, 27] proposed protocols
that use a single-hop communication mode to send their data to the BS. Other lit-
eratures [31, 40, 10] employed hierarchical modes of communication (multi-hop) for
sensors outside each others range to reach BS. The design objectives of dierent com-
munication modes could be to extend the entire network life-time of the sensors or to
reduce communication cost. In [24] the authors investigated a systematic cost-based
approach for both multi-hop and single-hop communication modes and further pro-
posed a hybrid communication which focused on data aggregation model. The shift
in communication paradigm from any-to-any in ad hoc networks to many-to-one in
wireless sensor networks has motivated several research into design of an energy aware
protocol for WSNs. Most protocol designs have not successfully balanced the trade-o
between using the multi-hop mode for energy conservation to the single-hop mode for
reduced communication cost.
44
When sensor nodes are organized in a hierarchy or multi-level cluster structure using
multi-hop communication mode, it is obvious that the nodes closer to the BS dies
out rst as a result of being over-burdened from relaying packets of other far away
nodes. Although this method may seem to reduce the unnecessary energy drainage of
the network when properly leveraged, the downside of the multi-hop approach is the
BS-centric dying pattern of the sensor nodes around the BS if not properly utilized
and the cost can be considerably very expensive. However, when nodes communicate
directly to the BS using a single-hop, the nodes farther away use much more energy to
reach the BS. Thus, nodes far away die out rst due to the long range of transmission.
On the other hand, it could be cheaper in terms of cost to deploy a single-hop commu-
nication network. A good exploitation of the above mentioned communication modes
can yield desirable results. The authors in [43] proposed a multi-hop communication
mode between cluster-heads and sink. Their result revealed an improvement to existing
LEACH that used single-hop mode. In the next sections, this thesis examines these
communication modes and then propose a dual and multi-hop communication modes
that leverages on both layered and clustering architecture for the design.
4.2 Single-hop communication mode
When nodes communicate directly with the BS without relaying their packets, it is
referred to as single-hopping. The design of single-hop technique could vary in dierent
network topology. A protocol design may require the nodes to form clusters among
themselves such that each non-cluster member sends its data to their respective cluster-
heads and the cluster-heads performs data aggregation before forwarding the rened
data to the BS. An example of this protocol is LEACH. On the other hand a protocol
design can completely adopt a layered architecture where each node is required to send
its data directly to the BS. One of the protocols that used this approach is the Direct
Transmission protocol [29]. In this approach, each node transmits directly to the base
station. If the BS is far away from the nodes, direct transmission will require large
transmission energy, since distance d will be suciently large. As shown by Heinzelman
et al in [17] this method is not so eective, as the energy of the nodes is drained faster
and the overall life-time of the system is shortened. However, if the BS is within the
sensing region say at center location, the performance could be optimal since the BS
is the only data reception point and the cost function of data aggregation energy is
minimized on the total energy of the network system. Figure 4.1 depicts the single-hop
45
communication mode for a clustered WSN.
Figure 4.1: Single-hop Network Design
4.2.1 Total Energy Dissipation for a Single-hop Mode in a
Clustered WSN
The total energy dissipation for a network system is expressed as the sum of energy
consumed by the sensor nodes to sense an event and transmit the sensed data to a
central location or the BS. If the sensor node is a cluster-head, the energy expended
will be the sum of energy consumed to sense the environment, to receive data from
cluster members, to perform data aggregation and to transmit the rened data to the
BS. Being a cluster-head can be energy consuming, however the energy expended is
also a factor of the number of cluster members in each cluster and the distance to the
BS as discussed in [14]. In this regard, having the location of the BS at the center
of the sensing region can result to an optimal setting compared with having the BS
location outside the sensing eld. Thus, assuming the BS is located at the center of the
sensing region as shown in Figure 4.1. The total energy expended by a cluster-head is
given by:
E
CH
= kE
elec
B
0
+ kE
DA
(B
0
+ 1) + E
Tx
(k, d
toSink
). (4.1)
where E
CH
is the energy expended in receiving B
0
number of k bits from cluster
members, and E
DA
is the energy expended to aggregate the data and then transmit
with E
Tx
(k, d
toSink
) energy. In this premise, the free space path loss is used since the
46
BS is at the center of the sensing region. Recall from Chapter 3 that if the sensor node
is a cluster member, the energy expended is given by:
E
nonCH
= kE
elec
+ k
fs
d
2
toCH
. (4.2)
Thus, the total energy expended in a single-hop communication network will be the
sum of energy expended by non-cluster members and the cluster-heads expressed as:
E
cluster
E
CH
+
n
c
E
nonCH
. (4.3)
However, to ensure an optimal setting for this type of communication mode, the fol-
lowing issues need to be considered: an optimal number of cluster-heads per round per
epoch and the battery dimensioning that will ensure at least a guaranteed network life-
time. In some instances, a single-hop communication can be preferable to a multi-hop
communication as explained in [18]. The authors noted that for the parameters they
investigated, the single-hop communication is more ecient than the multi-hop mode
when they compared their approach with [29]. However, the authors in [24] found this
proposition to be relaxed when they considered a network that may be deployed over
a large region. They revealed that the energy spent by each node to send data to
the BS can be higher than the energy spent if the data where to be aggregated and
multi-hopped before transmission to the BS. The argument by [18] may be true for
a single-hop mode to become more ecient when the path loss factor is 2. However,
when this assumption is relaxed, then it becomes undesirable in considerably large
networks.
4.3 Dual-hop and Multi-hop communication mode
Several authors have proposed using multi-hop routing scheme to relay data to the
BS. One of the earliest work to use this model is the Minimum-Transmission-Energy
(MTE)[29]. The authors estimated that a packet with a transmission distance more
than 2
1
2
should be routed through an intermediate node. Here is the density in the
intermediate area. The goal of this scheme is to use the route with minimum energy
consumption. But as the authors rightly pointed out, minimization of energy in multi-
hop routing is only one of the criterion. As discussed in [5], some other criteria for a
multi-hop network might include maximal available power, minimal hop and maximal-
minimal available power. The goal of these modied protocol designs in this chapter
47
is to exploit the minimum energy route based on distance estimation. This method is
similar to the idea used in LEACH, SEP-E and SEP in the sense that energy is esti-
mated as a function of distance, except that this method exploits further the energy
resources around the BS by relaying packets to nodes closer to the BS.
Similar to the single-hop mode, multi-hop can be classied as inter-cluster-based and/or
intra-cluster-based for clustered architecture or layer-to-layer hopping for layered archi-
tecture. In [43], the authors proposed an inter-cluster multi-hop communication as an
improvement to LEACH protocol. While the authors in [15] successfully implemented
a layered architecture using a multi-hop communication mode. In [40], a multi-hop
WSN with mobile sink was presented, the goal of this approach is to adaptively move
the sink towards the events being sensed. As discussed in Section 4.2, deploying a
multi-hop mode may be desirable if only the network is large enough to compensate
for the aggregation energy of the cluster-heads. However, none of the authors have ac-
tually assessed the impact of using a dual-hop in a three-level hierarchically clustered
network in an energy homogeneous setting. Here, a dual-hop is dened as a communi-
cation mode between two cluster-heads with the aim of relaying their aggregated data
to the BS. In the section that follows, the total energy consumptions for both dual and
multi-hop modes are discussed. The goal is to see how these schemes scale well, as
opposed to using a single-hop scheme such as LEACH in a homogeneous small-scaled
network of sensors.
4.3.1 Total Energy Dissipation in a Dual and Multi-hop Net-
work in a Clustered WSN
This section presents and examines the total energy that is expended in a dual-hop and
multi-hop networks for a clustered architecture following the thoughts of [14]. Let us
consider the following scenario in Figure 4.2, as a dual-hopping network, if we partition
the network area logically into three dierent levels, say level 1, 2 and 3 with C
2
as
level 2 (local cluster-heads) and C
3
as level 3 (relay cluster-heads). When the clusters
are formed in the network, C
2
cluster-heads aggregate the data from level 1 nodes as
their cluster members and transmit the data to C
3
cluster-heads. Interestingly, level 2
cluster-heads sees level 1 nodes as their cluster members, likewise level 3 cluster-heads
sees level 2 nodes as their cluster members.
Following the assumptions in Chapter 3 as used in SEP and LEACH, from Eq.(3.1),
48
Figure 4.2: Dual-hop Network Design
by equating the two expressions at d = d
0
, we have d
0
=
_

fs
mp
. This means from
Table 3.1, by using the radio parameters, the communication distance d from a sender
to a receiver is approximately 87.7m. If the sink is located at the center, the maximum
distance d
1
of any node to the sink would be approximately 70m. This help us to choose
sub-optimal values for R, to be more accurate the value of R is chosen as 0 R 70
in this regard i.e the choice of R is bounded by distance d
1
. However, if the BS is
located outside the sensing region, then the sub-optimal values for R will be bounded
by the position (x, y) coordinates of the sink, estimated using Pythagoras theorem.
Thus, if we form a concentric circle of radius R around the BS such that all level 3
cluster-heads are chosen within R, then we can easily compute the energy per bit for
nodes in all levels. Note, the choice of R is assumed to be within the communication
area occupied by the sensor nodes. It is important to note that the number of sensor
nodes within the concentric circle of radius R depends on its size. Assuming an area
A = M M square meters and the area of the concentric circle A

= R
2
. In order
to estimate the eects of R on the network performance, we compute the ratio of the
area of the concentric circle to the total area of the network, with respect to the total
number of nodes in the network given as:
=
R
2
M
2
=
n

n
where is the variability constant, n

is the number of nodes within the concentric circle


R and n is the total number of nodes in the network. Since is directly proportional
to R, by varying with respect to R can yield dierent sub-optimal settings. As the
49
value of R increases, the number of nodes n

within its region increases this is shown


in Figure 4.3. When the value of R = 0 or R = 100 it becomes the original LEACH
protocol. However, the increment or decrement in R does not necessarily guarantee
a better performance, e.g assuming R = 100, in this regard, it becomes the original
LEACH, this is the premise for the experiments carried out in this thesis.
From Figure 4.2 given n nodes in a sensing eld, let the energy required for level 1
0 2 4 6 8 10 12 14 16
0
10
20
30
40
50
60
70
80
90
100
number of trials
n
u
m
b
e
r

o
f

n
o
d
e
s
Percentage of nodes within concentric circle R


R=40
R=30
R=20
R=10
Figure 4.3: Percentage of nodes within concentric circle R
nodes to sense and transmit the data to level 2 be E
1
. Also let the energy required for
level 2 cluster-heads to receive and aggregate the data from non-cluster heads be E
2
,
when level 3 cluster-heads receive and aggregate the data from level 2, let the energy
expended be E
3
and nally when level 3 transmits the data to BS, let the energy used
be E
4
. Thus, the expected energy per bit for level 1 non-cluster heads will be:
E
1
k
= E
elec
+
fs
d
2
toCH
(4.4)
Substituting d
2
toCH
=
M
2
2C
2
(recall the expected distance given in Eq.(3.7) with path
loss 2) into Eq.(4.4), it becomes:
E
1
k
= E
elec
+
fs
M
2
2C
2
(4.5)
Likewise, the level 2 cluster-heads expend some energy receiving and aggregating the
data. The energy per bit is given as:
E
C
2
k
= E
elec
(
n
C
2
1) + E
DA
n
C
2
(4.6)
50
The term (
n
C
2
1) is the number of non-cluster head nodes for each level 2 cluster-head.
Hence, the overall energy per bit E
2
at level 2 stage will be the sum of energy expended
by non-cluster heads n C
2
in level 1 and the level 2 clusterheads C
2
given as:
E
2
k
= (n C
2
)
E
1
k
+ C
2
E
C
2
k
(4.7)
Finally, at level 2, the selected cluster-heads will transmit the rened data to level 3
cluster-heads. Let (E
Tx
C2
/k) be the transmission energy per bit expressed as:
E
TxC
2
k
= E
elec
+
fs
M
2
2C
3
(4.8)
Using similar analysis above for level 3 cluster-heads, we have the overall energy per
bit to receive and aggregate the energy from level 2 cluster-heads as:
E
C
3
k
= E
elec
(
C
2
C
3
1) + E
DA
C
2
C
3
(4.9)
Following the same explanation from Eq.(4.7), C
3
level 3 cluster-heads, see level 2
cluster-heads as their cluster members; hence we have (
C
2
C
3
1) non-cluster members
per level 3 cluster-head. The overall energy per bit (E
3
/k) expended at level 3 stage,
will be the sum of energy per bit of the non-cluster heads (C
2
C
3
) to transmit the
aggregated data(in this case level 2 becomes cluster members to level 3 cluster-heads)
and the energy expended by level 3 cluster-heads to receive and aggregate the data is
given as:
E
3
k
= (C
2
C
3
)
E
TxC
2
k
+ C
3
E
C
3
k
(4.10)
The total energy per bit expended at level 2 will be the sum of energies for receiving,
aggregating and transmitting, which is computed in Eq.(4.11) by substituting Eqs.(4.8),
(4.9) into (4.10).
E
2
k
= 2(C
2
C
3
)E
elec
+
fs
M
2
2
_
C
2
C
3
1
_
+ C
2
E
DA
(4.11)
Since the BS is located at the centre in the context considered in this thesis , the free
space path loss factor of v = 2 is used. Thus, the overall energy per bit E
4
for level 3
cluster-head to transmit to the BS or sink is expressed as:
E
4
k
= E
TxC
3
(k, d
toSink
). (4.12)
The function (k, d
toSink
) is expressed in Eq.(3.11). Finally, by adding Eqs.(4.7), (4.11)
and (4.12) the total energy per bit E
sum
that will be expended in a dual-hopping
network per round will be:
51
E
sum
k
= 2nE
elec
+
fs
M
2
2
_
n
C
2
+
C
2
C
3
2
_
+E
DA
(n+C
2
)+C
3
(
fs
d
2
toSink
E
elec
). (4.13)
From the network energy analysis for a dual-hopping scheme, we can form a generalized
energy model by iterating the energy model for a three-level system into an N
th
-level
system. An extension of dual-hop energy model yields an energy model for a multi-hop
network in a hierarchically clustered WSN expressed as:
E(N
th
sum
)
k
= 2nE
elec
+
fs
M
2
2
_
n
C
2
2 +
N

i=2
C
i1
C
i
_
+E
DA
_
n +
N1

i=1
C
i
_
+ C
N
(
fs
d
2
toSink
E
elec
). (4.14)
4.4 Assessing dierent communication modes in the
design of LEACH Protocol
This section presents an improvement to LEACH protocol in two dierent forms, rst
by considering a multi-hop system of communication using a concentric circle of radius
R among cluster-heads, and secondly, by using a dual-communication between two
types of cluster-heads with the same initial energy E
0
. In LEACH, each cluster-head
communicates directly with the BS. This approach proves to consume more energy as
cluster-heads farther away from the BS will use more energy to transmit their data
to the BS since the energy expended is a function of the distance. The proposition
is the same as LEACH in terms of the probability model of choosing cluster-heads
but diers in terms of communication modes. According to [17], the set-up phase
begins when all sensor nodes elect cluster-heads among themselves with a probability
indicator function and announce their status. The rest of the non-cluster heads wait for
the announcements and send a join-request message to the chosen cluster-head that
is the closest in terms of communication energy estimated by the distance required
to reach it. The cluster-heads wait for a join-request messages and then creates a
TDMA schedule before sending the schedule to the cluster members. When the cluster
members receive this schedule, the steady state operation of data transmission begins.
The authors in [9] used similar approach as in [17]. However, they proposed a multi-hop
system among all nodes at a xed power level. Data exchanged between sensors not
52
within each others radio range is forwarded by other sensors in the network regardless
of whether a node is a cluster-head or a cluster member. This thesis, on the other
hand, uses similar approach, except it considers a dual-hop and a multi-hop system
between elected cluster-heads to transmit data to the BS. In both cases, the following
assumptions (for the network model and cluster formation process) were made:
1. All sensors can transmit with enough power to reach the BS if needed, and the
nodes can vary their transmission power.
2. Each node possess enough computational power to perform various signal pro-
cessing duties and support dierent MAC protocols.
3. The model used assumes that the nodes always have data to send to the end user
throughout the network operation.
4. The sensors are randomly distributed according to a homogeneous spatial distri-
bution in a 2-dimensional space, and the topology does not signicantly aect
the performance as discussed in [15]. It is further assumed that the trac load
is lighter since the network is not so large.
5. For Multi-hop LEACH with Concentric Circle (MLCC) the cluster-heads aggre-
gates the data from their cluster members before forwarding to the next clos-
est cluster-head to the BS. In case of Dual-hop LEACH with Concentric Circle
(DLCC) the next closest cluster-head is chosen within the concentric circle of
radius R.
6. The distance d of any node to the BS is bounded by distance d
1
. It is assumed
that the BS is located at the center of the sensing region.
7. The communication environment is error-free and contention-free, this means
sensor nodes will not need to retransmit their data.
8. All sensor nodes have equal energy at the beginning of the network operation.
9. Finally, the BS is assumed to have wide transmission range cover, hence can use
a single broadcast to reach all the sensor nodes.
Following the above assumptions a Dual-hop LEACH and a Multi-hop LEACH algo-
rithms using a concentric circle around the BS is proposed and tested. The following
sections discuss these protocols and their algorithms in details.
53
4.4.1 Dual-hop LEACH with Concentric Circle
The idea behind this scheme is much similar to the single-hop LEACH in terms of
network model and cluster formation process as discussed earlier, except this method
communicate with BS using two hops and further exploits a radius of connectivity R
around the BS, and chooses an optimal path that uses less energy for transmission
among the cluster-heads. The goal of this method is to assess the impact of more than
one-way communication mode among the cluster-heads and observe how much it does
aect the overall performance of the original LEACH protocol. In this instance cluster-
heads farther away from the BS will relay their aggregated data to cluster-heads closer
to the BS. The local cluster-heads communicate aggregated data from their cluster
members to only relaying cluster-heads located within the radius R of the BS. Recall,
that this form of communication is what is referred to as dual-hopping in this thesis.
Figure 4.4; shows the ow chart algorithm for DLCC. The problem that may arise
is that cluster-heads closer to the BS will be overburdened with relaying of packets.
To cope with such problem a concentric circle of R is formed around the BS with a
newly dened epoch T
delay
. The T
delay
is chosen as a function of the normal epoch
T
normal
= 1/P
opt
, given as:
T
delay
= T
normal
, (4.15)
where is a constant of optimality, chosen between 1 < 2. The cluster-heads
within R logically constitute a layered architecture with the BS, since they are one hop
away. These cluster-heads report directly to the sink, while the other nodes outside the
BS form a clustered network and dual-hop to reach the BS. The T
delay
helps any cluster-
head within R to transmit less frequently than cluster-heads outside R. However, there
is still tendency that in some instances nodes within radius R will die out a little faster
than nodes outside R. If this situation arises, then there is likelihood that some packets
will be dropped. To solve this kind of problem, cluster-heads farther away have the
option of transmitting directly to the BS. This is achieved by a periodic broadcast
(broadcasting the nodes IDs at the beginning of each round) by the BS of the status
of live nodes and dead nodes as described by the author in [15]. With this update
the cluster-heads farther away can decide whether to transmit to a closer cluster-head
inside R or transmit directly to the BS. This approach proves to be more energy ecient
in most cases than the original LEACH protocol with cluster-heads using a single-hop
to communicate with the BS.
54
DLCC Algorithm
Following the discussions of a two-level single-hop network, by extending the algorithm
to three-level yields DLCC. In DLCC the level 1 nodes transmit their data to level 2
local cluster-heads, which performs data aggregation and then locate and transmit the
data to the closest cluster-head that is within the concentric circle of radius R, if any,
otherwise it transmits directly to the BS. The relay cluster-heads within R wait for a
T
delay
epoch, performs data aggregation before forwarding the rened data to the BS.
This process generates two levels of clustering with a probability p
2
and p
3
for election
as cluster-heads. The level 3 node becomes relay cluster-head to level 2 and level 1
nodes.
It is worthy to note that when the choice of =1 and R=0 or R=100 as discussed
above, the setting becomes the original LEACH protocol design. However, the open
research issue is to investigate the performance of the methods to varying values of
and R in both small-scale and large-scale networks.
Figure 4.4: DLCC algorithm Flow chart
55
4.4.2 Multi-hop LEACH with Concentric Circle
Multi-hop LEACH with Concentric Circle(MLCC) is similar to DLCC except it extends
the algorithm to an N
th
level system. It also exploits a radius of connectivity R around
the BS to cope with the BS-centric dying pattern that normally accompanies a multi-
hop network and then chooses an optimal path that uses less energy for transmission
among the cluster-heads. In this instance, cluster-heads farther away from the BS will
relay their aggregated data to cluster-heads closer to the BS. The relaying cluster-heads
may be within or outside the radius R, depending on which is closer. This is one of
the other dierences between the MLCC and DLCC. The eects of choosing relaying
cluster-heads outside the BS is noted in the simulation results, as this increases the
number of hop counts, and reduces the performance when compared with DLCC. The
remaining process of cluster-head selection and communication model remains the same
as with DLCC. The relay cluster-heads within R uses a T
delay
as specied in DLCC.
Figure 4.5: MLCC algorithm Flow chart
56
MLCC Algorithm
In Section 4.2, a single-hop communication mode with 2 levels of hierarchy was dis-
cussed. This section extends the algorithm to N
th
levels as described by the energy
model in Eq.(4.14). Here it is assumed there are N
th
1 cluster-heads, level 2 nodes
are the rst level of cluster-heads until it iterates to N
th
1 cluster-heads. The level 2
local cluster-heads receive the data from level 1 nodes, gathers the data and transmits
to level 3 local cluster-heads. The same procedures follows until the data reaches the
N
th
level relay cluster-heads, here the data is further aggregated before relaying to the
BS.
Following this thoughts of data forwarding process, the multi-hop algorithm is devel-
oped. From level 2.....N
th
, the nodes decide cluster-heads elections with a probability
p
2
.......p
N
th
. This generates dierent levels of cluster-heads. This means for any cluster-
head of level N
th
becomes cluster-head to levels (N
th
1, N
th
2, N
th
3...., 1).
However, the communication energy required to transmit the gathered data in both
MLCC and DLCC to the BS through the hierarchy of cluster-heads depends on two
factors:(1) the probability p
opt
of becoming cluster-head in each level of hierarchy; and
(2) the maximum number of hops between cluster-heads to reach the BS (in the case
of MLCC there is no restriction to the maximum number of hops). The idea is that a
multi-hop communication mode can still be deployed in smaller networks by exploiting
the resources around the BS, and would be as ecient as that of single-hop mode,
contrary to the notions of authors in [24], [18]. The ow chart algorithm per round
per epoch for MLCC is given in Figure 4.5. The energy model, network model and
parameter settings of this scheme are the same as discussed in both Sections 4.3.1 and
3.2 respectively.
4.4.3 Simulation Results
Let us consider a hypothetical setting of 100 nodes randomly deployed in a network of
100m100m with the same type of nodes called normal nodes equipped with 0.5J of
energy, although this value is arbitrary for the purpose of the study, it does not aect
the behavior of the protocols. The simulation is carried out with the location of the
BS, at (x = 50, y = 50) inside the sensing eld, the goal is to study the behavior of
LEACH, MLCC and DLCC to this scenario and see how much the cost of transmission
aects the performance of these protocols. Let the p
opt
as discussed in Section 3.2.3
remain the same. This means by setting p
opt
= 0.1, on average there would be 10 nodes
57
as cluster-heads per round. If we consider an homogeneous setting with equal initial
energy in the nodes, the epoch for this system would be equal to
1
p
opt
= 10 rounds. Table
4.1 shows the parameters used in the simulation. In the next subsection, a discussion
of the results of experiments is presented, but rst the summary of the observations
after a sample of 20 dierent runs for each of these protocols are highlighted below:
LEACH goes to unstable region faster than MLCC and DLCC, although the
dierence between MLCC and DLCC is not so high (see Figures 4.9 and 4.10).
DLCC extends the stable region better than in LEACH and MLCC by dual-
hopping among cluster-heads to reach the BS, this is shown in Figures 4.9 and
4.11.
The instable period in DLCC is signicantly lowered compared with LEACH, and
a little lower when compared with MLCC. This is because DLCC exploits the
energy resources around the BS better than in LEACH and MLCC by reducing
the transmission cost, see Figures 4.12 and 4.14.
The throughput of DLCC is higher than both MLCC and LEACH, i.e the overall
number of data sent from cluster-heads to BS per round per epoch, shown in
Figure 4.8.
The stable and instable region in MLCC is better compared with LEACH (see
Figure 4.13). This is due to two factors: the MLCC leverages on multi-hopping
to signicantly extend the stable region and the concentric circle of R to reduce
the instability in the system.
All the above observations are discussed more in the discussion of result section.
58
800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800
0
10
20
30
40
50
60
70
80
90
100
number of rounds
n
u
m
b
e
r

o
f

l
i
v
e

n
o
d
e
s

Live nodes per round


DLCC
Leach
MLCC
Figure 4.6: The performance of DLCC, MLCC and LEACH (m =
0, = 0), E
total
= 50J in the presence of low energy homogeneity
from one of the experiments.
Parameter Values
E
elec
50nJ/bit
E
DA
5nJ/bit/message
E
o
0.5J
k 4000
P
opt
0.1

fs
10pJ/bit/m
2

mp
0.0013pJ/bit/m
4
n 100
R 40
1.5
Table 4.1: Parameter settings for MLCC, DLCC and LEACH
Discussion of Results
Figures 4.6, 4.7 and 4.8 show the performance of MLCC, DLCC and LEACH in terms
the stability, instability and throughput. The simulation is observed for 20 dierent
runs for each of the protocols. It is observed that both MLCC and DLCC perform
better in most of the cases than LEACH in this regard. Although this dierences in
stability and instability are not so high for MLCC when compared with LEACH, it
59
1000 1500 2000 2500 3000 3500 4000
0
10
20
30
40
50
60
70
80
90
100
number of rounds
n
u
m
b
e
r

o
f

n
o
d
e
s
Live nodes per round


LEACH
MLCC
DLCC
Figure 4.7: The performance of MLCC, DLCC and LEACH (m =
0, = 0), E
total
= 100J in the presence of high energy homogeneity
from one of the experiments.
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
35
40
Time steps of rounds
T
h
r
o
u
g
h
p
u
t

i
n

K
b
i
t
s
Throughput per round per epoch from Clusterheads to sink/BS


DLCC
LEACH
MLCC
Figure 4.8: Data rate from cluster-heads to BS.
60
Protocols Stability Instability
LEACH 968 856
MLCC 1012 761
DLCC 1028 718
Table 4.2: Average lifetime for the sensors when the BS is located
inside the sensing region.
however proves that a multi-hop system can scale very well in smaller networks, as long
as the energy resources around the BS are well exploited to evenly distribute energy in
the network. The performance of DLCC on the other hand proves to be much better
than both MLCC and LEACH. This is due to the fact that DLCC exploits the corre-
lation between transmission distance and energy consumption in the system (see the
energy model in 4.13). By this approach the maximum transmission distance any node
will use to communicate to the BS is approximately 50m since the choice of R = 40,
unlike in LEACH where this maximum transmission distance is approximately 70m.
The theory is that, with the choice of R = 40, DLCC guarantees that approximately
50% of the nodes will communicate with a distance less than or equal 40m as shown
in Figure 4.3, but LEACH does not guarantee this as most of the nodes will commu-
nicate at a distance of 60m or more. Another advantage of DLCC is that it uses two
hops from cluster-members through relaying cluster-heads to reach the BS. These two
factors signicantly improves the stability period and decreases the instability period
in DLCC compared with both LEACH and MLCC.
From Table 4.2, on average the stability period for DLCC is extended from 968 and
1012 to 1028 rounds compared with LEACH and MLCC respectively. And the instabil-
ity region is also reduced from 856 and 761 to 718 rounds when compared with LEACH
and MLCC respectively. It should also be noted that the performance of MLCC is lower
than DLCC due to the energy wasted in multi-hopping among cluster-heads to reach
the BS, such that in the end the cost of transmission distance becomes so high that
it aects the network performance. However, MLCC still proves to be more robust
compared with LEACH as the cost of muti-hopping is well compensated for in this
regard.
Similarly, the throughputs for MLCC and DLCC justify this approach, especially
when the rst node dies in the protocols, the throughput for LEACH is reduced com-
pared with both MLCC and DLCC, as there are only a few cluster-heads elected to
transmit packets to the BS. This is emphasized in the throughput graph in Figure 4.8.
This graph depicts the throughput from the period when the rst node dies over a time
61
Figure 4.9: The stability of DLCC vs. LEACH (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
Figure 4.10: The stability of MLCC vs. LEACH (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
62
Figure 4.11: The stability of DLCC vs. MLCC (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
Figure 4.12: The instability of DLCC vs. LEACH (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
63
Figure 4.13: The instability of MLCC vs LEACH (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
Figure 4.14: The instability of DLCC vs. MLCC (m = 0, = 0),
E
total
= 50J in the presence of energy homogeneity for 20 runs.
64
period when the network operation ends. In general, DLCC proves to be more supe-
rior in performance(stability, instability and throughput) than LEACH and MLCC. As
highlighted by the authors in [17], the simulations do not account for the setup time
to congure the sensor nodes or the update process for dead nodes, they however, give
an approximation of the network life-time that can be achieved using these protocols.
4.4.4 Summary
This chapter presents an overview of dierent communication modes and their impacts
on clustered WSN. The energy model for a single-hop, dual-hop and multi-hop network
following the thoughts of [18] and [14] are discussed. A novel approach that improves
the performance of LEACH is presented and tested. Simulation results are compared
and discussed thereafter.
From the experiments conducted in this chapter, simulation results show that DLCC
achieves a better performance in terms of stability, instability and throughput than
both MLCC and LEACH, this is due to two main factors; (1) the number of hop
counts in DLCC from cluster-heads to BS is bounded i.e. 2 hops; and (2) the relaying
cluster-heads is chosen within an optimal radius R. Although the MLCC used similar
approach but the hop count is more than two in most instances and the choice of
relaying cluster-heads is relaxed.
In general, the study shows that a dual-hop and multi-hop LEACH can scale very
well in a relatively smaller network of 100 nodes as single-hop LEACH does without
additional cost on nodes capabilities. This implies that a good exploitation of the
resources around the BS can be very helpful in the design of topology for clustered
WSN, as long as the cost function for hopping is well accounted for to reect the
overall performance of the network system.
65
Chapter 5
Assessing Spatial Uniformity of
Energy Distribution in Clustered
WSNs
In this chapter, an assessment of spatial uniformity of energy distribution in WSN
is discussed. First, a brief discussion of the relevance of this approach is highlighted
followed by the discussion on F-test, as used to evaluate the variations of dierent
network protocols that are examined in this thesis. The results of the experiments and
the parameters for assessment are presented thereafter.
5.1 Introduction
In Chapter 3, a spatial uniformity of energy distribution (the spread of energy among
each nodes as the network evolves) was briey discussed. A good protocol design is
expected to have a tight spread. That is, if for instance the measurement of the status
of the nodes is taken at interval during the course of operation of the network, it is
expected that the ratio of the dead nodes to the live nodes should be evenly distributed
in the sensing eld. By knowing the distribution of the ratio of live and dead nodes
at interval of the network operation, can provide a good measurement on the spatial
uniformity of energy distribution in a network. The death of the nodes should not
be skewed to the region surrounding the BS in case of a multi-hop network or to the
region farther away from the BS in the case of a single-hop network. In the sections
that follow, a comparative study of some protocols examined in this thesis will be used
as a test for this approach to see how much they vary from each other in terms of their
spatial distribution of energy.
66
5.2 Relevance of grid granularity in WSN
The goal of this chapter is to be able to assess the spatial uniformity of energy dis-
tribution in dierent network settings for various protocol design. Many studies, for
example [32, 43] have used dierent metrics to scale the performance of WSN, however,
none of them has attempt to measure the spread of energy among the sensor nodes as
the network evolves. This thesis is the rst to assess the performance of WSN using
this approach. A successful modeling of the spatial distribution of energy in a network
can provide enough information on the performance of a protocol in terms of energy
uniformity in various scenarios or terrains.
One of the major concerns is how to assess the performance of dierent protocols in
both homogeneous and heterogeneous settings with respect to the spatial distribution
of energy. In [17, 32], the authors justied the performance of their protocol design in
this regard by using an image representation of the randomness of the network after
the death of some nodes. This kind of image representation may be misleading as it
does not provide enough information on the dying pattern or the spatial energy dis-
tribution in a clustered WSN. The authors in [25] presented a cost-based analysis for
homogeneous and heterogeneous clustered network. This thesis takes this work further
by exploring the spatial distribution of energy in both homogeneous and heterogeneous
setup using a grid approach. A successful modelling of this networks can be a guide
for choosing an optimal setting on how a protocol should be deployed.
This thesis uses a grid approach to assess the spatial uniformity of energy distri-
bution in WSNs. First, let us think of a grid as a ruler which has a variable called
granularity that can be specied depending on choice. Granularity by denition is the
extent to which a system is broken down into smaller bits. In other domains granularity
may have dierent meanings from the one implied above. But in the context of this
thesis we will stick to the above denition. The positions of objects in a grid can be
determined by its granularity. The author in [23] employed grid granularity to locate
positions of objects in second life (SL). Here the grids are divided into regions expressed
by three(3) coordinates X, Y and Z. Following similar approach, if we rather consider
two coordinates X and Y in an M M region randomly scattered with sensor nodes.
Assuming we construct a virtual picture of a CC grid over an MM eld of sensors
as shown in Figure 5.1. Then, we can bind each nodes position to each grid-construct
say C
1,1
....C
1,C
. Thus, assuming we have a Set N {i = 1, 2......n} with n elements called
sensor nodes. The location of each i N with coordinates x X and y Y can be
67
estimated as [
x
s
,
y
s
], where s = M/C is the width of the MM grid, also known as the
granularity constant. Note the smaller the size of s, the ner the granularity. However,
granularity also depends on size of the network under consideration. Once we are able
to estimate the grid position where each node is located, then we can compute the
ratio of live nodes at 50 percent to live nodes at 100 percent intervals of the network
operation in each grid. First, we can assess the random distribution of each node at the
beginning of the network N
live
when all sensor nodes are 100 percent alive to when the
network operation ends N
death
and then vary the assessment coecient depending
on the choice of measurement. Where can be chosen as N
death
N
live
. The
current approaches by these authors [17, 18, 20, 22, 27, 32, 43] measured the network
life-time by taking 1 percent of the nodes death as the stability period and the remain-
ing 99 percent as the measure of instability period. Recall, that the stability period
dened as; the beginning of the network operation to the point when the rst node
dies. This is same by choosing = 1 percent for stability period and =100 percent for
instability period. The open research issue is, do these metrics suce? The following
questions should be examined thoroughly. Is the stability period enough parameter
for measuring a network life-time? How much eect does a 1 percent death have on
the entire performance of the network life-time most especially for a network that is
energy constrained? Or can we redene this stability period based on the assessment
of spatial energy distribution? And does Pareto 80-20 rule apply to WSNs in terms of
live-death ratio? This thesis does not provide answers to all these questions but build a
foundation for these open research issues to nd a dierent standardized method, and
to complement the metrics currently in use to analyze protocol performance in WSNs.
In the next section, an examination of F-test is presented as one of the validation tools
to measure the variations in the ratio of live and deaths of sensor nodes for LEACH,
SEP, MLCC, DLCC and SEP-E protocols.
5.3 F-test analysis
The objective of this section is to compare the dierence of live node distribution at
50% interval among the various protocols under consideration using F-test analysis.
The F-test statistic has been used by various researchers in dierent elds of studies
such as in biology, mathematics, engineering, statistics, chemistry, medicine and etc.
One of the objectives of F-test is that it helps to know if the dierence in variance
68
0 20 40 60 80 100
0
20
40
60
80
100
A 5x5 grid over an 100x100 area of randomly deployed sensor nodes
Figure 5.1: A 5x5 grid over a eld of sensor nodes
between two samples are statistically signicant [33]. The authors in [28] developed a
functional F-test to choose among two nested functional linear models. The test was
applied to some Ergonomic data and compared to some other competing tests. The
authors further explored the power of using F-test in data analysis. Similar idea on
functional F test was used in [16], where the properties of F-test statistic in two way
ANOVA for correlated data was studied in details.
The F-test is any statistical test which has a test statistic of F-distribution under the
null hypothesis. That is, if we want to compare two variances v
1
and v
2
of two dierent
sets of data, the ratio of the two variances should be specied as:
F = v
1
/v
2
(5.1)
This ratio is known as F-statistics and follows an F-distribution. If the null hypothesis
H
0
assumes that the variances are equal, then the F-statistic must be 1. The alternative
hypothesis H
a
assumes these variances to be unequal. For a successful application of
an F-test, the following assumptions must be met:
The samples should be normally distributed and
The samples should be independent of each other.
The followings are the common examples of using F-test:
69
1. To verify the hypothesis that the means of several normally distributed samples
with equal standard deviation are equal. The use of F-test in this regard plays a
very important role in the analysis of variance (ANOVA).
2. To verify that two samples or procedures observed over several trials have equal
variance.
3. To verify the hypothesis that a proposed regression model ts the data well.
4. To verify that a set of data in a regression analysis follows the simpler of proposed
linear models that are nested within each other.
An F-test could be either a one-tailed test or two-tailed test depending on the hypoth-
esis, the test statistic and the degree of freedom chosen.
One-tailed F-test
The hypothesis is stated as: H
0
:
2
1

2
2
H
a
:
2
1
<
2
2
.
Test statistic is given as: v
2
2
/v
2
1
.
Degree of freedom is specied as df = n 1 if the sample sizes n are same.
Two-tailed F-test
The hypothesis is stated as: H
0
:
2
1
=
2
2
H
a
:
2
1
<
2
2
or
2
1
>
2
2
Test statistic is given as: (Larger sample variance)/(Smaller sample variance).
Degree of freedom for the numerator and denominator are n
1
1 and n
2
1
respectively, where
1
and
2
are the variances of the sampled data set.
5.4 Spatial Energy Distribution in Homogeneous
and Heterogeneous Networks
As discussed in Chapter 2, homogeneous networks are networks with all similar sensor
nodes that are identical with same capabilities, while in heterogeneous networks the
70
sensor nodes have varying capabilities in terms of battery power i.e energy level or
hardware complexities. In this thesis, the focus is on energy levels. Furthermore,
in order to be able to measure the performance of homogeneous and heterogeneous
settings, LEACH is used as a representative of a single-hop clustered WSN, while
MLCC and DLCC are representatives of two or more hops homogeneous clustered
networks. SEP and SEP-E characterize a single-hop heterogeneous network settings.
The goal of this approach is to present a spatial uniformity of energy-based comparative
study of homogeneous and heterogeneous clustered networks by employing the grid
approach as discussed earlier. The objective in mind is to be able to model the spatial
uniformity of energy distribution of these protocols using dierent settings in terms
of their sensor nodes positions. This thesis further analyze the performance of each
network with respect to the ratio of live nodes at = 50 percent of the network life
time to when the sensor nodes are deployed at = 100 percent (i.e when all nodes are
alive), Figure 5.3 shows this approach. Recall that the attribute of a good protocol
design is to be able to balance a multi-criterion objective of maximizing network life-
time, fault tolerance and load balancing as discussed in Chapter 2. Being able to model
the spatial uniformity of energy among sensor nodes in a network can provide a useful
information on how much a protocol is able to balance the above mentioned objectives.
The rst step is to use the grid approach as discussed in Section 5.1 to measure the
variations of live nodes at 50% of network operation in each protocol, taking as a
representative of homogeneous and heterogeneous networks. And then we can evaluate
the level of signicance of each model by comparing each of the protocol designs using
the F-test as discussed in previous section.
5.4.1 Validation and Analysis of Experiments
Validation of experiments using F-test
From the discussions in Section 5.3, Example 2 becomes the premise of our test. The
two-tailed F-test is used for the analysis of each protocol. The motive is to verify
that the standard deviations or variances of the live node distribution at 50% which
is a measure of spatial energy uniformity between two protocols representing a homo-
geneous setting and heterogeneous setting are not equal. From the theory of F-test
analysis, the more the F-statistic ratio deviates from 1, the stronger the evidence for
unequal population variances. By translating, the power of F-test into the results
of the analysis under consideration in this thesis, majority of the results revealed an
71
F-statistic that deviates considerably from one(1) in favour of a heterogeneity aware
protocol design. In some instances, they become very signicant that we cannot accept
the null hypothesis that the variances are equal, see Table (5.1). The MedCalc Statistic
[2] tool is used for data analysis. For detailed F-test results see Appendix A.3.
Results of Experiments
The experiments are performed by randomly deploying 100 sensors in a 100m100m
eld. LEACH, SEP, SEP-E, MLCC, and DLCC protocols are compared in both 4 4
and 55 logical grids. Since the network size is not so large the granularity s is chosen
to reect the size of the network. The variation in spatial uniformity of energy in each
protocol is then analyzed. First, the original SEP protocol designed for heterogeneous
networks is compared with the original LEACH protocol designed for homogeneous
networks. From the experiments, see Appendices (A.3.7, A.3.8 and A.3.9), SEP showed
a better spatial distribution of energy among its sensor nodes at = 50 when compared
with LEACH. This means the variation of live node status in SEP when measured at
50% network life-time is better compared with LEACH. This supports the claims of
the authors in [32] that SEP is more robust than LEACH, thus justifying the grid
approach as used for measuring spatial uniformity of energy distribution in a clustered
WSN.
The same analysis is performed with SEP-E protocol. Figure 5.2 shows the spatial
distribution of energy for SEP-E and LEACH protocols from one of the experiments
conducted, from this gure it is obvious that majority of the grid status for SEP-E
has closer variation with respect to the live nodes compared with LEACH having a
wider variation in same regard. SEP-E showed a better variation of energy among its
nodes than LEACH at 50% interval. The implication is that SEP-E protocol is able to
evenly distribute energy consumption in the network by exploiting the presence of both
advanced nodes and intermediate nodes in order to balance the probability of election
process as cluster-heads. This same trend is also observed when SEP-E is compared
with SEP see Table 5.3; the better performance of SEP-E is due to the presence of
additional node (intermediate node) which further normalizes the election process for
cluster-heads during the course of network operation. For detailed results of variance
ratio test refer to Appendices (A.3.1, A.3.2, A.3.3, A.3.4, A.3.5 and A.3.6). Tables 5.1,
5.2 and 5.3 show some of the data analysis results from the experiments carried out
for SEP-E, SEP and LEACH.
One interesting phenomenon is that the variations between DLCC, MLCC and LEACH
72
are very close (see Table 5.4 and Appendices A.3.13, A.3.14). In some instances these
variations become insignicant, this points to the fact that energy-diversity of sensor
nodes plays a very important role in spatial energy distribution in a clustered WSN,
since these protocols are designed for homogeneous setting. Figure 5.4 shows the
impacts of energy-diversity in sensor nodes on network-life time and energy spread
in a network. From Figure 5.4, it is evident that as the number of energy levels in
sensor nodes increases, the energy spread which is a function of variance ratio becomes
more attened. Apart from SEP-E reducing the energy dissipation among the sensor
nodes, SEP-E successfully distributes energy-usage among the nodes in the network
such that the nodes die out in a more randomized fashion in their respective grid
locations. In all the experiments conducted SEP-E has a better spatial uniformity
of energy among the sensor nodes than both LEACH, SEP, MLCC and DLCC. This
result is expected according to the model estimation of SEP-E. In this regard the
presence of the three-node energy setting in SEP-E enhances the utilization of energy
among the sensor nodes, thus creating a better control of cluster-head election process.
Figure 5.4 conrms this presumption. Considering the protocols that are used as
representatives of both energy heterogeneous and homogeneous network, the deduction
from this approach is that energy heterogeneous setting has a better control of energy
distribution than energy homogeneous setting for a clustered WSN.
0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
grid location
r
a
t
i
o

o
f

l
i
v
e

n
o
d
e

a
t

5
0
%
Spatial distribution of live nodes for 5x5 grid.


SEPE
LEACHHomo
Figure 5.2: SEP-E vs. LEACH live node distribution at 50% interval.
73
0 20 40 60 80 100
0
20
40
60
80
100
A 5x5 grid at 50% network operation
dead
node
live node
Figure 5.3: Sample of live node distribution at 50% interval from one
of the experiments.
1 2 3
1
1.2
1.4
1.6
1.8
2
2.2
2.4
2.6
2.8
number of node diversity in terms of energy
v
a
r
i
a
n
c
e

r
a
t
i
o
Trend asenergydiversity of nodes increases from 1 node setting to 3 nodes setting.


Trend(1:3,1)
Trend(1:3,2)
Trend(1:3,3)
Trend(1:3,4)
Trend(1:3,5)
Figure 5.4: Homogeneous vs Heterogeneous trend as node diversity
increases (plotted data from 5 sample experiments).
74
Metrics SEP-E LEACH-Homo
Sample size 25 25
Arithmetic mean 0.4977 0.5425
95% CI for the mean 0.3888 to 0.6066 0.3776 to 0.7073
Variance 0.06962 0.1595
Standard deviation 0.2639 0.3993
Standard error of mean 0.05277 0.07987
Variance ratio 2.2905
signicance level P=0.048
Table 5.1: SEP-E vs. LEACH F-test Result-Sample 1.
Metrics SEP-E LEACH-Homo
Sample size 16 16
Arithmetic mean 0.4580 0.5135
95% CI for the mean 0.3436 to 0.5724 0.3263 to 0.7008
Variance 0.04605 0.1235
Standard deviation 0.2146 0.3514
Standard error of mean 0.05365 0.08785
Variance ratio 2.6815
signicance level P=0.065
Table 5.2: SEP-E vs. LEACH F-test Result-Sample 2
Metrics SEP-E SEP
Sample size 16 16
Arithmetic mean 0.4580 0.4799
95% CI for the mean 0.3436 to 0.5724 0.2942 to 0.6656
Variance 0.04605 0.1214
Standard deviation 0.2146 0.3484
Standard error of mean 0.05365 0.08711
Variance ratio 2.6364
signicance level P=0.07
Table 5.3: SEP-E vs. SEP F-test Result
Metrics DLCC LEACH
Sample size 25 25
Arithmetic mean 0.5200 0.5180
95% CI for the mean 0.3665 to 0.6736 0.3560 to 0.6801
Variance 0.1383 0.1542
Standard deviation 0.3719 0.3926
Standard error of mean 0.07438 0.07853
Variance ratio 1.1146
signicance level P=0.793
Table 5.4: DLCC vs. LEACH F-test Result
75
Remarks
Although the variance ratio test of signicance for some of the protocols is not so high
between energy homogeneous and heterogeneous settings, but the trend becomes obvi-
ous with a higher multi-level energy (three-node energy setup) heterogeneous settings,
especially between SEP-E and LEACH. These dierences could also be seen as the
nodes multi-diversity increases between SEP-E in three-node energy setup and original
SEP in two-node energy setup in this regard.
One of the main energy savings of SEP-E is due to the presence of more nodes with
dierent energy levels, as this helps to balance the election process for cluster-heads.
As already shown in Chapter 3 that SEP-E is more robust than both SEP and LEACH
in terms of stability, instability and throughput, this claim further justies the grid
approach used to assess these protocols, as the results in Chapter 3 and 5 complement
each other. In conclusion, the study reveals that a WSN in an energy heterogeneous
setup proves to be more energy ecient than a WSN in an energy homogeneous setup
for the protocols reviewed in this thesis.
5.4.2 Summary
In this chapter the spatial uniformity of energy distribution in clustered WSN is dis-
cussed. A novel approach that characterized the assessments of this model is presented.
The F-test validation tool for test of signicance and the results that compare the
dierent protocols representing an energy homogeneous and heterogeneous setup are
presented thereafter.
The results from experiments in this chapter revealed that SEP-E (with three-node en-
ergy setting) spatially distributes energy better than SEP, LEACH, DLCC and MLCC.
The same trend is also observed for SEP in two-node energy setting when compared
with LEACH, DLCC and MLCC in one-node energy set-up. The performance in this
regard reduces as the number of energy-diversity of nodes decreases, i.e. from three-
node energy set-up to one-node energy set-up. This trend points to the fact that:
1). Energy is better managed in a heterogeneous setup than in homogeneous setup;
2). There is a strong correlation between the spatial uniformity of distribution and
energy-diversity of node in a clustered WSN.
In conclusion, the relationship between energy-diversity of nodes and spatial uniformity
of energy distribution and/or protocol performance in clustered WSN is established ac-
cording to the trend result in Figure 5.4. The study further reveals that a protocol
76
design that is heterogeneity aware with energy-diversity of sensor nodes proves to be
more energy ecient in terms of network life-time compared with a protocol using
single-node energy setting i.e. homogeneous in a clustered WSN. Thus, energy het-
erogeneity should be given a thorough consideration when deploying wireless sensor
networks, especially in an uneven terrain.
77
Chapter 6
Conclusion and Future Work
6.1 Conclusion
This thesis discussed various clustering schemes that have been employed in both ho-
mogeneous and heterogeneous WSN that are hierarchically clustered. Energy hetero-
geneity is one of the key issues in design of WSNs protocols. Since these sensors are
battery-powered, energy utilization has been one of the main objectives for protocol
design.
As already discussed in this thesis, network researchers have worked on extending the
network life-time of WSN, but there still exists the need for a more robust protocol
design that is heterogeneity-aware. Clustering scheme, originally inspired by [17] and
further enhanced by [32] was proposed to cope with energy distribution in WSN. Fol-
lowing this thoughts, this thesis developed SEP-E, an adaptive clustering algorithm
that is self-organizing in two-level hierarchy using three types of nodes: advanced nodes,
intermediate nodes and normal nodes in a heterogeneous setting. This idea improved
on the LEACH protocol by considering an energy heterogeneous environment. The
LEACH protocol assumed an energy homogeneous system, where all nodes have equal
energy at the beginning of the network operation. This proves not to be an ideal setting
for WSNs as the topology or terrain can cause periodic failure of some sensor nodes
leading to energy heterogeneity in the nodes. Another good source of energy hetero-
geneity could be the original network settings. This is the premise for the design of
SEP-E and SEP. Some protocol design employ more powerful nodes to perform signal
processing duties such as data aggregation and compression. However, in the case of
78
SEP-E and SEP all sensors can perform data aggregation and sensing except that some
nodes have more residual energy than the others, thus the election probabilities in SEP-
E are well adapted to cater for such heterogeneity. In this regard, the LEACH protocol
performed poorly in the presence of such energy heterogeneity compared with SEP-E
and SEP, as shown in Chapter 3. The spatial uniformity of energy distribution analysis
carried out in Chapter 5 also strengthens the claim that SEP-E and SEP protocols de-
signed for energy-heterogeneous environment out-performs a generic LEACH protocol
designed for energy-homogeneous environment. Likewise SEP-E becomes more robust
than SEP as the level of energy-heterogeneity increases. This points to the fact that:
(1) SEP-E improved on SEP protocol by considering three-energy node levels in a
single-hop communication network among the cluster-heads. This approach extended
the overall network life-time in the presence of high energy heterogeneity; (2) SEP-E
solved the problem of energy gap that occurs especially in high energy heterogeneity
between the advanced nodes and the normal nodes in SEP by introducing a bridge
called intermediate nodes. In general, to cope with the energy gap, these intermediate
nodes take up the role of cluster-heads proportionately, which helps to reduce the fre-
quency of advanced nodes and normal nodes elections as cluster-heads (see numerical
solutions in Section 3.3.1). In most of the cases, this yielded a balanced and more
uniform spread of energy. These results are evident in the spatial uniformity of energy-
based model used in Chapter 5. To sum up, realizing the relationship between energy
heterogeneity and spatial uniformity of energy, intermediate nodes were used in SEP-E
design to leverage on this relationship. The result is a more robust protocol design for
clustered heterogeneous WSN.
This thesis further analyzed the performance of the original LEACH protocol to dif-
ferent communication modes. The methods exploited the capabilities of layered and
clustering techniques to develop modied multi-hop and dual-hop LEACH schemes that
used a concentric circle in a homogeneous network setting. The motive is to exploit
the energy resources around the base station in order to extend the network life-time.
On average, the performance of both protocol designs proved to be more stable when
compared with LEACH in the same settings under consideration. From the ndings,
it showed that both multi-hop and dual-hop communication modes can be as ecient
as a single-hop communication mode in a relatively small network of 100 sensor nodes
as long as the energy distributions in the network are well compensated for.
In order to verify the performances of the protocols under consideration and to jus-
tify the approaches used in the model design, both t-test and F-test are used for this
79
purpose. The results of the t-test revealed that SEP-E yields a better performance in
the scenarios considered. The F-test was used to analyze the dierence in variance in
terms of spatial uniformity of energy distribution. By assessing the spatial uniformity of
energy distribution in both heterogeneous and homogeneous clustered WSN, the impli-
cation is that energy is better utilized in a heterogeneous setup than in a homogeneous
setup. Finally, the study established a strong correlation between energy-diversity of
nodes in a clustered WSN and the performance of a protocol design under the settings
considered, this result is evident from the trend analysis variance ratio graph in Figure
5.4. The results from experiments conducted in Chapter 3 and 5 revealed that SEP-E
with three-node energy setting spatially distributes energy better than SEP, LEACH,
DLCC and MLCC. The same trend is also observed for SEP in two-node energy setting
compared with LEACH, DLCC and MLCC in one-node energy setup. This trend can
be very useful when deploying sensor network in dierent terrains. By integrating the
results in Chapters 3 and 5, it is evident that a protocol that is heterogeneity-aware
i.e. with energy-diversity of sensor nodes proves to be more energy ecient in terms of
the overall network life-time compared with a protocol using single-node energy setting
i.e. homogeneous in a hierarchically clustered WSN.
6.2 Future Research Direction
The following areas outlined briey in this section are open research issues that needs
to be explored further for future works in the area of wireless sensor networks:
1. Following the SEP-E approach a generalized model can be developed for multi-
diversity of nodes i.e. more than three types of nodes: (1) the epoch of the entire
system; (2) the residual energy indication function for cluster-head election; (3)
the probabilistic model that determines and controls the frequency of election for
cluster-head at each level of hierarchy. This work can also be extended to multi-
hierarchy and multi-level system where the communication method is multi-hop
or dual-hop instead of a single-hop. Here the intermediate nodes at dierent
stages of hierarchy can perform various functions such as ltering and other
signal processing tasks depending on the objectives in mind.
2. The trac pattern used for experiments and proof of concept is the Constant
Bit Rate (CBR). As discussed in [6], WSN is evolving into multimedia systems.
This paradigm shift necessitates the design of new schemes that can compensate
80
for dierent trac patterns. Thus, new protocol designs can be extended to
accommodate Variable Bit Rate (VBR), that is, packets that are bursty in na-
ture, especially for Multimedia Wireless Sensor Network (MWSN) which is more
applicable to video surveillance monitoring systems.
3. Another viable research direction is; how to control the number of associated
cluster members in every cluster. The idea is to create a relative load balanced
clusters such that no cluster-head is heavily burdened regardless of its proximity
to the sink. This load balancing technique could ensure a balanced number of
nodes in each clusters formed. This can further extend the network life-time by
ensuring a uniform energy drainage pattern.
4. Recently wireless charging technique has been one of the emerging technologies in
the eld of electro-mechanical systems. WiTricity [35] successfully demonstrated
this idea and showed the possibilities of wirelessly charging gadgets without the
need for a battery source. DELL [38] has successfully applied similar technology
to their range of laptops. Other corporations such as IGN and Evatran [41] have
been working on using this technique for other personal appliances. Similarly,
this wireless charging technology can be extended to WSN, since the major con-
straint is battery-drainage of the sensor nodes as the network evolves. One way
to accomplish this is to use a mobile sink or BS (since it is assumed to have un-
limited power source) to periodically charge the sensor nodes at close proximity.
The mobility of the sink could be randomized or could be triggered by a dying
sensor nodes depending on the optimization strategy in place. The evolution
of wireless charging technology promises a long-term breakthrough for WSN if
properly leveraged and could create new potential areas of research in wireless
sensor networks.
5. Another area to improve the capabilities of these protocols is to develop a more ef-
cient relaying node selection algorithm that can further extend the stable region
and reduce the instability region in the network by distributing the system load
evenly. The scalability of the performance of these protocols in larger networks
could also be a useful contribution.
6. A good exploitation of the system parameters i.e transmission range, node den-
sity and system-epoch to nd the best possible optimal setting could also be
researched further.
81
7. The trend of the spatial uniformity in energy distribution-based model for ho-
mogeneous versus heterogeneous clustered networks could be examined further
in larger networks of say hundreds of thousands sensor nodes. This approach
can also be extended to other network architectures rather than just a clustered
network. The implication of this method is that it can help to localize the behav-
ior of sensor nodes in each grid locations by tuning the parameters for optimal
performance especially for very large networks. Another interesting phenomenon
that can be studied further is the relationship between the number of hops and
the spatial uniformity of energy distribution in a WSN. Knowing this relationship
can help to choose the right parameters in a WSN for dierent kinds of topology.
As briey enumerated above, the performance of any protocol design cannot be fully
generalized, but it is most likely that the application scenarios may dier signicantly
especially in some instances where it is impossible to access the sensor nodes after being
deployed. Therefore a good protocol design should be tailored to suit the application
for which the purpose is to be met.
82
References
[1] http://www.mathworks.com.
[2] http://www.medcalc.be/index.php [Online; accessed 8-February-2010].
[3] Markowski Carol A. and Markowski Edward P., Conditions for the Eectiveness
of a Preliminary Test of Variance, The American Statistician 44 (1990), 322326,
http://www.jstor.org/stable/2684360.
[4] Ameer Ahmed Abbasi and Mohamed Younis, A survey on clustering algorithms
for wireless sensor networks, Computer Communication 30 (2007), no. 14-15,
28262841.
[5] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci, Wireless sensor
networks: a survey, Computer Networks 38 (2002), 393422.
[6] Ian F. Akyildiz, Tommaso Melodia, and Kaushik R. Chowdhury, A survey on
wireless multimedia sensor networks, Computer Networks 51 (2007), no. 4, 921
960.
[7] Ian F. Akyildiz, Welljan Su, Yogesh Sankarasubramaniam, and Erdal Cayirci, A
Survey on Sensor Networks, IEEE Communications Magazine 40 (2002), 102114.
[8] Jamal N. Al-karaki and Ahmed E. Kamal, Routing Techniques in Wireless Sensor
Networks: A Survey, IEEE Wireless Communications 11 (2004), 628.
[9] Seema Bandyopadhyay and Edward J. Coyle, Minimizing communication costs
in hierarchically-clustered networks of wireless sensors, Computer Network 44
(2004), no. 1, 116.
83
[10] , An Energy Ecient Hierarchical Clustering Algorithm for Wireless Sen-
sor Networks, In Proceedings of IEEE INFOCOM, April 2003, pp. 17131723.
[11] Paolo Baronti, Prashant Pillai, Vince W. C. Chook, Stefano Chessa, Alberto
Gotta, and Y. Fun Hu, Wireless sensor networks: A survey on the state of the
art and the 802.15.4 and ZigBee standards, Computer Communication 30 (2007),
no. 7, 16551695.
[12] Richard R. Brooks and S. S. Iyengar, Multi-sensor fusion: fundamentals and ap-
plications with software, Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1998.
[13] Yuanzhu Peter Chen, Arthur L. Liestman, and Jiangchuan Liu, Energy-
Ecient Data Aggregation Hierarchy for Wireless Sensor Networks, Proceedings
of the Second International Conference on Quality of Service in Heterogeneous
Wired/Wireless Networks (Washington, DC, USA), IEEE Computer Society, 2005,
p. 7.
[14] Frank Comeau, Optimal Clustering in Wireless Sensor Networks Employing Dif-
ferent Propagation Models And Data Aggregation Techniques, Ph.D. thesis, Dal-
housie University, Halifax, Nova Scotia, 2008.
[15] J. Ding, Design and Analysis of an Integrated MAC and Routing Protocol Frame-
work for Large-Scale Multi-Hop Wireless Sensor Network, Technical report, Uni-
versity of Maryland,Baltimore, 2002.
[16] BOX G.E.P, Some Theorems on Quadratic Forms Applied in the Study of Anal-
ysis of Variance Problems, I. Eect of Inequality of Variance in the One-Way
Classication, Annals of Mathematical Statistics 25 (1954), 290302.
[17] Wendi R. Heinzelman, Anantha Chandrakasan, and Hari Balakrishnan, Energy-
ecient communication protocol for wireless microsensor networks, Proceeding
33rd Hawaii International Conference on System Sciences, 2000.
[18] Wendi R. Heinzelman and P. Chandrakasan, An Application-Specic Protocol Ar-
chitectures for Wireless Networks, IEEE Transactions on Wireless Communica-
tions 1 (2002), 660670.
84
[19] Wendi Rabiner Heinzelman, Joanna Kulik, and Hari Balakrishnan, Adaptive pro-
tocols for information dissemination in wireless sensor networks, MobiCom 99:
Proceedings of the 5th annual ACM/IEEE international conference on Mobile
computing and networking (New York, NY, USA), ACM, 1999, pp. 174185.
[20] Kyung Tae Kim and Hee Yong Youn, Energy-Driven Adaptive Clustering Hierar-
chy EDACH for Wireless Sensor Networks, EUC Workshops, 2005, pp. 10981107.
[21] Bhaskar Krishnamachari, Deborah Estrin, and Stephen B. Wicker, The Impact of
Data Aggregation in Wireless Sensor Networks, ICDCSW 02: Proceedings of the
22nd International Conference on Distributed Computing Systems (Washington,
DC, USA), IEEE Computer Society, 2002, pp. 575578.
[22] Chengfa Li, Mao Ye, and Guihai Chen, An Energy-Ecient Unequal Clustering
Mechanism for Wireless Sensor Networks, Proceeding of IEEE MASS05, 2005,
pp. 317.
[23] Richard Manseld, How to do Everything with Second Life, McGraw-Hill, Inc.,
New York, NY, USA, 2008.
[24] Vivek Mhatre and Catherine Rosenberg, Design guidelines for wireless sensor
networks: communication, clustering and aggregation, Ad Hoc Networks Journal,
Elsevier Science 2 (2004), 4563.
[25] , Homogeneous vs. Heterogeneous Clustered Sensor Networks: A compar-
ative study, In Proceedings of 2004 IEEE International Conference on Communi-
cations (ICC), 2004, pp. 36463651.
[26] C. Siva Ram Murthy and B.S Manoj, Ad Hoc Wireless Networks Architectures
and Protocol, Prentice Hall, USA, 2004.
[27] Li Qing, Qinqxin Zhu, and Mingwen Wang, Design of a distributed energy-ecient
clustering algorithm for heterogeneous wireless sensor networks, Computer Com-
munication 29 (2006), 22302237.
[28] Qing Shen and Juliana Faraway, An F-test for linear models with functional re-
sponses, Statistica Sinica 14 (2004), 12391257.
85
[29] Timothy J. Shepard, A Channel Access Scheme for Large Dense Packet Radio
Networks, In Proceeding ACM SIGCOMM, 1996, pp. 219230.
[30] Victor Shnayder, Bor rong Chen, Konrad Lorincz, Thaddeus R. F. Fulford-Jones,
and Matt Welsh, Sensor Networks for Medical Care, Report tr-08-05, Harvard
University, 2005.
[31] Hongjoong Sin, Sungju Lee, Jangsu Lee, Seunghwan Yoo, Sanghyuc Lee, Jaesik
Lee, and Sungchun Kim, Self-organized Cluster Based Multi-hop Routing for Wire-
less Sensor Networks, APNOMS 08: Proceedings of the 11th Asia-Pacic Sym-
posium on Network Operations and Management (Berlin, Heidelberg), Springer-
Verlag, 2008, pp. 499502.
[32] Georgios Smaragdakis, Ibrahim Matta, and Azer Bestavros, SEP: A Stable Elec-
tion Protocol for clustered heterogeneous wireless sensor networks, In: Proceeding
of the International Workshop on SANPA, 2004.
[33] George W. Snedecor and William G. Cochran, Statistical Methods, eight edition
ed., Iowa State University Press, Iowa State, USA, 1989.
[34] Katayoun Sohrabi, Jay Gao, Vishal Ailawadhi, and Gregory J. Pottie, Protocols
for self-organization of a wireless sensor network, IEEE Personal Communications
7 (2000), 1627.
[35] Marin Soljacic, Andre Kurs, Aristeidis Karalis, Robert Moatt, Peter Fisher, and
John Joannopoulos, Goodbye wires, Tech. report, Massachusetts Institute of Tech-
nology, 2007, www.web.mit.edu/newsoce/2007/wireless-0607.html.
[36] Statsoft, Electronic Statistics Textbook statsoft.com, 2009,
http://www.statsoft.com/textbook/basic-statistics/t-test for independent
samples [Online; accessed 8-March-2010].
[37] Igor Talzi, Andreas Hasler, Stephan Gruber, and Christian Tschudin, PermaSense:
investigating permafrost with a WSN in the Swiss Alps, EmNets 07: Proceedings
of the 4th workshop on Embedded networked sensors (New York, NY, USA),
ACM, 2007, pp. 812.
86
[38] TechRadar, Dells wireless charging laptop breaks cover techradar.com, 2009,
http://www.techradar.com/news/mobile-computing/laptops/dell-s-wireless-
charging-laptop-breaks-cover-639135 [Online; accessed 15-March-2010].
[39] Karthikeyan Vaidyanathan, Sayantan Sur, Sundeep Narravula, and Prasun Sinha,
Data Aggregation techniques in Sensor Networks, Osu-cisrc-11/04-tr60, The Ohio
State University, 2004.
[40] Zoltan Vincze and Rolland Vida, Multi-hop wireless sensor networks with mobile
sink, CoNEXT 05: Proceedings of the 2005 ACM conference on Emerging network
experiment and technology (New York, NY, USA), ACM, 2005, pp. 302303.
[41] Wikipedia, Inductive charging Wikipedia, The Free Encyclopedia,
2010, http://en.wikipedia.org/w/index.php?title=Inductivechargingoldid =
348922633[Online; accessed15 March 2010].
[42] Chun-Hsien Wu and Yeh-Ching Chung, Heterogeneous Wireless Sensor Network
Deployment and Topology Control Based on Irregular Sensor Model, GPC, 2007,
pp. 7888.
[43] Fan Xiangning and Song Yulin, Improvement on LEACH Protocol of Wireless
Sensor Network, SENSORCOMM 07: Proceedings of the 2007 International Con-
ference on Sensor Technologies and Applications (Washington, DC, USA), IEEE
Computer Society, 2007, pp. 260264.
87
Appendix A
Source Code for Experiments
A.1 MATLAB scripts
A.1.1 SEP-E code
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SEP-E: An Enhanced Stable Election Protocol for clustered %
% heterogeneous wireless sensor networks %
% %
% (c) Femi Aderohunmu %
% Information Science Department, University of Otago. %
% %
% You can find full documentation and related information at: %
10 % %
% %
% To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
%This is the SEP-E code used. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;
30 %Number of Nodes in the field
n=100;
88
%Optimal Election Probability of a node
%to become cluster head
p=0.1;
%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
40 %Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;
%Values for Hetereogeneity
50 %Percentage of nodes than are advanced
m=0.2;
%Percentage of nodes than are intermediate
x=0.3;
%\alpha
a=3;
%Beta
b=1.5;
%maximum number of rounds
rmax=8000;
60 %variables
Ave_CH=0;
sum=0;
count_ch=0;
Throughput=0;
% packets size
Packet=4000;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
70 do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
rand(seed,13)
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
80 S(i).G=0;
S(i).E=0;
%initially there are no cluster heads only nodes
S(i).type=N;
temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=(x+m)*n+1)
89
S(i).E=Eo;
S(i).ENERGY=0;
90 %%%%plot(S(i).xd,S(i).yd,o);
hold on;
end
%Random Election of intermediate Nodes
if (temp_rnd0<(m+x)*n+1) && (temp_rnd0>m*n)
S(i).E=Eo*(1+b);
S(i).ENERGY=0.5;
%%%%plot(S(i).xd,S(i).yd,*);
hold on;
end
100 %Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a);
S(i).ENERGY=1;
%%%%plot(S(i).xd,S(i).yd,D);
hold on;
end
end
110 S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
%%plot(S(n+1).xd,S(n+1).yd,x);
%First Iteration
figure(1);
%counter for CHs
countCHs=0;
120 %counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
flag_first_Hdead=0;
flag_last_dead=0;
c=1;
130
for r=0:1:rmax
r
%Election Probability for Normal Nodes
pnrm=( p/ (1+a*m+b*x) );
%Election Probability for intermediate Nodes
pint=( p*(1+b)/ (1+a*m+b*x) );
%Election Probability for Advanced Nodes
140 padv= ( p*(1+a)/(1+a*m+b*x) );
%Operation for heterogeneous epoch
90
if(mod(r, round(1/pnrm) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end
150 %Operations for sub-epochs
if(mod(r, round(1/padv) )==0)
for i=1:1:n
if(S(i).ENERGY==1)
S(i).G=0;
S(i).cl=0;
end
end
end
160 %Operations for sub-epochs
if(mod(r, round(1/pint) )==0)
for i=1:1:n
if(S(i).ENERGY==0.5)
S(i).G=0;
S(i).cl=0;
end
end
end
170 hold off;
%Number of Half dead nodes
Hdead=0;
%Number of half dead Advanced Nodes
Hdead_a=0;
%Number of half dead Normal Nodes
Hdead_n=0;
%Number of half dead intermediate Nodes
Hdead_in=0;
%Number of dead nodes
180 dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
%Number of dead intermediate Nodes
dead_in=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
190 packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
figure(1);
91
for i=1:1:n
%Checking if the energy is less or reduced by half
200 if (S(i).E<=(Eo/2)) && (S(i).E>0)
plot(S(i).xd,S(i).yd,yellow .);
Hdead=Hdead+1;
if(S(i).ENERGY==1)
Hdead_a=Hdead_a+1;
end
if(S(i).ENERGY==0.5)
Hdead_in=Hdead_in+1;
end
if(S(i).ENERGY==0)
210 Hdead_n=Hdead_n+1;
end
hold on;
end
%checking the rate of energy dissipation in normal, intermediate and
%advance nodes
if (S(i).E<=Eo)||(S(i).E>Eo)
if(S(i).ENERGY==0)
220 RnEnergy(r+1)=S(i).E;
end
if (S(i).ENERGY==0.5)
RINEnergy(r+1)=S(i).E;
end
if (S(i).ENERGY==1)
RAEnergy(r+1)=S(i).E;
end
end
230 %checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
240 if(S(i).ENERGY==0.5)
dead_in=dead_in+1;
end
hold on;
end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,o);
end
250 if (S(i).ENERGY==0.5)
plot(S(i).xd,S(i).yd,p);
end
92
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,D);
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,x);
260
HSTATISTICS(r+1).DEAD=Hdead;
HDEAD(r+1)=Hdead;
HDEAD_N(r+1)=Hdead_n;
HDEAD_IN(r+1)=Hdead_in;
HDEAD_A(r+1)=Hdead_a;
%When the first node is half dead
if (Hdead==1)
270 if(flag_first_Hdead==0)
first_Hdead=r;
flag_first_Hdead=1;
end
end
STATISTICS(r+1).DEAD=dead;
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_IN(r+1)=dead_in;
280 DEAD_A(r+1)=dead_a;
%When the first node dies
if (dead==1)
if(flag_first_dead==0)
first_dead=r;
flag_first_dead=1;
end
end
290 %Number of alive Nodes
alive=0;
%Number of alive Normal Nodes
alive_n=0;
%Number of alive intermediate Nodes
alive_in=0;
%Number of alive advance Nodes
alive_a=0;
300
for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
alive=alive+1;
if(S(i).ENERGY==1)
alive_a=alive_a+1;
end
93
if(S(i).ENERGY==0.5)
alive_in=alive_in+1;
310 end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
end
hold on;
end
%checking nodes status
if (S(i).E>0)
nodes_status=1;
end
320 if (S(i).E<0)
nodes_status=0;
end
STATISTICS(i).Status=nodes_status;
Status(i)=nodes_status;
ASTATISTICS(r+1).Live=alive;
Live(r+1)=alive;
Live_n(r+1)=alive_n;
Live_in(r+1)=alive_in;
330 Live_a(r+1)=alive_a;
end
for i=1:1:n
%checking for last dead or alive node
if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0||S(i).ENERGY==0.5)
plot(S(i).xd,S(i).yd,green .);
last_dead=r;
Instability=last_dead-first_dead;
flag_last_dead=1;
340 end
end
end
countCHs=0;
cluster=1;
for i=1:1:n
if(S(i).E>0)
350 temp_rand=rand;
if ( (S(i).G)<=0)
%Election of Cluster Heads for normal nodes
if( ( S(i).ENERGY==0 && ( temp_rand <= ( pnrm / ( 1 - pnrm * mod(r,round(1/pnrm)) )) ) ) )
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
360 S(i).type=C;
S(i).G=100;
C(cluster).xd=S(i).xd;
94
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
370 Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
Energy_CH_N=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance );
end
if (distance<=do)
380 S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
Energy_CH_N=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance);
end
end
%Election of Cluster Heads for intermediate nodes
if( ( S(i).ENERGY==0.5 && ( temp_rand <= ( pint / ( 1 - pint * mod(r,round(1/pint)) )) ) ) )
countCHs=countCHs+1;
390 packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
S(i).G=100;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
400 C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
410 Energy_CH_I=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance );
end
if (distance<=do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
Energy_CH_I=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance);
end
end
95
%Election of Cluster Heads for Advanced nodes
420 if( ( S(i).ENERGY==1 && ( temp_rand <= ( padv / ( 1 - padv * mod(r,round(1/padv)) )) ) ) )
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
S(i).G=100;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
430 plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
440 distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
Energy_CH_A=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance );
end
if (distance<=do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
Energy_CH_A=(ETX+EDA)*(Packet) + Emp*Packet*( distance*distance);
end
end
450
end
end
end
%Checking average number of ClusterHeads per epoch
sum=sum+cluster;
count_ch=count_ch+1;
460 if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a)+(b*x));
Throughput=Ave_CH*4;
STATISTICS(r+1).ave_clustHd=Ave_CH;
ave_ch(r+1)=Ave_CH;
STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
Ave_CH=0;
sum=0;
470 count_ch=0;
end
96
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
CLUSTERHS(r+1)=cluster-1;
countmember=0;
%Election of Associated Cluster Head for Normal Nodes
for i=1:1:n
480 if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
min_dis=temp;
min_dis_cluster=c;
countmember=countmember+1;
490 end
CLUSTERMEM(r+1)=countmember;
end
countmember=0;
%Energy dissipated by associated Cluster Head
min_dis;
500 if (min_dis>do)
S(i).E=S(i).E- ( ETX*(Packet) + Emp*Packet*( min_dis * min_dis * min_dis * min_dis));
Energy_member=ETX*(Packet) + Emp*Packet*( min_dis * min_dis * min_dis * min_dis);
end
if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(Packet) + Efs*Packet*( min_dis * min_dis));
Energy_member=ETX*(Packet) + Emp*Packet*( min_dis * min_dis);
end
%Energy dissipated
if(min_dis>0)
510 S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*Packet );
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
S(i).min_dis=min_dis;
S(i).min_dis_cluster=min_dis_cluster;
end
end
end
520 hold on;
countCHs;
rcountCHs=rcountCHs+countCHs;
% %finding live or dead node in each 4x4 grid
ni=20;
97
cell=zeros(5,5);
if alive ==100
530
for i=1:1:n
for j=1:1:n
u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
540
end
end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
550 if (ai == 0)
ai = 1;
end;
bi= v_grid(i);
if (bi == 0)
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
%
560 end
end
%stop
end
%Code for Voronoi Cells
%Unfortunately if there is a small
570 %number of cells, Matlabs voronoi
%procedure has some problems
%[vx,vy]=voronoi(X,Y);
%plot(X,Y,r*,vx,vy,b-);
%hold on;
%voronoi(X,Y);
%axis([0 xm 0 ym]);
580 end
98
A.1.2 LEACH Heterogeneous code
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% LEACH Heterogeneous wireless sensor networks %
% %
% (c) Femi Aderohunmu %
% Information Science Department, University of otago. %
% %
10 % You can find full documentation and related information at: %
% %
% %
% To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
% This is the LEACH Heterogeneous code used %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;
%Number of Nodes in the field
n=100;
%Optimal Election Probability of a node
30 %to become cluster head
p=0.1;
%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
40 Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;
%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0.2;
%\alpha
a=3;
99
%Percentage of nodes than are intermediate
x=0.3;
50 %mhu
b=1.5;
%maximum number of rounds
rmax=8000;
%variables
Ave_CH=0;
sum=0;
count_ch=0;
Throughput=0;
%communication Range
60 radius=30;
%control
epoch=0;
%packet size
Packet=4000;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
70 rand(seed,13)
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type=N;
temp_rnd0=i;
80 %Random Election of Normal Nodes
if (temp_rnd0>=(x+m)*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,o);
hold on;
end
%Random Election of intermediate Nodes
if (temp_rnd0<(m+x)*n+1) && (temp_rnd0>m*n)
S(i).E=Eo*(1+b);
90 S(i).ENERGY=0.5;
plot(S(i).xd,S(i).yd,*);
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a);
S(i).ENERGY=1;
%%%%plot(S(i).xd,S(i).yd,D);
hold on;
100 end
end
S(n+1).xd=sink.x;
100
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,x);
%First Iteration
figure(1);
%counter for CHs
countCHs=0;
%counter for CHs per round
110 rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
flag_first_Hdead=0;
flag_last_dead=0;
temp_rnd0=0;
for r=0:1:rmax
120 r
%Operation for epochs
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
end
130
hold off;
%Number of Half dead nodes
Hdead=0;
%Number of half dead Advanced Nodes
Hdead_a=0;
%Number of half dead intermediate Nodes
Hdead_in=0;
%Number of half dead Normal Nodes
Hdead_n=0;
140
%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
150 %counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
figure(1);
for i=1:1:n
%Checking if the energy is less or reduced by half
if (S(i).E<=(Eo/2)) && (S(i).E>0)
101
plot(S(i).xd,S(i).yd,yellow .);
Hdead=Hdead+1;
160 if(S(i).ENERGY==1)
Hdead_a=Hdead_a+1;
end
if(S(i).ENERGY==0.5)
Hdead_in=Hdead_in+1;
end
if(S(i).ENERGY==0)
Hdead_n=Hdead_n+1;
end
hold on;
170 end
%checking the rate of energy dissipation in normal and advance nodes
if (S(i).E<=Eo)||(S(i).E>Eo)
if(S(i).ENERGY==0)
RnEnergy(r+1)=S(i).E;
end
if (S(i).ENERGY==0.5)
RINEnergy(r+1)=S(i).E;
end
180 if (S(i).ENERGY==1)
RAEnergy(r+1)=S(i).E;
end
end
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
190 end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,o);
200 end
if (S(i).ENERGY==0.5)
plot(S(i).xd,S(i).yd,*);
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,D);
end
hold on;
end
end
210 plot(S(n+1).xd,S(n+1).yd,x);
HSTATISTICS(r+1).DEAD=Hdead;
102
HDEAD(r+1)=Hdead;
HDEAD_N(r+1)=Hdead_n;
HDEAD_IN(r+1)=Hdead_in;
HDEAD_A(r+1)=Hdead_a;
%When the first node is half dead
if (Hdead==1)
220 if(flag_first_Hdead==0)
first_Hdead=r;
flag_first_Hdead=1;
end
end
STATISTICS(r+1).DEAD=dead;
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_A(r+1)=dead_a;
230
%When the first node dies
if (dead==1)
if(flag_first_dead==0)
first_dead=r;
flag_first_dead=1;
end
end
240 %Number of alive Nodes
alive=0;
%Number of alive Normal Nodes
alive_n=0;
%Number of alive advance Nodes
alive_a=0;
for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
250 alive=alive+1;
if(S(i).ENERGY==1)
alive_a=alive_a+1;
end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
end
hold on;
end
%checking nodes status
260 if (S(i).E>0)
nodes_status=1;
end
if (S(i).E<0)
nodes_status=0;
end
STATISTICS(i).Status=nodes_status;
Status(i)=nodes_status;
103
ASTATISTICS(r+1).Live=alive;
Live(r+1)=alive;
270 Live_n(r+1)=alive_n;
Live_a(r+1)=alive_a;
end
%checking for last dead or alive node
for i=1:1:n
if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,green .)
last_dead=r;
280 Instability=last_dead-first_dead;
flag_last_dead=1;
end
end
end
countCHs=0;
cluster=1;
for i=1:1:n
if(S(i).E>0)
290 temp_rand=rand;
if ( (S(i).G)<=0)
%Election of Cluster Heads
if(temp_rand<= (p/(1-p*mod(r,round(1/p)))))
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
S(i).G=round(1/p)-1;
C(cluster).xd=S(i).xd;
300 C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
distance;
310 if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
end
if (distance<=do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
end
end
end
end
320 end
%Checking average number of ClusterHeads per epoch
104
sum=sum+cluster;
count_ch=count_ch+1;
if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a)+(b*x));
Throughput=Ave_CH*4;
330
STATISTICS(r+1).ave_clustHd=Ave_CH;
ave_ch(r+1)=Ave_CH;
STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
Ave_CH=0;
sum=0;
count_ch=0;
end
340
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
CLUSTERHS(r+1)=cluster-1;
%Election of Associated Cluster Head for Normal Nodes
for i=1:1:n
if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
350 temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
min_dis=temp;
min_dis_cluster=c;
end
end
%Energy dissipated by associated Cluster Head
min_dis;
if (min_dis>do)
S(i).E=S(i).E- ( ETX*(Packet) + Emp*Packet*( min_dis * min_dis * min_dis * min_dis));
360 end
if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(Packet) + Efs*Packet*( min_dis * min_dis));
end
%Energy dissipated
if(min_dis>0)
S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*Packet );
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
370 S(i).min_dis=min_dis;
S(i).min_dis_cluster=min_dis_cluster;
end
end
end
hold on;
countCHs;
105
rcountCHs=rcountCHs+countCHs;
CSTATISTICS(r+1)=r;
380 Rcount(r+1)=r;
% %finding live or dead node in each 4x4 grid
ni=25;
cell=zeros(4,4);
if alive ==50
390 for i=1:1:n
for j=1:1:n
u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
400 end
end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
if (ai == 0)
410 ai = 1;
end;
bi= v_grid(i);
if (bi == 0)
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
%
end
420 end
stop
end
%Code for Voronoi Cells
%Unfortynately if there is a small
430 %number of cells, Matlabs voronoi
%procedure has some problems
%[vx,vy]=voronoi(X,Y);
106
%plot(X,Y,r*,vx,vy,b-);
%hold on;
%voronoi(X,Y);
%axis([0 xm 0 ym]);
end
A.1.3 SEP code
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SEP-E: An Enhanced Stable Election Protocol for clustered %
% heterogeneous wireless sensor networks %
% %
% (c) Femi Aderohunmu %
% Information Science Department, University of Otago. %
% %
% You can find full documentation and related information at: %
10 % %
% %
% To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
20 % This is the SEP [1] code used. %
% %
% [1] Georgios Smaragdakis, Ibrahim Matta and Azer bestavros, %
% "SEP: A Stable Election Protocol for clustered %
% heterogeneous wireless sensor networks", %
% Second International Workshop on Sensor and Actor Network %
% Protocols and Applications (SANPA 2004),Boston MA, August %
% 2004. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30
clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
40 sink.x=0.5*xm;
sink.y=0.5*ym;
%Number of Nodes in the field
n=100;
%Optimal Election Probability of a node
%to become cluster head
107
p=0.1;
50 %Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
60 EDA=5*0.000000001;
%Values for Hetereogeneity
%Percentage of nodes than are advanced node
m=0.3;
%\alpha
a=3.5;
%Percentage of nodes than are intermediate node
b=0;
%mhu
70 x=0;
%maximum number of rounds
rmax=8000;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
do=sqrt(Efs/Emp);
%variables
Ave_CH=0;
sum=0;
80 count_ch=0;
Throughput=0;
%Creation of the random Sensor Network
figure(1);
rand(seed,13)
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
90 S(i).G=0;
S(i).E=0;
%initially there are no cluster heads only nodes
S(i).type=N;
temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
100 %%%%plot(S(i).xd,S(i).yd,o);
hold on;
end
108
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a);
S(i).ENERGY=1;
%%%%plot(S(i).xd,S(i).yd,D);
hold on;
end
110 end
S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
%%plot(S(n+1).xd,S(n+1).yd,x);
%First Iteration
figure(1);
120 %counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
flag_first_Hdead=0;
130 flag_last_dead=0;
first_dead=0;
for r=0:1:rmax
r
%Random packets
% Packet=rand(1);
% Packet=Packet*10000;
% STATISTICS_Packet(r+1)=Packet;
% Packet_size(r+1)=Packet;
140 Packet=4000;
%Election Probability for Normal Nodes
pnrm=( p/ (1+a*m) );
%Election Probability for Advanced Nodes
padv= ( p*(1+a)/(1+a*m) );
%Operation for heterogeneous epoch
if(mod(r, round(1/pnrm) )==0)
for i=1:1:n
S(i).G=0;
150 S(i).cl=0;
end
end
%Operations for sub-epochs
if(mod(r, round(1/padv) )==0)
for i=1:1:n
if(S(i).ENERGY==1)
109
S(i).G=0;
S(i).cl=0;
160 end
end
end
hold off;
%Number of Half dead nodes
Hdead=0;
%Number of half dead Advanced Nodes
Hdead_a=0;
170 %Number of half dead Normal Nodes
Hdead_n=0;
%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
180
%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
figure(1);
190
for i=1:1:n
%Checking if the energy is less or reduced by half
if (S(i).E<=(Eo/2)) && (S(i).E>0)
plot(S(i).xd,S(i).yd,yellow .);
Hdead=Hdead+1;
if(S(i).ENERGY==1)
Hdead_a=Hdead_a+1;
end
if(S(i).ENERGY==0)
200 Hdead_n=Hdead_n+1;
end
hold on;
end
%checking the rate of energy dissipation in normal and advance nodes
if (S(i).E<=Eo)||(S(i).E>Eo)
if(S(i).ENERGY==0)
RnEnergy(r+1)=S(i).E;
end
210 if (S(i).ENERGY==1)
RAEnergy(r+1)=S(i).E;
end
110
end
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
220 dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
230 plot(S(i).xd,S(i).yd,o);
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,D);
end
hold on;
end
end
plot(S(n+1).xd,S(n+1).yd,x);
240
HSTATISTICS(r+1).DEAD=Hdead;
HDEAD(r+1)=Hdead;
HDEAD_N(r+1)=Hdead_n;
HDEAD_A(r+1)=Hdead_a;
%When the first node is half dead
if (Hdead==1)
if(flag_first_Hdead==0)
first_Hdead=r;
250 flag_first_Hdead=1;
end
end
STATISTICS(r+1).DEAD=dead;
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_A(r+1)=dead_a;
%When the first node dies
260 if (dead==1)
if(flag_first_dead==0)
first_dead=r;
flag_first_dead=1;
end
end
%Number of alive Nodes
111
alive=0;
%Number of alive Normal Nodes
270 alive_n=0;
%Number of alive advance Nodes
alive_a=0;
for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
alive=alive+1;
280 if(S(i).ENERGY==1)
alive_a=alive_a+1;
end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
end
hold on;
end
%checking nodes status
290 if (S(i).E>0)
nodes_status=1;
end
if (S(i).E<0)
nodes_status=0;
end
STATISTICS(i).Status=nodes_status;
Status(i)=nodes_status;
ASTATISTICS(r+1).Live=alive;
300 Live(r+1)=alive;
Live_n(r+1)=alive_n;
Live_a(r+1)=alive_a;
end
for i=1:1:n
%checking for last dead or alive node
if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,green .)
last_dead=r;
310 Instability=last_dead-first_dead;
flag_last_dead=1;
end
end
end
countCHs=0;
cluster=1;
320 for i=1:1:n
if(S(i).E>0)
temp_rand=rand;
112
if ( (S(i).G)<=0)
%Election of Cluster Heads for normal nodes
if( ( S(i).ENERGY==0 && ( temp_rand <= ( pnrm / ( 1 - pnrm * mod(r,round(1/pnrm)) )) ) ) )
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
330
S(i).type=C;
S(i).G=100;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance;
C(cluster).id=i;
340 X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
end
if (distance<=do)
350 S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
end
end
%Election of Cluster Heads for Advanced nodes
if( ( S(i).ENERGY==1 && ( temp_rand <= ( padv / ( 1 - padv * mod(r,round(1/padv)) )) ) ) )
countCHs=countCHs+1;
360 packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
S(i).G=100;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
370 C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
cluster=cluster+1;
%Calculation of Energy dissipated
distance;
113
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Emp*Packet*( distance*distance*distance*distance ));
380 end
if (distance<=do)
S(i).E=S(i).E- ( (ETX+EDA)*(Packet) + Efs*Packet*( distance * distance ));
end
end
end
end
end
390 %Checking average number of ClusterHeads per epoch
sum=sum+cluster;
count_ch=count_ch+1;
if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a)+(b*x));
Throughput=Ave_CH*4;
STATISTICS(r+1).ave_clustHd=Ave_CH;
400 ave_ch(r+1)=Ave_CH;
STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
Ave_CH=0;
sum=0;
count_ch=0;
end
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
CLUSTERHS(r+1)=cluster-1;
410
%Election of Associated Cluster Head for Normal Nodes
for i=1:1:n
if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
420 min_dis=temp;
min_dis_cluster=c;
end
end
%Energy dissipated by associated Cluster Head
min_dis;
if (min_dis>do)
S(i).E=S(i).E- ( ETX*(Packet) + Emp*Packet*( min_dis * min_dis * min_dis * min_dis));
end
430 if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(Packet) + Efs*Packet*( min_dis * min_dis));
end
114
%Energy dissipated
if(min_dis>0)
S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*Packet);
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
S(i).min_dis=min_dis;
440 S(i).min_dis_cluster=min_dis_cluster;
end
end
end
hold on;
countCHs;
rcountCHs=rcountCHs+countCHs;
450 CSTATISTICS(r+1)=r;
Rcount(r+1)=r;
%stop(r)
% %finding live or dead node in each 4x4 grid
ni=20;
cell=zeros(5,5);
if alive ==50
460 for i=1:1:n
for j=1:1:n
u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
470 end
end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
if (ai == 0)
480 ai = 1;
end;
bi= v_grid(i);
if (bi == 0)
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
115
end
end
490
stop
end
%Code for Voronoi Cells
%Unfortynately if there is a small
%number of cells, Matlabs voronoi
%procedure has some problems
500
%[vx,vy]=voronoi(X,Y);
%plot(X,Y,r*,vx,vy,b-);
%hold on;
%voronoi(X,Y);
%axis([0 xm 0 ym]);
end
510
116
A.1.4 Dual-hop code
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% Energy Management Techniques for Protocol Designs in WSN %
% %
% (c) Femi A. Aderohunmu %
% Information Science Department, University of Otago, New Zealand %
% %
10 % %
% To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This is the dual-hop LEACH with concentric circle %
% code used. Same code can be use for LEACH When Tau= 0 and R=0. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;
%Number of Nodes in the field
n=100;
30 %Optimal Election Probability of a node
%to become cluster head
p=0.1;
%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
40 Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;
%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0;
%\alpha
a=0;
%maximum number of rounds
50 rmax=6000;
%radius
radius=30;
%control
117
delay_epoch=0;
distance=0;
s=1;
%variables
Ave_CH=0;
sum=0;
60 count_ch=0;
Throughput=0;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
rand(seed,79)
S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
70 plot(S(n+1).xd,S(n+1).yd,x);
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
%initially there are no cluster heads only nodes
%S(i).type=N;
80 temp_rnd0=i;
distance_sink=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
%Random Election of Normal Nodes
if (distance_sink<=radius)&& (temp_rnd0>=m*n+1)
S(i).type=N;
S(i).E=Eo;
S(i).ENERGY=2;
plot(S(i).xd,S(i).yd,green o);
hold on;
end
90 if (distance_sink>radius)&&(temp_rnd0>=m*n+1)
S(i).type=N;
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,o);
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a);
100 S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,+);
hold on;
end
end
118
110 %First Iteration
figure(1);
%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
120 distance_sink=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
for r=0:1:rmax
r
delay_epoch=delay_epoch+1;
%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
130 end
end
hold off;
%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
dead_r=0;
140 %counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
packets_TO_CH=0;
throughput=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
throughput_BS(r+1)=0;
figure(1);
150
for i=1:1:n
%checking if there is a dead node
if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
160 dead_n=dead_n+1;
end
if(S(i).ENERGY==2)
dead_r=dead_r+1;
119
end
hold on;
end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
170 plot(S(i).xd,S(i).yd,o);
end
if (S(i).ENERGY==2)
plot(S(i).xd,S(i).yd,green o);
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,+);
end
hold on;
end
180 end
plot(S(n+1).xd,S(n+1).yd,x);
STATISTICS(r+1).DEAD=dead;
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_A(r+1)=dead_a;
%When the first node dies
if (dead==1)
if(flag_first_dead==0)
first_dead=r;
190 flag_first_dead=1;
end
end
%Number of alive Nodes
alive=0;
%Number of alive Normal Nodes
alive_n=0;
alive_r=0;
%Number of alive advance Nodes
alive_a=0;
200
% for i=1:1:n
% %checking number of alive node per round
% if (S(i).E>0)
% alive=alive+1;
% if(S(i).ENERGY==1)
% alive_a=alive_a+1;
% end
% if(S(i).ENERGY==2)
% alive_r=alive_r+1;
210 % end
% if(S(i).ENERGY==0)
% alive_n=alive_n+1;
% end
% hold on;
% end
% %checking nodes status
% if (S(i).E>0)
% nodes_status=1;
120
% end
220 % if (S(i).E<0)
% nodes_status=0;
% end
% STATISTICS(i).Status=nodes_status;
% Status(i)=nodes_status;
%
% ASTATISTICS(r+1).Live=alive;
% Live(r+1)=alive;
% Live_n(r+1)=alive_n;
% Live_a(r+1)=alive_a;
230 % Live_a(r+1)=alive_r;
% end
%Number of alive Nodes
alive=0;
%Number of alive Normal Nodes
alive_n=0;
%Number of alive advance Nodes
alive_a=0;
240 for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
alive=alive+1;
if(S(i).ENERGY==1)
alive_a=alive_a+1;
end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
end
250 hold on;
end
%checking nodes status
if (S(i).E>0)
nodes_status=1;
end
if (S(i).E<0)
nodes_status=0;
end
STATISTICS(i).Status=nodes_status;
260 Status(i)=nodes_status;
ASTATISTICS(r+1).Live=alive;
Live(r+1)=alive;
Live_n(r+1)=alive_n;
Live_a(r+1)=alive_a;
end
%checking for last dead or alive node
for i=1:1:n
270 if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,green .)
last_dead=r;
121
Instability=last_dead-first_dead;
flag_last_dead=1;
end
end
end
280 countCHs=0;
cluster=1;
%added
countch_r=1;
countch_f=1;
for i=1:1:n
if(S(i).E>0)
temp_rand=rand;
if ( (S(i).G)<=0)
%Election of Cluster Heads
290 if(temp_rand<= (p/(1-p*mod(r,round(1/p)))))
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
%added
if S(i).type==C && S(i).ENERGY==2
countch_r=countch_r +1;
C(cluster).xd=S(i).xd;
300 C(cluster).yd=S(i).yd;
end
if S(i).type==C && S(i).ENERGY==0
countch_f=countch_f +1;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
end
%stop
S(i).G=round(1/p)-1;
310 plot(S(i).xd,S(i).yd,k*);
distance_sink=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance_sink;
% if (S(i).type==C && distance_sink>r)
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
min_dis_CH=sqrt( (S(i).xd-S(n+1).xd)^2 + (S(i).yd-S(n+1).yd)^2 );
min_dis_ClusterHD=1;
%added
320 if S(i).type==C && S(i).ENERGY==2
for s=1:1:countch_r-1
temp_CH=min_dis_CH;
% if ( temp_CH<min_dis_CH )
% min_dis_CH=temp_CH;
% min_dis_ClusterHD=c;
% end
end
end
122
%stop
330 if S(i).type==C && S(i).ENERGY==0
for c=1:1:countch_f-1
temp_CH=min(min_dis_CH,sqrt( (C(c).xd-C(s).xd)^2 + (C(c).yd-C(s).yd)^2 ) );
if ( temp_CH<min_dis_CH )
min_dis_CH=temp_CH;
min_dis_ClusterHD=c;
end
end
end
340
if alive_r==0
distance=distance_sink;
end
if alive_r~=0;
distance= min_dis_CH;
end
C(cluster).distance=distance;
cluster=cluster+1;
countCHs=countCHs+1;
350
%Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Emp*4000*( distance*distance*distance*distance ));
end
if (distance<=do)
if (S(i).type==C) && (S(i).ENERGY==0)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Efs*4000*( distance * distance ));
end
360 if (delay_epoch>=20)
if (S(i).type==C) && (S(i).ENERGY==2)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Efs*4000*( distance_sink * distance_sink ));
end
end
end
end
end
end
end
370 %Checking average number of ClusterHeads per epoch
sum=sum+(cluster-1);
count_ch=count_ch+1;
if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a));
Throughput=Ave_CH*4;
STATISTICS(r+1).ave_clustHd=Ave_CH;
ave_ch(r+1)=Ave_CH;
380 STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
Ave_CH=0;
sum=0;
123
count_ch=0;
end
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
CLUSTERHS(r+1)=cluster-1;
%Election of Associated Cluster Head for Normal Nodes
390 for i=1:1:n
if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
min_dis=temp;
min_dis_cluster=c;
400 end
end
%Energy dissipated by associated Cluster Head
min_dis;
if (min_dis>do)
S(i).E=S(i).E- ( ETX*(4000) + Emp*4000*( min_dis * min_dis * min_dis * min_dis));
end
if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(4000) + Efs*4000*( min_dis * min_dis));
end
410 %Energy dissipated
if(min_dis>0)
S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*4000 );
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
S(i).min_dis=min_dis;
S(i).min_dis_cluster=min_dis_cluster;
end
end
end
420 hold on;
countCHs;
rcountCHs=rcountCHs+countCHs;
%finding live or dead node in each 4x4 grid
ni=20;
cell=zeros(5,5);
if alive ==50
430 for i=1:1:n
for j=1:1:n
u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
124
440 end
end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
if (ai == 0)
450 ai = 1;
end;
bi= v_grid(i);
if (bi == 0)
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
%
end
460 end
stop
end
% if (epoch==20)
% epoch=0;
% end
% if rmax==250
% radius=20;
470 % end
% if rmax==500
% radius=30;
% end
% if rmax==1000
% radius=40;
% end
% if rmax==1300
% radius=50;
% end
480
%Code for Voronoi Cells
%Unfortnately if there is a small
%number of cells, Matlabs voronoi
%procedure has some problems
%[vx,vy]=voronoi(X,Y);
%plot(X,Y,r*,vx,vy,b-);
%hold on;
%voronoi(X,Y);
%axis([0 xm 0 ym]);
490 end
125
A.1.5 Multi-hop code
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% Energy Management Techniques for Protocol Designs in WSN %
% %
% (c) Femi A. Aderohunmu %
% Information Science Department, University of Otago, New Zealand %
% %
10 % %
% To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This is the Multi-hop LEACH with concentric circle code used. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;
%Number of Nodes in the field
n=100;
%Optimal Election Probability of a node
30 %to become cluster head
p=0.1;
%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
40 Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;
%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0;
%\alpha
a=0;
%maximum number of rounds
rmax=6000;
50 %radius
radius=40;
%control
epoch=0;
126
%variables
Ave_CH=0;
sum=0;
count_ch=0;
Throughput=0;
60 %%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
rand(seed,13)
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
70 S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).G=0;
node.id(i)=i;
id(i)=i;
%initially there are no cluster heads only nodes
S(i).type=N;
80 temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
plot(S(i).xd,S(i).yd,o);
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
90 S(i).E=Eo*(1+a);
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,+);
hold on;
end
end
S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,x);
%First Iteration
100 figure(1);
%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
127
110 for r=0:1:rmax
r
epoch=epoch+1;
%Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
120 end
hold off;
%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
130 packets_TO_CH=0;
throughput=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
throughput_BS(r+1)=0;
figure(1);
for i=1:1:n
%checking if there is a dead node
140 if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
150 end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,o);
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,+);
end
hold on;
160 end
end
plot(S(n+1).xd,S(n+1).yd,x);
STATISTICS(r+1).DEAD=dead;
128
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_A(r+1)=dead_a;
%When the first node dies
if (dead==1)
if(flag_first_dead==0)
170 first_dead=r;
flag_first_dead=1;
end
end
%Number of alive Nodes
alive=0;
%Number of alive Normal Nodes
alive_n=0;
%Number of alive advance Nodes
alive_a=0;
180
for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
alive=alive+1;
if(S(i).ENERGY==1)
alive_a=alive_a+1;
end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
190 end
hold on;
end
%checking nodes status
if (S(i).E>0)
nodes_status=1;
end
if (S(i).E<0)
nodes_status=0;
end
200 STATISTICS(i).Status=nodes_status;
Status(i)=nodes_status;
ASTATISTICS(r+1).Live=alive;
Live(r+1)=alive;
Live_n(r+1)=alive_n;
Live_a(r+1)=alive_a;
end
%checking for last dead or alive node
for i=1:1:n
210 if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,green .)
last_dead=r;
Instability=last_dead-first_dead;
flag_last_dead=1;
end
end
129
end
220 countCHs=0;
cluster=1;
for i=1:1:n
if(S(i).E>0)
temp_rand=rand;
if ( (S(i).G)<=0)
%Election of Cluster Heads
if(temp_rand<= (p/(1-p*mod(r,round(1/p)))))
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
230 PACKETS_TO_BS(r+1)=packets_TO_BS;
throughput=4000*packets_TO_BS;
throughput_BS(r+1)=throughput;
S(i).type=C;
S(i).G=round(1/p)-1;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
240 distance_sink=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance_sink;
% if (S(i).type==C && distance_sink>r)
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
min_dis_CH=sqrt( (S(i).xd-S(n+1).xd)^2 + (S(i).yd-S(n+1).yd)^2 );
min_dis_ClusterHD=1;
for c=1:1:cluster-1
temp_CH=min(min_dis_CH,sqrt( (C(c).xd-C(c+1).xd)^2 + (C(c).yd-C(c+1).yd)^2 ) );
250 if ( temp_CH<min_dis_CH )
min_dis_CH=temp_CH;
min_dis_ClusterHD=c;
end
end
distance=min_dis_CH;
C(cluster).distance=distance;
cluster=cluster+1;
countCHs=countCHs+1;
260 %Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Emp*4000*( distance*distance*distance*distance ));
end
if (distance<=do)
if (S(i).type==C) && (distance_sink>radius)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Efs*4000*( distance * distance ));
end
if (epoch >=20)
270 if (S(i).type==C) && (distance_sink<=radius)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Efs*4000*( distance_sink * distance_sink ));
end
end
130
end
end
end
end
end
%Checking average number of ClusterHeads per epoch
280 sum=sum+(cluster-1);
count_ch=count_ch+1;
% count_object=zeros(1,r);
l=100;
if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a));
Throughput=Ave_CH*4;
STATISTICS(r+1).ave_clustHd=Ave_CH;
ave_ch(r+1)=Ave_CH;
290 STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
if Ave_CH~=0
count_object(l)=Ave_CH ;
end
Ave_CH=0;
sum=0;
count_ch=0;
end
300
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
CLUSTERHS(r+1)=cluster-1;
%Election of Associated Cluster Head for Normal Nodes
for i=1:1:n
if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
310 temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
min_dis=temp;
min_dis_cluster=c;
end
end
%Energy dissipated by associated Cluster Head
min_dis;
if (min_dis>do)
S(i).E=S(i).E- ( ETX*(4000) + Emp*4000*( min_dis * min_dis * min_dis * min_dis));
320 end
if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(4000) + Efs*4000*( min_dis * min_dis));
end
%Energy dissipated
if(min_dis>0)
S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*4000 );
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
131
S(i).min_dis=min_dis;
330 S(i).min_dis_cluster=min_dis_cluster;
end
end
end
hold on;
countCHs;
rcountCHs=rcountCHs+countCHs;
% if (epoch==25)
% epoch=0;
% end
340 % if rmax==250
% radius=40;
% end
% if rmax==500
% radius=30;
% end
% if rmax==1000
% radius=25;
% end
% if rmax==1500 || rmax>1500
350 % radius=20;
% end
% %finding live or dead node in each 4x4 grid
ni=20;
cell=zeros(5,5);
if alive ==50
360 for i=1:1:n
for j=1:1:n
u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
370 end
end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
if (ai == 0)
380 ai = 1;
end;
bi= v_grid(i);
if (bi == 0)
132
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
end
end
390
stop
end
%Code for Voronoi Cells
%Unfortnately if there is a small
%number of cells, Matlabs voronoi
400 %procedure has some problems
%[vx,vy]=voronoi(X,Y);
%plot(X,Y,r*,vx,vy,b-);
%hold on;
%voronoi(X,Y);
%axis([0 xm 0 ym]);
end
410
A.1.6 LEACH Homogeneous code
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% Energy Management Techniques for Protocol Designs in WSN %
% %
% (c) Femi A. Aderohunmu %
% Information Science Department, University of Otago, New Zealand %
% %
% %
10 % To report your comment or any bug please send e-mail to: %
% afemi@infoscience.otago.ac.nz %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This is the LEACH [1] code used. %
% %
% [1] W.R.Heinzelman, A.P.Chandrakasan and H.Balakrishnan, %
% "An application-specific protocol architecture for wireless %
20 % microsensor networks" %
% IEEE Transactions on Wireless Communications, 1(4):660-670,2002 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
133
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
30 xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=0.5*xm;
sink.y=0.5*ym;
%Number of Nodes in the field
n=100;
40 %Optimal Election Probability of a node
%to become cluster head
p=0.1;
%Energy Model (all values in Joules)
%Initial Energy
Eo=0.5;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
50 %Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000001;
%Values for Hetereogeneity
%Percentage of nodes than are advanced
m=0;
%\alpha
60 a=0;
Ave_CH=0;
sum=0;
count_ch=0;
Throughput=0;
%maximum number of rounds
rmax=10000;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
70 %Computation of do
do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
rand(seed,13)
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
80 YR(i)=S(i).yd;
134
S(i).G=0;
%initially there are no cluster heads only nodes
S(i).type=N;
temp_rnd0=i;
%Random Election of Normal Nodes
if (temp_rnd0>=m*n+1)
S(i).E=Eo;
S(i).ENERGY=0;
90 plot(S(i).xd,S(i).yd,o);
hold on;
end
%Random Election of Advanced Nodes
if (temp_rnd0<m*n+1)
S(i).E=Eo*(1+a);
S(i).ENERGY=1;
plot(S(i).xd,S(i).yd,+);
hold on;
end
100 end
S(n+1).xd=sink.x;
S(n+1).yd=sink.y;
plot(S(n+1).xd,S(n+1).yd,x);
%First Iteration
figure(1);
110 %counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
120 for r=0:1:rmax
r
% radii = 20;
% frequency = 20;
%
% del_y = sin((r*frequency)/pi)*radii;
% del_x = cos((r*frequency)/pi)*radii;
% S(n+1).xd=sink.x+del_x;
% S(n+1).yd=sink.y+del_y;
130 %Operation for epoch
if(mod(r, round(1/p) )==0)
for i=1:1:n
S(i).G=0;
S(i).cl=0;
end
135
end
hold off;
140
%Number of dead nodes
dead=0;
%Number of dead Advanced Nodes
dead_a=0;
%Number of dead Normal Nodes
dead_n=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
packets_TO_BS=0;
150 packets_TO_CH=0;
%counter for bit transmitted to Bases Station and to Cluster Heads
%per round
PACKETS_TO_CH(r+1)=0;
PACKETS_TO_BS(r+1)=0;
figure(1);
for i=1:1:n
%checking if there is a dead node
160 if (S(i).E<=0)
plot(S(i).xd,S(i).yd,red .);
dead=dead+1;
if(S(i).ENERGY==1)
dead_a=dead_a+1;
end
if(S(i).ENERGY==0)
dead_n=dead_n+1;
end
hold on;
170 end
if S(i).E>0
S(i).type=N;
if (S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,o);
end
if (S(i).ENERGY==1)
plot(S(i).xd,S(i).yd,+);
end
hold on;
180 end
end
plot(S(n+1).xd,S(n+1).yd,x);
STATISTICS(r+1).DEAD=dead;
DEAD(r+1)=dead;
DEAD_N(r+1)=dead_n;
DEAD_A(r+1)=dead_a;
190 %When the first node dies
136
if (dead==1)
if(flag_first_dead==0)
first_dead=r;
flag_first_dead=1;
end
end
%Number of alive Nodes
alive=0;
200 %Number of alive Normal Nodes
alive_n=0;
%Number of alive advance Nodes
alive_a=0;
for i=1:1:n
%checking number of alive node per round
if (S(i).E>0)
alive=alive+1;
if(S(i).ENERGY==1)
210 alive_a=alive_a+1;
end
if(S(i).ENERGY==0)
alive_n=alive_n+1;
end
hold on;
end
%checking nodes status
if (S(i).E>0)
nodes_status=1;
220 end
if (S(i).E<0)
nodes_status=0;
end
STATISTICS(i).Status=nodes_status;
Status(i)=nodes_status;
ASTATISTICS(r+1).Live=alive;
Live(r+1)=alive;
Live_n(r+1)=alive_n;
230 Live_a(r+1)=alive_a;
end
%checking for last dead or alive node
for i=1:1:n
if (alive==1 && S(i).E>0)
if (S(i).ENERGY==1||S(i).ENERGY==0)
plot(S(i).xd,S(i).yd,green .)
last_dead=r;
Instability=last_dead-first_dead;
240 flag_last_dead=1;
end
end
end
% countCHs=0;
137
cluster=1;
for i=1:1:n
if(S(i).E>0)
250 temp_rand=rand;
if ( (S(i).G)<=0)
%Election of Cluster Heads
if(temp_rand<= (p/(1-p*mod(r,round(1/p)))))
countCHs=countCHs+1;
packets_TO_BS=packets_TO_BS+1;
PACKETS_TO_BS(r+1)=packets_TO_BS;
S(i).type=C;
260 S(i).G=round(1/p)-1;
C(cluster).xd=S(i).xd;
C(cluster).yd=S(i).yd;
plot(S(i).xd,S(i).yd,k*);
distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
C(cluster).distance=distance;
C(cluster).id=i;
X(cluster)=S(i).xd;
Y(cluster)=S(i).yd;
270 cluster=cluster+1;
%Calculation of Energy dissipated
distance;
if (distance>do)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Emp*4000*( distance*distance*distance*distance ));
end
if (distance<=do)
S(i).E=S(i).E- ( (ETX+EDA)*(4000) + Efs*4000*( distance * distance ));
280 end
end
end
end
end
%Checking average number of ClusterHeads per epoch
sum=sum+(cluster-1);
count_ch=count_ch+1;
% count_object=zeros(1,r);
290 l=100;
if count_ch==10
Ave_CH=(sum*0.1)/(1+(m*a));
Throughput=Ave_CH*4;
STATISTICS(r+1).ave_clustHd=Ave_CH;
ave_ch(r+1)=Ave_CH;
STATISTICS(r+1).throughput=Throughput;
Clust_throughput(r+1)=Throughput;
if Ave_CH~=0
300 count_object(l)=Ave_CH ;
138
end
Ave_CH=0;
sum=0;
count_ch=0;
end
STATISTICS(r+1).CLUSTERHEADS=cluster-1;
310 CLUSTERHS(r+1)=cluster-1;
%Election of Associated Cluster Head for Normal Nodes
for i=1:1:n
if ( S(i).type==N && S(i).E>0 )
if(cluster-1>=1)
% min_dis=sqrt( (S(i).xd-S(n+1).xd)^2 + (S(i).yd-S(n+1).yd)^2 );
min_dis=9999;
min_dis_cluster=1;
for c=1:1:cluster-1
320 temp=min(min_dis,sqrt( (S(i).xd-C(c).xd)^2 + (S(i).yd-C(c).yd)^2 ) );
if ( temp<min_dis )
min_dis=temp;
min_dis_cluster=c;
end
end
%Energy dissipated by associated Cluster Head
min_dis;
if (min_dis>do)
330 S(i).E=S(i).E- ( ETX*(4000) + Emp*4000*( min_dis * min_dis * min_dis * min_dis));
end
if (min_dis<=do)
S(i).E=S(i).E- ( ETX*(4000) + Efs*4000*( min_dis * min_dis));
end
%Energy dissipated
if(min_dis>0)
S(C(min_dis_cluster).id).E = S(C(min_dis_cluster).id).E- ( (ERX + EDA)*4000 );
PACKETS_TO_CH(r+1)=n-dead-cluster+1;
end
340
S(i).min_dis=min_dis;
S(i).min_dis_cluster=min_dis_cluster;
end
end
end
hold on;
countCHs;
350 rcountCHs=rcountCHs+countCHs;
%finding live or dead node in each 4x4 grid
ni=20;
cell=zeros(5,5);
139
if alive ==50
for i=1:1:n
for j=1:1:n
360 u(i)=(S(i).xd);
a=int32(S(i).xd);
u_grid(i)=idivide(a,ni,ceil);
v(j)=(S(j).yd);
b=int32(S(j).yd);
v_grid(j)=idivide(b,ni,ceil);
end
370 end
for i =1:1:n
%
if (Status(i) == 1)
ai= u_grid(i);
if (ai == 0)
ai = 1;
end;
380 bi= v_grid(i);
if (bi == 0)
bi = 1;
end;
cell(ai,bi)= cell(ai,bi)+ 1;
%
end
end
390
stop
end
%Code for Voronoi Cells
%Unfortynately if there is a small
%number of cells, Matlabs voronoi
%procedure has some problems
%[vx,vy]=voronoi(X,Y);
400 %plot(X,Y,r*,vx,vy,b-);
% hold on;
% voronoi(X,Y);
% axis([0 xm 0 ym]);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% STATISTICS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% DEAD : a rmax x 1 array of number of dead nodes/round %
410 % DEAD_A : a rmax x 1 array of number of dead Advanced nodes/round %
140
% DEAD_N : a rmax x 1 array of number of dead Normal nodes/round %
% CLUSTERHS : a rmax x 1 array of number of Cluster Heads/round %
% PACKETS_TO_BS : a rmax x 1 array of number packets send to Base Station/round %
% PACKETS_TO_CH : a rmax x 1 array of number of packets send to ClusterHeads/round %
% first_dead: the round where the first node died %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
420
A.2 t-test Analysis and Graphs
A.2.1 SEP-E vs. LEACH Instability analysis
1 Independent samples t-test
Sample 1
Variable SEP_E_Instability
SEP-E_Instability
Select 1
Sample 2
Variable LEACH_Instability
Select 1
10 Sample 1 Sample 2
Sample size 10 10
Arithmetic mean 3751.9000 4585.2000
95% CI for the mean 3534.2082 to 3969.5918 4315.9964 to 4854.4036
Variance 92605.8778 141617.2889
Standard deviation 304.3121 376.3207
Standard error of the mean 96.2319 119.0031
F-test for equal variances P = 0.537
20 T-test (assuming equal variances)
Difference 833.3000
Standard Error 153.0435
95% CI of difference 511.7675 to 1154.8325
Test statistic t 5.445
Degrees of Freedom (DF) 18
Two-tailed probability P < 0.0001
30
141
A.2.2 SEP-E vs. LEACH Stability analysis
1 Independent samples t-test
Sample 1
Variable SEP_E_Stability
SEP-E_Stability
Select 1
Sample 2
Variable LEACH_Stability
Select 1
10 Sample 1 Sample 2
Sample size 10 10
Arithmetic mean 1450.0000 994.4000
95% CI for the mean 1431.6624 to 1468.3376 974.8754 to 1013.9246
Variance 657.1111 744.9333
Standard deviation 25.6342 27.2935
Standard error of the mean 8.1062 8.6310
F-test for equal variances P = 0.855
20 T-test (assuming equal variances)
Difference -455.6000
Standard Error 11.8408
95% CI of difference -480.4766 to -430.7234
Test statistic t -38.477
Degrees of Freedom (DF) 18
Two-tailed probability P < 0.0001
A.2.3 SEP-E vs. LEACH Half-live analysis
1 Independent samples t-test
Sample 1
Variable LEACH_Half_live
LEACH_Half-live
Sample 2
Variable SEP_E_Half_live
SEP-E_Half-live
Sample 1 Sample 2
10 Sample size 10 10
Arithmetic mean 478.7000 704.0000
95% CI for the mean 463.7856 to 493.6144 688.0112 to 719.9888
Variance 434.6778 499.5556
Standard deviation 20.8489 22.3507
Standard error of the mean 6.5930 7.0679
F-test for equal variances P = 0.839
T-test (assuming equal variances)
20
Difference 225.3000
Standard Error 9.6656
142
95% CI of difference 204.9934 to 245.6066
Test statistic t 23.310
Degrees of Freedom (DF) 18
Two-tailed probability P < 0.0001
A.2.4 SEP-E vs. SEP Stability analysis
1 Independent samples t-test
Sample 1
Variable SEP_Instability
Select 1
Sample 2
Variable SEP_E_Instability
SEP-E_Instability
Select 1
10 Sample 1 Sample 2
Sample size 10 10
Arithmetic mean 5050.7000 3751.9000
95% CI for the mean 4528.7850 to 5572.6150 3534.2082 to 3969.5918
Variance 532296.9000 92605.8778
Standard deviation 729.5868 304.3121
Standard error of the mean 230.7156 96.2319
F-test for equal variances P = 0.016
20 T-test (assuming equal variances)
Difference -1298.8000
Standard Error 249.9806
95% CI of difference -1823.9897 to -773.6103
Test statistic t -5.196
Degrees of Freedom (DF) 18
Two-tailed probability P = 0.0001
A.2.5 SEP-E vs. SEP Instability analysis
1 Independent samples t-test
Sample 1
Variable SEP_Instability
Select 1
Sample 2
Variable SEP_E_Instability
SEP-E_Instability
Select 1
10 Sample 1 Sample 2
Sample size 10 10
Arithmetic mean 5050.7000 3751.9000
95% CI for the mean 4528.7850 to 5572.6150 3534.2082 to 3969.5918
Variance 532296.9000 92605.8778
Standard deviation 729.5868 304.3121
Standard error of the mean 230.7156 96.2319
143
F-test for equal variances P = 0.016
20 T-test (assuming equal variances)
Difference -1298.8000
Standard Error 249.9806
95% CI of difference -1823.9897 to -773.6103
Test statistic t -5.196
Degrees of Freedom (DF) 18
Two-tailed probability P = 0.0001
A.2.6 SEP-E vs. SEP Half-live analysis
1 Independent samples t-test
Sample 1
Variable SEP_E_Half_live
SEP-E_Half-live
Sample 2
Variable SEP_Half_live
SEP_Half-live
Sample 1 Sample 2
10 Sample size 10 10
Arithmetic mean 704.0000 631.2000
95% CI for the mean 688.0112 to 719.9888 608.9030 to 653.4970
Variance 499.5556 971.5111
Standard deviation 22.3507 31.1691
Standard error of the mean 7.0679 9.8565
F-test for equal variances P = 0.336
T-test (assuming equal variances)
20
Difference -72.8000
Standard Error 12.1288
95% CI of difference -98.2816 to -47.3184
Test statistic t -6.002
Degrees of Freedom (DF) 18
Two-tailed probability P < 0.0001
A.3 F-test Analysis and Results
A.3.1 SEP-E vs. LEACH Variance analysis-sample 1
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable LEACH-Homogeneous
LEACH-Homogeneous
144
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4977 0.5425
95% CI for the mean 0.3888 to 0.6066 0.3776 to 0.7073
Variance 0.06962 0.1595
Standard deviation 0.2639 0.3993
Standard error of the mean 0.05277 0.07987
Variance ratio test (F-test)
Variance ratio 2.2905
Significance level P = 0.048 <=0.05
20
A.3.2 SEP-E vs. LEACH Variance analysis-sample 2
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable LEACH-Homogeneous
LEACH-Homogeneous
Sample 1 Sample 2
10 Sample size 16 16
Arithmetic mean 0.4580 0.5135
95% CI for the mean 0.3436 to 0.5724 0.3263 to 0.7008
Variance 0.04605 0.1235
Standard deviation 0.2146 0.3514
Standard error of the mean 0.05365 0.08785
Variance ratio test (F-test)
Variance ratio 2.6815
20 Significance level P = 0.065
A.3.3 SEP-E vs. LEACH Variance analysis-sample 3
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable LEACH-homogeneous
LEACH-homogeneous
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4628 0.4998
95% CI for the mean 0.3458 to 0.5798 0.3427 to 0.6570
Variance 0.08035 0.1449
Standard deviation 0.2835 0.3807
145
Standard error of the mean 0.05669 0.07614
Variance ratio test (F-test)
Variance ratio 1.8039
20 Significance level P = 0.156
A.3.4 SEP-E vs. SEP Variance analysis-sample 1
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable SEP
Sample 1 Sample 2
Sample size 16 16
10 Arithmetic mean 0.5801 0.5145
95% CI for the mean 0.3662 to 0.7939 0.3637 to 0.6653
Variance 0.1610 0.08009
Standard deviation 0.4013 0.2830
Standard error of the mean 0.1003 0.07075
Variance ratio test (F-test)
Variance ratio 2.0109
Significance level P = 0.188
20
A.3.5 SEP-E vs. SEP Variance analysis-sample 2
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable SEP
SEP
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4977 0.4708
95% CI for the mean 0.3888 to 0.6066 0.3228 to 0.6187
Variance 0.06962 0.1284
Standard deviation 0.2639 0.3584
Standard error of the mean 0.05277 0.07168
Variance ratio test (F-test)
Variance ratio 1.8449
20 Significance level P = 0.141
146
A.3.6 SEP-E vs. SEP Variance analysis-sample 3
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable SEP
Sample 1 Sample 2
Sample size 25 25
10 Arithmetic mean 0.4977 0.6169
95% CI for the mean 0.3888 to 0.6066 0.4639 to 0.7699
Variance 0.06962 0.1373
Standard deviation 0.2639 0.3706
Standard error of the mean 0.05277 0.07412
Variance ratio test (F-test)
Variance ratio 1.9728
Significance level P = 0.103
20
A.3.7 SEP vs. LEACH Variance analysis-sample 1
1 Variance ratio test (F-test)
Sample 1
Variable SEP
SEP
Sample 2
Variable LEACH-Homogeneous
LEACH-Homogeneous
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4708 0.5425
95% CI for the mean 0.3228 to 0.6187 0.3776 to 0.7073
Variance 0.1284 0.1595
Standard deviation 0.3584 0.3993
Standard error of the mean 0.07168 0.07987
Variance ratio test (F-test)
Variance ratio 1.2416
20 Significance level P = 0.600
A.3.8 SEP vs. LEACH Variance analysis-sample 2
1 Variance ratio test (F-test)
Sample 1
Variable SEP
147
Sample 2
Variable LEACH-Homogeneous
LEACH-Homogeneous
Sample 1 Sample 2
Sample size 16 16
10 Arithmetic mean 0.4530 0.5135
95% CI for the mean 0.2307 to 0.6754 0.3263 to 0.7008
Variance 0.1741 0.1235
Standard deviation 0.4173 0.3514
Standard error of the mean 0.1043 0.08785
Variance ratio test (F-test)
Variance ratio 1.4098
Significance level P = 0.514
20
A.3.9 SEP vs. LEACH Variance analysis-sample 3
1 Variance ratio test (F-test)
Sample 1
Variable SEP
Sample 2
Variable LEACH-homogeneous
LEACH-homogeneous
Sample 1 Sample 2
Sample size 25 25
10 Arithmetic mean 0.5321 0.5558
95% CI for the mean 0.3823 to 0.6819 0.3983 to 0.7133
Variance 0.1316 0.1457
Standard deviation 0.3628 0.3817
Standard error of the mean 0.07256 0.07633
Variance ratio test (F-test)
Variance ratio 1.1066
Significance level P = 0.806
20
A.3.10 SEP-E vs. MLCC Variance analysis
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable Multi-hop
Multi-hop
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4531 0.5100
95% CI for the mean 0.3392 to 0.5670 0.3634 to 0.6567
148
Variance 0.07614 0.1262
Standard deviation 0.2759 0.3552
Standard error of the mean 0.05519 0.07104
Variance ratio test (F-test)
Variance ratio 1.6572
20 Significance level P = 0.223
A.3.11 SEP-E vs. DLCC Variance analysis
1 Variance ratio test (F-test)
Sample 1
Variable SEP-E
SEP-E
Sample 2
Variable Dual-hop
Dual hop
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.4531 0.5200
95% CI for the mean 0.3392 to 0.5670 0.3665 to 0.6736
Variance 0.07614 0.1383
Standard deviation 0.2759 0.3719
Standard error of the mean 0.05519 0.07438
Variance ratio test (F-test)
Variance ratio 1.8165
20 Significance level P = 0.151
A.3.12 DLCC vs. LEACH Variance analysis
1 Variance ratio test (F-test)
Sample 1
Variable Dual_hop
Dual hop
Sample 2
Variable LEACH_Homo
LEACH-Homo
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.5200 0.5180
95% CI for the mean 0.3665 to 0.6736 0.3560 to 0.6801
Variance 0.1383 0.1542
Standard deviation 0.3719 0.3926
Standard error of the mean 0.07438 0.07853
Variance ratio test (F-test)
Variance ratio 1.1146
149
20 Significance level P = 0.793
A.3.13 MLCC vs. LEACH Variance analysis
1 Variance ratio test (F-test)
Sample 1
Variable Dual_hop
Dual hop
Sample 2
Variable LEACH_Homo
LEACH-Homo
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.5200 0.5180
95% CI for the mean 0.3665 to 0.6736 0.3560 to 0.6801
Variance 0.1383 0.1542
Standard deviation 0.3719 0.3926
Standard error of the mean 0.07438 0.07853
Variance ratio test (F-test)
Variance ratio 1.1146
20 Significance level P = 0.793
A.3.14 DLCC vs. MLCC Variance analysis
1 Variance ratio test (F-test)
Sample 1
Variable Multi-hop
Multi-hop
Sample 2
Variable Dual-hop
Dual hop
Sample 1 Sample 2
10 Sample size 25 25
Arithmetic mean 0.5100 0.5200
95% CI for the mean 0.3634 to 0.6567 0.3665 to 0.6736
Variance 0.1262 0.1383
Standard deviation 0.3552 0.3719
Standard error of the mean 0.07104 0.07438
Variance ratio test (F-test)
Variance ratio 1.0961
20 Significance level P = 0.824
150

S-ar putea să vă placă și