Sie sind auf Seite 1von 38

Chapter 1.

Introduction

1.1 Aim

To implement an energy efficient adaptive SMAC protocol in a wireless sensor


network(WSN) and compare it with SMAC protocol.

1.2 Motivation

Energy consumption is the main constraint seen in wireless sensor networks as the
operational lifetime corresponds directly to it. The remote and mobile nature of a WSN that
results in the inability to resupply power to the energy constrained nodes. Therefore
increasing the energy efficiency is the top priortity so that the lifetime of the WSN can be
extended.

A MAC protocol is required in sensor network to coordinate the sensor nodes’ access to the
shared medium. So many MAC protocols have been developed for wireless voice and data
communication networks.

In our study to determine a good MAC protocol for the wireless sensor networks, we have
considered the following attributes. The first is the energy efficiency. Another important
attribute is the scalability of a WSN, to the change in network size, node density and
topology. The network topology and size can change over time as well due to many reasons.
A good MAC protocol should easily accommodate such network changes. Other important
attributes include fairness, latency, throughput and bandwidth utilization.

A suitable medium access control (MAC) protocol can maximize the whole network lifetime.
This project focuses on a protocol solution that deals with MAC layer which will minimize
the energy consumption and the latency encountered while transmuting packets across the
network.

National Institute of Technology, Warangal Page 1


1.3 OUTLINE OF REPORT
In Chapter 2, the fundamental concepts of Wireless sensor networks will be
explained.

In Chapter 3, we compare the various MAC (Media Access Control) protocols and
analyze the essential components of an energy efficient MAC protocol.

In Chapter 4, S-MAC protocol will be discussed in detail.

In Chapter 5, Adaptive S-MAC protocol and how it addresses various issues not
solved by S-MAC, will be explained.

In Chapter 6, we estimate the performance of the Adaptive SMAC protocol in


comparison with that of the S-MAC Protocol via simulation.

National Institute of Technology, Warangal Page 2


Chapter 2 Wireless Sensor Network

2.1 Introduction

Wireless Sensor Networks are infrastructures containing sensing, computing and


communication elements all incorporated in a sensor node with the sole aim to give the
WSN, the ability to sense, measure, collect and react to various stimulus in the monitored
environment. Because of their widespread applications, they are one of the most rapidly
developing information technologies over the last few years.

Figure 1 A Wireless Sensor Network is shown here. This figure emphasizes the range of
applications in which a WSN is used. Various environments are studied and data is collected
which are then transmitted over long distance via the gateway.

Wireless Sensor Networks are networks that usually consist of a large number of
widely distributed sensing devices that are equipped to monitor physical or environmental
phenomena. These devices work autonomously and are logically linked by self-organizing
means.
The ideal wireless sensor is networked and scalable, consumes very little power, can
change its active time interval according to the traffic condition, capable of fast data
acquisition, costs little to purchase and install, and requires no real maintenance [1].
A wireless sensor network (WSN) generally consists of a base station (or “gateway”)
that can communicate with a number of wireless sensors via a radio link. Data is collected at
the wireless sensor node, compressed, and transmitted to the gateway directly or, if required,

National Institute of Technology, Warangal Page 3


uses other wireless sensor nodes to forward data to the gateway. The transmitted data is then
presented to the system by the gateway connection.

Figure 2 This figure shows the simple breakdown of a WSN. The blue circles represent the
sensor nodes which collect data from the environment. Data is received at cluster heads
represented by green hexagons which in turn is connected to a gateway.

Some of the challenges for these systems are:


 Reliability:
WSNs are wireless networks and are therefore vulnerable to problems like
packet loss. Nevertheless, they are used in areas such as forests, mountains, sea etc.
and for various applications such as temperature and precipitation detection, in which
these problems could easily lead to serious catastrophe.

Besides WSNs should be able to function seamlessly without any human intervention
as it not viable to involve human support in harsh environment.

 Power Consumption:
The nodes of Wireless Sensor Networks are usually battery powered because
of their size. This limits the lifetime of a sensor node and raises the topic of energy-
efficiency in all aspects.

 Node size:
Miniaturization is the keyword in many studies about WSNs. Developing
smaller nodes, with the same or even more efficiency than bigger nodes is a

National Institute of Technology, Warangal Page 4


challenge. Besides these nodes should be made in such a manner that chances of node
failures taking place should be minimum. They should be small in size in order to
allow large scale deployment of sensor nodes in various areas like sea and forests and
should be able to deploy the nodes from an aircraft as well.
 Mobility:
Many applications urge the factor mobility into WSN challenges. For
example, commercial applications, like vehicle tracking, need networks that are able
to constantly change its routing paths and infrastructure.
 Privacy and Security:
Unlike wired channels, wireless channels are accessible to both, legitimate and
illegitimate users. Therefore, several methods, like encoding the traffic, have to be
discussed.

2.2 Working
Wireless Sensor Networks forms a class of special wireless ad hoc networks. A
wireless ad hoc network is a collection of wireless nodes that communicate directly over a
common shared medium. Therefore, every node is equipped with a wireless transceiver and
has to be able to act as a router, to process packets and to transmit data to its destinations.
The main difference between common ad hoc networks and Wireless Sensor
Networks is their area of application. For WSNs, the focus is more on monitoring and
collecting data, while common ad hoc networks focus more on the communication aspects.
2.2.1 Sensor node

Figure 3 A Sensor Node and its Components are exhibited in the figure. These components
gather process and transmit data and are internally linked by an operating system.

National Institute of Technology, Warangal Page 5


Sensor node is a node in a wireless sensor network that is capable of performing some
processing, gathering sensory information and communicating with other connected nodes in
the network.

There are several hardware components that make up a typical sensor node:
1) Low-power embedded processor:
The computational tasks on a WSN device include the processing of both locally
sensed information as well as information communicated by other sensors. Currently,
primarily due to economic reasons, the embedded processors are often substantially
limited in terms of computational power (small MHz area). Due to the constraints of such
processors, devices typically run specialized component-based embedded operating
systems, such as TinyOS. They incorporate advanced low-power design techniques, such
as sleep modes and dynamic voltage scaling to provide energy savings.

