nano rk
play

Nano-RK: an Energy-aware Resource-centric RTOS for Sensor Networks - PowerPoint PPT Presentation

Nano-RK: an Energy-aware Resource-centric RTOS for Sensor Networks Anand Eswaran Anthony Rowe Raj Rajkumar Anand Eswaran, Anthony Rowe, Raj Rajkumar { aeswaran,agr,raj} @ece.cmu.edu Real-Time and Multimedia Systems Lab Carnegie Mellon


  1. Nano-RK: an Energy-aware Resource-centric RTOS for Sensor Networks Anand Eswaran Anthony Rowe Raj Rajkumar Anand Eswaran, Anthony Rowe, Raj Rajkumar { aeswaran,agr,raj} @ece.cmu.edu Real-Time and Multimedia Systems Lab Carnegie Mellon University Presented by Anthony Rowe RTSS 2005 Real-Time and Multimedia Systems Laboratory

  2. Secure Sensor Networks for Ph Physical Infrastructures i l I f t t • Develop a secure software platform for infrastructure sensor networks to be deployed in physical structures such as factories, buildings, homes, bridges, factories, buildings, homes, bridges, campuses, vehicles, ships and planes. • Provide continual monitoring of operational health and safety health and safety, • Report malfunctions (nearly) instantly, and • Support mobile nodes and track people. Real-Time and Multimedia Systems Laboratory

  3. What is nanoRK? • A Real-time Operating System for sensor nodes for use in wireless sensor networks – Priority-Based Preemptive Multitasking – Resource Reservations – Built-in Multi-hop Networking Support Real-Time and Multimedia Systems Laboratory

  4. Related Work • Tiny OS (Berkeley) – Large public following and support L bli f ll i d t – Compact – Cooperative Multitasking – No timing guarantees for tasks • Mantis OS (University of Colorado) – No real-time scheduling No real time scheduling – No reservation support • uCos, Emerald, OSEK – Still too large – Not network centric Real-Time and Multimedia Systems Laboratory

  5. NanoRK Motivation • Quicker Development Cycles p y – Traditional OS abstractions allow for quicker learning curves and help abstract away low level details • Scaling Technology • Scaling Technology – Sensor Nodes will become increasingly complex as they begin to manage multiple tasks – Local Processing is much cheaper than using the network Local Processing is much cheaper than using the network • Resource Reservations (Energy Budget) – Reservations can enforce energy and communication Reservations can enforce energy and communication budgets to minimize negative impact on network lifetimes from unintentional errors or malicious behavior on some nodes Real-Time and Multimedia Systems Laboratory

  6. NanoRK Motivation • Why Priority-based scheduling? Period Period Execution Time Execution Time Network Radio Sporadic 10ms Audio Sensor 200 hz 10us Light Sensor 166 hz 10us Smart Camera 1 hz 300ms Global Positioning 5 hz 10ms Time-triggered task interleaving can become gg g daunting… Furthermore, what if a new sensor is added or a period changes? Real-Time and Multimedia Systems Laboratory

  7. Goals of a Sensor RTOS (1 of 2) ( ) • Multitasking with Priority-Based Multitasking with Priority Based Preemption – Respond on a timely basis to critical events p y – Support predictability and schedulability • Built-in Network Support u t et o Suppo t – Decrease coding effort to implement custom communication protocols • Enforce Energy Usage Limits – Meet Battery Lifetime Requirements Real-Time and Multimedia Systems Laboratory

  8. Goals of a Sensor RTOS (2 of 2) ( ) • Unified Sensor / Network API Unified Sensor / Network API – Sensors and actuators support in a device driver manner that is abstracted away from the user • Small Footprint – Current trends in microcontrollers show larger ROM sizes (64Kb to 128KB) and smaller RAM sizes (2KB to 8KB) sizes (2KB to 8KB) Real-Time and Multimedia Systems Laboratory

  9. FireFly Hardware y Atmega128L CC2420 (802.15.4) Light, Temp, Audio, PIR, Acceleration, PIR, Acceleration, Ultrasound Global AM band Synchronization Synchronization Real-Time and Multimedia Systems Laboratory

  10. FireFly Synchronization Hardware Real-Time and Multimedia Systems Laboratory y y

  11. NanoRK Resources Component Resource 45 μ S 45 μ S Context Swap Time Context Swap Time Mutex Structure Overhead 5 Bytes per Resource 32 � 128 bytes (64 bytes by default) Stack Size Per Task y ( y y ) OS Struct Overhead 50 bytes Per Task Network Overhead 164 bytes Total Typical Configuration: 2KB RAM, 10KB ROM (8 tasks, 8 mutexes, 4 16 byte network buffers) Current Hardware Platform : 4Mhz Atmega128L with Chipcon CC2420 802.15.4 transceiver Real-Time and Multimedia Systems Laboratory

  12. NanoRK Reservations • CPU CPU – Each Task can be given a budget of how long it is allowed to execute per a given period • Network – Per Task Budget on Network Usage – Transmit and Receive Packets and/or Bytes • Sensors / Actuators – Number of System Calls to a particular peripheral per a given period Real-Time and Multimedia Systems Laboratory

  13. Virtual Energy Reservations gy • {CPU, Network, Sensors} – Together comprise the total energy usage of the node • Static Offline Budget Enforcement – It is possible to calculate a node lifetime given a certain It is possible to calculate a node lifetime given a certain energy budget Node Node Reserve Reserve TX Rate TX Rate Lifetime Lifetime Lifetime Lifetime w/ out w/ [ TX, RX ] a c Reserve Reserve a [1,2] 1 8 years 8 years e e G G b X 300 3.5 days 3.5 days b d c [1,2] 1 5 years 5 years d d [1 2] [1,2] 1 1 3 9 days 3.9 days 5 years 5 years e [1,2] 1 4 days 2.9 years Real-Time and Multimedia Systems Laboratory

  14. NanoRK Reservations • What if a reservation is violated? What if a reservation is violated? • Hard Reservation – For CPU reservations the task is preempted – For CPU reservations, the task is preempted – For Sensor/Network reservations, an error is returned to the task making the system call • Firm Reservations – The task is allowed to consume slack resources until they have been depleted Real-Time and Multimedia Systems Laboratory

  15. NanoRK Architecture User Applications Real-Time Scheduler IPC Task S Sensor Management Drivers Network Stack E Energy Reservations R ti Kernel Microcontroller 802.15.4 Radio Hardware Real-Time and Multimedia Systems Laboratory

  16. NanoRK Architecture User Applications Real Time Scheduler Real-Time Scheduler • Priority-based Scheduling Real-Time Scheduler IPC • Static Design-time • Static Design-time Task Sensor Framework Management Drivers Network • Priority Ceiling Protocol Stack Energy Reservations Kernel Microcontroller 802.15.4 Radio Hardware Real-Time and Multimedia Systems Laboratory

  17. NanoRK Architecture User Applications • Task Management T k M t Real-Time Scheduler IPC – Two 32 bit counters • { Seconds, Nanoseconds } { , } Task Task Sensor Sensor – Periodic Task Switching Management Drivers Network • Triggered by a One Shot Timer Stack or an Event Energy Reservations Energy Reservations – Enables Fine Grained Timing Kernel Control Microcontroller 802.15.4 Radio H Hardware d Real-Time and Multimedia Systems Laboratory

  18. Nano-RK Task Specs nrk_task_type Task1; Task1.task = Sound_Task; Task1.Ptos = (void *) &Stack1[STACKSIZE - 1]; Task1.TaskID = 1; Task1.priority = 3; Task1.Period = 1000; // ms Task1.set_reserve[CPU] = 50; //ms Task1.set_reserve[NETWORK_PACKETS] = 3; Task1 set reserve[SENSE ACTUATE] = 12; Task1.set_reserve[SENSE_ACTUATE] = 12; nrk_activate_task(Task1); Real-Time and Multimedia Systems Laboratory

  19. NanoRK Architecture User Applications • Sensor Drivers S D i Real-Time Scheduler IPC – System Calls • Allows for arbitration if two Task Task Sensor Sensor tasks read from a non-atomic Management Drivers Network sensor Stack – Raw ADC Values Energy Reservations Energy Reservations • Temp = 67 Kernel – Real World Values • Temp = 24 (°C) p ( ) Microcontroller 802.15.4 Radio H Hardware d Real-Time and Multimedia Systems Laboratory

  20. NanoRK Architecture User Applications • Inter Process I t P Real-Time Scheduler IPC Communication – Use Semaphores to arbitrate U S h t bit t Task Task Sensor Sensor Management Drivers shared memory Network communication Stack Energy Reservations Energy Reservations – “Message Boxes” “M B ” Kernel Microcontroller 802.15.4 Radio H Hardware d Real-Time and Multimedia Systems Laboratory

  21. NanoRK Network Stack • Zerocopy Buffering Mechanism • Zerocopy Buffering Mechanism – TX and RX buffers are in application space – Kernel Manages network data through pointer manipulation into application space Network • Port Abstraction Stack – A port allows applications to direct their data to individual tasks on each node • Network Task • Network Task – Handles Forwarding Packets, Routing, etc. Real-Time and Multimedia Systems Laboratory

  22. NanoRK Network Stack • CSMA MAC Support • CSMA MAC Support – Low Power Listen (LPL) MAC support • TDMA MAC Support • TDMA MAC Support – RT-Link: Globally Time Synchronized MAC protocol Network • Ad-Hoc Routing Support • Ad-Hoc Routing Support Stack – Tasks can access low level routing table – Ex: An AODV or DSR TASK can be responsible for establishing and managing routes Real-Time and Multimedia Systems Laboratory

  23. Detailed NanoRK Network Stack Network Task Network Task U User Application A li ti * … sock_fd * TX B ff TX Buffer Receiver Interrupt Config … * NanoRK Kernel Kernel sock_fd k fd Forwarding Buffers RX Buffer * Router MAC Config Routing Table Radio Interface Radio Interface Real-Time and Multimedia Systems Laboratory

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend