WSN Unit 05
WSN Unit 05
ToOLS
S.1, INTRODUCTION
.TinyOS is des1gned to run on small, wireless sensors. Networks of these sensors
have the potential to revolutionize a wide range of disciplines, fields, and
technologies. Recent example uses of these devices include:
Golden Gate Bridge Safety. High-speed accelerometers collect synchronized
structure of San
data on the movement of and oscillations within the
bridge
Francisco'sGolden Gate Bridge. This data allows the maintainers of the
events such as
to easily observe the structural health of the bridge in response to
possible damage after an
high winds or traffic, as well as quickly assess
maintaining miles
earthquake. Being wireless avoids the need for installing and
of wires.
observe seismicevents
4 VolcanicMonitoring. Accelerometers and microphones
Ecuador. Nodes locally
on the Reventador and Tungurahua volcanoes in
location, and report
compare when they observe events to determine their
long-range wireless
aggregate data to a camp several kilometers away using a
link.
systems
&Datacenter Provisioning. Data centers and enterprise computing
regions
require huge amounts of energy, to the point at which they are placed in
that have low power costs. Approximately 50% of the energy in these systems
goes into cooling, in part due to highly conservative cooling systems. By
installing wireless sensors across machine racks, the data center can
automatically sense what areas need cooling and can adjust which computers do
work and generate heat.
topofthe node has the radio,
5.2| Wireless Sensor Nework Design 4 The 5.3
The bottom, not sensors, and circuitry for the
shown, has the processor
Base station code Gateway code of the Printed
and flash USB connector.
Sensor code
(nesC/TinyOS) (nesC/Tinyos) (Java, C, ..)
part
concerns
Circuit Board (PCB). storage chip. The antenna is
4 Energy
need to be wireless,
domi nat e sensor hardware and
While it is often
small, low-cost, and operate software design. These nodes
poSsible to
panels, periodic battery provide large power
unattended for long periods.
or wall resources,
such as large solar
gateways, doing so to everyreplone acement ,
of hundreds of
power, to small number of
isensors is
Patch of sensors Data sink Gateway Internet
4 Four broad requirements motivate the infeasible.
/Iimited resources: Motes have very design of Tiny OS:
Fig. 5.1. A typical sensor network architecture
Goals of small size, low cost, and limited physical resources, due the
low power
Patches of ultra-low power sensors, running nesC/TinyOS, communicate to oonsist of about a 1-MIPS processor and tens consumption. Current motes
gateway nodes through data sinks. These gateways connect to the larger of kilobytes of storage.
JReactive
Internet. The sheer diversity of sensor network applications means that there are Concurrency: n a typical sensor network application, a node is
many network architectures, but a dominant portion of deployments tend to responsible for sampling aspects of its environment through sensors, perhaps
follow a common one, showm in Figure 5.1 of ultra-low power sensors self manipulating it through actuators, performing local data processing,
organize to form an ad-hoc routing network to one or more data sink nodes. transmitting data, routing data for others, and participating in various
* These sensor sinksare attached to gateways, which are typically a few orders of distributed processing tasks, such as statistical aggregation or feature
magnitude more powerfulthan the sensors: gateways run an embedded form of recognition.
Linux, Windows, or other multitasking operating system. Gateways have an Flexibility: The variation in hardware and applications and the rate of
Internet connection, either through a cell phone network, long-distance innovation require a flexible OS that is both application-specific to reduce
wireless, or wired Ethernet. space and power, and independent of the boundary between hardware and
software.
Antenna Radio Circuitry USB Serial
V Low Power: Demands of size and cost, as well as untethered operation make
low power operation a key goal of mote design. Battery density doubles
roughly every 50 years, which makes power an ongoing challenge.
Sensor Network Programming Challenges:
provide
* Traditional programming technologies rely on operating systems tohardware.
processing, VO, networking, and user interaction
abstraction for
networked embedded systems,
Expånsion Sensors When applying such a model to programming
programmers need to explicitly deal
Such as sensor networks, the application
Connector
synchronization, interrupt handling, and sensor
Fig. 5.2.ATelos sensor produced by
Moteiv With message passing, event
reading.
Tools
BYTE
S.5. CONTIKIOS
ADC CLOCK RPM & ContikiOS 1s open source operating system for
TOSSIM resource constraint hardware
Implementation devices with low power and less memory. It was developed by Adam Dunkels
in 2002. This OS is fully GUIbased system requires only 30 KBROM
and 10
ADC KB RAM. Italso provide multitasking feature and have the built in TCP/IP suit.
Model
The working environments of the WSNs are often energy-limited. This is one of
the most important constraint for WSNs. Likewise, tiny and simple designs of
the nodes are the other constraints. For this reason, WSNs should have some
Fig. 5.9. TOSSIMArchitecture
important hardware and software features to cope with these constraints.
emulator built in Python, a high Contiki OS is one of the convenient solutions to cope with mentioned
4 TOSSIM is a bit-level discrete event network low-powered
readability, and C++. It can run Çonstraints to its flexibility and support of lightweight and
levelprogramming language emphasizing code
Windows.
TOSSIM on Linux Operating Systems or on Cygwin on networks.
Stack
over IPv4, IPv6 and Rime Network
provides open sources and online documents. Developers had
set Contiki can provide communication structure.
4 TOSSIM also 5.10 gives more details for its
bridging. Contiki Network Stack shown in Figure
four requirements for TOSSIM: scalability,completeness, fidelity and operated
severely power-constrained. Battery
4 To be scalable, a simulator should manage networks of
thousands of nodes in a Many Contiki systems are operation and with
years of unattended
provide
TOSSIM is Wireless sensors may need to
wide variety of configurations. To achieve this, each node in replace batteries.
connected in adirected graph where each edge has a probabilistic bit error. little means to recharge or
Toots
5.18 Wircless Sensor Network Design
without
systems on which it runs. The default mechanism for attaining low-power
operation of the radio is called ContikiMAC. With Contiki MAC, nodes can be components: phenomena. A node-level simulator
dealing with the vagaries of actual
running in low-power mode and still be able to receive and relay radio typically has the following
&Sensor node model: A in a
platform, a sensor host, node
messages.
as well as siamulator acts as a software execution
LAYER
Application
PROTOCOL
CoAP/HTTP
designers to focus on the communication terminal. In order for
provides or simulates a application-level code, a node
model typically
communisystemcation protocolIf stack, sensor behaviours
Transport UDP/TCP sensing noise), and operating (e.g.,
Network Layer
Network, Routing IPV6/RPL
nositions and motion properties of theservices.
nodes
the nodes are mobile,
then the
need to be modelled. If
characteristics part of the design
are energy
MACLayer
Adaptation
MAC
6LoWPAN
consumption of the nodes needs to be modelled.considerations, then the power
CSMA A
RDCLayer Duty Cycling ContikiMAC
Commnunication model: Depending on the
may be captured at different layers. The details of modelling, communication
most elaborate
Radio Layer Radio IEEE 802.15.4 communication media at the physical layer, simulating simulators model the
the RF propagation
delay and collision of simultaneous
Fig. 5.10. Contiki Network Stack
transmissions. Alternately, the
communication may be simulated at the MAC layer or network layer, using, for
+ The Contiki programming model is based on protothreads. A protothread is a example, stochastic processes to represent low-level behaviours.
memory efficient programming abstraction that shares features of both 4 Physical environment model: A key element of the environment within a
multithreading and event-driven programming to attain a low memory overhead sensor network operates is the physical phenomenon of interest. The
of each protothread.
environnment can also be simulated at various levels of details. For example, a
* The kernel invokes the protothread of a process in response to an
internàl or moving object in the physical world may be abstracted into a point signal
external event. Examples of internal events are timers that fire or messages
source. The motion of the point signal source may be modelled by differential
being posted from other processes. Examples of external events are sensors that
equations or interpolated from atrajectory profile.
trigger or incoming packets from a radio neighbour.
+ Statistics and isualization: The simulation results need to be collected for
S.6. SIMULATION ENVIRONMENT analysis. Since the goal of a simulation is typically to derive global properties
behaviours is
from the execution of individual nodes, visualizing global
Node-Level Simulators: allow users to easily
extremely important. An ideal visualization tool should the
* Node-level design methodologies are and mobility of the nodes,
usually associated with simulators that Observe on demand the spatial distribution communication routes and
simulate the end-to-end
behavior of a sensor network on a per-node basis. Connectivity among nodes, link qualities,
Using
simulation, designers can quickly study the performance (in terms of spatio-temporal dynamics, sensor readings on cach
timing, delays, phenomena and their battery power).
node lifetime parameters (e.g.,
node, sensor nodes states, and
fools
DE
5.20
Wircless Sensor Nework Desion 4 A cimulator typically requires a global
between nodes or
5.21
Asensor network simulator simulates
the behavior of a subset of the senso. are put in the event queue. All
modules
order. At each eventof queue and sortedevents
passing
4
time is advanced in the their chronological
nodes with respect to time. Depending on how the according to
simulation, there are two types of cxccution models:
removes the first
event (the one withiteration the simulation,
the simulator
Cycle-Driven Simulation
triggers the component that earliest
reacts to that event. timne stamp) from the gueue and
Diserete-Event Simulation NS2andits Extension to Sensor
Cycle-Driven Simulation:
The NS-2
discrete event
(Network Simulator-2)Networks:
is a
well-known network simulator for
4 ACycle-Driven (CD) simulation discretizes the continuous notion of real time OTcl.
simulation. Simulations are based on a combination of C+t and
into (typically regularly spaced) ticks and simulates the system behavior at NIS-2includes a large number of
these ticks. At each tick, the physical phenomena are first simulated, and then simulated network protocols and tools used for
all nodes are checked to see if they have anything to sense, process, or simulating Transport Control Protocol (TCP), routing algorithm, multicast
communicate. protocol over the wired or wireless (local connection or via satellite
networks. connection)
Sensing and computation are assumed to be finished before the next tick.
A NS-2 is committed to OSI model simulation,
Sending a packet is also assumed to be completed by then. However, the packet including the behaviour of
will not be available for the destination node until next tick. This split-phase physical layer and it is a free open source software and available for free
communication is a key mechanism to reduce cyclic dependencies that may download.
occur in cycle-driven simulations. Limitations of NS-2:
Discrete-Event Simulation: VIt puts some restrictions on the customisation of packet formats, energy
# A Discrete-Event (DE) simulator assumes that the time is continuous and an models, MACprotocols, and the sensing hardware models, which limits its
event may occur at any time. As event is 2-tuple with a value and a time stamp flexibility.
indicating when, the event is supposed to be handled. Components in a DE V The lack of an application model makes it ineffective in environments that
simulation react to input events and produce output events. In node-level require interaction between applications and the network protocols.
simulators, a component can be a sensor node, and the events can be It does not run real hardware code.
communication packets; or a component can be software module within and the
It has been built by many developers and
contains several inherent known
events can be message passing among these nodes.
and unknown bugs.
o Typically, components are causal, in the sense that if an output event is its object-oriented design.
computed from an input event, then the time stamp of the output should not be V It does not scale wellfor WSNs due to
scripts make it dificult to use.
earlier than that of the input event. Non-causal components require the V Using C++ code and OTcl
initially designed to simulate wireless sensor network,
simulators to be able to roll back in time, and worse, they may not define a * Actually, NS-2 was not enable it to support
had extended NS-2 in order to
deterministic behavior of a system. but a few research groups sensor model, battery model, a
simulation, including
Wireless sensor network
stack, and hybrid simulation tools.
small
Tools
What is TOSSIM
simulator? The Timer has an
component in Tiny0S?
$.
for TinyOS applications running On one or init) method that
VTOSSIM is a dedicated simulator
enabled and initializes
disabled via the start and stop calls. its internmal flag, and it can be
more Berkeley motes.
building TOSSIM were to make it scalable + Start Stop
AK SimeroFire
1fFire
Timer
The kev design decisions on
to use the actual
network of potentially thousands of nodes, and to be able
software code in the simulation.
6 Draw the Contiki architecture.
operating system for small
Contiki is a popular embedded open-source TIMER
microcontroller architectures.
Internal state: evenFlag
User apps Built-in apps SetRate
ulPv6 Fire
Socket-like AP!
UDP|TCPICMP Contiki OS
IPV6 LoWPAN
Rime (MAC)
REVIEW QUESTIONS
Platform CPU
Hardware drivers 1. What are the programming challenges of sensor network tools?
2. Explain the following (i) Tiny OS (ii) nesC in detail.
7. Whatis Cooja simulator? 3. Describe about the CONTIKIOS simulator.
use peripheral
A system that typically enables the host system to run software or
enabling your laptop to run the 4. Explain about the following () CO0JA (i) TOSSIM.
devices designed for the guest system: e.g. Cooja
RPL protocol, LIBP and/or other IoT protocols of interest. 5. Explain the node level simulator with example.
List the various commercial simulator used in WSN. CONTIKIOS for WSN.
8. 6. Outline the features of TinyOS and
as ns-2,
There are several open-source or commercial simulators available such
J-Sim (previously known as JavaSim), and GloMoSim/QualNet.
9. List the types of codes used in nesC.
In nesC, code can be classified into two types:
Asynchronous code (AC): Code that is reachable from at least one interrupt
handler.
V Synchronous code (S): Code that is only reachable from tasks.