1 / 23

Reliable and Efficient Programming Abstractions for Sensor Networks

Reliable and Efficient Programming Abstractions for Sensor Networks . Nupur Kothari , Ramki Gummadi (USC), Todd Millstein (UCLA) and Ramesh Govindan (USC). What are Sensor Networks?. Composed of small battery-powered devices called motes Communicate using wireless

lorimer
Download Presentation

Reliable and Efficient Programming Abstractions for 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. Reliable and Efficient Programming Abstractions for Sensor Networks Nupur Kothari, Ramki Gummadi (USC), Todd Millstein (UCLA) and Ramesh Govindan (USC)

  2. What are Sensor Networks? • Composed of small battery-powered devices called motes • Communicate using wireless • Primarily programmed in a language called nesC

  3. Micro-habitat monitoring Volcanic activity monitoring Wildlife monitoring Many Compelling Applications! Urban sensing Structural health monitoring Actuation-based sensing

  4. Domain-Specific Challenges • Need to deal with several application-level concerns • Time-critical sensing • Hardware resource constraints • Energy-efficient communication • Concurrency and application logic • Failures • Distributed data consistency • Simultaneously achieving efficiency and reliability while providing readability is hard Efficiency Reliability

  5. Programming Today Node-level program written in nesC Compiled to mote binary Tradeoff: High efficiency, but readability and reliability suffer because achieving global results and maintaining invariants through a local approach is tedious and error-prone

  6. Our Approach: Centralized Programming Central program that specifies application behavior Compiler Node-level nesC programs + Runtime Compiled to mote binary Simplifies programming by offloading concurrency, reliability, and energy efficiency to the compiler and runtime

  7. Our Contributions • The Pleaides programming language • Centralized as opposed to node-level • Automatic program partitioning and control-flow migration • Minimizes energy by optimizing data movement • Easy-to-use and reliable concurrency primitive • Ensures consistency under concurrent execution • Mote-based implementation • Evaluated several realistic applications

  8. Pleiades Constructs by Example Node-local variable int temp LOCAL; void main() { nodelist all = get_available_nodes(); int max = 0; Central variable List of nodes in network cfor for (noden = get_first(all); n!=NULL; n = get_next(all)) { if (temp@n > max) max = temp@n; } } Network Node Concurrent-for loop Access node-local variables declaratively Central variables needn’t be synchronized

  9. Two Main Challenges The Pleiades Compiler and Runtime How to achieve serializability under concurrency How to compile and efficiently execute a centralized program Partitioning Concurrency

  10. Program Execution Control-flow migration as well as data movement val@n1 = a; n3 = val@n2; n1 Nodecut How does the compiler partition code into nodecuts? void main() { ……… val@n1 = a; n3 = val@n2; val@n3 = b; val@n4 = c; ……… } n2 Sequential Program val@n3 = b; val@n4 = c; n3 Control-flow migration n4 How does the runtime know where to execute each nodecut? Access node-local variables from nearby nodes

  11. Our Contributions • The Pleaides programming language • Centralized as opposed to node-level • Automatic program partitioning and control-flow migration • Minimizes energy • Easy-to-use and reliable concurrency primitive • Ensures consistency under concurrent execution • Mote-based implementation • Evaluated several realistic applications

  12. start all = get_available_nodes() 1 max = 0 2 n = get_first(all) 3 if(n!=NULL) True False end 4 if(temp@n > max) True 5 False max = temp@n 6 n = get_next(all) Partitioning Code into Nodecuts Control-flow graph for max example Property: The location of variables accessed within a nodecut are known before its execution Nodecuts generated by the Pleiades compiler

  13. Control-flow Migration Algorithm Runtime attempts to find lowest communication cost node to execute nodecut

  14. Our Contributions • The Pleaides programming language • Centralized as opposed to node-level • Automatic program partitioning and control-flow migration • Minimizes energy • Easy-to-use and reliable concurrency primitive • Ensures consistency under concurrent execution • Mote-based implementation • Evaluated several realistic applications

  15. Cfor execution Challenge: To ensure serializability during concurrent execution Approach: Distributed locking, with multiple reader/single writer locks On completion, cfor iterations send DONE message to originating node Nodecut encountering a cfor forks a thread for each iteration

  16. Distributed Locking 6 max Deadlocks possible, but dealt with using a simple deadlock detection and recovery scheme 10 20 5 10 Technique generalizes to nested cfor loops using hierarchical locking 20 cfor (node n = 1; n < 5; n++) { if (temp@n > max) max = temp@n; } temp@n Only the write operation to max is serialized.

  17. Our Contributions • The Pleaides programming language • Centralized as opposed to node-level • Automatic program partitioning and control-flow migration • Minimizes energy • Easy-to-use and reliable concurrency primitive • Ensures consistency under concurrent execution • Mote-based implementation • Evaluated several realistic applications

  18. Implementation and Evaluation • Compiler built as an extension to the CIL infrastructure for C analysis and transformation • Pleiades compiler generates nesCcode • Pleiades evaluated on TelosB motes • Experience with several applications: pursuit-evasion, car parking, etc. • Compiler built as an extension to the CIL infrastructure for C analysis and transformation • Pleiades compiler generates nesCcode • Pleiades evaluated on TelosB motes • Experience with several applications: pursuit-evasion, car parking, etc.

  19. Pursuit-Evasion in Pleiades

  20. Related Work • Embedded and Sensor networks languages • Concurrent Systems (e.g.,Transactional Memory) • Parallel Processing Languages (e.g., Split-C, Linda)

  21. Related Work • SpatialViews (Ni et. al., PLDI’05) • Achieve concurrency and reliability by restricting the programming model • Kairos (Gummadi et. al., DCOSS’05) • Does not provide automatic code migration or serializability; support for automatic recovery mechanisms • Regiment (Newton et. al., IPSN’07) • Purely functional language; Cannot update node-local state • COSMOS (Awan et. al., EuroSys’07) • Dataflow programming model; Designed for heterogeneous networks • TinyDB (Madden et. al., TODS’05) • Declarative interface for centrally manipulating data; not Turing complete

  22. Conclusions and Future work • The centralized programming model in Pleiades simplifies programming • Compiler and runtime deal with concurrency, reliability, and efficiency details • Implemented on TelosB motes • Future Work: • Declarative failure recovery for Pleiades • User-defined/relaxed consistency models to improve concurrency

  23. Thanks! More info at: http://kairos.usc.edu

More Related