Professional Documents
Culture Documents
22082228
1. Aims
The aim of this assignment is to understand the characteristics of LEACH and experience
wireless sensor network simulators.
2. Introduction of LEACH
LEACH is a cluster-based protocol, which includes distributed cluster formation. LEACH
randomly selects a few sensor nodes as cluster heads (CHs) and rotates this role to evenly
distribute the energy load among the sensors in the network.
The operation of LEACH is separated into two phases, the setup phase and the steady state
phase. In the setup phase, the clusters are organized and CHs are selected. In the steady
state phase, the actual data transfer to the base station takes place.
In setup phase, each node chooses a random number between 0 and 1. If the number is less
than the threshold, the node is the cluster head. It will broadcast news to other nodes, and
each node decides to join which cluster node according to signal strength.
In steady state phase, cluster nodes will process data which is sent from nodes such as data
fusion and aggregation, and transmit it to sink.
3. Implement
NS2 which is an network simulator is used to simulate the network. LEACH protocol source
code provided by mit is loaded on NS2 to implement LEACH protocol.
4. Experiments result
My experiments are based on the default leach test set by MIT. First experiment uses the
default config file. Then I changed two parameters of default config file and got other two
different results. The following are the main files of each experiment.
alg=leach
dirname="mit/leach_sims"
filename=$alg
topology_file="mit/uAMPS/sims/100nodes.txt"
num_clusters=5
eq_energy=1
# energy values. How much energy does each node have initially
init_energy=2
stop=3600
x=1000
y=1000
bs_x=50
bs_y=175
nn=101
# Number of nodes. This should be 1 higher than the number of nodes generated in the scenario
Condition.txt file
USING LEACH: DISTRIBUTED CLUSTER FORMATION
Simulation will stop after 3600 seconds.
Base station at (50, 175)
Each node starting with 2 Joules of energy.
Energy Model:
RXThresh = 6e-9
CSThresh = 1e-9
Rb = 1e6
Excvr = 50e-9
Efriss_amp = 9.6741659015025702e-12
Etwo_ray_amp = 1.3037037037037037e-15
Ebf = 5e-9
Pidle = 0
Psleep = 0
Thresholds chosen using original probs.
Desired number of clusters = 5
Spreading factor = 8
Changing clusters every 20 seconds
10 0 0.020595866298143972
10 1 0.020796805544838353
10 2 0.0076756180100429105
10 3 0.0080182483101283227
378.70000000001761 96 2.7319517057416345
378.70000000001761 97 2.0016787300175682
378.70000000001761 98 2.6527214788314222
378.70000000001761 99 3.076902775055153
378.70000000001761 96 0
378.70000000001761 97 0
378.70000000001761 98 0
378.70000000001761 99 0
TDMAschedule.20.txt file:
5
64 16 40 27 1 39 65 62 88 0 56
79 37 30 28 74 98 84 57 73 2 10 96 78 69
26
44 85 80 13 15 53 4 76 21 99 41 67 72 92 46 87 17 32 45
50
54 61 24 93 89 91 48 52 59 75 95 47 55 66 63 97 36 58 12 42
77
33 94 8 49 7 29 51 70 23 38 90 81
82
14 43 83 35 31 18 71 68 25 60 86 20 19 34 22 11 6 3
num_clusters=5
Condition.txt file
381.60000000001827 96 2.5149526692928803
381.60000000001827 97 3.4356600175697785
381.60000000001827 98 2.5193031335323699
381.60000000001827 99 2.5649926069643216
381.60000000001827 96 0
381.60000000001827 97 0
381.60000000001827 98 0
381.60000000001827 99 0
TDMAschedule.60.txt file:
62 20 18
40
27 64
77
23 33
79
17 30
91
25
98
bs_x=50
bs_y=175
Condition.txt file
USING LEACH: DISTRIBUTED CLUSTER FORMATION
Simulation will stop after 3600 seconds.
Base station at (20, 50)
Each node starting with 2 Joules of energy.
Energy Model:
RXThresh = 6e-9
CSThresh = 1e-9
Rb = 1e6
Excvr = 50e-9
Efriss_amp = 9.6741659015025702e-12
Etwo_ray_amp = 1.3037037037037037e-15
Ebf = 5e-9
Pidle = 0
Psleep = 0
Thresholds chosen using original probs.
Desired number of clusters = 5
Spreading factor = 8
Changing clusters every 20 seconds
565.20000000005996 96 3.9511984004717937
565.20000000005996 97 2.1832415749427532
565.20000000005996 98 2.0021766326620138
565.20000000005996 99 6.2290362802848112
565.20000000005996 96 0
565.20000000005996 97 0
565.20000000005996 98 0
565.20000000005996 99 0
TDMAschedule.120.txt file:
4
67 45 15 87 99 46 41 72 26 76 78 30
21
34 95 3 11 81 43 18 82 83 94 19 31 49 35 6 63 71 22 60 58 20 86 25
47
97 27 14 62 50 56 54 42 12 59 48 93 24 16 61 10 68 0 40 89 88 75 1 65 39 64 5 52 55 66
74
79 69 57 91 36 73 9 28 98 2 96
84
13 44 37 17
85
90 53 29 8 92 38 32 70 80 77 33 51 7 23
5. Conclusion
In the three experiments, after adding the number of cluster header, the number of alive
nodes is increased and the number of transmitted data is decreased. After moving the BS
from inside to the border of field, the number of alive nodes is decreased and much more
data need to be transmitted.
6. References
[1] W. Heinzelman, A. Chandrakasan, and H. Balakrishnan, "Energy-efficient communication
protocol for wireless sensor networks," in the Proceeding of the Hawaii International
Conference System Sciences, Hawaii, January 2000.
*2+ MIT AMPS project ns2 code extensions.
http://www-mtl.mit.edu/research/icsystems/uamps/research/leach/leach_code.shtml
[3] Marc Greis' Tutorial for the UCB/LBNL/VINT Network Simulator "ns"
http://www.isi.edu/nsnam/ns/tutorial/