Sensor Network Xiang Mao & Qin Chen Department of Electrical & Computer Engineering 08:45 “Sensor” and “Network” Which is more important ??? 08:45 1. Introduction 08:45 Introduction Sensor network or more commonly wireless sensor network (WSN) is a network consists of spatially distributed autonomous sensors to cooperatively monitor physical or environmental conditions, such as temperature, sound, motion, vibration, pressure, or pollutants. —— Wikipedia Sensing Computing Communication 08:45 This idea was born in late 1990s Features Sensor nodes are of • a large number • low-cost • low-power • multiple function • small in size 08:45 WSN vs. Ad Hoc Networks • The number of sensor nodes can be several orders of magnitude higher than the nodes in an ad hoc network • More densely deployed; • Nodes may not have global identification (ID). • Broadcast vs. peer-to-peer communication • The mobility of sensor nodes is lower than nodes in an ad hoc network • Sensor nodes are prone to failures • Sensor nodes are limited in power, computational capacities, and memory 08:45 Technology Innovation Moore’s law Energy capacity miniaturization “One of the 10 technologies that will change the System-on-chip MEMS world”, Integration MIT Technology Review, 2003 08:45 Components of a Sensor Node 08:45 Communication Architecture Each of these scattered sensor nodes has the The sensor nodes are usually scattered in aback sensor field capabilities to collect data and route data to the sink The sink may communicate with the task manager node via Internet or Satellite. 08:45 2. Application 08:45 ? In The Movie – Twister (1996) Thanks to the National Severe Storms 08:45 Lab(NSSL) and the University of Oklahoma Famous Prototype – Great Duck Island (2002) Patch Network Sensor Node Sensor Patch Gateway Transit Network Burrow Occupancy Detector Client Data Browsing and Processing Basestation Miniature Weather Station Base-Remote Link Internet Data Service 08:45 Senera – Bridge Monitoring 08:45 Our Fancy Stuff (2007) 08:45 3. Future Development 08:45 Innovation: Sensor Network Sensor Web Sensor Web is a “Web of Webs” 08:45 Generalized Concept of Sensor Remote Sensing Satellite Temperature Sensor Humidity Sensor Web Camera Sensor Optical Sensor Billing-related Device Web Smoke Sensor 08:45 Mobile Devices …… …… NASA (JPL) Project Space + Spacecraft Sky + Land + Ocean 08:45 Lander Sensor Nodes Base Station Rover I had a dream … SensorMap by Microsoft 08:45 Topic. 1 Analytical Study: Central vs. In-network Data Processing 08:45 Outline • In-network vs. centralized computing • Environmental factors – Topology – Cache – Dataset • Results • Conclusion 08:45 Why In-network Processing? Operation Current @ 3.6V Idle <1 mA GPS position sampling and CPU/storage 177 mA Base discovery only 432 mA Transmit data to base 1622 mA from ZebraNet Computation is much less expensive than radio transmission! 08:45 Algorithms for Computing Paradigm • Centralized computing paradigm - Central data optimized algorithm - Central result optimized algorithm • In-network computing paradigm - Local algorithm - Local optimized algorithm 08:45 Central Data Optimized Algorithm Definition: Collects all available data from the nodes and transfers it to a central off network computing facility. Pros: - High response accuracy; - Complete data reusability. Cons: - High data transfer costs. 08:45 Central Result Optimized Algorithm Improvement: It applies transformations to innetwork data to minimize the data transfer overhead. Pros: - Low data transfer overhead; - High response accuracy. Cons: - Transformations are limited by nodes’ computational capabilities; - Reusability depends on transformation type; - Require cache/storage on each local node. 08:45 Local Algorithm Definition: Each node computes the local results and forward to its parent node. Pros: - Overall overhead still lower than central data optimized algorithm. Cons: - Data overhead is directly proportional to the size of the network; - May introduce computational error due to nodes’ limited computing resources; - A limited amount of data reusability; Enough storage for the subtree results. 08:45 Local Optimized Algorithm Definition: Each node computes a single aggregate value that represents own local result as well as aggregate results received from its children and forward this value to its parent node. Pros: - The data transfer overhead is minimized; - Overhead may not related with network size depending on how the in-network aggregation process is defined. Cons: - Even larger potential for computational error than the local algorithm. 08:45 Key Environmental Factors 1. Network topology; 2. Amount of data that each sensor can hold (cache); 3. Domain of data collected by sensors (dataset). 08:45 1. Network Topology 08:45 2. Cache Three levels of cache sizes have been used as follows: - Small ~ 5; - Medium ~ 25; - Large ~ 125. * The cache size refers to the memory buffer where data are stored, not the hardware cache. 08:45 3. Dataset Three ranges for the domain of the datasets are used as follows: - Small value set ~ (0, 3); - Medium value set ~ (0, 1100); - Large value set 08:45 ~ (10000, 11100). Impact of Network Size on Wide Network 08:45 Impact of Network Size on Wide Network 08:45 Impact of Network Size on Balanced Network 08:45 Impact of Network Size on Deep Network 08:45 Impact of Network Size on Deep Network 08:45 Impact of Dataset Domain 08:45 Conclusion Experimental results show that centralized computing is a viable alternative to in-network computing under various conditions especially when the result accuracy, the response time and the data reusability are of primary concern. My Point: • the network size may be too small to provide compelling results! • Data traffic scene, data processing functions are not clear; • Deep network too simple, avoids many collisions … 08:45 Topic. 2 TinyOS: An Operating System for Sensor Networks 08:45 Outline • Motivation – Sensor node (mote) specifications – Four requirements • Design – Meet the four requirements • Performance • Applications • Summary 08:45 Mote • HW specifications – Program memory: 128 KB – RAM: 4 KB – Power: two AA batteries – Size: 1 by 1 inch – Data rate: 38.4 kbps 08:45 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 08:45 TinyOS • Open source – Collaboration between UC, Berkeley, Intel, and Crossbow Technology – Widely used by over a hundred groups worldwide • Component based architecture • Programming language: nesC • Supported development environment: Linux and Windows 08:45 Main Concept • Application = Collection of components + scheduler – Compiled into a single executable • Event-driven architecture • Single shared stack 08:45 Main (includes Scheduler) Application (User Components) Actuating Sensing Communication Communication Hardware Abstractions 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 08:45 47 Component Library • • • • • • Network protocols Distributed services Sensor drivers Data acquisition tools Timers Storage 08:45 Execution Model Tasks Preempt POST events Run-to-completion Non-preemptive FIFO scheduling Atomic to each other Interrupt handlers Signaled asynchronously by HW CAN preempt tasks NesC compiler prevents nearly all data races 08:45 Tasks FIFO commands commands Interrupts Hardware Time 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 08:45 Comparison with Linux Linux TinyOS 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 08:45 Req 1: Limited Resources Absolute size Components are resolved at compile time Application specific version Base TinyOS < 1KB Most applications < 16 KB TinyDB < 64 KB (largest TinyOS application) Footprint Optimization Stripping symbol table Prune dead code Cross-component optimization Size improvement: 8% -- 60% 08:45 Req 2: Reactive Concurrency • Concurrency exhibited by applications – Example: TinyDB • Race detection • Context switch – Task scheduling – Interrupt handler overhead • Real-time constraints – Burst of activities + lengthy idle interval – Time critical work + task 08:45 Req 3: Flexibility • Fine-grained components • HW/SW transparency • Interposition 08:45 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 08:45 Applications Habitat monitoring Low power Robust Object tracking High concurrency: routing, data sharing, time sync, localization, power management, and sensor filtering TinyDB Largest and most complex application Concurrency control Limited resources 08:45 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 08:45 Improvements • FIFO scheduling shortest first? Earliest deadline first, etc? 08:45 References • TinyOS: An Operating System for Sensor Networks, Ambient Intelligence, 2005 • TinyOS tutorials, http://docs.tinyos.net/index.php/TinyOS_T utorials • http://www.tinyos.net/ • http://en.wikipedia.org/wiki/TinyOS • www.cs.virginia.edu/~cl7v/cs851talks/tinyos_chenyang.ppt 08:45 Question The End? 08:45