1 Tracking Energy in Networked Embedded System Prabal Dutta Computer Science Division University of California, Berkeley

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

Telos Fourth Generation WSN Platform
Operating System.
AVEKSHA: A Hardware-Software Approach for Non-intrusive Tracing and Profiling of Wireless Embedded Systems SenSys 2011 Best Paper Matthew Tancreti, Mohammad.
Decentralized Reactive Clustering in Sensor Networks Yingyue Xu April 26, 2015.
Nemo: A High-fidelity Noninvasive Power Meter System for Wireless Sensor Networks Ruogu Zhou, Guoliang Xing Department of Computer Science and Engineering,
Overview: Chapter 7  Sensor node platforms must contend with many issues  Energy consumption  Sensing environment  Networking  Real-time constraints.
Medium Access Control in Wireless Sensor Networks.
Oscilloscope Watch Teardown. Agenda History and General overview Hardware design: – Block diagram and general overview – Choice of the microcontroller.
Geoff Salmon, Monia Ghobadi, Yashar Ganjali, Martin Labrecque, J. Gregory Steffan University of Toronto.
The Mote Revolution: Low Power Wireless Sensor Network Devices
1 Introduction to Wireless Sensor Networks. 2 Learning Objectives Understand the basics of Wireless Sensor Networks (WSNs) –Applications –Constraints.
An Energy-Efficient MAC Protocol for Wireless Sensor Networks
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
1 Tracking Energy in Networked Embedded Systems Rodrigo Fonseca † *, Prabal Dutta †, Philip Levis ‡, Ion Stoica † Computer Science Division † University.
Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.
1 Energy Metering for Free: Augmenting Switching Regulators for Real-Time Monitoring Prabal Dutta †, Mark Feldmeier ‡, Joseph Paradiso ‡, and David Culler.
An Energy Consumption Framework for Distributed Java-Based Systems Chiyoung Seo Software Architecture Research Group University of Southern California.
Integrated  -Wireless Communication Platform Jason Hill.
1 TinyOS Mohammad Rahimi CSCI599-Spring Motivation  The new class of distributed tiny devices  The new generation of software.
Energy-Efficient Design Some design issues in each protocol layer Design options for each layer in the protocol stack.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 13th Lecture Christian Schindelhauer.
5/5/2003MobiSys 2003 Tutorial TinyOS Tutorial, Part II Robert Szewczyk, Joe Polastre, Phil Levis, David Culler Mobisys 2003.
Introduction to TinyOS. Networking Open Experimental Platform Small microcontroller 8 kB code 512 B data Simple, low-power radio 10 kbps ASK EEPROM (32.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Power Containers: An OS Facility for Fine-Grained Power and Energy Management on Multicore Servers Kai Shen, Arrvindh Shriraman, Sandhya Dwarkadas, Xiao.
CS 423 – Operating Systems Design Lecture 22 – Power Management Klara Nahrstedt and Raoul Rivas Spring 2013 CS Spring 2013.
Spring 2000, 4/27/00 Power evaluation of SmartDust remote sensors CS 252 Project Presentation Robert Szewczyk Andras Ferencz.
SpartanRPC Secure WSN Middleware for Cooperating Domains Peter Chapin and Christian Skalka University of Vermont MASS-2010; San Francisco; November 8-12,
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Paper By : Samuel Madden, Michael J. Franklin, Joseph Hellerstein, and Wei Hong Instructor :
FlockLab: A Testbed for Distributed, Synchronized Tracing and Profiling of Wireless Embedded Systems IPSN 2013 NSLab study group 2013/04/08 Presented by:
An Effective Dynamic Scheduling Runtime and Tuning System for Heterogeneous Multi and Many-Core Desktop Platforms Authous: Al’ecio P. D. Binotto, Carlos.
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
A Transmission Control Scheme for Media Access in Sensor Networks Alec Woo and David Culler University of California at Berkeley Intel Research ACM SIGMOBILE.
1 An Adaptive Energy-Efficient MAC Protocol for Wireless Sensor Networks The First ACM Conference on Embedded Networked Sensor Systems (SenSys 2003) November.
Noninvasive Power Metering for Mobile and Embedded Systems Guoliang Xing Associate Professor Department of Computer Science and Engineering Michigan State.
Low-Power Wireless Sensor Networks
Institut for Technical Informatics 1 Thomas Trathnigg Towards Runtime Support for Energy Awareness in WSNs Towards Runtime Support for Energy Awareness.
Introduction to Wireless Sensor Networks
High-Level Interconnect Architectures for FPGAs Nick Barrow-Williams.
1 XYZ: A Motion-Enabled, Power Aware Sensor Node Platform for Distributed Sensor Network Applications Presenter: James D. Lymberopoulos, A. Savvides.
TRICKLE: A Self-Regulating Algorithm for Code Propagation and Maintenance in Wireless Sensor Networks Philip Levis, Neil Patel, Scott Shenker and David.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presented by Yang Zhao.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
SENSOR NETWORKS BY Umesh Shah Mayuresh Patil G P Reddy GUIDES Prof U.B.Desai Prof S.N.Merchant.
1 A Run-Time Feedback Based Energy Estimation Model for Embedded Systems Selim Gürün Chandra Krintz Department of Computer Science U.C. Santa Barbara International.
Power Containers: An OS Facility for Fine-Grained Power and Energy Management on Multicore Servers Kai Shen, Arrvindh Shriraman, Sandhya Dwarkadas, Xiao.
Wireless Sensor Networks Nov 1, 2006 Jeon Bokgyun
Computer Science 1 TinySeRSync: Secure and Resilient Time Synchronization in Wireless Sensor Networks Speaker: Sangwon Hyun Acknowledgement: Slides were.
Power and Control in Networked Sensors E. Jason Riedy and Robert Szewczyk Presenter: Fayun Luo.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
An Adaptive Energy-Efficient and Low- Latency MAC for Data Gathering in Wireless Sensor Networks Gang Lu, Bhaskar Krishnamachari, and Cauligi S. Raghavendra.
A Low-Power Architecture for Sensor Nodes DEUS EX MACHINA: Octav Chipara Paul Gross Harri Thorvaldsson.
A Biologically-Inspired Approach to Designing Wireless Sensor Networks Matthew Britton, Venus Shum, Lionel Sacks and Hamed Haddadi The University College.
SATIRE: A Software Architecture for Smart AtTIRE R. Ganti, P. Jayachandran, T. F. Abdelzaher, J. A. Stankovic (Presented by Linda Deng)
Adaptive Sleep Scheduling for Energy-efficient Movement-predicted Wireless Communication David K. Y. Yau Purdue University Department of Computer Science.
KAIS T Medium Access Control with Coordinated Adaptive Sleeping for Wireless Sensor Network Wei Ye, John Heidemann, Deborah Estrin 2003 IEEE/ACM TRANSACTIONS.
By: Gang Zhou Computer Science Department University of Virginia 1 Medians and Beyond: New Aggregation Techniques for Sensor Networks CS851 Seminar Presentation.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
CSE466 - Fall What is an Embedded System  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)  Lacks some or.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Introduction to Wireless Sensor Networks
KAIS T Location-Aided Flooding: An Energy-Efficient Data Dissemination Protocol for Wireless Sensor Networks Harshavardhan Sabbineni and Krishnendu Chakrabarty.
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
Software Architecture of Sensors. Hardware - Sensor Nodes Sensing: sensor --a transducer that converts a physical, chemical, or biological parameter into.
INTRODUCTION TO WIRELESS SENSOR NETWORKS
On the Effectiveness of Energy Metering on Every Node
Simulation of Distributed Application and Protocols using TOSSIM
Presentation transcript:

1 Tracking Energy in Networked Embedded System Prabal Dutta Computer Science Division University of California, Berkeley University of Washington – Systems and Networking Seminar – Nov 19, 2008

2 Collaborators on Energy Metering and Profiling SPOT Meter –X. Jiang, D. Culler, I. Stoica (UCB) iCount Meter: –M. Feldmeier, J. Paradiso (MIT) –D. Culler (UCB) Quanto System –R. Fonseca, I. Stoica (UCB) –P. Levis (Stanford) ACme –X. Jiang, S. Dawson-Haggerty, D. Culler (UCB)

3 Motivation: in sensor networks, energy is the defining constraint Battery-operated2 “AA” batteries –10 mA active current –10 uA sleep current –1% duty cycle CPU10 MIPS RAM4 KB to 10 KB ROM32 KB to 128 KB Flash512 KB to 1 MB Radio40 kbps to 250 kbps 2000 mA-Hr

4 Energy-efficient design pervades the research agenda… So, why don’t more publications provide empirical evidence of a change in energy usage? Three challenges make energy profiling hard

5 Three challenges Energy metering –“Measure” energy usage –i(t)  p(t)  ∫p(t)dt Energy tracking –“Slice” usage horizontally Activity tracking –“Dice” usage vertically –Connecting causal dots

6 Outline Introduction Why is it hard and how do you solve it? –Energy Metering (“measuring”) –Energy Tracking (“slicing”) –Activity Tracking (“dicing”) How well does it work? How much does it cost? What are its limitations? How could it be used?