2) Memory/storage:
In the storage, both, program memory (memory for the instruction set of the
processor) and data memory (for storing measured data and other local information, e.g.
the location of the node) are included. The size of the memory is often limited due to
economic reasons. With the ongoing price-reduction of memory devices, the quantities of
storage and memory used on sensor nodes increase over time.

3) Radio transceiver:
WSN devices include a low-rate, short-range wireless radio (10–100 kbps, <100m).
While currently quite limited in capability too, these radios are likely to improve in
sophistication over time – including improvements in cost, spectral efficiency, tunability,
and immunity to noise, fading, and interference. Radio communication is often the most
power-intensive operation in a WSN device, and hence the radio must incorporate
energy-efficient sleep and wake-up modes.

4) Sensors with ADC unit:


WSN devices usually support only low-data-rate sensing, because of the limitations of
energy and bandwidth. In many applications, multi-modal sensing is necessary, resulting
in the fact, that every device could have multiple sensors implemented. Which specific
sensors are used, is application-based. The Analog-to-Digital Converter Unit translates
National Institute of Technology, Warangal Page 6
the analog signals, provided by the sensors, to digital signals, that can be processed by the
processor unit.

5) Location finding system:


To analyze the measured data, in many WSNs it is important to know in which
location, the data was monitored. But unfortunately, only a few applications allow the
designer to pre-configure the location of the sensor nodes. Particularly for randomly
deployed WSNs, which are used, for example, for outdoor operations, location finding
systems, normally based on satellite GPS, have to be implemented.

6) Power Source:
Usually, the power source is a small battery. The finite battery power is likely to be
the bottleneck in most WSN applications. However, in some applications, a couple of
nodes may be wired to continuous power source or energy harvesting techniques may
provide a small amount of renewed energy.

Figure 4 The schematic diagram of the components in a Sensor Node is shown here. All the
connections between components which were discussed earlier are shown.

2.2.2 NETWORK TOPOLOGY

The most common architecture followed in WSNs is the two-tier hierarchical cluster
architecture. In this topology, the nodes within a particular region collect data from the

National Institute of Technology, Warangal Page 7


environment and transmit it forward to a specific node called cluster head. This cluster head
forms a network with other cluster heads that are covering different regions. In this network,
the cluster heads of tier 2 could send their data to a new cluster head that covers these tier 2
cluster heads and forms another network with other cluster heads, and then finally send their
data to the gateway. The advantage of this hierarchical structure is that it separates a large
network into several zones of interests within which routing can be performed.

Figure 5 Two tier hierarchical architecture followed by WSN is shown in this figure. The 1st
tier consists of sensor nodes grouped in form of clusters whereas the 2nd consists of cluster
heads.

National Institute of Technology, Warangal Page 8


CHAPTER 3 MAC ROUTING PROTOCOLS

3.1 INTRODUCTION

Networking unattended sensor nodes may have profound effect on the efficiency of
many military and civil applications such as target imaging, intrusion detection, weather
monitoring, security and tactical surveillance, distributed computing, detecting ambient
conditions such as temperature, movement, sound, light, or the presence of certain objects,
inventory control, and disaster management.
Wireless Sensor Networks are a class of wireless ad hoc networks that pose unique
design challenges for their developers. The sensor nodes are normally battery-powered and
therefore their lifetime is limited. Typically, these batteries also cannot be changed. Since
energy is a valuable resource in WSNs, energy-efficient routing is one of the most important
aspects of increasing the life span of sensors.

One of the factors, of energy-efficient routing, is the strategy of picking a route between two
nodes.
The challenges for the strategy are:
1) Number of transmissions:
The number of transmissions until a packet reaches its destination should be as small
as possible due to the fact that every transmission between two nodes uses energy. If the
strategy minimizes the re-transmissions, it will also minimize the energy consumption.
2) Balanced use of nodes:
The use of the nodes for the routing has to be balanced between all the nodes. If some
nodes are used distinctly more than others, their battery-power will decrease faster and
will expire sooner. Too many dead sensor nodes could result in a partition of the network,
which would make communication impossible.
3) Delay:
For many applications of WSNs, it is important that the delay of the transmission is
not too big. It is desirable, that the strategy comes to a compromise between overhead and
delay.
4) Balancing the previous aspects:
The routing strategy has to be aware of the energy resources that are left and has to
balance all the previous aspects to produce the best possible solution.

National Institute of Technology, Warangal Page 9


3.2 Sources of energy wastage
With reference to our project, we made sure energy is not utilized in a manner which leads to
unnecessary wastage of power since in WSN the sensor node runs on limited power supply.
Hence it’s imperative that we know about the sources of energy wastage.

So the major sources of energy wastage are:

Collision: A collision can occur when a node receives two signals or more simultaneously
from different sources that transmit at the same time. This leads to corruption of data packets
at the receiver. Hence the transmitter got to send the packet again. Collision can be removed
in schedule-based MAC protocols however; it is a concern issue in contention-based
protocol.
Idle listening: A node doesn’t know when will be receiving a frame so it must maintain
permanently its radio in the ready to receive mode, as in the wireless network protocol (IEEE
802.11). This mode consumes a lot of energy, nearly equal to the one consumed in receipt
mode.

Overhearing: This happens when a node receives packets that are not destined for it or
when a redundant broadcast takes place.

Control packet overhead: The RTS/CTS (Request to Send /Clear to Send) used by some
protocols transport no information whereas their transmission consumes energy. Note that the
traffic generated by control frames in sensors network is far from being negligible, it could
represent until 70% of the global traffic. Hence it shows energy wastage due to control packet
overhead is not less in magnitude.

3.3 MAC protocol


