Presentation is loading. Please wait.

Presentation is loading. Please wait.

TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe.

Similar presentations


Presentation on theme: "TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe."— Presentation transcript:

1 TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe

2 Background Created at UCBerkeley Created at UCBerkeley Used by over 500 groups Used by over 500 groups tinyos.net tinyos.net Uses Uses Habitat Monitoring Habitat Monitoring Shooter Localization Shooter Localization Pursuer-Evader Pursuer-Evader

3 Design Features Cross-layer control Cross-layer control Static Resource allocation Static Resource allocation Snooping & scheduled communication Snooping & scheduled communication

4 Design Requirements Work with current and future designs Work with current and future designs Allow diverse implementation of operating system services and applications Allow diverse implementation of operating system services and applications Support varying hardware Support varying hardware Address the unusual challenges of sensor networks Address the unusual challenges of sensor networks

5 Hardware Motes-small resource constrained computing nodes Motes-small resource constrained computing nodes Mica motes Mica motes Radio capable of 40Kbps Radio capable of 40Kbps 4Mhz processor 4Mhz processor 1-4k of ram 1-4k of ram Up to 128K of storage Up to 128K of storage 32Khz external clock 32Khz external clock

6 General code info TinyOS requires 400 bytes for core OS TinyOS requires 400 bytes for core OS Supports Supports Event-driven execution Event-driven execution Flexible concurrency model Flexible concurrency model Tasks Tasks Events Events Component oriented application design Component oriented application design Apps use only the components they need Apps use only the components they need

7 Language Written in nesC Written in nesC An extension of C An extension of C Stripped down Stripped down No function pointers No function pointers Static Static No dynamic memory allocation No dynamic memory allocation Call-graph fully known at run time Call-graph fully known at run time

8 Writing in nesC Everything is a component Everything is a component Module – application code, implements interfaces Module – application code, implements interfaces Configurations – connect interfaces Configurations – connect interfaces All components use modular interfaces All components use modular interfaces Group commands and events together Group commands and events together Bi-directional interfaces to support hardware interrupts Bi-directional interfaces to support hardware interrupts

9 Writing in nesC Discourage sharing of data Discourage sharing of data Asynchronous operation with interrupts Asynchronous operation with interrupts Synchronous operation with tasks Synchronous operation with tasks Make event code atomic Make event code atomic Optimizes Optimizes Inlines small functions Inlines small functions Eleminates unreachable code Eleminates unreachable code Reduces cpu usage by 30% and code size by 10% Reduces cpu usage by 30% and code size by 10%

10 TinyOS features Multi-hop communication Multi-hop communication Tree-based collection Tree-based collection Intra-network routing Intra-network routing Dissemination Dissemination Broadcast – everyone transmits once Broadcast – everyone transmits once Epidemic – send when needed, snoop Epidemic – send when needed, snoop

11 TinyOS Features Scheduling Scheduling Timed listening and communication Timed listening and communication Reduces collisions Reduces collisions Extends Life Extends Life Synchronization Synchronization Time-stamped messages Time-stamped messages External Clock External Clock Accurate to within +/- 1 ms Accurate to within +/- 1 ms

12 Flexible Power Scheduling Idle listening costs tons of power Idle listening costs tons of power Provides communication schedules for local nodes Provides communication schedules for local nodes Tree based topology Tree based topology Adaptive slotted communication schedule used to route packets Adaptive slotted communication schedule used to route packets Allows for global routing schedules Allows for global routing schedules Base/root nodes have higher duty cycles Base/root nodes have higher duty cycles

13 Node States + Reservations Sending Sending Receiving Receiving Advertisement – receive from parent node with available reservation slot Advertisement – receive from parent node with available reservation slot Transmit pending – send reservation request Transmit pending – send reservation request Receive pending – receive a reservation request from child Receive pending – receive a reservation request from child Idle Idle

14 Effects of Power Scheduling High efficiency AA battery gives about 221 hours or 9 days of operation without power management. High efficiency AA battery gives about 221 hours or 9 days of operation without power management. 1274 hours or 53 days of operation with power scheduling 1274 hours or 53 days of operation with power scheduling Can be increased even more Can be increased even more

