Servilla: Provisioning in Wireless Sensor Networks Chenyang Lu
Sensor Network Challenges Ø Device heterogeneity Ø Network dynamics q due to mobility and interference Ø Limited resources and energy Signal Strength (dbm) q e.g., memory Time Source: Hackmann, G., Chipara, O., and Lu, C., Robust Topology Control for Indoor Wireless Sensor Networks, SenSys 08. Device: Imote2 CPU: 32-bit 416MHz RAM: 32MB Power: 151mW Device: TelosB CPU: 16-bit 8MHz RAM: 10KB RAM Power: 0.33mW 2
Structural Health Monitoring Ø >26% of bridges were structurally deficient in 2009 [ASCE] Ø Locates damage by analyzing a structure s natural frequencies. Ø Evaluated on a 5.6m steel truss using 11 Imote2s q Imote2 necessary due to high computational complexity. q It worked! [RTSS 2008] Ø Problem: Imote2 is power-hungry Ø Solution: Use middleware to exploit device heterogeneity by integrating energy-efficient nodes 3
Pa7ent Monitoring Ø 4-17% of hospitalized patients suffer clinical deterioration. q Wireless clinical monitoring system collect patients vital signs. q Difficult due to patient mobility. Ø Dynamic Relay Association Protocol (DRAP) [SenSys 2010] q Automatically adapts to dynamic network topology q Real-time monitoring of mobile patients Ø Implemented and underwent clinical trials at Barnes-Jewish Hospital in St. Louis. Ø Problem: Application-specific Ø Solution: Provide adaptation via middleware 4
Servilla Ø An adaptive middleware for heterogeneous WSNs Ø Introduces -Oriented Computing into WSNs Ø Features q Multiple forms of service invocation q Energy-aware service binding q invocation sharing q Adaptive binding q Middleware asymmetry Network Dynamics Limited Resources Device Heterogeneity 5
Servilla s Programming Model Application Scripts (Platform-Independent & Interpreted) Device Heterogeneity script script script script Medical Patient Monitoring Building Automation Security Structural Health Monitoring Dynamic discovery and binding using SOC Patient Sensors Occupancy Sensor Door/Window Sensor s (Platform-Specific & Native) HVAC Actuators Energy Meter Vibration Sensor DSP Limited Resources Network Dynamics 6
- Oriented Compu7ng (SOC) User Application Invoke Specification User Application User Application Dynamic Discovery, Matching, and Binding 7
Evolu7on of SOC in WSNs Web Application Web Application User Application Registry Registry Atlas (King 06), TinySOA (Lopez 07), PhyNet (ArchRock 08), TinyWebs (Pryantha 08) Enables In-Network Processing Servilla (Fok 09) 8
Mul7ple Forms of Invoca7on On-Demand Periodic 1 4 These three types of service invocations are 2 commonly used in WSN applications. 3 Selecting a suitable type of invocation can significantly increase energy efficiency. Event-Based 9
Energy- aware Binding Ø Selectively bind to the most efficient service provider q Possible due to device heterogeneity Ø Requires additional information about energy efficiency q sends 8 attributes to consumer during discovery q calculates and selects the most efficient provider Ac7on / State TelosB Imote2 Idle (Sensor Off) 0.45 109.7 Idle (Sensor On) - - 204.83 Sensing 102.9 241.83 Message Tx 51.82 184 Message Rx 57.52 192.91 Power (mw) Ac7on / State TelosB Imote2 Sensing 18.49 2.61 Message Tx 725 506 Message Rx 6.17 14.07 Latency (ms) 10
Invoca7on Sharing Ø can optimize for energy efficiency by grouping multiple service invocations into one Ø Reflected in the provider s energy specification sent to the consumer q Process is opportunistic, automatic and hidden from consumer 11
Adap7ve Binding Ø Middleware performs adaptive binding transparently from the application Flush service registry and re-discover services after three consecutive failures Registry switch 12
Lightweight Specifica7ons Ø Traditional specifications impose too much overhead q WSDLInterpreter (Vaughan 07) consumes 48KB memory Ø ServillaSpec: Interface for Accuracy Attributes for Flexibility NAME = fft METHOD = fft-real INPUT = {int dir, int numsamples, float[] data} OUTPUT = float[] ATTRIBUTE Version = 5.0 Attribute MaxSamples = 5000 Attribute Power = 10 Implementation using TinyOS 2.x consumes only 1.4KB memory 13
Rapid Matching Ø 10s of milliseconds to establish service match q Proportional to specification size 14
Simple Interface Ø Applications access services using a single line of code q Hides the complexities of service discovery, binding, execution, and adaptation 1. uses AccelTrigger; // declare required service 2. 3. void main() { 4. int flag = 0; 5. while(flag == 0) { 6. flag = invoke(acceltrigger, check ); // invoke service 7. } 8. // send alert 9. } All complexity due to service discovery, network heterogeneity, network dynamics, and energy efficiency hidden 15
Middleware Asymmetry Ø Increases the types of devices supported Ø Possible due to the decoupling of consumers and providers in the SOC programming model Ø Hidden from the application developer Servilla Servilla Provisioning Framework Virtual Machine CPU: 32-bit 416MHz Memory: 32MB RAM Power: 151mW Powerful platform Provisioning Framework CPU: 16-bit 8MHz RAM: 10KB RAM Power: 0.33mW Weak platform 16
Servilla s Implementa7on Ø On top of TinyOS 2.x Ø Tested on Imote2 and TelosB devices Scripts execute on VM to ensure platform independence Provisioning Framework (SPF) modularized to enable middleware asymmetry Servilla Middleware Architecture 17
Memory Footprint on TelosB Ø Nearly all of the memory on a TelosB is consumed by just the virtual machine! Ø TelosB can still participate as a service provider 46KB 5KB 48KB Limit 29KB Plenty of room for services 18
Structural Health Monitoring Ø Do not continuously run DLAC due to high energy costs Ø During idle periods use AccelTrigger q An energy efficient service q Periodically sense vibration to determine likelihood of damage q Only perform DLAC if potential damage exists Ø Energy-aware service binding q Should AccelTrigger be bound locally or remotely? TelosB TelosB Imote2 Local invocation Imote2 Remote invocation 19
Significant Energy Savings Possible % Energy Savings Remote vs. Local Invoca7on Ø Energy-aware service binding is critical due to significant differences in energy efficiency among providers Ø In the structural health monitoring application, energy consumption can be reduced by up to 98.9% 100 80 60 40 20 0 Periodic Invocation 1Hz Sensing Frequency 7Hz Sensing Frequency 14Hz Sensing Frequency 0 0.5 1 1.5 2 Invoca7on Period (minutes) 100 80 60 40 20 0 Event-based Invocation 1Hz Sensing Frequency 7Hz Sensing Frequency 14Hz Sensing Frequency 0 0.5 1 1.5 2 Invoca7on Period (minutes) 20
Energy Footprint (mj) Valida7on of Energy- Awareness Ø The consumer can determine the most efficient provider using the eight provider attributes 2000 1800 1600 1400 1200 1000 800 600 400 200 0 q 10% radio duty cycle, 1Hz invocation and sensing frequencies q Bind to remote service when number of service executions 4 Local InvocaUon Remote InvocaUon 0 2 4 6 8 10 Number of Execu7ons Local Invoke (Predicted) Remote Invoke (Predicted) Local Invoke (Actual) Remote Invoke (Actual) 21
Medical Pa7ent Monitoring Ø Servilla hides the complexities of adapting to network topology changes due to patient mobility Ø Using Servilla, the application implementation is trivial 1. uses Sensor, DataRelay; 2. 3. void main() { 4. while(true) { 5. int data = invoke(sensor, get ); 6. invoke(datarelay, send, data); 7. sleep(15); // sleep 15 seconds 8. } 9. } 22
Experimental Setup Ø WSN test bed containing 73 TelosB nodes deployed across two buildings at Washington University in St. Louis Ø Patient travels along 359m path at two speeds q Slow: 0.7m/s average q Fast: 1.6m/s average Ø Patient s node invokes data relay service every 15s 23
Successful Adapta7on Ø Adaptive service binding enables the application to achieve 100% successful delivery of patient data Ø Adaptation process hidden from the application developer q Abstracted by a simple invoke interface Invocation Success Rate Servilla CTP Non-adaptive native implementation Fast Walk 100% ± 0% 31.6% ± 7.6% Slow Walk 100% ± 0% 40.47% ± 11.2% 24
Conclusions Ø Middleware can simplify sensor network applications while enhancing software flexibility and network efficiency Ø Servilla supports service-oriented computing over sensors q Multiple forms of service invocation q Energy-aware service binding q invocation sharing q Adaptive binding q Middleware asymmetry Ø Efficacy demonstrated via real-world applications q Medical patient monitoring reliability despite mobility q Structural health monitoring energy savings due to network heterogeneity 25
References Ø C.-L. Fok, G.-C. Roman and C. Lu, Servilla: a Flexible Provisioning Middleware for Heterogeneous Sensor Networks, Science of Computer Programming, Special Issue on Best Papers of Coordination'09, 77(6): 663 684, June 2012. Ø C.-L. Fok, G.-C. Roman and C. Lu, Adaptive Provisioning for Enhanced Energy Efficiency and Flexibility in Wireless Sensor Networks, Science of Computer Programming, Special Issue on Best Papers of Coordination'10, accepted. 26