![Page 1: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/1.jpg)
Middle ware and Programming Paradigms for WSN
Budwell Tamuka MasaitiFebruary 23, 2013
JNTUCEH(CSE Department)
![Page 2: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/2.jpg)
Middle ware and Programming Paradigms for WSN
![Page 3: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/3.jpg)
Agenda
Wireless Sensor Networks :Introduction
Applications of WSNs
Main Issues in WSN
Middleware and Programming Abstractions for WSN
Goals for Middleware and Programming abstractions
OSM : Object State model (FSM)
Contiki: Event driven abstractions
TinyOs: Event driven abstractions
Conclusion
![Page 4: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/4.jpg)
A wireless sensor network (WSN) consists of spatially distributed autonomous sensors to
monitor physical or environmental conditions, such as temperature, sound, pressure, etc. and to cooperatively pass their data through the network to a main location.
Wireless Sensor Networks :Introduction
![Page 5: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/5.jpg)
Sensor Node
Transceiver10Kbps-1Mbps 50-125 range
Memory(3K-1Mb)
SensorTransducer
ADC
Embedded Processor
8bit 4-8Mhz
Battery
![Page 6: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/6.jpg)
Popular Implementations
mica mica2 mica2dot micaz
telos telosb rene2 waspmote
![Page 7: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/7.jpg)
WSN Architecture
![Page 8: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/8.jpg)
Environment and Habitat Monitoring
http://fiji.eecs.harvard.edu/Volcano
![Page 9: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/9.jpg)
Monitoring bridge health
Infrastructure Health Monitoring
![Page 10: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/10.jpg)
HealthCare Monitoring(BAN,PAN)
![Page 11: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/11.jpg)
Smart Metering
![Page 12: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/12.jpg)
Middleware provides the software layer interfacing the hardware and the application programs in an OS less system
Or the software layer between the OS and the application programs.
Programming abstractions refer to the interfaces and data structures provided for a programming model and language
WSN Middleware and Programming Abstractions
![Page 13: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/13.jpg)
Automatic node management
Concurrency management
Resource management
Developer friendly abstractions
Goals for WSN Middle and Programming Abstractions
![Page 14: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/14.jpg)
A programming model and language for programming sensor nodes, based on FSM
Uses states and transitions such that the invocation of an event is now a function of both the event and the program state
State attributes (infor sharing )
Object State ModelOliver Kasten n Kay Romer
![Page 15: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/15.jpg)
OSM goes beyond traditional event driven programming and draws inspiration from FSM state charts.
OSM is a hybrid FSM implementation which tackles FSM problems such as:
Memory Management(Global and local variables)
Event hierarchies
Manual flow control
Object State Model(OSM)
![Page 16: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/16.jpg)
Uses Parallel State Machines
Allows hierarchical composition of state(superstates)
Explicit program state(not implied)
State variables
Event queues
OSM Main Features
![Page 17: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/17.jpg)
Background:
Contiki – pioneering open source operating system for sensor networks
Development started in 2001
Got its name from Kon Tiki
Contiki
Across the Atlantic with bare minimum resources
![Page 18: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/18.jpg)
Small memory footprint
IP networking
Hybrid threading model, protothreads
Power profiling
-measure power consumption at network scale
Network shell
- for easy command line interaction
Designed for portability
Dynamic loading
Contiki Key Features
![Page 19: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/19.jpg)
Two communication stacks
uIP TCP/IP
Rime low overhead
Can run on top of each other
Contiki Communication Stack
![Page 20: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/20.jpg)
The Contiki kernel is event-based
Invokes processes whenever something happens
Sensor events, processes starting,
Process invocations must not block
Protothreads provide sequential flow of control in Contiki processes
Protothreads extremely lightweight and stackless
Contik :Event Driven Paradigm
![Page 21: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/21.jpg)
Event-driven vs multithreaded
Event-driven requires less memory
Multithreading requires per-thread stacks
Threads require per-thread stack memory
Events require one stack
Protothreads like events require one stack for as many as there are protothreads running
Contik :Event Driven
![Page 22: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/22.jpg)
An event driven OS specifically designed for WSN
Completely non-blocking
Programs are built out of softaware componets
Tasks are non –preemptive and run in FIFO order
Code is statically linked
TinyOs:Event Driven
![Page 23: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/23.jpg)
Two level scheduling: events and tasks
Scheduler is simple FIFO
A task cannot preempt another task
Events preempt tasks (higher priority)
TinyOS :Scheduling
![Page 24: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/24.jpg)
Provides a specific Service
Message Handling, Signal Processing
Implemented in a Module(code)
Wired up of other components in a Configuration
![Page 25: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/25.jpg)
Comparison Contik n TinyOs
![Page 26: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/26.jpg)
Unique challenges and opportunities
Expanding areas of applications
Contik and TinyOs
New research directions
Conclusion
![Page 27: Wireless Sensor Networks ,Middleware and Programming abstractions](https://reader035.vdocuments.site/reader035/viewer/2022062405/557da901d8b42a351d8b4635/html5/thumbnails/27.jpg)
Geoff Werner-Allen, Konrad Lorincz, and Matt Welsh et al .Monitoring Volcanic Activity at Reventador Volcano, Ecuador with a Wireless Sensor Network
Oliver Kansten and Kay Romer. Beyond Event Handlers:Programming Wireless Sensors with Attriunuted State machines
A Dunkels,Bjorn Gronvall ,and Thiemo Voigt ,Contiki –a Lightweight and Flexible Operating System for Tiny Networked Sensors”inEmNeTSI,Tampa USA 2005
http://www.wsnmagazine.com/tinyos-tutorial/
http://fiji.eecs.harvard.edu/Volcano
https://www.sics.se/search/content/contiki
http://www.tinyos.net
references