Towards a New Programming Paradigm in Sensor Networks

  • Slides: 34
Download presentation
Towards a New Programming Paradigm in Sensor Networks S. Masoud Sadjadi http: //www. cse.

Towards a New Programming Paradigm in Sensor Networks S. Masoud Sadjadi http: //www. cse. msu. edu/~sadjadis/ Software Engineering and Networking Systems Laboratory Department of Computer Science and Engineering Michigan State University www. cse. msu. edu/sens A CSE 910 Literature Paper Presentation on Feb. 3, 2004

Acknowledgement Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary David

Acknowledgement Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary David Culler, University of California, Berkeley Joe Polastre, University of California, Berkeley Jason Hill, University of California, Berkeley Kristofer S. J. Pister, Dust Incorporation John A. Stankovic, University of Virginia Tarek F. Abdelzaher, University of Virginia Chien-Liang Fok, Washington Univ. in St. Louis Wei Hong, Intel Research, Berkeley David Gay, Intel Research, Berkeley Sam Madden, MIT Mike Horton, Crossbow Technology Inc. A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 2

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny.

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS and nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 3

Human Computer Interaction Overview: – Mainframe – Mini-Computers – Workstations Motivation Application Pull Human

Human Computer Interaction Overview: – Mainframe – Mini-Computers – Workstations Motivation Application Pull Human Comp. Int Emerging Apps. Technology Push Students & Small Businesses – Personal Computers – Distributed Systems New Paradigm Tiny. OS & nes. C Enviro. Track Tiny. DB Expert & Scientists Managers & Businessmen – Laptops, Tablet PC – PDA, i. PAQ – Cell phone, Smart watches Summary Everybody – Sensor Networks (Motes) – Augmented Reality (wearables) A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 4

Emerging Applications Overview: Motivation Habitat Monitoring Application Pull Vehicle detection Human Comp. Int Emerging

Emerging Applications Overview: Motivation Habitat Monitoring Application Pull Vehicle detection Human Comp. Int Emerging Apps. Technology Push New Paradigm Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Earthquake monitoring Environment Monitoring 36 m 33 m: 111 32 m: 110 30 m: 109, 108, 107 20 m: 106, 105, 104 10 m: 103, 102, 101 A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 5

Recent Advances in Hardware Mini. Overview: Motivation Application Pull storage – 1 -10 m.

Recent Advances in Hardware Mini. Overview: Motivation Application Pull storage – 1 -10 m. W active, 1 m. W passive (at 1% use 100 m. W ave) Technology Push Miniaturization Motes New Paradigm Enviro. Track Summary Micro-sensors (MEMS, Materials, Circuits) – acceleration, vibration, gyroscope, tilt, magnetic, heat, motion, pressure, temp, light, moisture, humidity, barometric – chemical (CO, CO 2, radon), biological, microradar, . . . – actuators too (mirrors, motors, smart surfaces, micro-robots) Tiny. OS & nes. C Tiny. DB CMOS miniaturization – 1 M trans/$ => tiny (~mm 2), inexpensive processing and Communication – short range, low bit-rate, CMOS radios (1 -10 m. W) Power – batteries remain primary storage (1, 000 m. W*s/mm 3), fuel cells 10 x – solar (10 m. W/cm 2, 0. 1 m. W indoors), vibration (~u. W/gm), flow 1 cm 3 battery => 1 year at 10 msgs/sec A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 6

Motes Overview: Motivation Application Pull Technology Push Miniaturization Motes New Paradigm Tiny. OS &

Motes Overview: Motivation Application Pull Technology Push Miniaturization Motes New Paradigm Tiny. OS & nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 7

Sensor Networks Characteristics Overview: Motivation – Unattended and inaccessible sensors – Prolonged deployment Application

Sensor Networks Characteristics Overview: Motivation – Unattended and inaccessible sensors – Prolonged deployment Application Pull Technology Push SN Char. Sensors Tiny. OS & nes. C Network Intensive – Low bandwidth ~40 k. Bits on motes (less in practice) – Very lossy (TCP end-to-end? MAC retransmit? ) Enviro. Track Tiny. DB Summary Data Centric – Operate in aggregate – In-network processing is necessary COTS-BOTS Energy Consum. Energy constrained – Lack of in-network recharging technology – Do the job and back to sleep New Paradigm Mica 2 Large number of sensor/actuator Requirements changes over time – Autonomic Computing – Self-organization, self-optimization, self auditing – In-network reprogramming and reconfiguration A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 8

Mica 2 Motes Limitations Overview: Motivation Application Pull Technology Push – Writes at disk

Mica 2 Motes Limitations Overview: Motivation Application Pull Technology Push – Writes at disk speeds, reads at RAM speeds – Interface : random access, read/write 256 byte pages – Maximum throughput ~10 Kbytes / second New Paradigm SN Char. Mica 2 COTS-BOTS Sensors 4 Mhz, 8 bit Atmel RISC u. Proc 40 kbps Radio 4 K RAM, 128 K Program Flash, 512 K Data Flash 2 x AA battery pack Based on Tiny. OS Energy Consum. Tiny. OS & nes. C Enviro. Track Tiny. DB Mica 2 Dot Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 9

COTS-BOTS Overview: Commercial Off-The-Shelf ro. BOTS (COTS-BOTS) Motivation Application Pull Technology Push New Paradigm

COTS-BOTS Overview: Commercial Off-The-Shelf ro. BOTS (COTS-BOTS) Motivation Application Pull Technology Push New Paradigm SN Char. 5” x 2. 5” x 3” size <$250 total 2 -axis accelerometer Mica 2 COTS-BOTS Sensors Energy Consum. Tiny. OS & nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 10

Types of Sensors Overview: Motivation – Temperature – Light x 2 (high intensity PAR,

Types of Sensors Overview: Motivation – Temperature – Light x 2 (high intensity PAR, low intensity, full spectrum) – Air Pressure – Humidity Application Pull Technology Push New Paradigm SN Char. Mica 2 COTS-BOTS Sensors Energy Consum. Sensors attach via daughtercard Vibration – 2 or 3 axis accelerometers Tiny. OS & nes. C Enviro. Track Weather Tracking – Microphone Tiny. DB Summary for ranging and acoustic signatures – Magnetometer GPS A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 11

Energy Consumption Breakdown Overview: Motivation Application Pull Technology Push New Paradigm SN Char. Mica

Energy Consumption Breakdown Overview: Motivation Application Pull Technology Push New Paradigm SN Char. Mica 2 COTS-BOTS Sensors Energy Consum. Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Component Rate Startup time Current consumption CPU Active 4 MHz N/A 4. 6 m. A CPU Idle 4 MHz 1 us 2. 4 m. A CPU Suspend 32 k. Hz 4 ms 10 u. A Radio Transmit 40 k. Hz 30 ms 12 m. A Radio Receive 40 k. Hz 30 ms 3. 6 m. A 2000 Hz 10 ms 1. 235 m. A I 2 C Temp 2 Hz 500 ms 0. 150 m. A Pressure 10 Hz 500 ms 0. 010 m. A Press Temp 10 Hz 500 ms 0. 010 m. A 500 Hz 500 ms 0. 775 m. A Thermopile 2000 Hz 200 ms 0. 170 m. A Thermistor 2000 Hz 10 ms 0. 126 m. A Photo Humidity A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 12

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny.

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS and nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 13

Tiny. OS: An OS for Motes Overview: Motivation Programming Philosophy – Component Based Tiny.

Tiny. OS: An OS for Motes Overview: Motivation Programming Philosophy – Component Based Tiny. OS & nes. C Tiny. OS “Wiring” to components together via interfaces, configurations – Event Driven nes. C Components Hardware Interrups Reactive sensors – Split-Phased Applications Reconfiguration Enviro. Track Nothing blocks, ever. Instead, completion events are signaled. – Highly Concurrent Tiny. DB Summary Single thread of “tasks”, posted and scheduled FIFO Events “fired” asynchronously in response to interrupts. Suite of software components – – Timers, clock synchronization Single and multi-hop networking Power management Non-volatile storage management A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 14

nes. C: A Component-Based Language Overview: Motivation – Source-to-source compilation (gcc-comp. output) Tiny. OS

nes. C: A Component-Based Language Overview: Motivation – Source-to-source compilation (gcc-comp. output) Tiny. OS & nes. C Tiny. OS nes. C Components A component-based extension of C language 3 types of files: – Interfaces Applications Reconfiguration Enviro. Track Tiny. DB Summary Set of function prototypes; no implementations or variables – Modules Provide (implement) zero or more interfaces Require zero or more interfaces May define module variables, scoped to functions in module – Configurations Wire (connect) modules according to requires/provides relationship A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 15

Tiny OS Components Applications – Graph of Components Reconfiguration Enviro. Track Applications Tiny. DB

Tiny OS Components Applications – Graph of Components Reconfiguration Enviro. Track Applications Tiny. DB Scheduler – constrained two-level scheduling model Summary msg_sen d_done) nes. C msg_rec(type, data) Tiny. OS Messaging Component internal thread Internal State TX_pack et_done (success) RX_pack et_done (buffer) Tiny. OS & nes. C Commands, Event Handlers Frame (storage) Tasks (concurrency) send_msg (addr, type, data) – – Events Commands power(mode) Motivation Component: init Power(mode) TX_packet(buf) Overview: threads + events – Very lean multithreading Constrained Storage Model – frame per component – shared stack, no heap A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 16

Application = Graph of Components Overview: Example: ad hoc, multi-hop routing of photo sensor

Application = Graph of Components Overview: Example: ad hoc, multi-hop routing of photo sensor readings Motivation Tiny. OS nes. C Components application Tiny. OS & nes. C Route map router sensor appln Applications Active Messages Reconfiguration packet Summary Radio Packet byte Tiny. DB Radio byte bit Enviro. Track RFM Serial Packet UART Temp photo ADC A CSE 910 Literature Paper Presentation by S. M. Sadjadi SW HW 3450 B code 226 B data clocks Feb. 3, 2004 17

Reconfiguration in Tiny. OS Overview: Motivation – Provides a suite of software components Tiny.

Reconfiguration in Tiny. OS Overview: Motivation – Provides a suite of software components Tiny. OS & nes. C Tiny. OS Components Reconfiguration Applications – Just additional components composed a selection of OS components nes. C Applications Tiny. OS Rich Compositional Support – separation of definition and linkage – robustness through narrow interfaces and reuse – Interpositioning Enviro. Track Tiny. DB Summary Whole system analysis and optimization – Notion of components is lost in images – No meta information is available Reconfiguration Reprogramming A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 18

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny.

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS and nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 19

Enviro. Track Overview: Motivation Provides a domain-specific programming model for entity-tracking in sensor networks

Enviro. Track Overview: Motivation Provides a domain-specific programming model for entity-tracking in sensor networks Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support Tiny. DB Summary – Abstracting the details of inter-node communication – Automatic group maintenance – Programmer interacts with context label rather than changing set of nodes – Developing components directly is error prone A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 20

Context Label Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label

Context Label Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label Model Cont. Lab. Spec. Group Main. context label abstraction – – Context labels are dynamically created Logically associated with an entity (one to one) Serves as an address to the entity Is distinguished by type (e. g. , fire or car) – Follows the entity – Automatic group management and leader maintenance Tiny. DB – Performs context-specific computations and actions – In-network aggregation Summary – Approximate aggregate state is maintained Lang. Support Freshness constraint, Le Critical mass constraint, Ne – Simplifies application development A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 21

Programming Model Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label

Programming Model Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 22

Context Label Specification Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context

Context Label Specification Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support Tiny. DB To declare a context label of type e, the following must be provided: – sensee() – specifies a pattern in the environment to watch for – statee() – the state data to be maintained within the context label Enviro. Track provides a library of statee() functions Accessible by all tracking objects – Which tracking objects to associate with the label Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 23

Group Maintenance Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label

Group Maintenance Overview: Motivation Tiny. OS & nes. C Enviro. Track Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support Tiny. DB A group of sensors that detect the entity should produce a single context label for it The algorithm must be lightweight and dynamic All members of the group must satisfy sensee() There is at most one majority leader within the group Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 24

Language Support Overview: Motivation Tiny. OS & nes. C – defining context labels, aggregate

Language Support Overview: Motivation Tiny. OS & nes. C – defining context labels, aggregate state variables, and tracking objects Enviro. Track Motivation Context Label Enviro. Track adds new constructs and keywords to nes. C Example code: Model Cont. Lab. Spec. Group Main. Lang. Support Tiny. DB Summary Not a Generic Solution! A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 25

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny.

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS and nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 26

Tiny. DB Overview: Tiny. OS & nes. C Enviro. Track Tiny. DB: Prototype declarative

