Professional Documents
Culture Documents
Submitted by
FEROOZ KHAN.K.M(2012506015)
SIDDARTH.C.R(2012506047)
Abstract:
In wireless sensor networks (WSNs), due to the limitation of nodes energy, energy
efficiency is an important factor should be considered when the protocols are designing. As a
typical representative of hierarchical routing protocols, LEACH Protocol plays an important role.
LEACH protocol is intended to balance the energy consumption of the entire network and
extend the life of the network. Our aim is to simulate and show how leach protocol works in
this kind of environment.
Introduction :
Wireless sensor network (WSN) is a self-organized network composed by a large
number of micro sensors that are randomly deployed in monitoring regional through wireless
communication. With its wide application in military reconnaissance, medical aid, logistics
management, environmental monitoring, agriculture and other commercial areas, WSN has
become the furthermost technology in the field of communication and computer research.
Among the current researches, the clustering routing technology is the most widely influential.
Low-Energy Adaptive Clustering Hierarchy (LEACH) is a classical clustering routing in wireless
sensor networks. LEACH is the earliest proposed single-hop clustering routing protocol in WSN,
it can save network energy greatly compared with the non-cluster routing algorithm.
Tool Used:
Protocol explanation:
LEACH (Low Energy Adaptive Clustering Hierarchy) is designed for sensor networks
where an end-user wants to remotely monitor the environment. In such a situation, the data
from the individual nodes must be sent to a central base station, often located far from the
sensor network, through which the end-user can access the data.
LEACH is a hierarchical protocol in which most nodes transmit to cluster heads, and the
cluster heads aggregate and compress the data and forward it to the base station (sink). Each
node uses a stochastic algorithm at each round to determine whether it will become a cluster
head in this round. LEACH assumes that each node has a radio powerful enough to directly
reach the base station or the nearest cluster head, but that using this radio at full power all the
time would waste energy.
Nodes that have been cluster heads cannot become cluster heads again for P rounds,
where P is the desired percentage of cluster heads. Thereafter, each node has a 1/P probability
of becoming a cluster head in each round. At the end of each round, each node that is not a
cluster head selects the closest cluster head and joins that cluster. The cluster head then
creates a schedule for each node in its cluster to transmit its data.
There are several desirable properties for protocols on these networks:
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
LL
16
set val(rp)
DSDV
;# antenna model
#===================================
#
Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
[new Topography]
#===================================
#
#===================================
$ns node-config -adhocRouting $val(rp) \
-llType
-macType
$val(ll) \
$val(mac) \
-ifqType
$val(ifq) \
-antType
$val(ant) \
-propType
$val(prop) \
-phyType
$val(netif) \
-channel
$chan \
-topoInstance $topo \
#===================================
#
Nodes Definition
#===================================
#Creation of nodes
set n0 [$ns node]
$n0 set X_ 437
$n0 set Y_ 301
$n0 set Z_ 0.0
$n0 color orange
$ns at 0.0 "$n0 color orange"
$ns initial_node_pos $n0 20
..
#===================================
#
#===================================
$ns at 0.5 "$n0 setdest 741.222 219.713 15.0"
$ns at 0.5 "$n1 setdest 661.911 293.578 15.0"
$ns at 0.0 "$n15 label Host"
..
#===================================
#
#===================================
proc create_cluster_head_node {} {
#======================================
# Creating agents, sinks and connecting them
#======================================
set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n0 $tcp
$ns attach-agent $n1 $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 64.2 "$ftp start"
$ns at 68.0 "$ftp stop"
..
#===================================
#
Finish Procedure
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam out1.nam &
exit 0
}
$ns run
Screenshots:
Initial Formation
Conclusion:
Thus LEACH protocol is simulated in Network Simulator 2(NS2) and we could see how
LEACH protocol helps in balancing energy consumption of the whole network and extending the
network lifetime by balancing the energy consumption of these cluster heads.