nano-rk: an energy-aware resource centric rtos for sensor networks anand eswaran, anthony rowe and...
TRANSCRIPT
Nano-RK: An Energy-Aware Resource Centric RTOS for
Sensor Networks
Anand Eswaran, Anthony Rowe and Raj Rajkumar
Presented by: Ravi Ramaseshan
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 2
Design GoalsMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Small Footprint• Battery Lifetime Requirements• Networking Stack Support
• Classical OS Multitasking• Unified Sensor Interface Abstraction
• Priority-based Preemptive Scheduling• Timeliness and Schedulability• Enforcement of Resource Usage Limits
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 3
The Nano-RK ArchitectureMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Static Approach
– OS & application co-located in a single address space.
– Admission control and schedulability analysis tests done offline.
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 4
The Nano-RK ArchitectureMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• The Reservation Paradigm
The following are specified per task:– CPU Reservations– Sender/Receiver Bandwidth Reservations– Sensor/Actuator Reservations
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 5
The Nano-RK ArchitectureMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Power Awareness Support
– Energy consumed by a task is the sum of:• CPU energy• Radio energy• Sensor/Actuator energy
– Virtual Energy Reservations• (CPU, Network, Sensor)• Tweak parameters at pre-deployment stage.
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 6
The Nano-RK ArchitectureMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Socket Abstraction and Support
– High-level socket like abstraction– Following are handled by Nano-RK:
• Populating application buffers on receipt of packets
• Routing table data structures• Destination look-up functions• One-hop transmission of packets
– Aggregate packets
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 7
The Nano-RK ImplementationMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Hardware and Sensor Support
– Atmel ATMEGA128-based sensor node called Firefly build at CMU.
– Provides sensor system calls reading raw sensor data and converting it to meaningful units.
– Functions are atomic and reservations are updated on calls.
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 8
The Nano-RK ImplementationMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Task Management and Scheduling
– Task Control Block (TCB)Register context, priority, period, (CPU, Network,
Sensor) reservation-tuple, port identifiers
– Semaphores and mutexes for task synchronization
• Priority ceilings for mutexes
– Priority-based preemptive solution• PCEP protocol resource allocation protocol
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 9
The Nano-RK ImplementationMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Reservation Support
– Reservation Policy• Hard• Soft
– CPU: Cycles used by task– Network: Bytes sent / received– Sensors: Number of reads
Resource reservation exhausted
Slack
Task suspended
Slack
Task Suspended
Slack
Reservation Replenished
Reservation Replenished
Next Period
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 10
The Nano-RK ImplementationMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Network Stack
– Lightweight network protocol– Allows port based communication– Tightly integrated with OS allowing:
• Automatic packet aggregation• Network reservation• Buffer management policies
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 11
Application using Nano-RK APIsnrk_task_type Task1
Task1.task = Sound_Task;
Task1.TaskID = 1;
Task1.priority = 3;
Task1.Period = 10;
Task1.set_cpu_reserve = 5;
Task1.set_network_reserve = 3;
Task1.set_sensor_reserve = 3;
nrk_activate_task (Task1);
Motivation
Architecture
Implementation
Sample Application
Future Work
Contributions
void Sound_Task () {
int prev_sound, sound;
char tx_buff[1];
nrk_port_des my_port;
port_des =
nrk_port (tx_buff, 1, 0);
nrk_connect (port_des, -1);
while (1) {
sound = read_sensor (MIC);
tx_buff[0] = sound;
nrk_port_send (my_port);
wait_until_send ();
prev_sound = sound
nrk_suspend_task ();
}
}
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 12
Future WorkMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Support end-to-end deadline guarantees for packet delivery
• Routing based on TDMA using global time synchronization
• Dynamic Energy-efficient routing schemes
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 13
ContributionsMotivation
Architecture
Implementation
Sample Application
Future Work
Contributions
• Classical structured multitasking OS– Allows sensor application developers to work in a
familiar paradigm resulting in short learning curves and quicker application development times.
• API support for:– Task management– Synchronization– IPC and high level network abstractions
• Reservation based approach to provide bounds on timeliness & QoS of node life.
Nano-RK: An Energy-Aware Resource Centric RTOS for Sensor Networks 14
Comparison with TinyOS
• The TinyOS is less intuitive for application developers.
• TinyOS has a smaller memory footprint.• Tasks cannot be preempted in TinyOS.• Real Time Embedded Operating System?
– No priority based scheduling policy– No resource allocation policy
• Design objective: Flexibility and accelerate innovation.
Motivation
Architecture
Implementation
Sample Application
Future Work
Contributions
Comparison