Tiny. DB Overview: Tiny. OS & nes. C Enviro. Track Tiny. DB: Prototype declarative query processor Platform: Berkeley Motes + Tiny. OS Tiny. SQL: Continuous variant of SQL Motivation: Motivation Tiny. DB Motivation Features Data Model PC Side Server Summary – Queries abstract away much of the complexity Burden on the database developers Application developers get: – – Safe and optimized programs Freedom to think about apps instead of details Data centric programming Interact with sensor network as a whole – Under the hood: Intelligent query processing – query optimization, power efficient execution Fault Mitigation: – automatically introduce redundancy, avoid problem areas A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 27

Tiny. DB Features Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB

Tiny. DB Features Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Motivation Features Data Model PC Side Server Summary Features – Declarative SQL-like query interface – Metadata catalog management – Multiple concurrent queries – Network monitoring (via queries) – In-network, distributed query processing – Extensible framework for attributes, commands and aggregates – In-network, persistent storage A CSE 910 Literature Paper Presentation by S. M. Sadjadi SELECT MAX(mag) FROM sensors WHERE mag > thresh SAMPLE PERIOD 64 ms App Query, Trigger Data Tiny. DB Sensor Network Feb. 3, 2004 28

Data Model Overview: Motivation – Entire sensor network as one single, infinitely-long logical table:

Data Model Overview: Motivation – Entire sensor network as one single, infinitely-long logical table: sensors Tiny. OS & nes. C Enviro. Track Tiny. DB Logical Tables Attributes – Columns consist of all the attributes defined in the network – Typical attributes: Motivation Features Data Model PC Side Server Summary Sensor readings Meta-data: node id, location, etc. Internal states: routing tree parent, timestamp, queue length, etc. – Nodes return NULL for unknown attributes catalog. xml – On server, all attributes are defined in A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 29

PC Side Server Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB

PC Side Server Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Motivation Features Data Model PC Side Server Summary Provide Remote (Java) API to client tools Inject queries and commands into sensor network Result dispatch from sensor network and to interested clients Log all data, queries and commands to DBMS Metadata management – – Mote locations and maps Mote capabilities: type of sensors Mote characteristics: power consumption Sensor calibration/conversion parameters Does this model address all the application domains? A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 30

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny.

Agenda Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS and nes. C Enviro. Track Tiny. DB Summary A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 31

Summary Overview: Motivation – Component-based and Event-driven programming – Split-phased and High concurrency –

Summary Overview: Motivation – Component-based and Event-driven programming – Split-phased and High concurrency – Infrastructure for developing application Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Tiny. OS Enviro. Track – A domain-specific programming model for tracking entities – Provides a language extension to nes. C – Relieves programmers from details of Group management, Directory service, and Data aggregation Tiny. DB – Provides a generic programming model – Easy to develop application – Applications are easy to use A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 32

References Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary [1]T.

References Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary [1]T. Abdelzaher, B. Blum, Q. Cao, D. Evans, J. George, S. George, T. He, L. Luo, S. Son, R. Stoleru, J. Stankovic, and A. Wood. Envirotrack: Towards an environmental computing paradigm for distributed sensor networks, ICDCS 2004 [2] J. Hill, R. Szewczyk, A. Woo, S. Hollar, D. Culler, and K. Pister. System architecture directions for network sensors. In ASPLOS, Cambridge, MA, November 2000. http: //tinyos. millennium. berkeley. edu/papers/tos. pdf [3] D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. The nes. C language: A holistic approach to network embedded systems. In ACMSIGPLAN Conference on Program-ming Language Design and Implementation, San Diego, CA, June 2003. http: //webs. cs. berkeley. edu/tos/papers/nesc. pdf [4] M. Horton, D. Culler, K. Pister, J. Hill, R. Szewczyk, and A. Woo. Mica: The commercialization of microsensor motes. Sensors Online, 19(4), April 2002. http: //www. sensorsmag. com/articles/0402/40/main. shtml [5] Tiny. DB : A query processing engine for Tiny. OS-based batterypowered, radio-equipped sensors. http: //telegraph. cs. berkeley. edu/tinydb A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 33

Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Questions? Thank

Overview: Motivation Tiny. OS & nes. C Enviro. Track Tiny. DB Summary Questions? Thank you! A CSE 910 Literature Paper Presentation by S. M. Sadjadi Feb. 3, 2004 34