Wireless Sensor Networks CMPSCI 677, 5/10/07 Peter Desnoyers Wireless Sensor Networks This lecture will answer: • What are building blocks of a WSN? • What is a WSN used for? Structure: • Hardware platforms (“motes”) • Sensing applications • Canonical problems • Examples • Operating systems
WSN Platforms What are the differences between WSN platforms and typical computers? • Battery power – Goal: maximum system lifetime with no recharge/replacement • Low-power radios for communication – 10-200kbit/sec • Small CPUs – E.g. 8bit, 4k RAM. • Flash storage • Sensors Battery Power Example: Mica2 “mote” • Total battery capacity: 2500mAH (2 AA cells) • System consumption: 25 mA (CPU and radio on) • Lifetime: 100 hours (4 days) Alternatives: • Bigger batteries • Solar/wind/… (“energy harvesting”) • Duty cycling
Low Power Radios • ISM band – 430, 900, or 2400 MHz • Varying modulation and protocol: – Custom (FSK?) – Mica2, 20 kbit/s – Bluetooth – Zigbee (802.15.4) - ~200kbit/sec • Short range – Typically <100 meters • Low power. E.g. Chipcon CC2420: – 9-17 mA transmit (depending on output level) – 19 mA receive • Listening can take more energy than transmitting Small CPUs • Example: Atmel AVR – 8 bit – 4 KB RAM – 128 KB code flash – ~2 MIPS @ 8MHz – ~8 mA • Example: TI MSP430 – 16 bit (sort of) Higher-powered processors: – 10 KB RAM ARM7 (Yale XYZ platform) – 48 KB code flash 32 bit, 50 MHz, >>1MB RAM – 2 mA ARM9 (StarGate, others) 32 bit, 400 MHz, >>16MB RAM
Flash Storage NAND NAND Removable flash flash media Serial NOR flash Raw flash “Cooked” flash • Small (serial NOR), very low power (NAND) • Disk-like interface • Page-at-a-time write • 512B re-writable blocks • No overwrite without erasing • Very convenient • Divided into pages and erase blocks • Higher power consumption • Typical values: 512B pages, 32 pages in erase block • Garbage collection needed to gather free pages for erasing Sensors • Temperature • Humidity • Magnetometer • Vibration • Acoustic • Light • Motion (e.g. passive IR) • Imaging (cameras) • Ultrasonic ranging • GPS • Lots of others…
Sensor Applications • Data driven Sensor Patch – Distributed computation, not Sensor Node communication network Patch • Homogeneous Network – All sensors typically participate in the same application(s) • Typical architecture: data Gateway collection, fusion, and Transit Network transport Client Data Browsing Basestation and Processing Base-Remote Link Internet Data Service Canonical WSN Problems • Localization • Time Synchronization • Routing • Duty cycled networking • Data aggregation
Localization Determining relative or absolute location of a sensor Solutions: Base Station 1 • GPS u Base Station 3 • Ranging and triangulation – Radio strength (RSSI) – RF time-of-flight (interferometry) Base Station 2 – Acoustic time-of-flight • Directional triangulation – Acoustic – phase measurement Problems in Localization • GPS is expensive, sometimes difficult to use, and power- Path loss Shadowing hungry RSSI Fading – Requires line-of-sight to 3 or 4 satellites overhead – 80mA for 1-5 minutes to acquire fix Distance • Radio ranging is not accurate • Acoustic ranging is limited – Range – Applications • Sensitivity to errors – Robust triangulation is hard
Time Synchronization • Applications: • Event detection by arrival time – E.g. gunshot triangulation • Duty cycling synchronization • External reference – GPS, WWV • Autonomous synchronization – Receiver-receiver – Sender-receiver – Drift estimation Autonomous Synchronization Idea: – Sample time at A T_A+T_os+T_mac – Transmit to B A B T_A +T_prop+T_rx Issues: – B receives T_A at T_A+ � T_tx – Software delays (T_tx, T_rx) – Channel acquisition (T_mac) T_rx – Propagation delay (T_prop) T_mac Clock drift T_prop – Quartz crystal: 50 ppm = 50µS/s = 180ms/hr – Varies with e.g. temperature
Synchronization methods A • Receiver-receiver X – Eliminate transmit uncertainty B T_A = T_B ± T_rx • Sender-receiver T_B = T_A+T_prop – Reduce transmit uncertainty T_A, App App T_B Network Network • Drift estimation stack stack – Estimate and correct Time Time T_A stamp stamp Routing • What addresses make sense in a sensor network? – Location – Data • Geographic routing – GPSR – Beacon routing • Flooding, tree construction GPSR – forward to node – Data collection architectures physically closest to destination
More Routing • How to handle duty cycling? – Sleep or go around? Sleeping C = 1 • Wireless vs. wired C = � More Routing • Network lifetime – More packets = more battery drain Data 1 packet/s sink 4 packet/s
Duty Cycled Networking Problem: continuous listening is too expensive Solution: listen periodically listen Low-power Rx listening Tx data preamble Synchronized Rx low-power listening Tx data preamble Example - Directed Diffusion • Name data (not nodes), use A sensor field physicality Source 1 Source 2 Event • Sensors publish event notifications and users subscribe to specific types. • optimize path with gradient-based feedback • Opportunistic in-network Directed aggregation and nested queries. Diffusion Sensor sink
Directed Diffusion • Expressing an Interest – Using attribute-value pairs – E.g., Type = Wheeled vehicle // detect vehicle location Interval = 20 ms // send events every 20ms Duration = 10 s // Send for next 10 s Field = [x1, y1, x2, y2] // from sensors in this area • Uses publish/subscribe – Inquirer expresses an interest, I, using attribute values – Sensor sources that can service I, reply with data Gradient-based Routing • Inquirer (sink) broadcasts exploratory interest, i1 – Intended to discover routes between source and sink • Neighbors update interest-cache and Exploratory Request forwards i1 Gradient • Gradient for i1 set up to upstream neighbor Event – No source routes – Gradient – a weighted reverse link Low Low – Low gradient � Few packets per unit time Low needed Bidirectional gradients established on all links through flooding
Examples - TinyDB TinySQL: SELECT <aggregates>, <attributes> [FROM {sensors | <buffer>}] [WHERE <predicates>] [GROUP BY <exprs>] [SAMPLE PERIOD <const> | ONCE] [INTO <buffer>] [TRIGGER ACTION <command>] Data Model • Entire sensor network as one single, infinitely-long logical table: sensors • Columns consist of all the attributes defined in the network • Typical attributes: – Sensor readings – Meta-data: node id, location, etc. – Internal states: routing tree parent, timestamp, queue length, etc. • Nodes return NULL for unknown attributes • On server, all attributes are defined in catalog.xml
Acquisitional Query Processing • What’s really new & different about databases on (mote-based) sensor networks? • This paper’s answer: – Long running queries on physically embedded devices that control when and where and with what frequency data is collected – Versus traditional DBMS where data is provided a priori • For a distributed, embedded sensing environment, ACQP provides a framework for addressing issues of • When, where, and how often data is sensed/sampled • Which data is delivered PRESTO: Model-driven Push Insight: PRESTO Proxy • Models are expensive to create, but simple to check Modeling & Data • Data which can be predicted Prediction Cache does not need to be reported. Push if sensor value exceeds or is less than predicted value by � Sensor Data Model Check Data Archive PRESTO Sensor
Data Management • Skip this one… Operating Systems What features does an operating system need? Unix TinyOS SOS Hardware drivers, system init Yes Yes Yes Loadable programs Yes No Yes File system Yes No No Resource allocation (e.g. memory) Yes No Yes Processes / threads Yes No Sort of Networking support Yes Yes Yes IPC Yes Yes Yes Event scheduling / timers Yes Yes Yes
TinyOS & nesC Concepts • New Language: nesC. Basic unit of code = Component • Component (used for split-phase) – Process Commands – Throws Events – Has a Frame for storing local state – Uses Tasks for concurrency • Components provide interfaces – Used by other components to communicate with this component • Components are wired to each other in a configuration to connect them Application = Graph of Components Application Route map router sensor appln Active Messages The OS Radio Packet Serial Packet Temp photo SW HW UART Radio byte ADC clocks RFM
Recommend
More recommend