Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid.

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

System Integration and Performance
Operating System.
AVEKSHA: A Hardware-Software Approach for Non-intrusive Tracing and Profiling of Wireless Embedded Systems SenSys 2011 Best Paper Matthew Tancreti, Mohammad.
SoNIC: Classifying Interference in Sensor Networks Frederik Hermans et al. Uppsala University, Sweden IPSN 2013 Presenter: Jeffrey.
Thread Criticality Predictors for Dynamic Performance, Power, and Resource Management in Chip Multiprocessors Abhishek Bhattacharjee Margaret Martonosi.
Nemo: A High-fidelity Noninvasive Power Meter System for Wireless Sensor Networks Ruogu Zhou, Guoliang Xing Department of Computer Science and Engineering,
Sensor Network Platforms and Tools
Overview: Chapter 7  Sensor node platforms must contend with many issues  Energy consumption  Sensing environment  Networking  Real-time constraints.
1 An Approach to Real-Time Support in Ad Hoc Wireless Networks Mark Gleeson Distributed Systems Group Dept.
Chapter 8 Hardware Conventional Computer Hardware Architecture.
Chapter 13 Embedded Systems
TinyOS Introduction Advanced Computer Networks. TinyOS Outline  Introduction to the Architecture of TinyOS and nesC  Component Model –Components, interfaces,
Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
An Energy-Efficient MAC Protocol for Wireless Sensor Networks
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
1 Tracking Energy in Networked Embedded Systems Rodrigo Fonseca † *, Prabal Dutta †, Philip Levis ‡, Ion Stoica † Computer Science Division † University.
How to Code on TinyOS Xufei Mao Advisor: Dr. Xiang-yang Li CS Dept. IIT.
Mica: A Wireless Platform for Deeply Embedded Networks Jason Hill and David Culler Presented by Arsalan Tavakoli.
1 Energy Metering for Free: Augmenting Switching Regulators for Real-Time Monitoring Prabal Dutta †, Mark Feldmeier ‡, Joseph Paradiso ‡, and David Culler.
1 Tracking Energy in Networked Embedded System Prabal Dutta Computer Science Division University of California, Berkeley
Integrated  -Wireless Communication Platform Jason Hill.
Radio Stack Iteration How to improve the CC1000 Joe Polastre January 15, 2004 NEST Retreat.
1 Ultra-Low Duty Cycle MAC with Scheduled Channel Polling Wei Ye Fabio Silva John Heidemann Presented by: Ronak Bhuta Date: 4 th December 2007.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
A Framework for Patient Monitoring A. L. Praveen Aroul, William Walker, Dinesh Bhatia Department of Electrical Engineering University of Texas at Dallas.
Versatile low power media access for wireless sensor networks Joseph PolastreJason HillDavid Culler Computer Science Department University of California,Berkeley.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
G Robert Grimm New York University Receiver Livelock.
Chapter 13 Embedded Operating Systems Eighth Edition By William Stallings Operating Systems: Internals and Design Principles.
Xen and the Art of Virtualization. Introduction  Challenges to build virtual machines Performance isolation  Scheduling priority  Memory demand  Network.
CS 423 – Operating Systems Design Lecture 22 – Power Management Klara Nahrstedt and Raoul Rivas Spring 2013 CS Spring 2013.
Avrora Scalable Sensor Simulation with Precise Timing Ben L. Titzer UCLA CENS Seminar, February 18, 2005 IPSN 2005.
Spring 2000, 4/27/00 Power evaluation of SmartDust remote sensors CS 252 Project Presentation Robert Szewczyk Andras Ferencz.
1 Software Development Infrastructure for Sensor Networks  Operating systems ( TinyOS )  Resource (device) management  Basic primitives  Protocols.
FlockLab: A Testbed for Distributed, Synchronized Tracing and Profiling of Wireless Embedded Systems IPSN 2013 NSLab study group 2013/04/08 Presented by:
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
By: R Jayampathi Sampath
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
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Typical Microcontroller Purposes
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
1 XYZ: A Motion-Enabled, Power Aware Sensor Node Platform for Distributed Sensor Network Applications Presenter: James D. Lymberopoulos, A. Savvides.
Other Chapters From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
Dhanshree Nimje Smita Khartad
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.
Versatile Low Power Media Access for Wireless Sensor Networks Sarat Chandra Subramaniam.
Wireless Sensor Networks Nov 1, 2006 Jeon Bokgyun
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Xiong Junjie Node-level debugging based on finite state machine in wireless sensor networks.
Accurate Prediction of Power Consumption in Sensor Networks University of Tubingen, Germany In EmNetS 2005 Presented by Han.
ChibiOS/RT Demo A free embedded RTOS
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
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.
On the Effectiveness of Energy Metering on Every Node
Simulation of Distributed Application and Protocols using TOSSIM
Ultra-Low Duty Cycle MAC with Scheduled Channel Polling
CS294-1 Reading Aug 28, 2003 Jaein Jeong
A Simple Sensing Program Structure
Investigating Mac Power Consumption in Wireless Sensor Network
Presentation transcript:

Energy Metering and Tracking with iCount and Quanto IPSN 2009 Tutorial – San Francisco – April 16 th, 2009 Prabal Dutta Rodrigo Fonseca Thoma Schmid

quanto /’kwän  to/ Portuguese (from Latin quantu) interrogative pronoun - how much, what amount, what quantity, what number, what price

Introductions tell us about yourselves

Schedule 1:00 – 2:30 Presentation 2:30 – 3:00 Break 3:00 – 5:00 Hands on Goals: –Present the concepts behind Quanto –Get you excited by instrumenting, running, and analyzing simple applications

Outline Demo: Blink Introduction How much energy? iCount –Principles –Calibration What is using my energy? –Energy breakdown Why is it using my energy? –Activity Tracking Quanto in Practice –Architecture –Interesting Findings –Recording Information Hands on Session

Blink Demo

7 Blink: What’s happening? 48 seconds of Blink Dedicated Resources Logical Threads of Execution Shared Resources

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

9 Blink: Instrumentation module BlinkC () { uses interface Timer as Timer0; uses interface Timer as Timer1; uses interface Timer as Timer2; uses interface Leds; uses interface Boot; } Implementation { event void Boot.booted() { call Timer0.startPeriodic(250); call Timer1.startPeriodic(500); call Timer2.startPeriodic(1000); } event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); } module BlinkC () { uses interface Timer as Timer0; uses interface Timer as Timer1; uses interface Timer as Timer2; uses interface Leds; uses interface Boot; } Implementation { event void Boot.booted() { call CPUActivity.set(ACT_LED0); call Timer0.startPeriodic(250); call CPUActivity.set(ACT_LED1); call Timer1.startPeriodic(500); call CPUActivity.set(ACT_LED2); call Timer2.startPeriodic(1000); } event void Timer0.fired() { call Leds.led0Toggle(); } event void Timer1.fired() { call Leds.led1Toggle(); } event void Timer2.fired() { call Leds.led2Toggle(); } }

10 Real applications: Many services making concurrent use of same hardware Hardware Power SupplySensorsMCURadioStorage “Trio Network” [Dutta06]

11 Three basic challenges Energy metering –Measure energy usage –i(t)  p(t)  ∫p(t)dt Energy breakdown –Slice usage horizontally –Allocate usage to energy sinks Activity tracking –Dice usage vertically –Track causal connections iCount iCount + P-states + Regression Labels

Outline Demo: Blink Introduction How much energy? iCount –Principles –Calibration What is using my energy? –Energy breakdown Why is it using my energy? –Activity Tracking Quanto in Practice –Architecture –Interesting Findings –Toolchain Hands on Session

13 Three basic challenges Energy metering –Measure energy usage –i(t)  p(t)  ∫p(t)dt Energy breakdown –Slice usage horizontally –Allocate usage to energy sinks Activity tracking –Dice usage vertically –Track causal connections iCount Labels iCount + P-states + Regression

14 Measuring: wide horizontal/vertical dynamic range TX packet at 1% duty cycle (20 ms / 2 s) 4,000 ms 640,000 ms 86,400,000 ms [Farkas00] 30 ms

15 Dynamic range in power draw exceeds 10,000:1 < 1 µW > 50 mW

16 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]

17 Key insight: Switching regulators inherently meter energy If your platform has a PFM switching regulator… (many do) add a wire iCount energy meter design

18 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

19 Each cycle transfers a fixed energy quanta to the load ΔE=½Li 2 P=ΔE/ΔtP=ΔE/Δt Counting cycles translates to measuring energy Regulator Cycles

