Sensor Networks. Part 3: TinyOS. CATT Short Course, March 11, 2005 Mark Coates Mike Rabbat. Operating Systems 101

Similar documents
The Emergence of Networking Abstractions and Techniques in TinyOS

The Emergence of Networking Abstractions and Techniques in TinyOS

System Architecture Directions for Networked Sensors[1]

TinyOS. Lecture Overview. UC Berkeley Family of Motes. Mica2 and Mica2Dot. MTS300CA Sensor Board. Programming Board (MIB510) 1.

Sensors Network Simulators

Link Estimation and Tree Routing

Sensors as Software. TinyOS. TinyOS. Dario Rossi Motivation

nesc Prof. Chenyang Lu How should network msg be handled? Too much memory for buffering and threads

Programming TinyOS. Lesson 2. Execution Flow. Tasks. commands. Events generated by interrupts preempt tasks Tasks do not preempt tasks

Networking Sensors, I

Self-Organization in Autonomous Sensor/Actuator Networks [SelfOrg]

Sensor Network Protocols

Outline. Mate: A Tiny Virtual Machine for Sensor Networks Philip Levis and David Culler. Motivation. Applications. Mate.

TOSSIM simulation of wireless sensor network serving as hardware platform for Hopfield neural net configured for max independent set

TinyOS. Jan S. Rellermeyer

WSN Routing Protocols

Programming Sensor Networks

The Internet vs. Sensor Nets

Wireless and WiFi. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Sensor Network Application Development ZIGBEE CONCEPTS 2

Node activity scheduling in wireless sensor networks

Wireless Sensor Networks: Clustering, Routing, Localization, Time Synchronization

nesc Ø Programming language for TinyOS and applications Ø Support TinyOS components Ø Whole-program analysis at compile time Ø Static language

Mobile and Ubiquitous Computing TinyOS application example. Niki Trigoni

More wireless: Sensor networks and TCP on mobile hosts

CHAPTER 2 WIRELESS SENSOR NETWORKS AND NEED OF TOPOLOGY CONTROL

Introduction to Programming Motes

Middleware for Sensor Networks

The Flooding Time Synchronization Protocol

Presented by: Murad Kaplan

SENSOR-MAC CASE STUDY

MAC LAYER. Murat Demirbas SUNY Buffalo

Exam Ad Hoc and Sensor Networks HS 2007

Availability and End-to-end Reliability in Low Duty Cycle Multihop Wireless Sensor Networks

Embedded Internet and the Internet of Things WS 12/13

Routing over Low Power and Lossy Networks

Vorlesung Kommunikationsnetze Research Topics: QoS in VANETs

ROUTING ALGORITHMS Part 2: Data centric and hierarchical protocols

Wireless Sensor Networks

Politecnico di Milano Advanced Network Technologies Laboratory. Internet of Things. TinyOS Programming and TOSSIM (and Cooja)

Secure Routing in Wireless Sensor Networks: Attacks and Countermeasures

Group Members: Chetan Fegade Nikhil Mascarenhas. Mentor: Dr. Yann Hang Lee

Information Brokerage

Wireless Sensor Networks (WSN)

15-441: Computer Networking. Lecture 24: Ad-Hoc Wireless Networks

Fig. 2: Architecture of sensor node

Routing in Sensor Networks

Wireless Sensor Networks

Lecture 8 Wireless Sensor Networks: Overview

CS 425 / ECE 428 Distributed Systems Fall 2014

Wireless and Mobile Networks 7-2

Asymmetry-Aware Link Quality Services in Wireless Sensor Networks

Middleware for Wireless Sensor Networks: An Outlook

MULTIPLE ACCESS PROTOCOLS 2. 1

End-To-End Delay Optimization in Wireless Sensor Network (WSN)

Introduction to SimpliciTI

Data Communications. Data Link Layer Protocols Wireless LANs

CS 410/510 Sensor Networks Portland State University

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Robust Multi-Hop Time Synchronization in Sensor Networks

Wireless Sensor Networks Chapter 7: Naming & Addressing

Technology Perspective

The Once and Future Internet of EveryThing

Mobile and Sensor Systems

Introduction to SimpliciTI. Low-power RF protocol from Texas Instruments