7 Measuring: wide horizontal/vertical dynamic range Transmit packet at 1% duty cycle (20 ms / 2 s)

8 Current energy metering techniques are inadequate cumbersome, expensive, not distributed, not scalable, not embedded, low resolution cumbersome, expensive, not distributed, not scalable, not embedded, low resolution, low responsiveness, high quiescent power low responsiveness, high cost, high quiescent power DS2438 ADM1191 BQ2019 BQ27500 [Jiang07]

9 How simply can energy metering be performed? If your platform has a PFM switching regulator… (increasingly, many do) very simply: iCount energy meter design Prabal Dutta, Mark Feldmeier, Joseph Paradiso, and David Culler, “Energy Metering for Free: Augmenting Switching Regulators for Real-Time Monitoring”, IPSN’08, St. Louis, MO, Best Paper Award and ISLPED’08 Design Contest Winner.

10 How does it work? Source: Maxim Semiconductor C in LxLx V in C out V out R load i LX Energize Transfer Monitor S1S1 S2S2 V LX E=½Li 2 PFM Regulator

11 Key insight: each regulator cycle transfers a fixed energy quanta to the load ΔE=½Li 2 P=ΔE/ΔtP=ΔE/Δt Counting cycles translates to measuring energy

12 This simple design works surprisingly well MAX1724 Prototype implementation

13 Outline Introduction Why is it hard and how do you solve it? –Energy Metering (“measuring”) –Energy Tracking (“slicing”) –Activity Tracking (“dicing”) How well does it work? How much does it cost? What are its limitations? How can it be used?

14 Slicing: breaking down the envelope into its parts Marc A. Viredaz and Deborah A. Wallach, “Power Evaluation of a Handheld Computer”, IEEE Micro, Jan-Feb, 2003

15 Too many hidden energy sinks! MCU Radio Power FlashSensorsLEDs PowerData Control USART DMA ALU OSC Timer ADC RXTX LNAPA RDWR Erase

16 A different approach: track power states of energy sinks Instrument device drivers –Track device power states –Expose state transitions to OS/App For every state transition –Snapshot system-wide power states (α 1,…, α n ) –Snapshot global energy usage (ΔE) –Snapshot system clock (Δt) Generate an equation of the form ΔE/Δt = α 1 p 1 +… +, α n p n (p’s are the unknown power draws) Solve for p’s using weighted multivariate least squares High-resolution, high-speed energy meter key for good results ΔtΔt ΔEΔE α’s pipi On Off

17 Estimating breakdowns from the aggregate RGBΔEΔEΔtΔt Regression Log X = [ones(size(R)) R G B]; p = dE./ dt; i = p / 3; a = X\i; ir=a(2); ig=a(3); ib=a(4);

18 Outline Introduction Why is it hard and how do you solve it? –Energy Metering (“measuring”) –Energy Tracking (“slicing”) –Activity Tracking (“dicing”) How well does it work? How much does it cost? What are its limitations? How can it be used?

19 Dicing: big gap between what is measured and what matters Itsy Measured: –Breakdown by subsystem –Breakdown by application PowerScope Measured: –Breakdown by PC –Breakdown by PID Marc A. Viredaz and Deborah A. Wallach, “Power Evaluation of a Handheld Computer”, IEEE Micro, Jan-Feb, 2003 Jason Flinn and M. Satyanarayanan, “Energy-Aware Adaptation for Mobile Apps.”, SOSP’99, Kiawah Island, SC, 1999

20 What actually matters? Energy metering and tracking show –How much energy is used –When energy is used –Where energy is used But why is the energy being spent? Activity tracking answers the why question –Attributes usage to meaningful resource principals –Not to: threads, processes, tasks, functions, or PC

21 What’s an activity? Connecting the causal dots… A causally-connected set of operations… whose distinct resource consumptions… should be grouped together for accounting* * M.B. Jones et al., “Modular Real-Time Resource Management in the Rialto Operating System”, HotOS’95, G. Banga et al. “Resource Containers: A New Facility for Resource Management in Server Systems”, OSDI’99,.

22 Three steps to activity tracking Annotating –Application programmers annotate their software –Associates an activity “label” with an execution –Labels are pairs Propagating –System software transfers activity labels –Across subsystems, nodes, and deferred computations Recording –Track, log, and post-process resource usage Rodrigo Fonseca, Prabal Dutta, Philip Levis, and Ion Stoica, Quanto: Tracking Energy in Networked Embedded Systems, OSDI ’08, San Diego, CA, To appear.

23 Annotating an activity “paints” causally-connected actions “Sensing” involves –Sensor... –CPU, ADC, I2C bus, … “Sending” involves –Radio… –CPU, SPI bus, timers, …... call CPUActivity.set(ACT_SENSING); call Sensor.read(); call CPUActivity.set(ACT_SENDING); call Radio.send(msg);...

24 Propagating activity labels CPU to device –CPU  ADC –CPU  Sensor Node to node –CPU  Radio  Radio  CPU Proxy activity to real activity –Interrupt  CPU –Timer  CPU –Radio  CPU Following logical threads over deferred computation –CPU  Timer  CPU –CPU  Queue  CPU

25 Propagating activity labels from CPU to device (1) Single Activity Device “Paints” device one color Example –CPU  Sensor –CPU  Radio Requires device driver change async command void Sensor.start() { call SensorActivity.set(call CPUActivity.get()); call SensorPowerState.set(1); call SensorImplP.start(); } async command void Sensor.stop() { call SensorActivity.setIdle(); call SensorPowerState.set(0); call SensorImplP.stop(); }

26 Propagating activity labels from CPU to device (2) Multi Activity Device “Paints” device multi color Example –Activity A turns on LED –Activity B turns on LED async command void Leds.led0On() { call Led0Activity.add(call CPUActivity.get()); call Led0PowerState.set(1); call Led0.clr(); } async command void Leds.led0Off() { call Led0Activity.setIdle(); call Led0PowerState.set(0); call Led0.set(); }

27 Propagating activity labels from node to node Add hidden field to packet Sender’s OS sets activity field command void Radio.send(message_t* msg) {... msg->header->activity = call CPUContext.get();... }

28 Propagating and binding activity labels to proxy activities Interrupts cause energy consumption before activity label is identified –Interrupt  CPU –Timer  CPU –Radio  CPU event message_t* Radio.recv(message_t* msg, void* payload, uint8_t len) {... call CPUContext.bind(msg->hdr->activity);... } Proxy activity provides ephemeral label Binding with real activity occurs when label is clear

29 Propagating activity labels through deferred computations Examples –CPU  Task  CPU –CPU  Timer  CPU –CPU  Queue  CPU Scheduler/Timer entry extended –Add activity field –Set activity field on task posting / Timer.start –Restore activity on task invocation /Timer.fired Queue –Add array (linked list) of activities to Queue –Write (enqueue) activity label on Queue.enqueue –Restore (dequeue) activity label on Queue.dequeue

30 Summary: Quanto energy profiling architecture Device Drivers Hardware Application Operating System,,,,, scheduler propagate labels over deferred computations interrupts monitor/expose power statessave/restore/expose activity Energy Meter Perform regressions, compute energy breakdowns annotate code with activity labels log power states, and time and energy usage arbiters timersqueues propagate labels to/from devices call CPUActivity.set(ACT_SENSING); log activity labels Allocate usage to activities

31 Outline Introduction Why is it hard and how do you solve it? How well does it work? –Energy Meter –Energy Tracking How much does it cost? What are its limitations? How can it be used?

32 Energy metering: performance summary Performance MetriciCount Range1 µA – 100 mA Accuracy±20% over 5 decades Resolution0.1 µJ – 0.5 µJ Read latency24 CPU cycles (24 µs) Power overhead1% % Responsiveness< 125 µs Precision±1.5% (over 2 secs) Stability±1% (over 1 week)* * Frequency averaged over 1 second

33 Energy tracking: ground truth and regression results agree Oscilloscope Ground Truth Quanto Regression 48 seconds of Blink

34 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? –Micro Benchmarks –Macro Benchmarks What are its limitations? How can it be used?

35 How much does it cost? Hardware –PFM regulator + wire –Microcontroller counter Software –iCount –Quanto Modified < 350 LOC Added 1275 new LOC

36 Software modifications (Quanto)

37 How much does it cost? Space –12 bytes per energy or activity sample –Logging: RAM buffer bytes each Time –Reading timer: 19 CPU cycles –Reading iCount: 24 CPU cycles –Logging a sample: 102 CPU cycles (total) –Logging Blink App 597 samples / 48 seconds 0.12% of CPU time (60.71 ms / 48 s) 71% of CPU active time –Reporting Blink App: between 4% and 15% of CPU time Energy –1% of sleep current (90 nA / 9 µA) –0.01% of active current (90 nA / 9 µA) –Logging Blink App: 0.08% energy (0.41 mJ)

38 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? What are its limitations? How can it be used?

39 Limitations Energy Metering –Requires hardware support –Input voltage dependence  Requires calibration –Hardware tolerances  Requires calibrations Energy Tracking –Assumes visibility into device power states –Assume constant per-state power draws –Assumes linearly independent equations –Requires device driver modifications Activity Tracking –Reentrancy not supported –Requires OS modifications