A medium access control (MAC) protocol coordinates actions over a shared channel.
The most commonly used solutions are contention-based. One general contention-based
strategy is for a node which has a message to transmit to test the channel to see if it is busy, if
not busy then it transmits, else if busy it waits and tries again later. After colliding, nodes
wait random amounts of time trying to avoid re-colliding. If two or more nodes transmit at
the same time there is a collision and all the nodes colliding try again later. Many wireless
MAC protocols also have a sleep mode where nodes not involved with sending or receiving a

National Institute of Technology, Warangal Page 10


packet in a given timeframe go into sleep mode to save energy. Many variations exist on this
basic scheme.
In general, most MAC protocols optimize for the general case and for arbitrary
communication patterns and workloads. However, a wireless sensor network has more
focused requirements that include a local unicast or broadcast, traffic is generally from nodes
to one or a few sinks (most traffic is then in one direction), have periodic or rare
communication and must consider energy consumption as a major factor.
An effective MAC protocol for wireless sensor networks must consume little power,
avoid collisions, be implemented with a small code size and memory requirements, be
efficient for a single application, and be tolerant to changing radio frequency and networking
conditions.

3.3.1 IEEE 802.11


The IEEE 802.11 DCF protocol works in two different modes: infrastructure mode
and ad hoc mode. In infrastructure mode communication between modes passes through a
central node, while in ad hoc mode nodes communicate directly with each other.
Infrastructure mode is the mode followed by sensor network clusters, in which sensors within
a cluster communicate directly with their cluster head. On the other hand, the
communications between gateways follow the ad hoc mode.
The widely used standardized IEEE 802.11 distributed coordination function (DCF) is
an example of the contention-based protocol. While studying the IEEE 802 DCF, we can see
that the binary exponential Back off (BEB) mechanism is used for resolving packet collisions
that occur as the sensor nodes contend for the transmission channel. To ensure packet
transmission reliability and signal fidelity, MAC acknowledgment (ACK) frames are used to
indicate the correct reception of the data packets at the receiving nodes. When a node does
not receive a corresponding ACK frame, it assumes the packet has been dropped due to
collision, and invokes the BEB mechanism for retransmission [6].
The standard BEB of IEEE 802.11 degrades significantly the network performance in
noisy environments. The problem with the IEEE 802.11 is that the standards were developed
with no energy minimization mechanisms taken into consideration, which are required in a
WSN.

National Institute of Technology, Warangal Page 11


3.3.2 TDMA (Time Division Multiple Access) protocol
Time-division multiple access (TDMA) [11] is a scheduled-based MAC protocol in
which the channel is divided into several time slots. Each node is assigned a time slot. The
node wakes and transmits data only in their allocated time slots and remains in sleep mode
otherwise.
Conventional TDMA MAC protocols are used to prevent collisions by fixing
individual time slots for each node. It also reduces energy consumption as all nodes are in
sleep condition except for the transmitting nodes. Hence, TDMA protocol is a suitable choice
for sensor networks. However, this protocol is suitable for a network with heavy traffic load.
The energy-efficient TDMA reduces energy consumption due to idle listening. Sensor nodes
keep their radios off when there is no data to transmit. The cluster head has to keep its radio
on during all the timeslots in readiness to collect data from the nodes it serves. Hence, the
cluster head does not use its energy efficiently as it wastes energy in its idle time.
Thus, the main and most important advantage of TDMA over CSMA is low power
consumption. Also, TDMA achieves better channel utilization as the number of nodes is
higher, which is more in tune with the WSN characteristics.
TDMA shows high latency and overhead associated with synchronization between
nodes and it also introduces early sleeping problem which is a serious issue in a WSN.
TDMA doesn’t adapt well to network change, which is a quite frequent phenomenon in
sensor networks due to node failure. Synchronization problems can lead to high latency and
power consumption caused by interference from overlapping schedules.

3.3.3. PAMAS (Power Aware Media Access Sensing) Protocol


The PAMAS protocol is a combination of the original MACA protocol and the idea of
using a separate signaling channel. Here we can see that the RTS-CTS message exchange
will take place over the signaling channel that is separate from the channel used for packet
transmissions. This separate signaling channel enables nodes to determine when and for how
long they can remain in the idle state.
In order to conserve power and extend the operational lifetime of the nodes, the
PAMAS protocol requires nodes to shut them off if they encounter overhearing. A node
knows if a neighbor is transmitting because it can hear the transmission. Likewise, a node
(with a non-empty transmit queue) knows if one or more of its neighbors is receiving because
the receivers transmit a busy tone when they begin receiving a. Thus, a node can easily
decide when to power off [5].
National Institute of Technology, Warangal Page 12
3.3.4. TRAMA (Traffic Adaptive Medium Access Protocol) protocol
TRAMA [8] is a TDMA-based algorithm and proposed to increase the utilization of
classical TDMA in an energy efficient manner. It is similar to Node Activation Multiple
Access (NAMA), where for each time slot a distributed election algorithm is used to select
one transmitter within two-hop neighborhood. This kind of election eliminates the hidden
terminal problem and hence, ensures all nodes in the one-hop neighborhood of the transmitter
will receive data without any collision.
The Traffic Adaptive Medium Access Protocol (TRAMA Protocol) tries to minimize
power consumption by synchronizing the transmitter as well as the receiver. To be as energy
efficient as possible TRAMA let nodes go to sleep when no node is sending data, and also
when a node is not the intended receiver of the sender. Besides, if a node has no information
to send, it will give up its slot, so other nodes may send.
Looking at all the above protocols we saw that they are not completely suitable to be
implemented in a WSN. Hence for this project we did our work implementing S-MAC
(Sensor Media Access Control) protocol which will be discussed in detail in the next chapter.

National Institute of Technology, Warangal Page 13


CHAPTER 4 S-MAC Protocol