ADB: An Efficient Multihop Broadcast Protocol Based on Asynchronous Duty-Cycling in Wireless Sensor Networks

Reliable Time Synchronization Protocol for Wireless Sensor Networks

ECE 158A: Lecture 13. Fall 2015

Geographic Routing in Simulation: GPSR

Ad Hoc Networks: Introduction

QoS Challenges and QoS-Aware MAC Protocols in Wireless Sensor Networks

A Low-Energy Adaptive and Distributed MAC Protocol for Wireless Sensor-Actuator Networks

ROUTING ALGORITHMS Part 1: Data centric and hierarchical protocols

Etiquette protocol for Ultra Low Power Operation in Sensor Networks

A Performance Comparison of Multi-Hop Wireless Ad Hoc Network Routing Protocols. Broch et al Presented by Brian Card

Wireless Sensornetworks Concepts, Protocols and Applications. Chapter 5b. Link Layer Control

Project: IEEE P Working Group for Wireless Personal Area Networks N

Ad hoc and Sensor Networks Chapter 6: Link layer protocols. Holger Karl

System Architecture Directions for Networked Sensors. Jason Hill et. al. A Presentation by Dhyanesh Narayanan MS, CS (Systems)

A MODEL DRIVEN DATA GATHERING ALGORITHM FOR WIRELESS SENSOR NETWORKS DHINU JOHNSON KUNNAMKUMARATH

Implementation of Gradient Routing in WSNs

Sensor Network Protocol Design and Implementation. Philip Levis UC Berkeley

CSC 4900 Computer Networks: Wireless Networks

Intelligent Transportation Systems. Medium Access Control. Prof. Dr. Thomas Strang

Sl.No Project Title Year

CSMA based Medium Access Control for Wireless Sensor Network

MAC in /20/06

Pervasive and Mobile Computing

Introduction to Real-Time Communications. Real-Time and Embedded Systems (M) Lecture 15

DASH7 ALLIANCE PROTOCOL - WHERE RFID MEETS WSN. public

Wireless Local Area Networks (WLANs)) and Wireless Sensor Networks (WSNs) Computer Networks: Wireless Networks 1

WPAN/WBANs: ZigBee. Dmitri A. Moltchanov kurssit/elt-53306/

Sensor Networks. Dr. Sumi Helal & Jeff King CEN 5531

Integrated Routing and Query Processing in Wireless Sensor Networks

CS4516 Advanced Computer Networks. Final Review

RT-Link: A global time-synchronized link protocol for sensor networks Anthony Rowe, Rahul Mangharam, Raj Rajkumar

Wireless Sensor Networks

BaseStation Based on GenericComm. Aly El-Osery Electrical Engineering Dept. New Mexico Tech Socorro, NM

Mobile and Ubiquitous Computing Routing Protocols. Niki Trigoni

Wireless Sensor Networks CS742

Transcription:

Sensor Networks Part 3: TinyOS CATT Short Course, March 11, 2005 Mark Coates Mike Rabbat 1 Operating Systems 101 operating system (äp ǝr āt ing sis tǝm) n. 1 software that controls the operation of a computer and directs the processing of programs by assigning storage space in memory and controlling input and output functions [miriam-webster.com] Key Ingredients: 1. Hide low-level machine operations 2. Provide common services 3. Manage tasks 4. Maintain system integrity Part 3: 2 1

Sensor Network Characteristics 1. Small, simple, cheap 2. Concurrent operation 3. Flexible, efficient usage 4. Robust design Part 3: 3 Something Completely Different Existing embedded RTOSes 1. Too bulky or too constrained 2. Control-centric 3. Task-based The answer Part 3: 4 2

Design Goals 1. Take account of current and likely designs for nodes and networks 2. Be flexible to allow for a diverse set of implementations and applications and for varying mixes of hardware and software 3. Address WSN-specific challenges The TinyOS Approach:! Event-driven concurrency model! Efficient modular framework Part 3: 5 Outline! Background! The TinyOS Architecture! Architecture overview! Modules and configurations! Managing concurrency! Clustering example! Communication Services Part 3: 6 3