40 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? What are its limitations? How can it be used?

41 Where have all the Joules gone? 48 seconds of Blink “Slice” by device “Dice” by activity

42 Where have all the (milli)seconds gone? 48 seconds of BlinkActivity tracking

43 What’s the cost of overhearing in Low-Power Listening?

44 What’s going on? Why is TIMERA firing at 16Hz?

45 What’s the network-wide cost of a routing update? …we’re still working on that one Toy example of node to node transfer in paper Challenge: getting data off the node

46 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? What are its limitations? How can it be used?

47 Summary += call CPUActivity.set(ACT_LED0);... call CPUActivity.set(ACT_LED1);... call CPUActivity.set(ACT_LED2); Measure Slice Dice

48 Discussion

49 Backup Slides

50 Random

51 Power draw characteristics

52 Energy profiling architecture and implementation Device Drivers Hardware Application Operating System,,,,, scheduler propagate labels over deferred computations interrupts monitor/expose power statessave/restore/expose activity Energy Meter Offline: perform regressions, compute energy breakdowns, allocate usage to activities annotate code with activity labels log power states, activity labels, and time and energy usage, arbiters timersqueues propagate labels to/from devices call CPUActivity.set(ACT_SENSING);

53 Annotating an activity “paints” causally-connected actions task void sensorTask() { call CPUActivity.set(ACT_HUM); call Humidity.read(); call CPUActivity.set(ACT_TEMP); call Temperature.read(); } void sendIfDone() { if (sensingDone) { call CPUActivity.set(ACT_PKT); post sendTask(); sensingDone = 0; }

54 Many scientific data collection applications stream sensor data from sensor nodes to sinks SELECT* FROMsensors SAMPLE PERIOD5 min SELECTtime, epoch, id, parent, voltage, depth, hum, temp, toplight, botlight FROMsensors SAMPLE PERIOD5 min “Redwoods” [Tolle05] “Great Duck Island” [Szewczyk04]

55 Motivation for tracking activities TIMERB fires VTimer callback Timer.fired() callback –Sensor.start() invoked ADC.start() invoked … ADC.startDone() callback –Sensor.startDone() callback Sensor.read() invoked –ADC.read() … ADC.readDone() callback –Sensor.readDone(x) callback Sensor.stop() invoked –ADC.stop() invoked … ADC.stopDone() callback –Sensor.stopDone() callback Radio.start() invoked … Radio.startDone() callback –Radio.send(x) … Sense Send

56 Outline Introduction How does it work? How well does it work? –Range –Accuracy –Resolution –Responsiveness –Precision –Stability How much does it cost? What are its limitations? How could it be used?

57 Performance summary Performance MetriciCount Range1 µA – 100 mA Accuracy±20% Resolution0.1 µJ – 0.5 µJ Read latency24 µs Power overhead1% % Responsiveness< 125 µs Precision±1.5% (over 2 secs) Stability±1% (over 1 week)* * Frequency averaged over 1 second

58 Range: motes exhibit 10000:1 dynamic range (5 µA - 50 mA) iCount offers a dynamic range exceeding :1

59 Accuracy: iCount exhibits less than ±20% error over five decades of current draw Common Operating Points iCount exhibits lower error over mote operating range

60 Resolution: A Telos mote uses about 20 µJ per second when sleeping iCount resolves less than 1 µJ

61 Responsiveness: A mote’s energy-consuming events can occur in as little as 100 µs [Jiang07] iCount responds in less than 125 µs to sudden changes in current draw

62 Precision: precise over short periods (2 sec) so one or two samples is enough to estimate the instantaneous current All samples fall within ±2% of the median

63 Stability: iCount is stable over long periods (1 week) All samples fall within ±1% of the median

64 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? –Micro Benchmarks –Macro Benchmarks What are its limitations? How can it be used?

65 Hardware costs: wire and counter “wire” Counter HydroSolar Node (v2)

66 Energy costs: gate switching, counter overflows 1% 0.01%

67 Software costs (iCount) Control Access (24 CPU cycles / 24 µs) Overflow Initialization

68 Software costs (Quanto)

69 Space and Time costs

70 Outline Introduction Why is it hard and how do you solve it? How well does it work? How much does it cost? What are its limitations? How can it be used?

71 Input voltage dependence requires calibration (not fundamental, but an artifact of the MAX1724)

72 Calibration is required either at manufacturing or at run-time Calibration Reg

73 Regulator inefficiency makes battery gas gauging challenging

74 Is hardware energy metering really needed?