4.1 INTRODUCTION
The S-MAC protocol (Sensor MAC) is a protocol specifically designed for usage in
Wireless sensor networks and is designed by Wei Ye. S-MAC is a contention-based protocol,
designed to reduce energy consumption from the sources of energy loss: idle listening,
collision, overhearing and control overhead. Periodic sleep technique is used in this protocol
to achieve low duty cycle that reduces energy consumption significantly. It uses virtual
carrier sense technique to reduce collision avoidance and in-channel signaling to implement
overhearing avoidance. S-MAC fragments the long message into many small parts and
transmits them in burst to reduce contention and communication overhead.
It is a stable MAC protocol used specifically for the WSN. S-MAC reduces energy
consumption by allowing the nodes to periodically turn off their radio receivers (and any
other resources that have no work to do) and enter a low power sleep state. The duty cycle of
a node is the ratio of the time it is active (i.e. not in the sleep state) to the total time. The
lower the duty cycle, the lower is the power consumption of a sensor node. In S-MAC the
channel access is done using a scheme similar to the IEEE802.11 distributed coordination
function. However, unlike the IEEE 802.11 MAC protocol, the intervals during which
contention can occur are scheduled. S-MAC, therefore, combines the features of both
contention based as well as time scheduled protocols. Even though the contention interval in
S-MAC is scheduled, S-MAC requires much looser time synchronization than TDMA based
protocols. Furthermore, S-MAC does not suffer from the limited scalability generally
associated with TDMA schemes [9].

4.2 Working

S-MAC carries out energy conservation by making the nodes to periodically listen for
any communication for a short interval and then allowing them to sleep; if and only if the
node is not involved in data transmission, for the rest of a pre-determined duration (a frame).
The listen interval and the sleep interval for a node occur according to a schedule which can
of its own or it follows a schedule of another node. S-MAC follows a mechanism which
enables the nodes to learn the sleep schedules of the nodes in their neighborhood, and using

National Institute of Technology, Warangal Page 14


this knowledge they communicate with their neighbors. For successful communication, a
transmitting node must transmit when the intended receiver is not sleeping.
The duty cycle of the sleep schedule of a node determines the base rate of energy
consumption. The base rate is the energy consumption rate when the node is in its sleep state.
The actual power consumption depends on the data traffic at the node. In a wireless sensor
network using S-MAC, some nodes may, however, have to wake up and listen more often
than the other nodes. Since all nodes may not have the same duty cycle, some nodes may
consume their energy faster and die earlier. This reduces the average life of the WSN nodes,
and hence reduces the average useful life. This non-uniform life span of the nodes eventually
creates region within the WSN which do not have any kind of sensor coverage and this
adversely affects the network connectivity.

Basic Scheme: Periodic Listen and Sleep


Instead of having a 100% duty cycle, a WSN following SMAC protocol periodically
goes to sleep having only a timer working which maintains the schedule and switches the
nodes on and off when the timer decrements to 0

Figure 6 Basic Scheme of SMAC protocol is shown here. The entire lifetime of a WSN
consists of active and sleep time intervals which takes place one after another.

The S-MAC protocol’s main focus is to keep the active state of a node to a minimum. It
accomplishes this in various ways:
 Scheduling.
 Collision avoidance.
 Overhearing avoidance.
 Message passing.

4.2.1 Avoidance of collisions


In S-MAC the nodes conserve energy by sleeping (i.e. turning off their receivers and
any other hardware resources which are not required while the node is in the sleep state), and
wake up periodically to listen and check if any of its neighbors want to communicate with it.

National Institute of Technology, Warangal Page 15


The duration of the listen interval and the sleep interval are fixed in a system according to the
application requirements. A listen interval followed by a sleep interval comprises a frame [9].
The node which needs to send data begins the transmission procedure during the
Listen interval of the receiver, and then continue the data transfer during the time that
normally is the sleep interval. Other nodes go back to sleep turning their radios off, and thus
are able to avoid overhearing and idle listening [10].

Figure 7 SMAC Frame is shown in detail here. Here the listen interval consists of SYNC
pulse used for synchronization between two nodes, RTS and CTS pulses used for contention
purposes.

The listen interval is divided into three sub-intervals. Two of these intervals are used for an
exchange of RTS and CTS control frames to avoid the hidden terminal problem in the way the
RTS-CTS exchange is used in the IEEE 802.11 MAC protocol. The protocol uses both
physical and virtual carrier sensing for collision avoidance.
In virtual carrier sensing, the RTS and CTS frames carry a time field indicating the
remaining duration of the transmission of the message. The node records this value in a
variable called the network allocation vector (NAV) and sets a timer for it. The node
decrements the NAV value until it reaches zero. When a node has data to send, it first looks
at the NAV. If its value is not zero, the node determines that the medium is busy and goes
back to sleep

4.2.2 SCHEDULING
Since the nodes periodically sleep with their radios turned off, a node must know the
listen and sleep schedule of a neighbor with which it wishes to communicate. Nodes
exchange their schedules by periodically broadcasting a special control frame, the sync frame.
The protocol requires each node to broadcast a sync frame at least once in a predetermined

National Institute of Technology, Warangal Page 16


synchronization period. A node builds a table of the schedules of its neighbors by listening to
the sync frames [10].

4.2.2.1 Choosing a schedule


Sync frames also enable a node to choose its schedule when it starts. The procedure
outlined below is followed by the S-MAC nodes for choosing its schedule and for
constructing the table of schedules of its neighbors[9].A node first listens to the broadcasts in
its neighborhood for a pre-determined duration which is at least as long as the
synchronization period. If it does not hear a valid sync frame (containing a schedule from a
neighbor), it randomly chooses a schedule for itself and starts following it. The node also
broadcasts a sync frame to announce its schedule.
1. If the node receives a schedule from a neighbor before it has chosen or announced a
schedule on its own, it adopts the received schedule and starts following it. The node
Announces this schedule as its own schedule by broadcasting a sync frame during its next
Scheduled listen time.
2. If the node receives a different schedule after it has chosen and announced a
schedule, there are two cases to consider:
a) If the node has no other neighbor, it discards the previously chosen schedule, and
Starts following the new schedule.
b) If the node already follows a schedule with one or more neighbors, it starts waking
up at the listen interval of the newly received schedule, in addition to following the
earlier schedule.

Once a node has chosen a schedule using the procedure described above, it continues to
broadcast this schedule in a sync frame at least once in a synchronization period.

National Institute of Technology, Warangal Page 17


Figure 8 Synchronization of schedules between two nodes is shown here. Above figure shows
the timing relationship of three possible situations that a sender transmits to a receiver. CS
stands for carrier sense. In the figure, sender 1 only sends a SYNC packet. Sender 2 only
wants to send data. Sender 3 sends a SYNC packet and a RTS packet.

4.2.2.2 Maintaining a schedule

The listen/sleep scheme requires synchronization among neighboring nodes. Although


the long listen time can tolerate fairly large clock drift, but in order to prevent long time clock
drift neighboring nodes still need to periodically update each other their schedules.
Updating schedules is accomplished by sending a SYNC packet. Receivers will adjust
their timers immediately after they receive the SYNC packet. A node will go to sleep when
the timer fires [10].

4.2.3 Message passing

S-MAC has an efficient method which it follows in order to pass large messages
around the network. Large messages that are transmitted as one large packet are inefficient as
this has a huge probability of failure in noisy environments. If packets are fragmented the
chances of failure are smaller, but this increases the control overhead as each packet needs a
RTS CTS packet. SMAC works around this by sending "bursts" of data using only one RTS
CTS pair. There is a possibility of a new node entering the range of the transmitting node and
this scenario might disrupt the current transmission. This way the node knows that a
transmission is in progress and will remain silent. Nodes on waking up will expect a clear

National Institute of Technology, Warangal Page 18


channel and this will detect this condition of time extension by detecting the
acknowledgements or data fragments (these both contain duration information) [7].

4.2.4 Overhearing Avoidance


In 802.11 each node goes to listen to all the transmissions from its neighbors in order
to perform effective virtual carrier sensing. As a result, each node overhears a lot of packets
that are not directed to it. This is a significant waste of energy, especially when node density
is high and traffic load is heavy.
S-MAC protocol tries to avoid overhearing by letting interfering nodes go to sleep
after they hear an RTS or CTS packet. Since DATA packets are normally much longer than
control packets, the approach prevents neighboring nodes from overhearing long DATA
packets and the following ACKs (acknowledgements).

Figure 9 Overhearing Avoidance is shown using the above figure. In the above figure 9, A,
B, C, D, E, and F forms a multi-hop network where each node can only hear the
transmissions from its immediate neighbors.

Node A is currently transmitting a data packet to B. Node D should go to sleep since its
transmission interferes with B’s reception. Node E and F do not produce interference, so
they do not need to go to sleep. C is two-hop away from B, and its transmission does not
interfere with B’s reception, so it is free to transmit to its other neighbors like E. However, C
is unable to get any reply from E, e.g., CTS or data, because E’s transmission collides with
A’s transmission at node C. So C’s transmission is simply a waste of energy [4].

4.3 Causes of Latency

Various kinds of delays contributing to latency


Carrier sense delay
Determined by the contention window size

National Institute of Technology, Warangal Page 19


Back off delay
Because the node detects another transmission or the collision occurs
Transmission delay
Determined by channel bandwidth, packet length and the coding scheme adopted
Propagation delay
Determined by the distance between the sending and receiving nodes.
Processing delay
Depends on the computing power of the node and the efficiency of in-network data
processing algorithms.
Queuing delay
Depends on the traffic load.

The above kinds of delays are common to S-MAC as well as IEEE802.11.

Sleep delay
This is an extra kind of delay in S-MAC caused by the nodes periodic sleeping.

A complete cycle of the listen and sleep is called a frame.

The average sleep delay on the sender is

Ds = Tframe/2 (1)
Where,
Tframe = Tlisten + Tsleep (2)

and, Tlisten = TRTS + TCTS (3)

The relative energy saving in SMAC is:-

Es =Tsleep/Tframe
=1- (Tlisten/Tframe) (4)

So from equation 4 we can see, lesser the duty cycle more is the energy saving.

National Institute of Technology, Warangal Page 20


CHAPTER 5 ADAPTIVE SMAC PROTOCOL

5.1 INTRODUCTION

In the earlier chapter we have studied SMAC protocol in detail and also have shown
the advantages SMAC protocol gives over the other MAC protocols. Even then we have seen
that the S-MAC protocol can only be implemented provided a trade-off is made between the
energy used for throughput and the latency. The throughput is reduced because only the
active part of the frame is used for communication. The latency is increased because a
message generating event may occur during the sleeping part. In this case, the message will
be queued until the start of the next active part.
To solve this problem, the ASMAC (ADAPTIVE SMAC) protocol was proposed.
ASMAC, which adds flexibility to S-MAC's duty cycle, can be adapted to the network traffic
state. A node will keep listening, and potentially transmitting, as long as it is in an active
period. Therefore, ASMAC is more energy efficient than S-MAC [2].

Figure 10 Example of SMAC protocol’s unnecessary active intervals are shown in the
above figure. Looking at the above figure we can see that S-MAC has unnecessary active
intervals. When burst messages are generated in part A and there are no messages in parts B
and C, unnecessary active intervals occur which decrease the energy efficiency.

National Institute of Technology, Warangal Page 21


5.2 WORKING

5.2.1 Adaptive SMAC Algorithm

Adaptive S-MAC is a protocol that dynamically changes the entire frame size by
adjusting the network frame states. The fundamental idea is to decide whether the interval is
to be spent in the active or sleep state by means of a two bit flag that records the data
generation, transmission and reception. In adaptive S-MAC, if the flag value is 0, in the next
active interval the node will sleep and when the flag value changes to 1 in this sleeping active
interval, in the next active interval node wakes up and can sense the messages. [3].

Figure 11 Basic working of AS-MAC protocol is shown. The figure 11 signifies that the
active interval is determined by the flag value. If the flag value is 0 in the previous active
interval, during the next active interval, node follows its sleeping schedule. On the other
hand, if the flag value is 1, then the next active interval has an active schedule [3].

. In the case where no message is generated, as in the case of Frames A, B and D, the
entire frame length is prolonged, whereas in the case where a message is generated, as in the
case of Frame C, the frame interval is reduced. In this manner, adaptive S-MAC can
dynamically control the entire frame length according to the network traffic state.

5.2.1.1 Improvement to the AS-MAC

The above proposed adaptive S-MAC protocol is useful when the data rate is moderate or
low. The adaptive S-MAC gives better power conservation with increased latency due to the
lower duty cycle used when traffic load is low. In the lifetime of a WSN, during certain time
period, when the activity of the environment increases, the rate of the fundamental S-MAC

National Institute of Technology, Warangal Page 22


may not be enough to sense the high traffic environment and transmit all the data. So the
situation demands the WSN network to have higher active time during this period. So we
propose a more flexible S-MAC protocol which takes care of this problem.

Henceforth in this report wherever AS-MAC protocol is mentioned, it will denote the
improved AS-MAC protocol proposed by us.

Figure 12 Moore state machine diagram for the AS-MAC protocol I shown in the given
figure. The above figure 11, the Moore machine has 5 states based on network traffic. Here 1
denotes the data being sensed by a WSN node and 0 data not sensed by the WSN in its active
period. The states are based on the duty cycles. The frame length of the WSN node depends
on the current state.

State Frame Length Flag Range


A,B 2T 00(0) to 11(3)
C,D T 00 to 01(1)
E T/2 00(0)

Table 1

National Institute of Technology, Warangal Page 23


In state C, D the WSN node has the frame length of an S-MAC protocol. The WSN
fundamentally has the duty cycle of S-MAC protocol. The states are chosen based on the
traffic load.
In state A and B the two bit flag ranges from 00 to 11 i.e. from decimal 0 to 3.The
flag value increments with every pulse .When it is 11 that means the next state is going to be
active with flag value 00,rest all are sleeping states.
In states C and D the flag ranges from 00 to 01.The frame size here is half that of in
states A and B. Here if flag is 01 it means next state will be active.
In state E the flag remains in 00 values, with 00 means the WSN node will be active
during next pulse.

Figure 13 Scenario 1 of AS-MAC protocol is shown. We can see that at state A when there’s
incoming data the node moves into state B and at this particular state if no data is received ,
then node moves back to state A.

Figure 14 Scenario 2 of AS-MAC protocol is shown. Here we see that the node moves all the
way into state C from state A, following the Moore state machine diagram. At state C it
doesn’t receive any data. So it moves back into state A.

National Institute of Technology, Warangal Page 24


Figure 15 Scenario 3 of AS-MAC protocol is shown. According to the state diagram if the
node enters state C, it can move into state D and on not receiving any data it changes to state
C. On the other hand if it receives data in state D it moves into state E and will stay there as
long as data keeps on coming in. and when the steady stream of data stops coming in the
node moves back into state C from E.

5.2.2 Synchronization

When the node synchronizes with its neighbors, AS-MAC operates just like SMAC
protocol. Especially, when the SYNC packets are sent to the neighbors or the cluster head,
they contain the schedule .A node fundamentally stays in state A or has largest frame length.
But that does not matter because as soon as it gets SYNC packet from its neighbor it starts
following the schedule contained in the SYNC packet [3].

Figure 16 Synchronization of AS-MAC protocol is shown here. In the above figure it can
be seen that B has a different duty cycle and also has a clock drift with respect to A. So when
A is looking to communicate with B it sends a SYNC packet containing its schedule. B
updates its schedule upon receiving it.

National Institute of Technology, Warangal Page 25


5.2.3 Operation with neighbors

Figure 17 Operation of a node with its neighbors following AS-MAC protocol is seen here.
The figure shows the schedules of the neighbor nodes in the case of transmission, after
synchronizing with the neighbors.

In State 1, node 3 sends a RTS packet to node 2 requesting permission to transmit. If node
2 is ready to receive the messages, it sends a CTS packet to node 3. As in State 2, nodes 2 and
3 send and receive DATA and ACK packets to each other. At this time, nodes 2 and 3 follow
the same schedule with their corresponding flag values and while staying in the same states,
so nodes 2 and 3 function using half or double of their usual frame size. In this situation,
nodes 1 and 4 enter sleep mode, because of the duration in the header of nodes 2 and 3's
DATA and ACK packets. As a result, nodes 0 and 5 don't send or receive messages and
maintain an established frame length.

5.3 Protocol Analysis


In front of experimenting S-MAC and adaptive S-MAC, we analyze the performance of the
AS-MAC protocol, and compare it with that of the S-MAC protocol. Following delays have
been considered.
Carrier sense delay
The latency incurred due to the carrier sensing procedure when a sensor contends for
the channel. We denote the average value of carrier sense delay by Tics, which is
determined by the contention window size.
Transmission delay
The transmission time is related to the channel bandwidth, packet length. Therefore,
we assume a fixed packet length as mentioned in the table (GIVE TABLE NUMBER
FOR SIM PARAMETERS) and denote the transmission delay by Ttx.

National Institute of Technology, Warangal Page 26


Propagation delay
It is determined by the distance between the sending and receiving nodes. It has been
ignored in the simulation as it is negligible.
Processing delay
It depends on the computing power of the node and the efficiency of in-network data
processing algorithms.
Back off delay
It is the delay incurred when a collision occurs while trying to send the data. It is
denoted by Tb .
Sleep delay
The latency incurred due to the periodic sleeping of each sensor. The latency incurred
by the periodic sleeping algorithm is denoted as Ts in this context. This contributes
most to the delay and hence the latency. It depends upon the frame length mentioned
below.

Frame length: We denote the entire frame length by Tf.


We look at the latency for a packet transmission between two neighboring nodes that are one
hop away from each other. We have ignored propagation delay and the processing delay.

5.3.1 Latency of S-MAC