TinyOS Overview - Event-driven concurrency model - Efficient decentralized processing for networked systems - Micro-threaded architecture without hardware parallelism - Efficient modular framework - Easily abstract hardware - Reuse common software modules by maintaining consistent interfaces - The TinyOS Philosophy - No user/system boundaries - No specific set of system services to drag around - Just defines a framework for establishing boundaries - Provides a list of services apps can choose from in addition to providing facilities for designing/building new services - Let the list of commonly used services evolve on its own - Core components - Processor/hardware initializaiton - Scheduler to manage tasks - RunTime to facilitate tasks & event interrupts, provide robustness - Total: less than 500 bytes of default code and storage! Part 3: 7 The Berkeley Mote 2000 2005 4MHz 8 bit MCU 512 bytes RAM, 8K ROM 900 MHz radio (10-100ft.) Temp. & light sensors LED and serial port 8MHz 8 bit MCU 128K + 512K RAM, 4K ROM ZigBee radio Temp, light, barometric, bio, pressure, sensors 3 LEDs, serial, extension Part 3: 8 4

TinyOS Architecture! Event-Based Scheduling! Events triggered by hardware! Tasks posted to queue! Component Model! Self-containing code unit! Interfaces! Tasks! Storage ActiveMessage CRCPACKET UART_PCKT SEC_DED UART RFM Part 3: 9 An Efficient Modular Framework! Component modules! Self-containing units! Reusable code! Abstract hardware Commands Accepted Component Events Signaled! Configuration! Wiring modules together! Specifies a solution Commands Called Events Handled Part 3: 10 5

