Tiny OS An Operating System for Sensor Networks

  • Slides: 20
Download presentation
Tiny. OS: An Operating System for Sensor Networks EEL 6935 Embedded Systems Long Presentation

Tiny. OS: An Operating System for Sensor Networks EEL 6935 Embedded Systems Long Presentation 1 Group Member: Qin Chen, Xiang Mao ECE@UFL 2/5/2010 1

Outline �Motivation �Sensor node (mote) specifications �Four requirements �Design �Meet the four requirements �Performance

Outline �Motivation �Sensor node (mote) specifications �Four requirements �Design �Meet the four requirements �Performance �Applications �Summary 2/5/2010 2

Mote HW specifications Program memory: 128 KB RAM: 4 KB Power: two AA batteries

Mote HW specifications Program memory: 128 KB RAM: 4 KB Power: two AA batteries Size: 1 by 1 inch Data rate: 38. 4 kbps 2/5/2010 3

Motivation �Why a new OS for sensor networks? 1) Limited resources � Small size,

Motivation �Why a new OS for sensor networks? 1) Limited resources � Small size, low cost and power consumption 2) Reactive concurrency � Many tasks � Real-time 3) Flexibility � HW and application variations 4) Low power � Low power operations � Flexible power management strategies 2/5/2010 4

Tiny. OS �Open source �Collaboration between UC, Berkeley, Intel, and Crossbow Technology �Widely used

Tiny. OS �Open source �Collaboration between UC, Berkeley, Intel, and Crossbow Technology �Widely used by over a hundred groups worldwide �Component based architecture �Programming language: nes. C �Supported development environment: Linux and Windows 2/5/2010 5

Main Concept Application = Collection of components + scheduler Compiled into a single executable

Main Concept Application = Collection of components + scheduler Compiled into a single executable Event-driven architecture Single shared stack 2/5/2010 Main (includes Scheduler) Application (User Components) Actuating Sensing Communication Hardware Abstractions 6

Component Model Component Computation entity Abstraction of HW resources Three abstractions Interface Command: downcall

Component Model Component Computation entity Abstraction of HW resources Three abstractions Interface Command: downcall Event: upcall Task: computation Split-phase Interface Task Interface Modules and configurations 2/5/2010 7

Component Library �Network protocols �Distributed services �Sensor drivers �Data acquisition tools �Timers �Storage 2/5/2010

Component Library �Network protocols �Distributed services �Sensor drivers �Data acquisition tools �Timers �Storage 2/5/2010 8

Execution Model events �Tasks Preempt POST �Run-to-completion �Non-preemptive FIFO scheduling commands �Atomic to each

Execution Model events �Tasks Preempt POST �Run-to-completion �Non-preemptive FIFO scheduling commands �Atomic to each other Interrupts �Interrupt handlers Hardware �Signaled asynchronously by HW �CAN preempt tasks �Nes. C compiler prevents nearly all data races 2/5/2010 Tasks FIFO commands Time 9

Network Messages �Active message (AM) � 36 -byte packet with a 1 -byte handler

Network Messages �Active message (AM) � 36 -byte packet with a 1 -byte handler ID �Event-driven �Handlers are registered to receive messages of a particular type �Provides an unreliable, single-hop datagram protocol �Higher-level protocol and multi-hop communication are built on top of the AM interface 2/5/2010 10

Comparison with Linux Tiny. OS Scheduling Preemptive, priority Non-preemptive FIFO Concurrency Process/thread Task IPC

Comparison with Linux Tiny. OS Scheduling Preemptive, priority Non-preemptive FIFO Concurrency Process/thread Task IPC Pipe, socket, semaphore NA Networking Socket/TCP/UDP/IP Active massage MMU Yes NA I/O Blocking Split-phase Kernel/user space Yes NA 2/5/2010 11

Req 1: Limited Resources �Absolute size �Components are resolved at compile time �Application specific

Req 1: Limited Resources �Absolute size �Components are resolved at compile time �Application specific version � Base Tiny. OS < 1 KB � Most applications < 16 KB � Tiny. DB < 64 KB (largest Tiny. OS application) �Footprint Optimization �Stripping symbol table �Prune dead code �Cross-component optimization �Size improvement: 8% -- 60% 2/5/2010 12

Req 2: Reactive Concurrency �Concurrency exhibited by applications �Example: Tiny. DB �Race detection �Context

Req 2: Reactive Concurrency �Concurrency exhibited by applications �Example: Tiny. DB �Race detection �Context switch �Task scheduling �Interrupt handler overhead �Real-time constraints �Burst of activities + lengthy idle interval �Time critical work + task 2/5/2010 13

Req 3: Flexibility �Fine-grained components �HW/SW transparency �Interposition 2/5/2010 14

Req 3: Flexibility �Fine-grained components �HW/SW transparency �Interposition 2/5/2010 14

Req 4: Low Power �Application specific �CPU power usage �Split-phase operation �Event driven execution

Req 4: Low Power �Application specific �CPU power usage �Split-phase operation �Event driven execution �Low-power sleep mode �Power management interface �Stop and start command � 15 days --- 5 years �HW/SW transparency �Replace SW components with HW ones 2/5/2010 15

Applications �Habitat monitoring �Low power �Robust �Object tracking �High concurrency: routing, data sharing, time

Applications �Habitat monitoring �Low power �Robust �Object tracking �High concurrency: routing, data sharing, time sync, localization, power management, and sensor filtering �Tiny. DB �Largest and most complex application �Concurrency control �Limited resources 2/5/2010 16

Summary �Small memory footprint �Application specific � Non-preemptive FIFO task scheduling �Power efficient �Application

Summary �Small memory footprint �Application specific � Non-preemptive FIFO task scheduling �Power efficient �Application specific � Multi-level power management �Efficient modularity �Component architecture � Function call (event, command) interface between components 2/5/2010 17

Improvements �FIFO scheduling shortest first? Earliest deadline first, etc? 2/5/2010 18

Improvements �FIFO scheduling shortest first? Earliest deadline first, etc? 2/5/2010 18

References �Tiny. OS: An Operating System for Sensor Networks, Ambient Intelligence, 2005 �Tiny. OS

References �Tiny. OS: An Operating System for Sensor Networks, Ambient Intelligence, 2005 �Tiny. OS tutorials, http: //docs. tinyos. net/index. php/Tiny. OS_Tutorials �http: //www. tinyos. net/ �http: //en. wikipedia. org/wiki/Tiny. OS �www. cs. virginia. edu/~cl 7 v/cs 851 talks/tinyos_chenyang. ppt 2/5/2010 19

Questions? 2/5/2010 20

Questions? 2/5/2010 20