When a node sends to its neighboring nodes using the S-MAC protocol, it takes
carrier sensing time and latency by the end of the sleep interval. Therefore, we can obtain the
latency of a single-hop communication experienced in the network as follows:

D= Tcs + Ttx + Ts+Tb

The sleep delay is a random variable from (0, Tf).Therefore the expression for average
delay of S-MAC is
E(D)= E(Tcs + Ttx + Ts)

= Tcs + Ttx + Tf /2 +Tb

National Institute of Technology, Warangal Page 27


5.3.2 Latency of AS-MAC

For Adaptive S-MAC, as described above, we assume three duty cycle levels. Let pl,
p2 and p3 denote probabilities that Tf /2, Tf and 2 Tf are the adjusted duty cycles in
algorithm, respectively. We have

E(D)= E(Tcs + Ttx + Ts)

= Tcs + Ttx +Tb+ Tf(p1+2p1+4p3)/4


Depending on the values of p1, p2 and p3, the latency of AS-MAC can be less or more than
S-MAC. These probabilities depend on the activity of the WSN.

National Institute of Technology, Warangal Page 28


Chapter 6. SIMULATION

6.1 Simulation Configuration


Simulation parameters have been taken from wireless sensor nodes, Motes, developed by
University of California, Berkeley [13]. The mote has a 8-bit Atmel AT90LS8535
microcontroller running at 4 MHz. It has a low power radio transceiver module TR1000 from
RF Monolithics, Inc [14], which operates at 916.5 MHz frequency and provides a
transmission rate of 19.2 Kbps. The mote runs on a very small event-driven operating system
called TinyOS [15].The WSN has been implemented in single cluster two hop network using
OMNeT++ software. We have simulated a hierarchical topology WSN with a single cluster.
The cluster head has all the nodes in its range and is aware of the schedules of other nodes.

Simulation Parameters

Parameter Value

Channel Bandwidth 20kbps


Average data packet size 50 Byte
RTS,CTS,ACK size 30 Byte
Reception Power 13mw
Transmission Power 24.75mw
Idle Power 13mw
Sleep Power 15µw
Transmission Range 250m
Battery power 1.6 Joules

Table 2
The simulation parameters can vary with hardware aspects of the WSN nodes.
Depending on requirement and resources we can have different battery power, bandwidth etc
parameters.The purpose of the simulation is to compare between S-MAC and A-SMAC with
same parameters for both. The functionality of the protocol is more important than the
numerical values of parameters and results. If the protocol simulation gives desired results it
should definitely work for other simulation parameters also.

National Institute of Technology, Warangal Page 29


6.2 Simulation Results for S-MAC protocol

6.2.1 Variation of Residual energy with time


Energy VS Time curve for SMAC and 802.11 MAC protocol
1600

1400

SMAC

1200
Avereage Energy left in the nodes(millijoules)

1000

Without SMAC

800

600

400

200

0
0 20 40 60 80 100 120 140 160
Time of Simulation

Figure 18

Figure 18 compares the energy efficiencies of SMAC with IEEE 802.11 protocol.
By 100 second the battery power of IEEE 802.11 is exhausted but S-MAC nodes still
have a lot of residual energy left. From the graph above it can be seen that the energy
efficiency of S-MAC is more than 10 times that of IEEE 802.11.The time of exhaustion
for 802.11 can vary with the simulation parameters but the network employing 802.11
will always die before a WSN using S-MAC protocol.

National Institute of Technology, Warangal Page 30


6.2.2 Transmission rate variation with Duty Cycle

2.5

No. of Packets per unit time

1.5

0.5

0
0 10 20 30 40 50 60 70 80
Duty Cycle Percentage

Figure 19
Figure 19 is a plot of number of packets sent against the duty cycle. We can get an
idea about the latency of the WSN from this curve. This curve also shows the tradeoff
between duty cycle and the latency. As we increase the duty cycle more packets are sent
hence less the latency whereas as we move towards the right less packets are sent
indicating more latency. So lesser the duty cycle or time of listening, more is the power
conservation but latency performance depletes.

6.2.3 Variation of Residual Node percentage with time


Residual Nodes Vs Time
120

100

80
Percentage of Nodes Alive

60

40

20

0
0 100 200 300 400 500 600 700 800 900 1000 1100
Time of simulation in milliseconds

Figure 20

National Institute of Technology, Warangal Page 31


Figure 20 is a plot of the lifetime of the network. A thirty node WSN has been simulated
with simulation parameters mentioned above. This curve is subjective to various conditions
like the geographical distribution of the nodes and the activity in the area employing WSN.
The important observation we can make is that almost all the nodes have survived till 80% of
the WSN lifetime. It goes to show good synchronization among the neighboring nodes. The
shape of the above curve heavily depends on the state of the WSN. So we cannot standardize
this as the way the WSN dies. This is just one of the ways.

6.3 Simulation of ASMAC protocol


6.3.1 Power Consumption Comparison

Figure 21

The curve is a plot of average power consumption of a node against packets per unit
time. The x axis shows the activity of the network. When the packets are less frequent the
AS-MAC adapts to lower frame length and hence the power consumption is much lesser than
the S-MAC. As packets per unit time increases, the frame length also increases and so is the
power consumption. Since a WSN is mostly inactive during its life time so we can say that
power conservation is more as compared to S-MAC. The power consumption is significantly
higher when activity is higher than about 15 packets per unit time. Though this should be
looked at qualitatively, as the values will differ with hardware and environment .When the

National Institute of Technology, Warangal Page 32


WSN is less active the performance of A-SMAC is significantly better than S-MAC with a
fixed duty cycle.

6.3.2 Packet loss analysis

Figure 22

One of the primary objectives for implementing AS-MAC was to prevent loss of data.
The AS-MAC performs remarkably better than S-MAC here. With packet loss of AS-MAC
and S-MAC being almost same when packets are less frequent the packet loss of S-MAC
increases at a greater rate than that of AS-MAC. S-MAC finds it difficult to keep up with the
messages generated. It may be possible that at very high rate even AS-MAC will show high
packet loss. This is particularly useful when WSN is deployed in a very dynamic situation
where different data is generated very frequently. When the same kind of data is generated S-
MAC will do the job as there will be redundancy in data.

