Wireless Sensor
Networks
BY
Prof. Vishal Rekha Ramchandra Gotarane
Wireless Sensor Networks
Wireless Sensor Networks
•Formed by hundreds or thousands of motes that
communicate with each other and pass data
along from one to another
•Research done in this area focus mostly on
energy aware computing and distributed
computing
History and context
From smart dust to smart plants
• The smart dust concept, a Defense Advanced Research Projects Agency project
funded in 1997, started from the desire to make micro-robots using micro
electro-mechanical systems (MEMS) technology.
• Similarly, it was clear at the time that the size and power of such devices would
follow similar trends to cost: everything you needed to build a wireless sensor
node was decreasing in size, power and cost. That was the seed of the smart dust
idea.
History and context
Application requirements in modern WSNs
•A WSN is capable of hitting a hot spot in return-on-investment that a wired
sensor network is unable to attain.
•While Moore’s law predicts how the hardware gets cheaper, the installation cost
and especially the wiring involved with installing a wired sensor network is
sometimes prohibitive.
•The real challenge faced by a modern WSN is to provide wired like reliability
using wire-free technologies.
Node
• Also known as a mote, is a node in a sensor
network
• It is capable of performing some processing,
gathering sensory info and communicating
with other connected nodes in the network.
• A mote is a node but a node is not always a
mote.
•A wireless mote contains a small number of
integrated circuits, or “chips”, connected
together onto a circuit board and powered by
a battery.
Node
Communication
•Typical transmission power (the power actually radiated out the antenna as RF
energy) is in the 1 to 10 mW range.
•The radio that generates this transmission power can be thought of as having two
parts: the modulator, which converts bits into the appropriate time varying (RF)
voltage, and the power amplifier that boosts the signal and delivers it to the
antenna.
Node
Computation
• Low power microprocessors typically operate with 8-, 16-, or 32- bit quantities
of data. Usually, the instruction width is the same as the data width, although
there is now a family of 32-bit processors from ARM that use a 16-bit instruction
set.
• In general, the wider the datapath and instruction, the more you can do in a single
instruction and a single clock cycle. So a 20 MHz 8-bit processor will be a lot
slower than a 20 MHz 32-bit processor (sometimes more than 10 times),
• The code size for the 8-bit processor will be larger than for the 32-bit processor
(maybe several dozen percent).
Node
Sensing
• There are thousands of different kinds of sensors, each with its own interface
specifications.
• Even a single company, selling a single type of sensor, may have dozens of
different versions of that sensor with different performance, interfaces,
packaging, temperature tolerance, etc.
• Increasingly, sensors have integrated electronics, so they may present either a
digital interface or a low impedance voltage output, both of which are relatively
easy to interface to a microcontroller.
Node
Energy
• The battery anode and cathode chemistry determine its fresh (predischarge) open-
circuit voltage as well as the temperature range for normal operation.
•Lithium batteries have a flat discharge profile, meaning that their voltage remains
constant over most of their useful life.
•Alkaline batteries have a linear decrease in voltage as their capacity is drained.
Lithium batteries generally have longer shelf-life due to lower internal leakage.
Consumers pay much higher prices for lithium batteries than for alkaline.
• Lithium thionyl chloride batteries are the most expensive of all, and have the highest
performance.
Connecting nodes
Radio basics
•If a radio transmits a continuous tone, then there is no information available to
the receiver other than the frequency of the transmission.
•To communicate information, the transmitter must change some aspect of the
transmitted wave. This is called modulation.
•The simplest form of modulation is to turn the tone on and off, which is known
as on-off keying, or OOK.
Connecting nodes
Radio basics
•Often the tone is not turned all the way off, but rather different amplitudes are
used. This is known as amplitude shift keying, or ASK.
• If the transmitter modulates the frequency of the radiated wave instead of its
amplitude, this is called frequency modulation. This simplest form of frequency
modulation is frequency shift keying, or FSK.
•Broadcast radio in the so-called FM band (88 – 107 MHz) uses this method.
•In phase shift keying, or PSK, the signal is transmitted by modulating the phase
of the carrier.
Connecting nodes
Common misconceptions
•A common misconception about wireless communication is that the
communication area of a node is a perfect disk of radius R.
•A second common misconception relates to energy.
•A third common misconception is related to ranging capabilities using received
signal strength.
Connecting nodes
Reliable communication in practice: channel hopping
•WSNs face the challenge of ensuring reliable communication over inherently
unreliable links.
•The bad news is that external interference and multi-path fading cause the
quality of wireless links to change dramatically, in an unpredictable way.
•The good news is that these phenomena change depending on the frequency the
nodes are communicating on.
•Channel hopping is a technique proven to efficiently combat the unreliable
nature of wireless technology.
Networking nodes
•Many things need to happen inside a node for it to be able to communicate over
a multi-hop network.
•The software running on the node needs to answer many questions.
• At what time should a node send a message?
• On what frequency?
• If a node wants to report a measurement to a distant node, to which neighbor
should it send its message?
• What should it do when a transmission fails? Re-transmit? Discard the packet?
Change its destination?
Networking nodes
Medium access control
• The medium access control (MAC) layer, it deals with two key constraints, is
arguably pivotal in WSN communication architecture.
• First, it controls the state of the radio chip, hence the duty cycle and the energy-
efficiency of the node.
• Second, since the wireless medium is broadcast in nature, it is in charge of
resolving any contention arising, while taking link outages and changes of
topologies due to nodes (dis)appearing into account.
Networking nodes
Multi-hop routing
• In large networks, a data source may not reach the intended sink in a single hop,
thereby requiring the traffic to be routed via multiple hops.
• An optimized choice of such a routing path is known to significantly increase
the performance of said network.
•There has been a growing interest in the understanding and optimizing of WSN
routing and networking protocols in recent years.
•The limited and constrained resources here have driven research towards
reducing energy consumption, memory requirements and complexity of routing
functionalities.
Securing Communication-
• Confidentiality and data integrity in WSNs most commonly uses the same
symmetric key encryption technology (advanced encryption standard (AES)
cipher) as commonly found in much larger systems.
•With built-in hardware support for AES, most motes can perform security
operations on an entire packet for less energy than the cost of sending a single bit
over the radio.
•Authentication, binding and key exchange can be more challenging.
Securing Communication
• There are many clever solutions to all the problems, but so far there are no
general solutions that span all application domains.
•Public key infrastructure is a very powerful tool that is often used in the broader
Internet for similar purposes.
•While public key, or asymmetric key, algorithms are substantially more
computationally challenging than symmetric key algorithms, they can still be
used on even the smallest wireless sensor platforms
Protocols
IoT needs standard protocols: Protocols - MQTT and CoAP
• These wo of the most promising protocols for small devices
• Following are true for both MQTT and CoAP:
• Are open standards
• Are better suited to constrained environments than HTTP
• Provide mechanisms for asynchronous communication
• Run on IP
• Have a range of implementations
Protocols
Message Queuing Telemetry Transport (MQTT)
• MQTT is a publish/subscribe messaging protocol
• It is designed for lightweight M2M communications
• It was originally developed by IBM
• It is now an open standard
• MQTT flexible in communication and acts as a pipe for binary data
Protocols
Message Queuing Telemetry Transport (MQTT)
MQTT Architecture
• It is a client/server model
• It is message oriented
• Every sensor is a client and connects to a server
• Such connections are known as a broker, over TCP
• Every message is a discrete chunk of data, opaque to the broker
• Every message is published to an address, known as a topic
• Clients may subscribe to multiple topics
• Each client subscribed to a topic receives every msg published to topic
Protocols
MQTT Example: For a simple network with 3 clients and a
central broker
• All 3 clients open TCP connections with the broker
• Clients B and C subscribe to the topic temperature
• At a later time, Client A publishes a value of 22.5 for topic
temperature
• Broker forwards the message to all subscribed clients
• The publisher subscriber model
• Model allows MQTT clients to
• Communicate O2O, O2M & M2M
Protocols
Constrained Application Protocol (CoAP): CoAP Architecture
• CoAP is designed for interoperability with the web
• Like HTTP, CoAP is a document transfer protocol
• Unlike HTTP, CoAP is designed for the needs of constrained device
• CoAP packets are much smaller than HTTP TCP flows
• Bitfields and mappings from strings to integers are used extensively to save space
• Packets are simple to generate and can be parsed in place without consuming extra
RAM in constrained devices.
• CoAP runs over UDP, not TCP
Protocols
Constrained Application Protocol (CoAP): CoAP Architecture
• Clients and servers communicate through connectionless datagrams
• Retries and reordering are implemented in the application stack
• Removing the need for TCP may allow full IP networking in small μc
• CoAP allows UDP broadcast and multicast to be used for addressing
• CoAP follows a client/server model
• Clients make requests to servers, servers send back responses
• Clients may GET, PUT, POST and DELETE resources
• CoAP is designed to interoperate with HTTP and The RESTful web at large through simple proxies
•Because CoAP is datagram based, it may be used on top of SMS and other packet based
communications protocols
Protocols
MQTT vs CoAP
Protocols
MQTT vs CoAP
Features CoAP MQTT
Full Form Constrained Application Message Queue Telemetry
Protocol Transport
Model used for Request-Response, Publish-Subscribe
communication Publish-Subscribe
RESTful Yes No
Transport layer Preferably UDP, TCP can also Preferably TCP, UDP can also be used
be used. (MQTT-S).
Header Size 4 Bytes 2 Bytes
Number of 4 16
message
types used
Protocols
MQTT vs CoAP
Features CoAP MQTT
Messaging Asynchronous & Asynchronous
Synchronous
Application 2 Levels 3 Levels
Reliability
Security IPSEC or DTLS Not defined in the
standard
Intermediaries YES YES (MQTT-S)
LLN Suitability Excellent Fair
(thousand nodes)
REST Transferring data
Representational State Transfer (REST) Transferring data
• Is an API architecture style
• Developed by Roy Fielding in his PhD Thesis
• Developed along the HTTP/1.1 protocol
• REST is the way HTTP should be used
• REST is not necessarily tied to HTTP
• HTTP is an application protocol
• REST is a set of rules
• REST exchanges any messages (XML, JSON etc. )
• Messages that can use HTTP to transport those messages
REST Transferring data
Idea 1: It consists of client and server
• client contains representation
• server contains resources
• It consists of Request and responses
• for transfer of representation of resources
REST Transferring data
Idea 2: Client state
• Client either transitioning between states or be at rest
• Client state contains links to initiate new state
REST Transferring data
Idea 3: Client at a rest state
• interact with its user
• creates no load on the servers or network
• consumes no per-client storage on the servers
REST Transferring data
HTTP Methods supported by REST
• GET
• Idempotent and should ideally return the same results every time a call is made
• PUT
• Same like GET. Idempotent and is used to update resources
• POST
• Should contain a url and body Used for creating resources
• Multiple calls should ideally return different results and should create multiple
products
• DELETE
• Used to delete resources on the server