20 This simple design works surprisingly well MAX1724 Prototype implementation [HydroWatch] (UCB) [Benchmark] (UCB) [Quanto] (UCB) [Quanto+] (UCLA) [Senseweb] (WSU)

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

22 iCount Performance summary Performance MetriciCount Range1 µA – 100 mA Accuracy±10% (±20%, full range) Resolution0.1 µJ – 0.5 µJ Read latency24 µs Power overhead0.01% - 1% Responsiveness< 125 µs Precision±1.5% (over 2 secs, N=167) Stability±1% (over 1 week)* * Frequency averaged over 1 second

Outline Demo: Blink Introduction How much energy? iCount –Principles –Calibration What is using my energy? –Energy breakdown Why is it using my energy? –Activity Tracking Quanto in Practice –Architecture –Interesting Findings –Toolchain Hands on Session

24 Three basic challenges Energy metering –Measure energy usage –i(t)  p(t)  ∫p(t)dt Energy breakdown –Slice usage horizontally –Allocate usage to energy sinks Activity tracking –Dice usage vertically –Track causal connections iCount Labels iCount + P-states + Regression

25 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 “Itsy”

26 Not all energy sinks can be instrumented MCU Radio Power FlashSensorsLEDs PowerData Control USART DMA OSC Timer ADC RXTX LNAPA CPU

27 A different approach to energy slicing: power state tracking* On Off * H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, Export device power states Through a narrow interface OS tracks/logs state transitions

28 Estimate energy breakdowns with regression For every power 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

29 Example power state equations ΔE/Δt= α 1 p 1 + α 2 p 2 + α 3 p 3 + α 4 p 4 + α 5 p 5 2/1= 1·p 1 + 1·p 2 + 1·p 3 + 1·p 4 + 0·p 5 3/1.1= 1·p 1 + 1·p 2 + 1·p 3 + 1·p 4 + 1·p 5 1/0.4= 1·p 1 + 0·p 2 + 1·p 3 + 1·p 4 + 1·p 5 0/0.4= 1·p 1 + 0·p 2 + 0·p 3 + 1·p 4 + 1·p 5 1/0.6= 1·p 1 + 0·p 2 + 0·p 3 + 0·p 4 + 1·p 5 0/0.6= 1·p 1 + 0·p 2 + 0·p 3 + 0·p 4 + 0·p 5 ΔEΔE α’s pipi Y = ΔE/Δt AP = Y P = A -1 Y W = diag( √(Δt*ΔE) ) P = (A T WA) -1 A T WY

Outline Demo: Blink Introduction How much energy? iCount –Principles –Calibration What is using my energy? –Energy breakdown Why is it using my energy? –Activity Tracking Quanto in Practice –Architecture –Interesting Findings –Toolchain Hands on Session

31 Three basic challenges Energy metering –Measure energy usage –i(t)  p(t)  ∫p(t)dt Energy breakdown –Slice usage horizontally –Allocate usage to energy sinks Activity tracking –Dice usage vertically –Track causal connections iCount Labels iCount + P-states + Regression

32 Tracking: gap between what is measured and what matters Itsy measured –Breakdown by subsystem –For each 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

33 What’s wrong with subsystems, PCs, and PIDs? Subsystem –No distinction between different logical activities –Is radio sending a routing beacon or data packet? Program Counter –Pinpoints code hotspots –But, not the data on which the code operates –Routing beacon? Time sync packet? Data packet? Process ID –Most sensornet applications are I/O bound –Most energy is spent outside the CPU –For I/O-bound processes, PID-based sampling is biased

34 Activities* are what actually matters * 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, H. Zeng et al. “ECOSystem: Managing Energy as a First Class Operating Systems Resource”, ASPLOS’02, A causally-connected set of operations… whose distinct resource consumptions… should be grouped together for accounting*

35 Three steps to activity tracking Annotating –Any abstraction can introduce an annotation –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

36 Annotating an activity “paints” causally-connected actions “Sensing” involves –Sensor... –CPU, ADC, I2C bus, … “Storing” involves –Flash… –CPU, SPI bus, timers, … Initiate annotation with CPUActivity.set( ) Quanto automatically propagates labels... CPUActivity.set(ACT_SENSING); Sensor.read();... CPUActivity.set(ACT_STORING); Flash.write(...);... CPU Sensor Flash Node A Act: sensing Act: storing

37 Propagating labels over deferred computations Examples –CPU  Post task (deferred function call)  CPU –CPU  Queue object  CPU Task Scheduler –Add activity field to task structure –Set activity field on task posting –Restore activity on task invocation Queue –Tag each entry with its activity label –Write activity label on enqueue –Restore activity label on dequeue

38 Propagating labels over the network CPU Flash Radio Node B CPU Sensor Radio Node A Act: sensingAct: sending Proxy Rx activityPacket Tx Add hidden field to packet Sender’s OS sets activity field Radio.send(message_t* msg) {... msg->header->activity = CPUActivity.get();... }

39 Propagating unknown labels using proxy activities CPU Flash Radio Node B CPU Sensor Radio Node A Act: sensingAct: sending Proxy Rx activityPacket Tx Every interrupt causes energy consumption before activity label is identified –Interrupt  CPU –Timer  CPU –Radio  CPU Proxy activity provides ephemeral label Binding with real activity occurs when label is clear message_t* Radio.recv(message_t* msg, void* payload, uint8_t len) {... CPUActivity.bind(msg->hdr->activity);... }

40 Concurrent activities on shared resources async command void Timer.start() { call TimerActivity.add(call CPUActivity.get());... } async event void HardwareTimer.fired() { signal Timer.fired(); call TimerActivity.remove(call CPUActivity.get());... } Activity A Activity B Timer Power State Timer.firedTimer.start Timer.firedTimer.start AA/BB Timer Activities Add A Add B Rem A Rem B Time

41 Three basic challenges Energy metering –Measure energy usage –i(t)  p(t)  ∫p(t)dt Energy breakdown –Slice usage horizontally –Allocate usage to energy sinks Activity tracking –Dice usage vertically –Track causal connections iCount iCount + P-states + Regression Labels

Outline Demo: Blink Introduction How much energy? iCount –Principles –Calibration What is using my energy? –Energy breakdown Why is it using my energy? –Activity Tracking Quanto in Practice –Architecture –Interesting Findings –Recording Information Hands on Session

43 Summary of Quanto energy profiling architecture Device Drivers Hardware Application Operating System,,,,, propagate labels over deferred computations monitor/expose power statessave/restore/expose activity meter energy usage annotate code with activity labels propagate labels to/from devices log and process activity/power data

44 Interesting Findings: catching power bugs. Why is TIMERA firing at 16Hz?!?

45 How much time and energy does using DMA really save? Using DMA can subvert MAC layer fairness

46 What’s the cost of false alarms in Low-Power Listening? PreambleD TX RX D T listen Noise Overhearing adds significant unpredictability to node lifetime

47 Recording: log, export, and post-process data Challenge is getting data off the node Reason most applications are still toys Burst: 10KB RAM Log + UART Out Burst 128K FIFO Log + UART Out Continuous: Compression + UART Out Continuous: Parallel Out + Ethernet

Logging Solutions Log to RAM: –12 bytes per logged event –Buffer for 700 events –Dump to UART once buffer is full Log to parallel port –Fast, real-time logging –Not scalable to multiple nodes Log to the UART, compressed –Blink running at 50ms, no compression: logging takes 80.9% of CPU time –With compression: 25% of CPU time, compression of 3.84X (each log entry ~ 3.1 bytes) –Not enough for larger applications RadioCountToLeds, 2 –427 ev/s –With LPL: 1617 ev/s

Logging Solutions Don’t trace: count Step 1: online accounting of activities –Time per activity per resource –Almost ready Step 2: online regression –Accumulating power state info –Doing regression online Current Status –The next release of Quanto will have online accounting of the activity times

Hands-on Section Instrument, record data, process, visualize –Basic: Blink –Cross-network: RadioCountToLeds If we have time: –LPL: Bounce –Another example: FTSP

Questions

References Quanto Website: – Quanto code: –tinyos-2.x-contrib/berkeley/quanto Network Management Interface: Papers: –“Energy Metering for Free: Augmenting Switching Regulators for Real-Time Monitoring” Prabal Dutta, Mark Feldmeier, Joseph Paradiso, David Culler. IPSN’08 –“Quanto: Tracking Energy in Networked Embedded Systems”, Rodrigo Fonseca, Prabal Dutta, Philip Levis, and Ion Stoica. OSDI’08