Example Interfaces interface StdControl { // booting & power management command result_t init(); } command result_t start(); command result_t stop(); interface ADC { // data collection command result_t getdata(); } command result_t getcontinuousdata(); event result_t dataready(uint16_t data); Part 3: 11 Event-Driven Concurrency! Events! Triggered by hardware! Run to completion, never preempted! Tasks! Posted to a queue! Run to completion, may be preempted by events! Can sleep when queue is empty Part 3: 12 6

Concurrency Example Example Config: Simple App CommHdlr Timer ADC Radio Event Cycle: Process Sample Process Packet Sample SmplHandler PktHandler Timer SampleReady Packet Arrived (SW) (HW) t Part 3: 13 Forming Networked Clusters! Commonly assumed networking setup! Randomly chosen cluster heads broadcast! Nodes join group of nearest cluster head (Thanks to Frederic Thouin) Part 3: 14 7

Forming Networked Clusters! Commonly assumed networking setup! Randomly chosen cluster heads broadcast! Nodes join group of nearest cluster head (Thanks to Frederic Thouin) Part 3: 15 Clustering Module module ClusteringM { provides { interface StdControl; } uses { interface Timer as TimerA; interface Timer as TimerB; interface Timer as TimerC; interface ReceiveMsg; interface SendMsg; interface Random; } } implementation { // State space allocation... // Command implementations task void advertisement() {... call SendMsg.send(...); }... } Commands Provided Component Commands Used Events Provided Events Used Part 3: 16 8

Clustering Configuration configuration Clustering { } implementation { components Main, ClusteringM, TimerC, GenericComm as Comm, RandomLFSR as Random; Main.StdControl -> Comm; Main.StdControl -> TimerC; Main.StdControl -> ClusteringM; } ClusteringM.TimerA -> TimerC.Timer[unique( Timer )];... Part 3: 17 Clustering In Action Part 3: 18 9

Outline! Background! The TinyOS Architecture! Communication Services! Neighbor-to-neighbor! Multi-hop! Synchronization! Power savings strategies Part 3: 19 Communication Overview! Single hop communication! Active Messages! Implementation issues! Multi-hop communication! Tree-based routing! Epidemic protocols! Related services! Synchronization! Saving energy Part 3: 20 10

Active Messages! Integrating communication and computation! Message contains data and handler! Ideal for data-centric applications interface SendMsg{ command result_t send(uint16_t addr, uint8_t len, TOS_MsgPtr msg); event result_t senddone(tos_msgptr msg, result_t success); } interface ReceiveMsg{ event TOS_MsgPtr receive(tos_msgptr m); } Part 3: 21 Active Message Implementations! Variations with new HW generations! More functionality in HW! Free microprocessor cycles! Hooks! S-MAC adds RTS/CTS! ZigBee, the stabilizer? Part 3: 22 11

Multi-Hop Routing! The network is the sensor! Key elements! Link quality estimation! Neighborhood discovery! Tree-based routing! Broadcast/Epidemic Protocols! Point-to-point communication not common Part 3: 23 Link Quality Estimation! Track observed/unobserved packets using ACKs! Received signal strength varies wildly over time, environmental conditions, bad indicator! Broadcast nature of transmission allows snooping! Listening uses energy " Low-power listening! No implicit loss indicator (e.g., sequence number)! Instead, assume average transmission rate! Smooth using Exponentially Weighted Moving Average Part 3: 24 12

Neighborhood Management! Discovery! Passive snooping! Actively probing (e.g., with beacons)! Maintenance! Use link quality estimates to identify good candidates! Challenge: Deciding which entries to maintain in a dense or mobile network! Simple example policy! Insert new neighbors based on received signal strength! Periodically down-sample at random! Reinforce good neighbors Part 3: 25 Tree-Based Routing! Prevelant applications! Habitat monitoring! TinyDB! Aggregation! Broadcast to form tree! Maintain list of neighbors! Choose best candidate as parent Part 3: 26 13

Epidemic Protocols! Dissemination via local broadcasts! Single flood reaches many nodes quickly! Problem: Collisions and lossy links prevent all nodes from receiving the message! Solution: Random local broadcasts Part 3: 27 Trees vs- Epidemics! Application requirements! Complexity (maintenance, especially)! Scaling with network size! Bottlenecks! Communication (capacity)! Security! Energy usage distribution! Other emerging multi-hop paradigms Part 3: 28 14

Point-To-Point Approaches! Major difference between WSNs and the Internet! Directed Diffusion! Grow and then prune a tree! Difficult to maintain! Geographic approaches! Nodes addressed based on geography! Requires GPS or localization! Perimeter problems (holes in the network) Part 3: 29 More Recent Trends! Snooping! Build up info about neighbors, link quality based on observed packets, not necessarily destined for you! Used to weed out uni-directional links! Send Queues! Newer hardware has more memory! Enables more sophisticated multi-hop communication! Secure Communication Part 3: 30 15

Time Synchronization! Problems with NTP in the Internet! Beacons synchronized using GPS! Adjust clock rate based on beacon signals! Result: Very irregular, unreliable behavior! Hardware hooks for fast retransmission! Cross-layer design! Synchronization integrated with applications! E.g., Modify sleep time to compensate! Goal: Reliable, robust coarse (15-30 µs) synchronization Part 3: 31 Power-Savings! When awake, listening eats up the most power! Typical application, 1000ms cycle! Transmit 1 packet for 50 ms # 600 µj! Receive 1 packet for 50 ms # 250 µj! Listen for 900ms # 4500 µj!!! Low-power listening! Coordinated sleep-wake cycles Part 3: 32 16

Low-Power Listening! Sleeping saves energy, but might miss something! Periodic listening:! Sleep 90 out of 100ms # 90% energy savings! Transmitter must broadcast for 100ms to be sure it reaches an awake receiver! Low-power listening! Sleep 30 out of 300µs # 90% energy savings! Transmitter only need to broadcast for 300µs! Much less overhead! Enabled by direct processor control of radio Part 3: 33 HW/SW Boundary Tradeoffs 2000 2002 2005 Trend: Move more complexity into hardware More cycles for processing -vs- Slower control of hardware devices Part 3: 34 17

Coordinated Sleep/Wake Cycles! New radios don t transition as fast! But hooks allow for more precise synchronization! Synchronize sleep/wake cycles! Forward packets when other nodes are awake! Efficient TDMA-style system reduces interference! Requires robust, reliable clock synchronization! Main application: Habitat Monitoring! Regularly schedule sampling! Not latency-sensitive Part 3: 35 In Summary! Modular, event-based " Flexible, expandable! Active Messages " Integrated comm. and computation! Variety of other comm-related services evolving! Additional facilities:! TOSSIM! Matlab interaction! Other platforms:! MANTIS! EmStar Part 3: 36 18

Trickle & Maté! For propagating code updates reliably through a WSN Part 3: 37 19