15 Trickle – A TinyOS component “A self-regulating algorithm for code propagation and maintenance in wireless sensor networks” “A self-regulating algorithm for code propagation and maintenance in wireless sensor networks” Designed with 3 principles Designed with 3 principles Low maintenance – scalable and infrequent data exchanges Low maintenance – scalable and infrequent data exchanges Rapid propagation – must be able to update every node in a network within 2 mins Rapid propagation – must be able to update every node in a network within 2 mins Scalability – handle few to hundreds of neighbors, don’t rely on mapped info because wireless networks change Scalability – handle few to hundreds of neighbors, don’t rely on mapped info because wireless networks change

16 Trickle’s (Polite Gossip) Periodically broadcast code summaries to local neighbors Periodically broadcast code summaries to local neighbors Stay quiet if another neighbor has broadcast identical code summary Stay quiet if another neighbor has broadcast identical code summary Older summaries result in broadcast of an update Older summaries result in broadcast of an update Newer summaries result in request for update Newer summaries result in request for update Few seconds of operation an hour Few seconds of operation an hour Prevents network flooding Prevents network flooding

17 Trickle’s Code Requires only 11 bytes of state on node Requires only 11 bytes of state on node Broadcasts and listens every interval I for time T Broadcasts and listens every interval I for time T Transmission time is T/2 Transmission time is T/2 Max of 2 transmissions every interval i Max of 2 transmissions every interval i Transmissions suppress other broadcasts Transmissions suppress other broadcasts Each node has a 1/(num of local node/ max 75) chance of broadcasting Each node has a 1/(num of local node/ max 75) chance of broadcasting

18 Trickle’s Code If over 75 neighbors, collisions begin to happen If over 75 neighbors, collisions begin to happen 512/75 or 1024/75 chance of broadcasting 512/75 or 1024/75 chance of broadcasting Does not have overhead of discovering and maintaining local groups Does not have overhead of discovering and maintaining local groups

19 Trickle’s Benefits Traditionally – have to rebroadcast all code to entire network if a node disconnects for a while Traditionally – have to rebroadcast all code to entire network if a node disconnects for a while Trickle – local distribution where needed Trickle – local distribution where needed Tremendous power savings Tremendous power savings 1 bit broadcasted costs 1000 cpu cycles of power 1 bit broadcasted costs 1000 cpu cycles of power 64k file costs days worth of operation time 64k file costs days worth of operation time

20 TinyDB – A TinyOS component Problems with databases in wireless networks Problems with databases in wireless networks Frequency of queries Frequency of queries Relevance of a node’s data Relevance of a node’s data Order of query samples Order of query samples Is a sample worth processing? Is a sample worth processing?

21 TinyDB features Query optimization Query optimization Do work on motes to reduce broadcast size Do work on motes to reduce broadcast size Eliminate recursive queries Eliminate recursive queries Identification of similar or unchanged info Identification of similar or unchanged info Ability to specify sampling rate and minimum sampling rate Ability to specify sampling rate and minimum sampling rate Dynamic adjustment of sampling rate based upon power and minimum specified lifetime Dynamic adjustment of sampling rate based upon power and minimum specified lifetime

22 Deluge – A variant of Trickle Trickle is designed for single packet dissemination Trickle is designed for single packet dissemination Deluge designed to handle large data objects Deluge designed to handle large data objects

23 Deluge Features Message suppression Message suppression Robust asymmetric link creation Robust asymmetric link creation Get rid of bad and find new neighbors Get rid of bad and find new neighbors Dynamic advertisement rate adjustment Dynamic advertisement rate adjustment Minimize collisions in node cells Minimize collisions in node cells Spatial multiplexing allows parallel transfers of data Spatial multiplexing allows parallel transfers of data

24 How Deluge works Divides data objects into fixed-size pages Divides data objects into fixed-size pages Broadcasts all pages, in order Broadcasts all pages, in order Must receive 1 page before can start the next Must receive 1 page before can start the next 16 bit cyclic redundancy checks 16 bit cyclic redundancy checks Updates OS by page Updates OS by page Capable of catching up nodes with only local communication Capable of catching up nodes with only local communication

25 Conclusions TinyOS is a highly customizable and adaptable operating system. TinyOS is a highly customizable and adaptable operating system. Used by hundreds of reported groups. Used by hundreds of reported groups. Open source. Open source. Dozens of modules available for download for free at tinyos.net Dozens of modules available for download for free at tinyos.net Any Questions?


Download ppt "TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe."

Similar presentations


Ads by Google