Академический Документы
Профессиональный Документы
Культура Документы
i.
ii.
iii.
Design and implements of CSMA / CA Algorithm for IEEE 802.15.4 standard in IAR
Embedded workbench for msp430.
Study of IEEE 802.15.4 standard
MAC layer, frame formats, csma/ca
Msp430 board details, some example programs using IAR, CCS
CSMA/CA C code is completed using IAR simulator, CSMA/CA FSM,
Flow chart, problems
TI-MAC simple data transfer between two msp430f5438a experimental boards
iv.
Implement of python GUI for complete sensor data access and controlling the feature
of msp430 and plotting the data.
Smartrf05EB + 2618+cc2520 example programs using CCS
Smartrf studio + packet sniffer
v.
vi.
Task 1:- Simulation of energy efficient WSN routing protocols (Algorithms) using
Castalia Simulator.
CHAPTER -1 INTRODUCTION
Wireless sensor network is a popular area for research now days, due to vast potential usage
of sensor networks in different areas. A sensor network is a comprised of sensing, processing,
communication ability which helps to observe, react to events and phenomena in a specified
environment. This kind of network enables to connect the physical world to environment. By
networking tiny sensor nodes, it becomes easy to obtain the data about physical phenomena
which was very much difficult with conventional ways. Wireless sensor network typically
consist of tens to thousands of nodes. These nodes collect process and cooperatively pass this
collected information to a central location. WSNs have unique characteristics such as low
duty cycle, power constraints and limited battery life, redundant data acquisition,
heterogeneity of sensor nodes, mobility of nodes, and dynamic network topology, etc.
Application of WSNs exists in variety of fields including environmental applications, medical
monitoring, home security, surveillance, military applications, air traffic control, industrial
and manufacturing automation, process control, inventory management, distributed robotics,
etc . Data collected by sensor nodes in a WSN is typically propagated toward a base station
that links the WSN with other networks where the data can be visualized, analyzed, and acted
upon. In small sensor networks where sensor nodes and a gateway are in close proximity,
single-hop communication between all sensor nodes and the gate- way may be feasible.
However, most WSN applications require large numbers of sensor nodes that cover large
areas, necessitating a multi-hop communication approach.
1.1
MOTIVATION
The key challenge in setting up and proper operation of WSN is increase the lifetime of the
network by minimizing the energy consumption. From last few years variety of changes
have been made to limit the energy requirement in WSN, as mainly energy dissipation is
more for wireless transmission and reception [2]. Main approaches till proposed were
focusing at making the changes at MAC layer and network layer to minimize the energy
dissipation. One more major challenge is how to communicate at longer distances. In large
scale sensor networks, multi-hop communication between sensor nodes is necessary to cover
a large monitoring region. Moreover, sensor nodes should be grouped into clusters to enhance
scalability and robustness.
If multi-hopping is used then we can extend coverage due to multi-hop forwarding .To tackle
with all the above mentioned challenges multi hopping have been found the efficient
PROBLEM STATEMENT
The sole purpose of this report is to find the energy efficient method by which we can
communicate at longer distances. Wireless sensor networks are battery operated. Sensor
nodes collect the data and pass them on to the network for further use. This passing and
receiving of data utilizes most of the energy of the network. So for better operation and
increase the lifetime of the network, energy consumption must be the major factor of concern.
In this report new method for communicating at longer distances with the sensor network is
proposed, which is divided into two phases as MAPPING and REDUCING. The MAP
protocol performs mapping or assigning of sensor nodes to clusters and REDUCE protocol
minimizes energy thereby using MAC and NWK protocols.
cluster heads. The actual energy drained from the battery of the device is considered.
However, the problem is not formulated and solved as an optimization problem, but rather an
efficient clustering algorithm that ensures fairness in energy consumption between nodes, due
to the probabilistic selection, is presented.
In the [13] paper, they have investigated, through simulation and experiments on a real test
bed, the performance of IEEE 802.15.4 WSNs when power management is enabled for
energy conservation. They have observed that sensor nodes experience a low communication
reliability in terms of delivery ratio which may prevent the distributed sensing system from
operating properly (e.g., as for a timely detection of events).Referred to this issue as the
MAC unreliability problem as it is originated by the contention-based 802.15.4 MAC
protocol. They found that the problem is essentially due to the Carrier sense multiple access
with collision avoidance (CSMA/CA) algorithm used by the 802.15.4 MAC for channel
access, which is not able to efficiently handle contention when the number of simultaneously
contending nodes is relatively high (a similar problem does not occur when using a Time
Division or polling scheme for channel access). Although this is a problem common to all
contention-based MAC protocols, nevertheless in the 802.15.4 MAC it is made more severe
than in other similar cases (e.g., S-MAC) due to the MAC parameters setting suggested by
the standard.
analysis, and storage systems. For example, Figure 3.1 shows two sensor eld monitoring
two different geographic regions and connecting to the Internet using their base stations.
The capabilities of sensor nodes in a WSN can vary widely that is, simple sensor nodes may
monitor a single physical phenomenon, while more complex devices may combine many
different sensing techniques (e.g., acoustic, optical, magnetic). They can also differ in their
communication capabilities, for example, using ultrasound, infrared, or radio frequency
technologies with varying data rates and latencies. While simple sensors may only collect and
communicate information about the observed environment, more powerful devices (i.e.,
devices with large processing, energy, and storage capacities) may also perform extensive
processing and aggregation functions. Such devices often assume additional responsibilities
in a WSN, for example, they may form communication backbones that can be used by other
resource-constrained sensor devices to reach the base station. [1]
The definition of WSN, according to, Smart Dust program of Defence Advanced Research
Projects Agency (DARPA) is: A sensor network is a deployment of massive numbers of
small, inexpensive, self-powered devices that can sense, compute, and communicate with
other devices for the purpose of gathering local information to make global decisions about a
physical environment [14].
Wireless Sensor Networks have been widely considered as one of the most important
technologies for the twenty-first century. Enabled by recent advances in micro-electro
mechanical systems (MEMS) and wireless communication technologies, tiny cheap, and
smart sensors deployed in physical area and networked through wireless links and the
Internet provide unprecedented opportunities for a variety of civilian and military
applications, for e.g., environmental monitoring, battlefield surveillance, and industry process
control. WSN have unique characteristics, for e.g., denser level of node deployment, higher
unreliability of sensor nodes and severe energy computation and storage constraints, which
presents many new challenges in the development and applications of WSNs. In the past
decade, WSN have received tremendous attention from both academia and industry all over
the world.
3.1.1 Evolution of Wireless Sensor Network
Sensor network development was initiated by the United States during the Cold War. A
network of acoustic sensors was placed at strategic locations on the bottom of the ocean to
detect and track Soviet submarines. This system of acoustic sensors was called the Sound
Surveillance System (SOSUS). Human operators played an important role in these systems.
The sensor network was wired network that did not have the energy bandwidth constraints of
wireless system. Modern research on sensor networks started around 1980 with the
Distributed Sensor Networks (DSN) program at the DARPA. These included acoustic sensors
communication (a high-level protocols that link processes working on a common application
in a resource-sharing network), processing techniques, algorithms (including self-location
algorithms for sensors), and distributed software (dynamically modifiable distributed systems
and language design). Recent advances in computing and communication have caused a
significant shift in sensor network research and brought it closer to achieving the original
vision. Small and inexpensive sensors based upon micro-electro-mechanical system (MEMS)
technology, wireless networking, and inexpensive low-power processors allow the
deployment of wireless ad hoc networks for various applications. Thus, the program
developed with new networking techniques is suitable for highly dynamic ad hoc
environments.
The organization has defined the IEEE 802.15 standard [15] for personal area networks
(PANs), with personal networks defined to have a radius of 5 to 10 m. Networks of short
range sensors are the ideal technology to be employed in PANs. Furthermore, increases in
chip capacity and processor production capabilities have reduced the energy per bit
requirement
for
both
computing
and
communication.
Sensing,
computing,
and
communications can now be performed on a single chip, further reducing the cost and
allowing deployment in ever-larger numbers.
A motor may be needed to move sensor nodes in some sensing tasks. All these units should
be built into a small module with low power consumption and low production cost.
IEEE 802.15.4 defines two types of devices. These devices types are shown in Table 1.Listed
in Table 2 are the three types of ZigBee protocol devices as they relate to the IEEE device.
Service Offered
Power Source
Receiver Configuration
All
Mains
ON when Idle
Limited
Battery
Coordinator
FFD
Router
RFD
End
RFD or FFD
Typical Function
One per network. Forms the network,
allocates the network address. Hold the
binding table.
Optional. Extend the physical range of
network. Allows more node to join the
network.
Perform monitoring and/or controlling
functions.
These devices have 64-bit IEEE addresses, with option to enable shorter addresses to reduce
packet size, and work in either of two addressing modes star and peer-to-peer.
1. The ZigBee coordinator node: There is one, and only one, ZigBee coordinator in each
network to act as the router to other networks, and can be likened to the root of a (network)
tree. It is designed to store information about the network.
2. The Full Function Device FFD: The FFD is an intermediary router transmitting data
from other devices. It needs lesser memory than the ZigBee coordinator node, and entails
lesser manufacturing costs. It can operate in all topologies and can act as a coordinator.
3. The Reduced Function Device RFD: This device is just capable of talking in the
network; it cannot relay data from other devices. Requiring even less memory, (no flash, very
little ROM and RAM), an RFD will thus be cheaper than an FFD. This device talks only to a
network coordinator and can be implemented very simply in star topology.
wireless network collaboratively determine their transmission power and dene the network
topology by forming the proper neighbour relation under certain criteria. This is in contrast to
the traditional network, in which each node transmits with its maximal transmission power
and the topology is built implicitly by routing protocols (that update their routing caches as in
timely a way as possible) without considering the power issue. A desirable network topology
not only reduces energy consumption and prolong network lifetime, but also improves spatial
reuse (and hence the network capacity) and mitigate the medium-access control (MAC) level
contention.
Basically there are following three types of topology in WSN in Fig 3.5:
1.
Star Topology
2.
3.
1. Star Topology.
The star topology consist of a coordinator and several end devices (nodes).In this topology,
the device communicates only with the coordinator. Any packet exchange between two
devices must go through the coordinator .The disadvantage of this topology is the operation
of the network depends upon coordinator of the network, and because all between devices
must go through it, so it may become bottlenecked.
Key attributes Simplicity, low cost, long battery life and Single point of failure.
2. Mesh Topology(Peer To-Peer Network)
It consists of one coordinator, several routers and end devices as shown in fig 3.5.The
following are the characteristics of mesh topology:
A mesh topology is multihop network: packets pass through multiple hops to reach to their
destination.
The range of the network can be increased by increasing more devices to the network.
A mesh topology is self-healing, meaning during transmission, if a path fails, the node will
find an alternate path to the destination.
3. Cluster Tree Topology
A cluster tree topology is a special case of tree topology in which parent with its children is
called cluster as shown in fig 3.5.each cluster is identified by a cluster ID. It consist of a
central node, which is a coordinator, several routers and end devices. The function of router is
to extend network coverage. Disadvantage of this topology is that even if two nodes are
geographically close to each other, they cannot communicate directly.
transferring one bit of data to a receiver at 100 m away is equal to that needed to execute
3,000 instructions [16]. The ratio of energy consumption for communicating 1 bit over the
wireless medium to that for processing the same bit could be in the range of 1,000 10,000
[17, 18]. Therefore, it is desired to reduce the amount of traffic and transmission distance in
order to increase energy savings and prolong network lifetime.
which can reduce the energy consumption for communication. The architecture of a multihop
network can be organized into two types: at and hierarchical.
Flat Architecture. In a at network, each node plays the same role in performing a
sensing task and all sensor nodes are peers. Due to the large number of sensor nodes, it is not
feasible to assign a global identier to each node in a sensor network. For this reason, data
gathering is usually accomplished by using data-centric routing, where the data sink transmits
a query to all nodes in the sensing region via ooding and only the sensor nodes that have the
data matching the query will respond to the sink. Each sensor node communicates with the
sink via a multihop path and uses its peer nodes as relays. Figure 3.8 illustrates the typical
architecture of a at network.
into clusters, where the cluster members send their data to the cluster heads while the cluster
heads serve as relays for transmitting the data to the sink. A node with lower energy can be
used to perform the sensing task and send the sensed data to its cluster head at short
distance, while a node with higher energy can be selected as a cluster head to process the
data from its cluster members and transmit the processed data to the sink. This process can
not only reduce the energy consumption for communication, but also balance traffic load
and improve scalability when the network size grows. Since all sensor nodes have the same
Sensor nodes are small-scale devices with volumes approaching a cubic millimeter in
the near future. Such small devices are very limited in the amount of energy they can store
or harvest from the environment.
Nodes are subject to failures due to depleted batteries or, more generally, due to
environmental influences. Limited size and energy also typically means restricted resources
(CPU performance, memory, wireless communication bandwidth and range).
Node mobility, node failures, and environmental obstructions cause a high degree of
dynamics in WSN. This includes frequent network topology changes and network
partitions. Despite partitions, however, mobile nodes can transport information across
partitions by physically moving between them.
The resulting paths of information flow might have unbounded delays and are
Another issue is heterogeneity. WSN may consist of a large number of rather different
scalability issues on the one hand, but provides a high level of redundancy on the other
hand. Also, nodes have to operate unattended, since it is impossible to service a large
number of nodes in remote, possibly inaccessible locations.
3.1.5 Challenges and Constraints of Wireless Sensor Networks
While sensor networks share many similarities with other distributed systems, they are
subjected to a variety of unique challenges and constraints. These constraints impact the
design of a WSN, leading to protocols and algorithms that differ from their counterparts in
other distributed systems. This section describes the most important design constraints of a
WSN.
Energy
The constraint most often associated with sensor network design is that sensor nodes operate
with limited energy budgets. Typically, they are powered through batteries, which must be
either replaced or recharged (e.g., using solar power) when depleted. For some nodes, neither
option is appropriate, that is, they will simply be discarded once their energy source is
depleted. Whether the battery can be recharged or not signicantly affects the strategy
applied to energy consumption. For non-rechargeable batteries, a sensor node should be able
to operate until either its mission time has passed or the battery can be replaced. As a
consequence, the rst and often most important design challenge for a WSN is energy
efficiency. This requirement permeates every aspect of sensor node and network design.
Self-Management
It is the nature of many sensor network applications that they must operate in remote areas
and harsh environments, without infrastructure support or the possibility for maintenance and
repair. Therefore, sensor nodes must be self-managing in that they congure themselves,
operate and collaborate with other nodes, and adapt to failures, changes in the environment,
and changes in the environmental stimuli without human intervention.
Wireless Networking
Decentralized Management
The large scale and the energy constraints of many wireless sensor networks make it
infeasible to rely on centralized algorithms (e.g., executed at the base station) to implement
network management solutions such as topology management or routing. Instead, sensor
nodes must collaborate with their neighbors to make localized decisions, that is, without
global knowledge. As a consequence, the results of these decentralized (or distributed)
algorithms will not be optimal, but they may be more energy-efficient than centralized
solutions.
Consider routing as an example for centralized and decentralized solutions. A base station
can collect information from all sensor nodes, establish routes that are optimal (e.g., in terms
of energy), and inform each node of its route. However, the overhead can be signicantly,
particularly if the topology changes frequently. Instead, a decentralized approach allows each
node to make routing decisions based on limited local information (e.g., a list of the nodes
neighbours, including their distances to the base station). While this decentralized approach
may lead to no optimal routes, the management overheads can be reduced signicantly.
Design Constraints
While the capabilities of traditional computing systems continue to increase rapidly, the
primary goal of wireless sensor design is to create smaller, cheaper, and more efficient
devices. Driven by the need to execute dedicated applications with little energy consumption,
typical sensor nodes have the processing speeds and storage capacities of computer systems
from several decades ago. The need for small form factor and low energy consumption also
prohibits the integration of many desirable components, such as GPS receivers. These
constraints and requirements also impact the software design at various levels, for example,
operating systems must have small memory footprints and must be efficient in their resource
management tasks. However, the lack of advanced hardware features (e.g., support for
parallel executions) facilitates the design of small and efficient operating systems. A sensors
hardware constraints also affect the design of many protocols and algorithms executed in a
WSN. [1]
3.1.6 Applications of Wireless Sensor Networks
Wireless sensor networks have inspired many applications. Some of them are futuristic while
a large number of them are practically useful. They are:
1.
2.
Traffic Control
3.
Health Care
4.
Pipeline Monitoring
5.
Precision Agriculture
6.
Active Volcano
7.
Underground Mining
Wireless
Networking
Protocol Stack
Application
Network Layer
Data Link Layer
PHY Layer
Specification
defined by
ZigBee Alliance
Specification
defined by
IEEE 802.15.4
important to specify relevant standards so that sensor products from different manufacturers
may interoperate. A lot of efforts have been made and are under way in many standardization
organizations in order to unify the market, leading to low - cost and interoperable devices,
and avoiding the proliferation of proprietary incompatible network protocols. To a certain
extent, the success of WSNs as a technology will largely rely on the success of these
standardization efforts.
The IEEE 802.15.4 Standard. The IEEE 802.15.4 is a standard developed by IEEE
802.15 Task Group 4, which species the physical and MAC layers for low - rate WPANs.
As dened in its Project Authorization Request, the goal of Task Group 4 is to provide a
standard for ultralow complexity, ultralow cost, ultralow power consumption, and low - data
rate wireless connectivity among inexpensive devices. The rst release of the IEEE
802.15.4 standard was delivered in 2003 and is freely distributed. This release was revised
in 2006, but the new release is not yet freely distributed. Its protocol stack is simple and
exible, and does not require any infrastructure. The standard has the following features
Some 16 channels in the 2.4 - GHz ISM band, 10 channels in the 915 MHz band,
and 1 channel in the 868 - MHz band.
The ZigBee Standard. The IEEE 802.15.4 standard only denes the physical and
MAC layers without specifying the higher protocol layers, including the network and
application layers. The ZigBee standard is developed on top of the IEEE 802.15.4 standard
and denes the network and application layers. The network layer provides networking
functionalities for different network topologies, and the application layer provides a
framework for distributed application development and communication. The two protocol
stacks can be combined together to support short range low data rate wireless
communication with battery powered wireless devices.
The potential applications of these standards include sensors, interactive toys, smart badges,
remote controls, and home automation.
The ZigBee protocol stack was proposed at the end of 2004 by the ZigBee Alliance , an
association of companies working together to enable reliable, cost - effective, low - power,
wirelessly networked, monitoring, and control products based on an open global standard.
The rst release of ZigBee was revised at the end of 2006, which introduces extensions on
the standardization of application proles and some minor improvements to the network and
application layers.
3.2
MEDIUM ACCESS CONTROL
Medium access control (MAC) is one of the critical issues in the design of wireless sensor
networks (WSNs).As in most wireless networks, collision, which is caused by two nodes
sending data at the same time over the same transmission medium, is a great concern in
WSNs. To address this problem, a sensor network must employ a MAC protocol to arbitrate
access to the shared medium in order to avoid data collision from different nodes and at the
same time to fairly and efficiently share the bandwidth resources among multiple sensor
nodes. Therefore, a MAC protocol plays an important role in enabling normal network
operation and achieving good network performance.
OBJECTIVE OF MAC DESIGN
The basic function of a MAC protocol is to arbitrate access to a shared medium in order to
avoid collisions from different nodes. In addition to this basic function, a MAC protocol
must also take into account other factors in its design in order to improve network
performance and provide good network services for different applications. In WSNs, these
mainly include energy efficiency, scalability, adaptability, channel utilization, latency,
throughput, and fairness [19].
Energy Efficiency. Energy efficiency is one of the most important factors that must be
considered in MAC design for sensor networks. It refers to the energy consumed per unit of
successful communication. Since sensor nodes are usually battery powered and it is often
very difficult or impossible to change or recharge batteries for sensor nodes, a MAC
protocol must be energy efficient in order to maximize not only the lifetime of individual
sensor nodes, but also the lifetime of the entire network.
Scalability. Scalability refers to the ability to accommodate the change in network size.
In sensor networks, the number of sensor nodes deployed may be on the order of tens,
hundreds, or thousands. A MAC protocol must be scalable to such changes in network size.
density and network topology. In sensor networks, node density can be very high. A node
may fail, join, or move, which would result in changes in node density and network
topology. A MAC protocol must be adaptive to such changes efficiently.
effective communication. Due to limited bandwidth, a MAC protocol should make use of
the bandwidth as efficiently as possible.
Latency. Latency refers to the delay from the time a sender has a packet to send until
the time the packet is successfully received by the receiver. In sensor networks, the
importance of latency depends on different applications. While it is true that latency is not a
critical factor for some applications (e.g., data collection for scientic exploration), many
applications may have stringent latency requirements (e.g., real - time monitoring of bush
res).
sender to a receiver in a given time, usually measured in bits or bytes per second. It is
affected by many factors, for example, the efficiency of collision avoidance, control
overhead, channel utilization and latency. Like latency, the importance of throughput
depends on different applications.
Fairness. Fairness refers to the ability of different sensor nodes to equally share a
Among all these factors, energy efficiency, scalability, and adaptability are the most
important for the MAC design of sensor networks. In particular, energy consumption is the
primary factor affecting the operational lifetime of individual nodes and the entire network.
The overall performance of a sensor network highly depends on the energy efficiency of the
network. Therefore, energy efficiency is of primary importance in sensor networks. For this
purpose, it is even worth trading some network performance for energy efficiency.
In general, energy consumption occurs in three aspects: sensing, data processing, and data
communication, where data communication is a major source of energy consumption.
According to Ref. [20], it consumes 3 J of energy to transmit 1 - Kb data over a distance of
100
million instructions per second can process 300 million instructions with the same amount
of energy. For this reason, it is desired to reduce data communication as much as possible in
a sensor network. Thus, sensor nodes can use their processing capability to locally perform
simple data processing, instead of sending all raw data to the sink(s) for processing, and
then transmit partially processed data to the sink(s) for further processing. On the other
hand, an efficient MAC protocol can improve energy efficiency in data communication and
prolong the lifetime of a sensor network. To design energy - efficient MAC protocol, it is
important to identify the major sources of energy waste in sensor networks from the MAC
perspective.
According to Ref. [21], energy waste comes from four major sources:
Collision. Collision occurs when two sensor nodes transmit their packets at the same
time. As a result, the packets are corrupted and thus have to be discarded. Retransmissions
of the packets increase both energy consumption and delivery latency.
Overhearing. Overhearing occurs when a sensor node receives packets that are
destined for other nodes. Overhearing such packets results in unnecessary waste of energy
and such waste can be very large when traffic load is heavy and node density is high.
Idle Listening. Idle listening occurs when a sensor node is listening to the radio
channel to receive possible data packets while there are actually no data packets sent in the
network. In this case, the node will stay in an idle state for a long time, which results in a
large amount of energy waste.
However, in many MAC protocols, for example, IEEE 802.11 ad hoc mode or CSMA, a
node has to listen to the channel to receive possible data packets. There are reports that idle
listening consumes 50 100% of the energy required for receiving data traffic. For
example, Stemm and Katz [10] reported that the idle: receive: send ratios are 1 : 1.05 :
1.4, while in the Digitan 2 - Mbps wireless LAN module (IEEE 802.11/2 Mbps)
specication the ratios are 1 : 2 : 2.5 [22] .
certain necessary control packets, which also consumes energy not for data communication.
Network structure
Flat:- all nodes are equal
Hierarchical:- different roles for different nodes
Location based:- nodes rely o location information
Route discovery
Reactive (on-demand):-find route only when needed
Proactive(table-driven):-establish routes before they are needed
Hybrid :-protocols with reactive and proactive characteristics
Protocol operation
Negotiation-based:-negotiate data transfers before they occur
Multi-path:-use multiple routes simultaneously
Query-based:-receiver-initiated
Qos-based:-satisfy certain Qos constraints
Coherent-based:-perform only minimum amount of in-network processing
Flat Architecture. In a at network, each node plays the same role in performing a
sensing task and all sensor nodes are peers. Due to the large number of sensor nodes, it is not
feasible to assign a global identier to each node in a sensor network. For this reason, data
gathering is usually accomplished by using data-centric routing, where the data sink transmits
a query to all nodes in the sensing region via ooding and only the sensor nodes that have the
data matching the query will respond to the sink. Each sensor node communicates with the
sink via a multihop path and uses its peer nodes as relays. Figure 3.8 illustrates the typical
architecture of a at network.
into clusters, where the cluster members send their data to the cluster heads while the cluster
heads serve as relays for transmitting the data to the sink. A node with lower energy can be
used to perform the sensing task and send the sensed data to its cluster head at short
distance, while a node with higher energy can be selected as a cluster head to process the
data from its cluster members and transmit the processed data to the sink. This process can
not only reduce the energy consumption for communication, but also balance traffic load
and improve scalability when the network size grows. Since all sensor nodes have the same
transmission capability, clustering must be periodically performed in order to balance the
traffic load among all sensor nodes. Moreover, data aggregation can be performed at cluster
heads to reduce the amount of data transmitted to the sink and improve the energy
efficiency of the network. The major problem with clustering is how to select the cluster
heads and how to organize the clusters. In this context, there are many clustering strategies.
According to the distance between the cluster members and their cluster heads, a sensor
network can be organized into a single - hop clustering architecture or a multi-hop
clustering architecture, as shown in Figs.3.9.
Install omnet-4.2.2
ii.
Install castalia-3.2
iii.
iv.
v.
vi.
vii.
Type $ ./makemake
viii.
Type $ make
Outputs:1. Simulation of AODV to follow the above steps then start the simulation of AODV
../../bin/Castalia c General naresh.txt
Running configuration 1/1
Above file we can visualize the various parameters for initializing, such as energy levels, no.
of nodes, simulation time, and transmitted output power
2. These are the available outputs of different modules and to find the latency using this
command
../../bin/CastaliaResults i naresh.txt s latency
4. TX packets
../../bin/CastaliaResults i naresh.txt s tx
../../bin/CastaliaResults i naresh.txt s tx n (to finding how many nodes are
connected)
5. Rx packets breakdown
../../bin/CastaliaResults i naresh.txt s rx -n
LEACH Step
by Step
Cluster
Header
Selection
Cluster
Formation
Steady State
Phase
The operations that are carried out in the LEACH protocol are divided into two stages, the
setup phase and the steady-state phase.
Setup phase: - In the set up phase, all the sensors within a network group themselves into
some cluster regions by communicating with each other through short messages. At a point of
time one sensor in the network acts as a cluster head and sends short messages within the
network to all the other remaining sensors. The sensors choose to join those groups or regions
that are
formed by the cluster heads, depending upon the signal strength of the messages sent by the
cluster heads. Sensors interested in joining a particular cluster head or region respond back to
the cluster heads by sending a response signal indicating their acceptance to join. Thus the
set-up phase completes
The cluster head can decide the optimal number of cluster members it can handle or
requires. Before it enters the steady-state phase, certain parameters are considered, such as
the network topology and the relative costs of computation versus the communication. A
TDMA Schedule is applied to all the members of the cluster group to send messages to the
cluster head, and then to the cluster head towards the base station. Figure 2 below shows two
phases of a sensor in a LEACH protocol: all the sensors form as cluster members to the
cluster heads and in the second phase cluster heads perform the transmission of data to the
sink in a multi-hop structure.
Setup phase main aim is clusters organization and cluster headers (CHs) selection
Cluster members
Steady State Phase: - As soon as a cluster head is selected for a region, all the cluster
embers of that region send the collected or sensed data in their allotted TDMA slots to the
cluster head. The cluster head transmits this collected data in a compressed format to the base
station which completes the second phase, called the Steady State Phase. Once the steadystate finishes the data transmission to the sink, the whole process comes to an end and a new
search for the forming of cluster heads for a region and new cluster-member formation
begins. In short, it can be said that a new set/up phase and steady state starts with the end of
data transmission done to the sink. This alternative selection of cluster heads within the
region, which is carried among the sensors in a self-organized way helps in reducing or
lowering the energy that is utilized. There is a possibility that all the sensors might not be too
close to the cluster head so the amount of energy that is utilized by the farther sensor is not
equal to the amount of energy utilized by the nearest node. In order to minimize this, cluster
heads formation or the role of cluster head is performed by a rotation among all the nodes in
the group. LEACH minimizes global energy usage by distributing the load of the network to
all the nodes or cluster members at different intervals.
All the cluster heads send the data which is collected towards the base station in a
compressed format. All the cluster heads may not be close to the base station so they send the
compressed data to the neighbouring cluster heads, and in this way, a multi-hop routing
network is formed. LEACH plays a randomized rotation of the cluster head in order to save
the high energy that is dissipated while transmitting data to the base station. This rotation is
observed within all the sensors so as not to drain the energy or battery of a single sensor.
Cluster members
Cluster Header (CHs)
Install omnet-4.2.2
Install castalia-3.2
Copy the file adjustmenFile.patch to the Castalia folder
Eq: home/user/Castalia-3.2
iv.
Open the prompt go to the Castalia folder and type the following command
patch p0 i adjustmentFile.patch
v. Copy the folder leach Routing to the following path
Castalia-3.2/source/node/communication/routing
vi.
Copy the folder leach to the following path
Castalia-3.2/Simulation
1. LEACH General .ini file
4. Command for finding Packets received for node tested 100 nodes
../../bin/CastaliaResults - i 100nodes.txt s packets
PHY Layer
MAC
Layer
Payload
Synch. Header
(SHR)
PHY Header
(PHR)
MAC Header
(MHR)
MAC Footer
(MFR)
Superframe structure:-
The IEEE 802.15.4 standard allows the optional use of a superframe structure. The format of
the superframe is defined by the coordinator. The superframe is bounded by network beacons
sent by the coordinator and is divided into 16 equally sized slots. Optionally, the superframe
can have an active and an inactive portion. During the inactive portion, the coordinator may
enter a low-power mode. The beacon frame is transmitted in the first slot of each superframe.
If a coordinator does not wish to use a superframe structure, it will turn off the beacon
transmissions. The beacons are used to synchronize the attached devices.
The superframe can have an active and an inactive portion. The active portion
consists of CAP (Contention Access Period) and CFP (Contention Free Period). Any device
wishing to communicate during the CAP shall compete with other devices using a slotted
CSMA/CA mechanism. On the other hand, the CFP contains GTS (guaranteed time slots).
The length of the superframe calculates that using the BO (Beacon Order) and the SO
(Superframe Order) in the PIB (PAN Information Base). The length of the superframe is
following:
BI = aBaseSuperframeDuration 2BO symbols, if 0BO14
SD = aBaseSuperframeDuration 2SO symbols, if 0SOBO14
The channel accessing mechanisms are basically two types there are beacon enabled and nonbeacon enable. The super frame order is less than 15 then that is beacon enabled mode called
as slotted cama/ca algorithm. Super frame order is greater than 15 that is unslotted csma/ca
algorithm
IEEE 802.15.4 MAC CSMA/CA Algorithm flow chart:-
CSMA/CA
NB=0
CW=2
Battery
life
Extension ?
BE= min(2,macMinBE )
Step 1
BE=macMinBE
Locate backoff period
boundary
Delay for
random(2BE-1 ) unit
backoff period
Step 2
Perform CCA on
backoff period
boundary
Step 3
Channel idle ?
N
Step 4
Step 5
CW=2 , NB=NB+1
BE=min(BE+1,macMaxBE)
CW=CW-1
NB>
macMaxCSMA
Backoffs?
CW=0?
Failure
success
Steps:Step1:- initialization of the algorithm variables: NB equal to 0, CW=2 and BE is set to the
minimum value between 2 and MAC sub layer constant (macMinBE)
Step2:- After locating a back off boundary, the algorithm waits for a random defined number
of back off periods before attempting to access the medium
Step3:- Clear channel Assessment (CCA) to verify if the medium is idle or not
Step4:- The CCA returned a busy channel; thus NB is incremented by 1 and the algorithm
must start again in step 2
Step5:- The CCA returned an idle channel, CW is decremented by 1 and when it reaches 0
the message is transmitted, otherwise the algorithm jumps to step 3
CSMA/CA Mechanism : If superframe structure is used in the PAN , the slotted CSMA/CA is used
CSMA/CA Algorithm is implemented using units of time called backoff period, each
of length aunit BackoffPeriod(=20 symbols times=320us in 2.4 GHz channels)
10 bytes can be transmitted in one backoff period.
Sensing and transmitting must be started at the boundary of each backoff period
The CSMA/CA mechanism is based on backoff periods (with the duration of 20
symbols). Three variables are used to schedule medium access:
CW: - Contention window is the no. of backoff periods, which need to be clear of
channel activity before the transmission can commence. MAC ensures this by
performing clear channel assessment(CCA)
BE:- Backoff exponent, before performing CCA , a node takes backoff of
random(0,2BE - 1) BE is initialized to lesser of 2 and macMinBE
NB:- NB is number of backoff , if NB is greater than macMaxCSMABackoffs , the
CSMA/CA algorithm terminates with failure states
CSMA/CA Problems:a) Node B increases exponential Backoff range
b) As node B performs redundant Backoffs
c) Also node B increases probability transmission failure (because transmission fails on
nodes fifth try )
d) As a result, such a meaningless backoffs consume energy
Coordinator
Random Backoff
in the range to 2BE
Node A
CCA
Random Backoff
in the range to 2BE
Node B
Random Backoff in
the range to 2BE-1
Random Backoff in
the range to 2BE-2
Random Backoff in
the range to 2BE-3
CCA
Random Backoff
in the range to 2BE
Node C
Random Backoff
in the range to 2BE
CCA
SLEEP
End of active period
Beacon timer expires
CAP starts
BEACON
ACQUIREMENT/
TRANSMISSION
End of active
period
CAP starts
ACK transmitted
ACK_TX
RX
Required ACK
TXNTRIG Enabled
Locate for
Backoff Period
Boundary
BACKOFF
Require ACK
Timer expires
CCA on backoff
period boundary
TX on backoff
period boundary
In this Finite state machine diagram basically there are transmission state and reception state
this diagram describes how to do the process of sending and receiving data using csma/ca.
General MAC frame communication between Coordinator and Device
RFD(Device)
Command frame
identifier
Command name
Tx
0x01
Association request
0x02
Association response
0x03
Disassociation notification
0x04
Data request
0x05
0x06
Orphan frame
0x07
Beacon request
0x08
Coordinator realignment
0x09
GTS
0x0a-0xff
Reserved
Table1.MAC Command Frame
Rx
X
X
X
Output of csma/ca using IAR Embedded Workbench for msp430 and msp430f5438a
controller:i.
I written the c code for csma/ca in the standard of IEEE 802.15.4 it has simulated in
code composer studio and IAR Simulator successfully completed results has been
taken.
ii.
The channel access is successful this is for slotted csma/ca algorithm whereas super
frame order is less than 15
i.
ii.
iii.
iv.
v.
i.
Hello world
PER Test
Register read application
Light switch application
Sprectrum Analyzer
Hello world application import on code composer studio, here I selected target board
is msp430f2618 and compiler version 4.2.1
ii.
To add the include file open properties and to add the file particular location into the
include path location i.e. properties-> General->include options->add include path
iii.
LEACH
Step by
Step
Cluster
Header
Selection
Cluster
Formation
Steady
State
Phase