My tutorial on SensorDB Design Issues at SIGMOD 2007


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Size of pda, cell phone, button. Processor board – lower power microcontroller, limited ram and rom, wireless transceiver, antenna, battery. Sensor board – temperature, humidity, acceleration, light, pressure, and others. Usually harsh deployment environment. Deployed in large quantity.
  • Write embedded code to handle the hardware, networking, scheduling, and query processing. Compile into binary. Inject into the nodes through the sink. Issue SQL-like queries.
  • Atmega128: Atmel. 128KB programmable FlashROM, 4KBRAM, 16MHz, 2.7-5.5volt operation. MSP430: TI. 16-bit. Up to 16KB ROM, 8MIPS, 1.8-3.6Volt. ARM/THUMB: OKI Semiconductor.
  • if devices can change frequency in runtime and communicate at different frequencies, it is called "frequency multiplex", like walkie talkie. if two devices want to communicate, they must have the same frequency some types of tv antennas receive uni-directional or just call directional signals Directional antennas are able to pull in signals from greater distances. because they "see" in only one direction they are resistant to noise and "multipath distortion" (a problem encountered when an antenna receives reflections of the desired signal). Because multi-directional antennas "see" in many directions they are more likely to pick up noise, interference, and multipath distortion.
  • Energy conservation: turn off radio when it is not needed. Bandwidth allocation: allocate communication channels to neighbor nodes. time synchronization is usually done in MAC, but some networks may not need time sync Time sync: to make the time on each node the same, so that the timestamp of the packet from each node is useful ad-hoc networks such as laptops, pdas may not sync their time another purpose of time sync is to make the nodes to return packets within each epoch. the nodes should know when the epoch starts and when it ends Collision detection/handling can be included in bandwidth allocation. there is some scheduling mechanism in the kernel.
  • UART, Radio, sensor, components -> hardware components system components include AM (Active Messages), task execution. Queue, debugger, random -> lib components interface components include attribute interface, message sending interface, timer interface, etc.
  • dynamic code update means the nodes do not need to reinstall all code. reinstalling will cause the node to stop or reset. Without priorities one task cannot preempt another single thread, single application
  • An example of networked embedded systems can be the information sharing system on cars, which can share the information about the highway status, accidents, fires, rains, road quality ahead, etc among cars. contiki doesn't support dynamic loading
  • direct calling cannot change the called module after compilation but jump table can, as it does not need the called module to be compiled together. like DLL - dynamic link lib
  • The small code size does not include application, but the kernel, scheduler, and network. stack occupies less than 500 bytes of RAM and about 14 KB of flash.
  • The application exists as binary code, just like TinyOS application code, which is compiled from (tinyos + application NesC program). It may have accidental program errors. Note that naturalization is not code interpretation. The naturalization is only performed at load-time. After the naturalization, the naturalized program is considered safe and will be executed without monitoring or interpretation. This load-time approach limits most of the software overhead to be a one-time cost. Hence, it is able to provide a much faster execution speed than the approaches based on interpretation. Changes in naturalization: memory change -> to enable virtual memory code change-> do not allow malicious program that try to enter the OS kernel to change something
  • most java machines run on RAM in a pc. Because loading code in RAM will be costly, most embedded device run code on ROM
  • TinyOS adopts such a CSMA protocol in wireless communication
  • The gradients are shown as the arrows in Step 2. They are just the links for the paths from the source to the destination. Normally, after Step 2, query results start flowing towards the destination along multiple paths. During transmission of these query results, the network “reinforces” one, or a small number of these paths. In Step 3 of this slide, the source sensor node reinforces one path by selecting the gradient that has been more reliable than others.
  • If node 3 finds that the link between 1 and 3 is not reliable – the packet loss rate exceeds a system defined threshold, node 3 may change to other neighbors with more reliable links, even though the hop count of node 3 may increase
  • When RERR happens, the source needs to reconstruct a route from the source to the destination. The process is the same as the previous process in the figure.
  • My tutorial on SensorDB Design Issues at SIGMOD 2007

    1. 1. System Design Issues In Sensor Databases Qiong Luo and Hejun Wu Department of Computer Science and Engineering The Hong Kong University of Science & Technology
    2. 2. Wireless Sensor Networks (WSNs) Energy efficiency is the most crucial performance factor. Limited on-node resource Multi-hop communication
    3. 3. In-Network Sensor Query Processing (Sensor Databases, SensorDBs) sink SELECT temperature FROM sensors WHERE temperature > 900 SAMPLE INTERVAL 60s σ , π , α Scheduler Sensing & Networking σ , π , α Scheduler Sensing & Networking σ , π , α Scheduler Sensing & Networking σ , π , α Scheduler Networking SELECT avg (light) FROM sensors SAMPLE INTERVAL 60s light: 1000 light: 500 light: 300 Avg light: 300/1 Avg light: 1000/1 Avg light: (1000+500)/2
    4. 4. Two Representative SensorDBs <ul><li>Cougar [BGS01, YG03] </li></ul><ul><ul><li>Model sensor network data as sequences </li></ul></ul><ul><ul><li>Declarative query interface with UDFs </li></ul></ul><ul><ul><li>Cross-layer optimization in later versions </li></ul></ul><ul><li>TinyDB [MF+02, 03] </li></ul><ul><ul><li>Declarative query interface </li></ul></ul><ul><ul><li>Efficient and extensible framework </li></ul></ul><ul><ul><li>Open-source implementation on real nodes </li></ul></ul>
    5. 5. Advantages of Sensor Databases <ul><li>Flexibility </li></ul><ul><ul><li>Declarative SQL style queries </li></ul></ul><ul><ul><li>Dynamic query injection and removal </li></ul></ul><ul><li>Efficiency </li></ul><ul><ul><li>Cross-layer optimization </li></ul></ul><ul><ul><ul><li>E.g., in-network filtering and aggregation </li></ul></ul></ul>
    6. 6. Challenges in Sensor Databases <ul><li>Dynamic data streams </li></ul><ul><li>Hardware resource limitations </li></ul><ul><ul><li>Limited per-node computing power and storage </li></ul></ul><ul><ul><li>Unreliable wireless communication </li></ul></ul><ul><ul><li>Battery power supply </li></ul></ul><ul><li>Complex, networked, embedded software </li></ul><ul><ul><li>Blurred boundaries between components </li></ul></ul><ul><ul><li>Plenty of cross-layer optimization opportunities </li></ul></ul>
    7. 7. Focus of this Tutorial <ul><li>System design issues in sensor databases </li></ul><ul><ul><li>Software architecture </li></ul></ul><ul><ul><li>Operating system support </li></ul></ul><ul><ul><li>Media Access Control (MAC) </li></ul></ul><ul><ul><li>Routing </li></ul></ul><ul><ul><li>Scheduling </li></ul></ul>These issues often dominate the overall performance.
    8. 8. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><ul><li>Computing, sensing, communication, and power supply </li></ul></ul><ul><li>Software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    9. 9. Current Sensor Node Hardware: Computing and Storage <ul><li>Low-power microcontroller (CPU of a node) </li></ul><ul><ul><li>E.g., Atmega128 (MICA series), MSP430 (Telos series), ARM/THUMB (XYZ sensor), and the latest 180MHz ARM920 (SunSpot). </li></ul></ul><ul><li>Limited memory </li></ul><ul><ul><li>RAM </li></ul></ul><ul><ul><ul><li>≤ 10KB SRAM (Static RAM) </li></ul></ul></ul><ul><ul><li>ROM </li></ul></ul><ul><ul><ul><li>Usually ≤ 1MB flash memory </li></ul></ul></ul>
    10. 10. Current Sensor Node Hardware: Sensing and Radio <ul><li>Sensing devices </li></ul><ul><ul><li>Electronic, mechanic, bio-chemical, … </li></ul></ul><ul><li>Radio transceiver </li></ul><ul><ul><li>Fixed radio frequency </li></ul></ul><ul><ul><li>Omni-direction radio signal </li></ul></ul><ul><ul><li>Transmission rate ≤ 200 kbps </li></ul></ul><ul><ul><li>Transmission range ≤ 50 meters </li></ul></ul>
    11. 11. Current Sensor Node Hardware: Power Supply and Consumption <ul><li>Power supply </li></ul><ul><ul><li>Batteries, usually <= 2000 mAh </li></ul></ul><ul><li>Electric currents in a node </li></ul><ul><ul><li>Sleep 15-20 µA </li></ul></ul><ul><ul><li>Radio on </li></ul></ul><ul><ul><ul><li>Idle 20-25 mA, compute 25-30 mA </li></ul></ul></ul><ul><ul><li>Radio off </li></ul></ul><ul><ul><ul><li>Idle 1-5 mA, compute 5-10 mA </li></ul></ul></ul>Sleeping is the most effective means to save energy.
    12. 12. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    13. 13. Common Software Architecture of Sensor Databases Scheduling Operating System Kernel Boundaries between components in a sensorDB are blurred.
    14. 14. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Common SensorDB software architecture </li></ul><ul><li>Operating system support </li></ul><ul><ul><li>Hardware management </li></ul></ul><ul><ul><li>Application code development and deployment </li></ul></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    15. 15. TinyOS ( <ul><li>De facto OS for sensor nodes </li></ul><ul><ul><li>Early research effort </li></ul></ul><ul><ul><li>Open source development </li></ul></ul><ul><ul><li>Wide presence in commercial products </li></ul></ul><ul><ul><li>Component-based architecture </li></ul></ul><ul><ul><ul><li>Adaptive to hardware changes </li></ul></ul></ul><ul><ul><ul><li>Lightweight for various applications </li></ul></ul></ul><ul><ul><li>Event-driven processing </li></ul></ul><ul><ul><ul><li>Responsive to sensor signals and radio messages </li></ul></ul></ul>
    16. 16. TinyOS Application Sensor devices Mote main board Hardware manipulation components Abstraction: Hardware: Core system components Lib components TinyOS interface components Commands Events Kernel: Application TinyOS startup (“Main”) Runable image of a TinyOS application A TinyOS application is compiled with TinyOS components.
    17. 17. Some Limitations of TinyOS <ul><li>Static code and memory </li></ul><ul><ul><li>No virtual memory </li></ul></ul><ul><ul><li>No dynamic memory allocation </li></ul></ul><ul><ul><li>No dynamic code update </li></ul></ul><ul><ul><li>Task execution without priorities </li></ul></ul><ul><li>Single thread </li></ul>Global Free Stack TinyOS memory allocation
    18. 18. Contiki [DGV04] <ul><li>Multi-threading </li></ul><ul><li>Lightweight program loading </li></ul><ul><li>Lightweight communication stacks </li></ul><ul><ul><li>uIP </li></ul></ul><ul><ul><ul><li>A micro-version of RFC-compliant TCP/IP </li></ul></ul></ul><ul><ul><li>Rime </li></ul></ul><ul><ul><ul><li>A lightweight communication stack for low-power radio </li></ul></ul></ul>core #1 #2 #3 #n … Multi-threading in Contiki
    19. 19. SOS [HK+05] <ul><li>Dynamic module loading </li></ul><ul><ul><li>Allows incremental update of binary code </li></ul></ul><ul><li>Runtime safety mechanisms </li></ul><ul><ul><li>Memory monitoring </li></ul></ul><ul><ul><li>Watchdog </li></ul></ul><ul><ul><ul><li>Restart when system hangs </li></ul></ul></ul>System function call Actual function to call … Module #1 Module #2 Module #N SOS Kernel Jump table 1 2
    20. 20. MANTIS [BC+05] <ul><li>Multi-threading </li></ul><ul><li>Remote testing </li></ul><ul><li>Scheduler for duty-cycle sleeping </li></ul><ul><li>Small code size </li></ul><ul><ul><li>Uses less than 500B RAM and 14KB flash memory </li></ul></ul>Device driver Communication Layer Kernel / Scheduler Sensor Node Hardware MANTIS System API #1 User threads #n … Network Stack Command Server
    21. 21. t-kernel [GS06] <ul><li>OS protection </li></ul><ul><ul><li>Separates OS/app space </li></ul></ul><ul><li>Virtual memory </li></ul><ul><ul><li>Extends the limited SRAM </li></ul></ul><ul><li>Preemptive scheduling </li></ul><ul><ul><li>Allows priorities </li></ul></ul><ul><li>Fault tolerance </li></ul><ul><ul><li>Prevents system hang-up from application errors </li></ul></ul>Load Application binary code Naturalization Run Running an app. in t-kernel
    22. 22. On-Node Virtual Machines <ul><li>SunSPOT </li></ul><ul><ul><li>A compact Java language </li></ul></ul><ul><ul><li>Java VM directly runs in on-node flash memory </li></ul></ul><ul><li>SwissQM [MAK07] </li></ul><ul><ul><li>Combines a powerful gateway with a virtual machine at the sensors </li></ul></ul><ul><ul><ul><li>Query Machine (QM) </li></ul></ul></ul> Bytecode interpreter QM programs Sensors Operand stack Query synopsis Transmission buffer
    23. 23. Declarative Sensor Networks [CP+07] <ul><li>Snlog language </li></ul><ul><ul><li>Datalog-like, declarative </li></ul></ul><ul><ul><li>Suitable for polynomial-time programs </li></ul></ul><ul><ul><li>Useful in a variety of apps </li></ul></ul><ul><li>Snlog compiler </li></ul><ul><ul><li>Translate Snlog into NesC </li></ul></ul><ul><li>Runtime system </li></ul><ul><ul><li>Components of user provided rules </li></ul></ul><ul><ul><li>No on-node interpreter </li></ul></ul>Snlog program nesC Templates DSN runtime components Generated NesC program NesC Compiler Binary code to be executed Snlog front-end Execution planner NesC backend Snlog compiler
    24. 24. Summary on OS Support <ul><li>Support app. development and deployment </li></ul><ul><ul><li>Programming interfaces </li></ul></ul><ul><ul><li>Code compilation and generation </li></ul></ul><ul><ul><li>Runtime loading and modification </li></ul></ul><ul><li>Provide hardware resource management </li></ul><ul><ul><li>Sensor signals, radio messages </li></ul></ul><ul><ul><li>Memory allocation and virtualization </li></ul></ul><ul><ul><li>Scheduling and system safety </li></ul></ul>
    25. 25. OS and Sensor Databases <ul><li>Desirable OS features for sensor databases </li></ul><ul><ul><li>Multiple applications </li></ul></ul><ul><ul><li>Multi-threading </li></ul></ul><ul><ul><li>Virtual memory </li></ul></ul><ul><ul><li>Priority scheduling </li></ul></ul><ul><ul><li>Reliability and fault tolerance </li></ul></ul>
    26. 26. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Common SensorDB software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><ul><li>CSMA, STEM, S-MAC, and T-MAC </li></ul></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    27. 27. CSMA (Carrier Sense Multiple Access) <ul><li>Random delay before transmission attempt </li></ul><ul><li>Node needs to keep idle listening before its communication done </li></ul><ul><li>Wireless collision remains a major problem </li></ul><ul><ul><li>Reason: no effective coordination between nodes </li></ul></ul>Sender 1 Sender 2 transmitting transmitting Collision
    28. 28. Sparse Topology and Energy Management (STEM) [STS02] <ul><li>Periodic wake up and listen </li></ul><ul><li>Sleep when no packet to send and receive </li></ul>Transmit Sleep Power Listening Listening Listening time
    29. 29. S-MAC (Sensor-MAC) [YHE02] <ul><li>Schedules nodes to periodically sleep </li></ul><ul><li>Coordinates the sleeping time of neighbors for reliable transmission </li></ul>Listen SYNC RTS Receiver Sender Sleep
    30. 30. T-MAC [DL03] <ul><li>Contention based protocol </li></ul><ul><li>Dynamically ends an active period </li></ul><ul><ul><li>Adapts to the needs for computation and communication </li></ul></ul>Aha, no more to do!, zzz~ S-MAC T-MAC Active time Sleep time Sleep time Active time TA
    31. 31. Summary on MAC <ul><li>Important for performance </li></ul><ul><ul><li>Communication quality </li></ul></ul><ul><ul><ul><li>Signal errors </li></ul></ul></ul><ul><ul><ul><li>Noise </li></ul></ul></ul><ul><ul><li>Communication energy </li></ul></ul><ul><ul><ul><li>Sleeping nodes </li></ul></ul></ul><ul><ul><ul><li>Retransmission </li></ul></ul></ul><ul><ul><li>Communication delay </li></ul></ul><ul><ul><ul><li>Negotiation for channels </li></ul></ul></ul><ul><ul><ul><li>Wireless signal transmission delay </li></ul></ul></ul>Significant to data quality, energy efficiency and response time in query processing!
    32. 32. MAC and Sensor Databases <ul><li>MAC behavior of sensor databases </li></ul><ul><ul><li>Mostly converge-cast </li></ul></ul><ul><ul><li>Periodic data flows </li></ul></ul><ul><li>Opportunities of sensor databases for MAC </li></ul><ul><ul><li>Sleep scheduling that suits the data flows </li></ul></ul>
    33. 33. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Common SensorDB software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><ul><li>MintRoute, TinyAODV, and Directed Diffusion </li></ul></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    34. 34. Location-Based Routing <ul><li>Requires location information </li></ul><ul><ul><li>Usually finds the shortest, reliable path using location information of each node </li></ul></ul><ul><ul><ul><li>Energy aware </li></ul></ul></ul><ul><li>Suitable for queries with spatial predicates </li></ul><ul><ul><li>Can route queries to some specific regions </li></ul></ul>S D Transmission range of S Shortest path
    35. 35. Flooding <ul><li>Every node broadcasts received data </li></ul><ul><ul><li>Broadcast can be reduced by hop count </li></ul></ul><ul><li>Advantage </li></ul><ul><ul><li>Simple </li></ul></ul><ul><li>Problems </li></ul><ul><ul><li>Message implosion </li></ul></ul><ul><ul><ul><li>Many duplicates </li></ul></ul></ul><ul><ul><li>Resource inefficiency </li></ul></ul><ul><ul><ul><li>Most nodes busy </li></ul></ul></ul><ul><ul><ul><li>No sleeping </li></ul></ul></ul>
    36. 36. Directed Diffusion [IG+00] <ul><li>Queries are defined as interests. </li></ul><ul><li>Sink nodes post interests. </li></ul><ul><li>Source nodes generate sensory data. </li></ul><ul><li>Source nodes select reliable and efficient routes to the sink nodes to forward data. </li></ul>
    37. 37. Illustration of Directed Diffusion Sink node Source node Source node Sink node Source node Sink node Step 3: Reinforce one path Step 1: Sink node propagates Interest (query) Step 2: Set up gradients
    38. 38. MintRoute [WTC03] <ul><li>Implemented in TinyOS </li></ul><ul><ul><li>Can be used in TinyDB </li></ul></ul><ul><li>More than simple shortest-path routing </li></ul><ul><ul><li>Monitors link connectivity </li></ul></ul><ul><ul><li>Decides a route based on both link quality and distance </li></ul></ul>1 2 3 1 2 3 Unreliable, high loss rate
    39. 39. TinyAODV (Tiny Ad-hoc On-Demand Distance Vector) <ul><li>Builds paths only when needed </li></ul><ul><li>Uses sequence number in RREQ to avoid cycles </li></ul>RREQ RREQ: Route Request RREP: Route Reply RERR: Route ERR RREP DATA X RERR … Source Destination …
    40. 40. Summary on Routing <ul><li>Focus of current routing protocols </li></ul><ul><ul><li>Efficient forwarding </li></ul></ul><ul><ul><ul><li>Shortest path or least retransmission </li></ul></ul></ul><ul><ul><li>Load balancing </li></ul></ul><ul><ul><ul><li>Avoid hot spots of heavy traffic </li></ul></ul></ul><ul><li>Open issues </li></ul><ul><ul><li>Reliability </li></ul></ul><ul><ul><ul><li>Node failure </li></ul></ul></ul><ul><ul><ul><li>Noise </li></ul></ul></ul><ul><ul><li>Communication delay </li></ul></ul><ul><ul><ul><li>Find the path of the minimal delay </li></ul></ul></ul>
    41. 41. Routing and Sensor Databases <ul><li>Routing characteristics of sensor databases </li></ul><ul><ul><li>Mainly converge-casting </li></ul></ul><ul><ul><li>Not all nodes satisfy a query all the time. </li></ul></ul><ul><li>Opportunities of sensorDBs for routing </li></ul><ul><ul><li>Data flow aware routing </li></ul></ul><ul><ul><ul><li>Busy nodes get better routes. </li></ul></ul></ul><ul><ul><ul><li>Busy queries get better routes. </li></ul></ul></ul><ul><ul><li>Query type aware routing </li></ul></ul><ul><ul><ul><li>Aggregation, duplicate-sensitivity, join </li></ul></ul></ul>
    42. 42. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Common SensorDB software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><ul><li>FPS, Sichitiu’s Scheme, and DCS </li></ul></ul><ul><li>Summary and future directions </li></ul>
    43. 43. Goal of Scheduling <ul><li>Communication efficiency and reliability </li></ul><ul><ul><li>Coordinate nodes in communication </li></ul></ul><ul><ul><ul><li>Wireless collisions among neighbors </li></ul></ul></ul><ul><ul><ul><li>No receiving on sleeping nodes </li></ul></ul></ul>Sending… zzz… zzz… Done! Data Lost!
    44. 44. Centralized Scheduling <ul><li>The base station specifies schedules for all nodes. </li></ul><ul><ul><li>The base station must be aware of the workload and the network topology </li></ul></ul><ul><li>Hard to scale </li></ul><ul><li>Hard to adapt to changes </li></ul>Sink Schedule …
    45. 45. Distributed Scheduling <ul><li>Scheduling in TinyDB (query layer) </li></ul><ul><ul><li>A node keeps active for 4 seconds and sleeps in the remaining time in a sample interval. </li></ul></ul><ul><li>Sichitiu’s Scheduling Scheme [Sic04] </li></ul><ul><ul><li>Schedules at the MAC and routing layers </li></ul></ul><ul><ul><li>Sets up both routing paths and schedules </li></ul></ul><ul><ul><ul><li>Schedule construction is time consuming and unreliable because it needs the sink to confirm. </li></ul></ul></ul>
    46. 46. FPS (Flexible Power Scheduling) [HDB04] <ul><li>Routing-layer distributed scheduling </li></ul><ul><li>A parent node assigns transmission slots to its children to avoid collision between siblings. </li></ul><ul><li>Collisions among non-sibling neighbors are possible. </li></ul>Slots: Time transmit … compute sleep sleep
    47. 47. DCS (Distributed Cross-Layer Scheduling) [WLX06] <ul><li>Slot based </li></ul><ul><li>Takes query processing cycles into account </li></ul><ul><ul><li>Receiving, computing, transmission, and sleep </li></ul></ul><ul><li>Not only parents assign schedules to children, but neighbors also negotiate. </li></ul><ul><ul><li>Able to avoid the collisions at the receiving nodes </li></ul></ul><ul><ul><li>Attempts to assign consecutive transmission slots to each node </li></ul></ul>
    48. 48. DCS Components Routing Layer Query Layer MAC Layer Route Maintenance Selection / Projection / Join / Aggregation Transmission / Receiving Route Selection Collision Detection Scheduling Module Schedule Construction Time Synchronization Query Scheduling Schedule Execution
    49. 49. Slot in a Schedule <ul><li>A slot is a time period of fixed length. </li></ul><ul><ul><li>Transmission, Sleeping, PL/R (Processing, Listening / Receiving), and Q/M (Query injection / route Maintenance) </li></ul></ul><ul><li>Slot number s at t: </li></ul><ul><ul><li>The length of a slot is ls. </li></ul></ul><ul><ul><li>The schedule start time is t0. </li></ul></ul><ul><ul><li>A sample interval has m slots. </li></ul></ul>
    50. 50. An Example Schedule Time Leaf Leaf Sink 0 Sleeping 2 Node 1 Node2 Node3 Hop 0 Hop 1 Hop 2 Hop 2 Transmission PL/R Q/M Active (sink only) Routing tree 1 3 0
    51. 51. Energy Efficiency DCS achieves 50-60% energy saving.
    52. 52. Summary on Scheduling <ul><li>Scheduling is done on one or more layers. </li></ul><ul><li>Scheduling is crucial for performance. </li></ul><ul><ul><li>Communication reliability </li></ul></ul><ul><ul><ul><li>Coordination of nodes </li></ul></ul></ul><ul><ul><li>Energy consumption </li></ul></ul><ul><ul><ul><li>Sleep scheduling </li></ul></ul></ul><ul><ul><li>Response time </li></ul></ul><ul><ul><ul><li>Different transmission timings of neighboring nodes result in different delays. </li></ul></ul></ul>
    53. 53. Scheduling and Sensor Databases <ul><li>SensorDBs are complex to schedule. </li></ul><ul><li>Opportunities in scheduling for sensorDBs </li></ul><ul><ul><li>On-node multi-query scheduling </li></ul></ul><ul><ul><ul><li>Limited resources </li></ul></ul></ul><ul><ul><ul><li>Changing sensor environments </li></ul></ul></ul><ul><ul><li>Query-aware transmission scheduling </li></ul></ul><ul><ul><li>Interaction between scheduling and query execution </li></ul></ul>
    54. 54. Outline <ul><li>Introduction </li></ul><ul><li>WSN hardware </li></ul><ul><li>Common SensorDB software architecture </li></ul><ul><li>Operating system support </li></ul><ul><li>MAC protocols </li></ul><ul><li>Routing </li></ul><ul><li>Scheduling </li></ul><ul><li>Summary and future directions </li></ul>
    55. 55. Tutorial Summary <ul><li>System design issues have a significant impact on the overall performance of sensor databases. </li></ul><ul><li>A holistic sensor database system requires considerations on all layers – from OS kernel, MAC, routing to query processing. </li></ul><ul><li>Cross-layer design is necessary, especially in scheduling. </li></ul>
    56. 56. Future Directions <ul><li>Multi-query processing in sensor networks </li></ul><ul><ul><li>Query optimization </li></ul></ul><ul><ul><ul><li>Sharing, caching, and pipelining </li></ul></ul></ul><ul><ul><li>Scheduling </li></ul></ul><ul><ul><ul><li>Queries, operators, and transmission </li></ul></ul></ul><ul><li>In-network joins among different nodes </li></ul><ul><ul><li>Fine-grained scheduling for node cooperation </li></ul></ul><ul><li>Query processing in multi-sink networks </li></ul>Cross-layer design is necessary for an efficient, holistic sensor database.
    57. 57. References: Sensor Databases and Runtime Support <ul><li>[BGS01] Philippe Bonnet, Johannes Gehrke, and Praveen Seshadri. Towards Sensor Database Systems. MDM, 2001 . </li></ul><ul><li>[MF+02] Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong. TAG: a Tiny AGgregation Service for Ad-Hoc Sensor Networks. OSDI , 2002. </li></ul><ul><li>[MF+03] Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong. The Design of an Acquisitional Query Processor for Sensor Networks . SIGMOD , 2003. </li></ul><ul><li>[YG03] Yong Yao and Johannes Gehrke. Query Processing for Sensor Networks. CIDR , 2003. </li></ul><ul><li>[MAK07] Rene Muller, Gustavo Alonso, and Donald Kossman. SwissQM: Next Generation Data Processing in Sensor Networks. CIDR, 2007. </li></ul><ul><li>[CP+07] David Chu, Lucian Popa, Arsalan Tavakoli, Joseph M. Hellerstein, Philip Levis, Scott Shenker, and Ion Stoica. The Design and Implementation of A Declarative Sensor Network System . Submitted for publication , 2007. </li></ul>
    58. 58. References: OS Support <ul><li>[DGV04] Adam Dunkels, Björn Grönvall, and Thiemo Voigt. Contiki - A Lightweight and Flexible Operating System for Tiny Networked Sensors . The 29th Annual IEEE Conference on Local Computer Networks , 2004. </li></ul><ul><li>[HK+05] Chih-Chieh Han, Ram Kumar, Roy Shea, Eddie Kohler and Mani Srivastava. A Dynamic Operating System for Sensor Nodes. International Conference on Mobile Systems, Applications, and Services , 2005. </li></ul><ul><li>[BC+05] Shah Bhatti, James Carlson, Hui Dai, Jing Deng, Jeff Rose, Anmol Sheth, Brian Shucker, Charles Gruenwald, Adam Torgerson, and Richard Han. MANTIS OS: An Embedded Multithreaded Operating System For Wireless Micro Sensor Platforms. ACM/Kluwer Mobile Networks and Applications (MONET), Special Issue on Wireless Sensor Networks , vol. 10, no. 4, pp.563–579, Aug 2005. </li></ul><ul><li>[GS06] Lin Gu and John A. Stankovic. t-kernel: Providing Reliable OS Support for Wireless Sensor Networks. SenSys , 2006. </li></ul>
    59. 59. References: MAC and Routing <ul><li>[STS02] Curt Schurgers, Vlasios Tsiatsis, and Mani B. Srivastava. STEM: Topology Management for Energy Efficient Sensor Networks . IEEE Aerospace Conference , 2002. </li></ul><ul><li>[YHE02] Wei Ye, John Heidemann, and Deborah Estrin. An Energy-Efficient MAC Protocol for Wireless Sensor Networks . INFOCOM , 2002. </li></ul><ul><li>[DL03] Tijs van Dam and Koen Langendoen. An Adaptive Energy-Efficient MAC Protocol for Wireless Sensor Networks . SenSys, 2003. </li></ul><ul><li>[IGE00] Chalermek Intanagonwiwat, Ramesh Govindan, and Deborah Estrin. Directed Diffusion: A Scalable and Robust Communication Paradigm for Sensor Networks. MobiCom , 2000. </li></ul><ul><li>[WTC03] Alec Woo, Ternence Tony, and David Culler. Taming the Underlying Challenges of Reliable Multihop Routing in Sensor Networks. SenSys , 2003. </li></ul>
    60. 60. References: Scheduling <ul><li>[HDB04] Barbara Hohlt, Lance Doherty, and Eric Brewer. Flexible Power Scheduling for Sensor Networks . IPSN , 2004. </li></ul><ul><li>[Sic04] Mihail L. Sichitiu. Cross-Layer Scheduling for Power Efficiency in Wireless Sensor Networks . INFOCOM , 2004. </li></ul><ul><li>[WLX06] Hejun Wu, Qiong Luo, and Wenwei Xue. Distributed Cross-Layer Scheduling for In-Network Sensor Query Processing . PerCom , 2006. </li></ul>