1 / 34

Towards a New Programming Paradigm in Sensor Networks

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. Acknowledgement. Overview:.

Download Presentation

Towards a New Programming Paradigm in Sensor Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. Acknowledgement Overview: • 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. Motivation TinyOS & nesC EnviroTrack TinyDB Summary

  3. Agenda Overview: Motivation Motivation TinyOS & nesC EnviroTrack TinyOS and nesC TinyDB Summary EnviroTrack TinyDB Summary

  4. Human Computer Interaction Overview: • Expert & Scientists • Mainframe • Mini-Computers • Workstations • Students & Small Businesses • Personal Computers • Distributed Systems • Managers & Businessmen • Laptops, Tablet PC • PDA, iPAQ • Cell phone, Smart watches • Everybody • Sensor Networks (Motes) • Augmented Reality (wearables) Motivation Application Pull Human Comp. Int Emerging Apps. Technology Push New Paradigm TinyOS & nesC EnviroTrack TinyDB Summary

  5. Emerging Applications Overview: Habitat Monitoring Motivation Vehicle detection Application Pull Human Comp. Int Emerging Apps. Technology Push New Paradigm TinyOS & nesC EnviroTrack Environment Monitoring TinyDB Earthquake monitoring Summary 36m 33m: 111 32m: 110 30m: 109,108,107 20m: 106,105,104 10m: 103, 102, 101

  6. Recent Advances in Hardware Mini. Overview: • CMOS miniaturization • 1 M trans/$ => tiny (~mm2), inexpensive processing and storage • 1-10 mW active, 1 mW passive (at 1% use 100 mW ave) • Micro-sensors (MEMS, Materials, Circuits) • acceleration, vibration, gyroscope, tilt, magnetic, heat, motion, pressure, temp, light, moisture, humidity, barometric • chemical (CO, CO2, radon), biological, microradar, ... • actuators too (mirrors, motors, smart surfaces, micro-robots) • Communication • short range, low bit-rate, CMOS radios (1-10 mW) • Power • batteries remain primary storage (1,000 mW*s/mm3), fuel cells 10x • solar (10 mW/cm2, 0.1 mW indoors), vibration (~uW/gm), flow • 1 cm3 battery => 1 year at 10 msgs/sec Motivation Application Pull Technology Push Miniaturization Motes New Paradigm TinyOS & nesC EnviroTrack TinyDB Summary

  7. Motes Overview: Motivation Application Pull Technology Push Miniaturization Motes New Paradigm TinyOS & nesC EnviroTrack TinyDB Summary

  8. Sensor Networks Characteristics Overview: • Large number of sensor/actuator • Unattended and inaccessible sensors • Prolonged deployment • Energy constrained • Lack of in-network recharging technology • Do the job and back to sleep • Data Centric • Operate in aggregate • In-network processing is necessary • Network Intensive • Low bandwidth ~40kBits on motes (less in practice) • Very lossy (TCP end-to-end? MAC retransmit?) • Requirements changes over time • Autonomic Computing • Self-organization, self-optimization, self auditing • In-network reprogramming and reconfiguration Motivation Application Pull Technology Push New Paradigm SN Char. Mica2 COTS-BOTS Sensors Energy Consum. TinyOS & nesC EnviroTrack TinyDB Summary

  9. Mica2 Motes Limitations Overview: • 4Mhz, 8 bit Atmel RISC uProc • 40 kbps Radio • 4 K RAM, 128 K Program Flash, 512 K Data Flash • Writes at disk speeds, reads at RAM speeds • Interface : random access, read/write 256 byte pages • Maximum throughput ~10Kbytes / second • 2 x AA battery pack • Based on TinyOS Motivation Application Pull Technology Push New Paradigm SN Char. Mica2 COTS-BOTS Sensors Energy Consum. TinyOS & nesC Mica2Dot Mica2 EnviroTrack TinyDB Summary

  10. COTS-BOTS Overview: Commercial Off-The-Shelf roBOTS (COTS-BOTS) Motivation Application Pull • 5” x 2.5” x 3” size • <$250 total • 2-axis accelerometer Technology Push New Paradigm SN Char. Mica2 COTS-BOTS Sensors Energy Consum. TinyOS & nesC EnviroTrack TinyDB Summary

  11. Types of Sensors Overview: Sensors attach via daughtercard • Weather • Temperature • Light x 2 (high intensity PAR, low intensity, full spectrum) • Air Pressure • Humidity • Vibration • 2 or 3 axis accelerometers • Tracking • Microphone • for ranging and acoustic • signatures • Magnetometer • GPS Motivation Application Pull Technology Push New Paradigm SN Char. Mica2 COTS-BOTS Sensors Energy Consum. TinyOS & nesC EnviroTrack TinyDB Summary

  12. Energy Consumption Breakdown Overview: Motivation Application Pull Technology Push New Paradigm SN Char. Mica2 COTS-BOTS Sensors Energy Consum. TinyOS & nesC EnviroTrack TinyDB Summary

  13. Agenda Overview: Motivation Motivation TinyOS & nesC EnviroTrack TinyDB TinyOS and nesC Summary EnviroTrack TinyDB Summary

  14. TinyOS: An OS for Motes Overview: • Programming Philosophy • Component Based • “Wiring” to components together via interfaces, configurations • Event Driven • Hardware Interrups • Reactive sensors • Split-Phased • Nothing blocks, ever. • Instead, completion events are signaled. • Highly Concurrent • Single thread of “tasks”, posted and scheduled FIFO • Events “fired” asynchronously in response to interrupts. • Suite of software components • Timers, clocks, clock synchronization • Single and multi-hop networking • Power management • Non-volatile storage management Motivation TinyOS & nesC TinyOS nesC Components Applications Reconfiguration EnviroTrack TinyDB Summary

  15. nesC: A Component-Based Language Overview: • A component-based extension of C language • Source-to-source compilation (gcc-comp. output) • 3 types of files: • Interfaces • 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 Motivation TinyOS & nesC TinyOS nesC Components Applications Reconfiguration EnviroTrack TinyDB Summary

  16. Events Commands send_msg(addr, type, data) msg_rec(type, data) power(mode) msg_send_done) init Messaging Component internal thread Internal State TX_packet(buf) Power(mode) RX_packet_done (buffer) TX_packet_done (success) init Tiny OS Components Overview: • Component: • Commands, • Event Handlers • Frame (storage) • Tasks (concurrency) • Applications • Graph of Components • Scheduler • constrained two-level scheduling model • threads + events • Very lean multithreading • Constrained Storage Model • frame per component • shared stack, no heap Motivation TinyOS & nesC TinyOS nesC Components Applications Reconfiguration EnviroTrack TinyDB Summary

  17. Route map router sensor appln application Active Messages Serial Packet Radio Packet packet Temp photo SW HW UART Radio byte ADC byte clocks RFM bit Application = Graph of Components Overview: Example: ad hoc, multi-hop routing of photo sensor readings Motivation TinyOS & nesC TinyOS nesC Components Applications Reconfiguration EnviroTrack TinyDB Summary 3450 B code 226 B data

  18. Reconfiguration in TinyOS Overview: • TinyOS • Provides a suite of software components • Applications • Just additional components composed a selection of OS components • Rich Compositional Support • separation of definition and linkage • robustness through narrow interfaces and reuse • Interpositioning • Whole system analysis and optimization • Notion of components is lost in images • No meta information is available  Reconfiguration  Reprogramming Motivation TinyOS & nesC TinyOS nesC Components Applications Reconfiguration EnviroTrack TinyDB Summary

  19. Agenda Overview: Motivation Motivation TinyOS & nesC EnviroTrack TinyOS and nesC TinyDB Summary EnviroTrack TinyDB Summary

  20. EnviroTrack Overview: • Provides a domain-specific programming model for entity-tracking in sensor networks • Motivation • 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 Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  21. Context Label Overview: • 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 • Performs context-specific computations and actions • In-network aggregation • Approximate aggregate state is maintained • Freshness constraint, Le • Critical mass constraint, Ne • Simplifies application development Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  22. Programming Model Overview: Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  23. Context Label Specification Overview: • 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 • EnviroTrack provides a library of statee() functions • Accessible by all tracking objects • Which tracking objects to associate with the label Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  24. Group Maintenance Overview: • 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 Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  25. Language Support Overview: • EnviroTrack adds new constructs and keywords to nesC • defining context labels, aggregate state variables, and tracking objects • Example code:  Not a Generic Solution! Motivation TinyOS & nesC EnviroTrack Motivation Context Label Model Cont. Lab. Spec. Group Main. Lang. Support TinyDB Summary

  26. Agenda Overview: Motivation Motivation TinyOS & nesC EnviroTrack TinyOS and nesC TinyDB Summary EnviroTrack TinyDB Summary

  27. TinyDB Overview: • TinyDB: Prototype declarative query processor • Platform: Berkeley Motes + TinyOS • TinySQL: Continuous variant of SQL • Motivation: • 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 Motivation TinyOS & nesC EnviroTrack TinyDB Motivation Features Data Model PC Side Server Summary

  28. Sensor Network TinyDB Features Overview: • 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 SELECT MAX(mag) FROM sensors WHERE mag > thresh SAMPLE PERIOD 64ms Motivation TinyOS & nesC EnviroTrack TinyDB Motivation Features App Data Model PC Side Server Summary Query, Trigger Data TinyDB

  29. Data Model Overview: • Logical Tables • Entire sensor network as one single, infinitely-long logical table: sensors • Attributes • Columns consist of all the attributes defined in the network • Typical attributes: • 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 Motivation TinyOS & nesC EnviroTrack TinyDB Motivation Features Data Model PC Side Server Summary

  30. PC Side Server Overview: • 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 Motivation TinyOS & nesC EnviroTrack TinyDB Motivation Features Data Model PC Side Server Summary  Does this model address all the application domains?

  31. Agenda Overview: Motivation Motivation TinyOS & nesC EnviroTrack TinyOS and nesC TinyDB Summary EnviroTrack TinyDB Summary

  32. Summary Overview: • TinyOS • Component-based and Event-driven programming • Split-phased and High concurrency • Infrastructure for developing application • EnviroTrack • A domain-specific programming model for tracking entities • Provides a language extension to nesC • Relieves programmers from details of Group management, Directory service, and Data aggregation • TinyDB • Provides a generic programming model • Easy to develop application • Applications are easy to use Motivation TinyOS & nesC EnviroTrack TinyDB Summary

  33. References Overview: [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 nesC 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] TinyDB : A query processing engine for TinyOS-based battery-powered, radio-equipped sensors. http://telegraph.cs.berkeley.edu/tinydb Motivation TinyOS & nesC EnviroTrack TinyDB Summary

  34. Overview: Questions? Motivation TinyOS & nesC EnviroTrack TinyDB Summary Thank you!

More Related