National Institute of Technology, Warangal Page 33


6.3.3 Latency Performance

Figure 23
For the latency simulation we have considered carrier sense delay, transmission delay
and sleep delay. The sizes of RTS, CTS and bandwidth gives the carrier sense delay while the
packet size gives the transmission delay. The latency is about 50ms when there is no collision
and when a node looking to send a data doesn’t encounter the cluster head to be busy.
Delays can be categorized into two kinds of delays, the fixed delays and the variable
delays. Carrier sense delay and transmission delay are the fixed delays depending on
contention window size and packet size as well as the bandwidth of the system. The variable
delays are the sleep delay and the back off delay. The listen time is 300 milliseconds. These
delays can be large as the sleep period is in the order of seconds due to focus on power
conservation. So when a collision occurs the node goes to sleep and retransmits after it wakes
up. Longer listening time reduces the latency so when the packets per unit time are low the S-
MAC which has a larger duty cycle gives better latency performance. As the transmission
rate increases the AS-MAC reduces the sleep time enhancing its latency performance. When
The latency starts decreasing after 8 packets per unit time due to collisions and back off
delay. The AS-MAC gives a much lesser latency than S-MAC here. So for the latency aspect,
in a low activity region S-MAC performs better while AS-MAC performs better in a highly
active WSN.

National Institute of Technology, Warangal Page 34


Chapter 7 Conclusion

The simulation of S-MAC protocol gave the expected results with improved energy
conservation, which is the primary issue in a WSN. Also in a WSN following S-MAC
protocol, there is a trade-off between energy efficiency and latency which varies according to
traffic conditions. The AS-MAC protocol when implemented takes care of both unnecessary
energy consumption as well as latency. It adds flexibility to the WSN in a manner not fully
provided by the conventional S-MAC protocol. Besides, ASMAC protocol provides a
solution to the secondary issue of packet loss. For the given simulation parameters the
ASMAC protocol was successfully implemented. Graphs were plotted using the various data
taken from the results of the simulation. Graphs were plotted for variation of power
consumption ,latency performance and packet loss with packets per unit time .From the
above results we can clearly say that ASMAC protocol provides better energy conserving
properties when compared to SMAC protocol.

National Institute of Technology, Warangal Page 35


REFERENCES

[1] John A. Stankovic, “Wireless Sensor Networks”, Department of Computer Science,


University of Virginia, Charlottesville, Virginia, June 19, 2006.

[2] Wei Ye, Member, IEEE, John Heidemann, Member, IEEE, and Deborah Estrin, Fellow,
IEEE, “Medium Access Control With Coordinated Adaptive Sleeping for Wireless Sensor
Networks” , IEEE/ACM TRANSACTIONS ON NETWORKING, VOL. 12, NO. 3, JUNE 2004.

[3] Dae-Suk Yoo, Su-Sung Park, Seung Sik Choi and Se Hwa Park ,“Dynamic S-MAC
protocol for Wireless Sensor Networks based on Network Traffic States”, Proceedings of
APCC, October 2008,Tokyo,Department of Computer Science, University of Incheon.
Dohwa-dong Nam-gu Incheon, South Korea.

[4] Subah Ramakrishnan, Hong Huang, Manikanden Balakrishnan and John Mullen, “Impact
of Sleep in a Wireless Sensor MAC Protocol”, 60th Vehicular Technology ConferenceIEEE
VTS Fall 60th Vehicular Technology Conference IEEE Vehicular Technology Conference
No60, Los Angeles CA, Klipsch School of Electrical Engineering, New Mexico State
University, Las Cruces, USA.

[5]Suresh Singh and C.S. Raghavendra, “PAMAS protocol with signaling for Adhoc
networks”, Oregon State University,Corvallis.

[6] Tamer Nadeem and Ashok Agrawala, “Performance of IEEE 802.11 based Wireless
Sensor Networks in Noisy Environments”, Department of Computer Science, University of
Maryland.

[7] Anton Bilos and David Hardy, “Survey wireless sensor network MAC protocols”,
Technical University of Eindhoven, Eindhoven, The Netherlands.

[8] Ilker Demirkol, Cem Ersoy, and Fatih Alagöz, “MAC Protocols for Wireless Sensor
Networks: a Survey”.

National Institute of Technology, Warangal Page 36


[9] Somnath Ghosh, Prakash Veeraraghavan, Samar Singh, and Lei Zhang ,” Performance
of a Wireless Sensor Network MAC Protocol with a Global Sleep Schedule”, Department of
Computer Science and Computer Engineering, Latrobe University. Melbourne, Australia.

[10] Wei Ye, Member, IEEE, John Heidemann, Member, IEEE, and Deborah Estrin, Fellow,
IEEE, “An Energy-Efficient MAC Protocol for Wireless Sensor Networks”.

[11] Victor Cionca, Thomas Newe and Vasile D˘adˆarlat, “TDMA Protocol Requirements for
Wireless Sensor Networks”, Electronic and Computer Engineering, University of Limerick,
Ireland.

[12] András Varga and Rudolf Hornig .“AN OVERVIEW OF THE OMNeT++
SIMULATION ENVIRONMENT”, OpenSim Ltd. , Budapest, Hungary.
[13] http://www.cs.berkeley.edu/˜awoo/smartdust/.

[14] RF Monolithics Inc., http://www.rfm.com/, ASH Transceiver TR1000 Data Sheet.

[15] Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler and Kristofer Pister,
“System architecture directions for networked sensors,” in Proceedings of the 9th
International Conference on Architectural Support for Programming Languages and
Operating Systems, Cambridge, MA, USA, Nov. 2000, pp. 93–104, ACM.

National Institute of Technology, Warangal Page 37


National Institute of Technology, Warangal Page 38

Das könnte Ihnen auch gefallen