Markus Bestehorn Stephan KesslerAndreas Leppert Sven Meisinger
KSN Radio Stack:
pp g
KSN Radio Stack:Reliable Wireless Communication for Data-intensive Applications in Sensor Networksintensive Applications in Sensor NetworksSun SPOT Symposium 2009London
www.kit.edu
Data-Intensive Application in WSN?
Wireless Sensor Network (WSN)Large number of battery powered devices
IntroductionData-IntensiveS St k g y p
energy is valuable!Exchanging data using wireless communicationUser can access network through base station Sun SPOT
Sun Stack
KSN Radio StackDesign TargetsSHP User can access network through base station
Countless ApplicationsMedical Care, Environment Monitoring, Object Tracking…
Su S OSHPRoutingOther LayersDemo
What is data-intensive application in WSN?2 variations:Nodes generate Data
Comparison
KSNTeam g
Data must be transported to user / base stationAmount of data accumulates on the way
Base station has to distribute data to the whole network
AcitivitiesResearch
Q&A Base station has to distribute data to the whole network2 examples follow
Slide 2Markus Bestehorn
Example 1: Data Gathering
Data Gathering ApplicationsA large number of nodes
IntroductionData-IntensiveS St k g
Generating / Measuring data (continously)Sending measured data back to base station
Sun Stack
KSN Radio StackDesign TargetsSHPSHPRoutingOther LayersDemo
More Sensor Nodes
Base
Comparison
KSNTeam
D it C i /A ti
Base StationAcitivities
Research
Q&A Despite Compression/Aggregation: Messages of several KB have to transmitted reliablyLarge part of result is lost if 1 message is lost!
Slide 3Markus Bestehorn
Example 2: Over-the-Air Deployment
TestbedsEvaluate your software
IntroductionData-IntensiveS St k y
Test and debug softwareSun Stack
KSN Radio StackDesign TargetsSHP Problem: Testing-Cycle very cumbersome
1. Connect SPOT to USB2. Put SPOTs into position
SHPRoutingOther LayersDemo u S O s o pos o
3. Start testing / evaluation1. Errors in software?2 Find error fix code
Comparison
KSNTeam 2. Find error, fix code
4. Collect SPOTs and start with step 1Solution:
AcitivitiesResearch
Q&AFixed infrastructure connected to nodes
Not possible/feasible or all deploymentsDistribute software over-the-air (OTA)
Slide 4
( )
Markus Bestehorn
Example 2: Over-the-air Deployment (cont‘d)
Requires large files / messages to be transmittedQuery Processor suite file ~500 KB
IntroductionData-IntensiveS St k Q y
Libraries ~700 KB„Large“ Number of Hops
I b d f 30 SPOT 9 H
Sun Stack
KSN Radio StackDesign TargetsSHP In our testbed of 30 SPOTs max. 9 Hops
Any testbed requires transmission of large
SHPRoutingOther LayersDemo Any testbed requires transmission of large
messages over multiple hopsComparison
KSNTeamAcitivitiesResearch
Q&A
Slide 5Markus Bestehorn
Requirements of data-intensive Applications
Communication software (stack) mustDeliver messages reliably
IntroductionData-IntensiveS St k g y
Cope with relatively large messagesMultiple Hops between sender and receiver node
P ti l l h d i t k
Sun Stack
KSN Radio StackDesign TargetsSHP Particularly hard in sensor networks
Expect nodes to fail during transmissionReact to topology changes due to external influences, e.g.,
SHPRoutingOther LayersDemo p gy g g
WeatherClosing/Opening of doors
Comparison
KSNTeam
SPOTs are shipped with a communication stackWhy not use this stack?
AcitivitiesResearch
Q&A
Slide 6Markus Bestehorn
Testing the Sun Stack (1)
Setup for evaluation2-5 nodes in a line, i.e., 1-4 hops
IntroductionData-IntensiveS St k , , p
1 specified node sends a message of varying sizeRadioStream was usedAfter sending node computes a hash value of the message
Sun Stack
KSN Radio StackDesign TargetsSHP After sending, node computes a hash value of the message
1 specified node receives messageWhen receiving completes, receiver computes hash value over received message
SHPRoutingOther LayersDemo received message
Transmission successful, if both hash values are equalCode can be obtained from our homepage:htt // i d i k l h d /KSN
Comparison
KSNTeam
http://www.ipd.uni-karlsruhe.de/KSNAcitivitiesResearch
Q&A
Sender Receiver
Slide 7Markus Bestehorn
Sender Receiver
Testing the Sun Stack (2)
Evaluation was conducted with the „Blue“ release (current) IntroductionData-IntensiveS St kSun Stack
KSN Radio StackDesign TargetsSHPSHPRoutingOther LayersDemoComparison
KSNTeamAcitivitiesResearch
Q&A
Slide 8Markus Bestehorn
Motivation for a new stack
Sun stack is reliable and fast for small messagesAlmost no errors for message sizes below 1KB
IntroductionData-IntensiveS St k g
Unreliable for large messages or high number of hopsMain reason: Design Goals for the Sun Stack
L P
Sun Stack
KSN Radio StackDesign TargetsSHP Low Power
Efficient usage of low bandwidth availableDesign not aimed at „data-intensive“ applications
SHPRoutingOther LayersDemo g „ pp
Messages are transmitted reliably 1 h
Comparison
KSNTeam
over 1 hop802.15.4 layer worksErrors must occur above
AcitivitiesResearch
Q&ADesign new stack above MAC
Slide 9Markus Bestehorn
Agenda
Motivation: Why do we need another stack?What does „data-intensive“ in sensor networks mean
IntroductionData-IntensiveS St k „
Demo and reliability evaluation dataKSN Radio Stack
D i & ddi i l f
Sun Stack
KSN Radio StackDesign TargetsSHP Design targets & additional features
The core of the KSN StackOptional KSN stack layers
SHPRoutingOther LayersDemo p y
Possibilities for Optimization / ImprovementsReliability evaluation and Demo of the KSN stackComparison: Sun Stack vs KSN Stack
Comparison
KSNTeam Comparison: Sun Stack vs. KSN Stack
The KSN TeamProjects
AcitivitiesResearch
Q&AResearch Agenda
Slide 10Markus Bestehorn
Design Targets - Reliability
Transmission of large messages over multiple hops must work reliably
IntroductionData-IntensiveS St k
yProblems encountered during transmission must be fixed inside the communication stack if possible
Handling of errors should not be mixed with application code
Sun Stack
KSN Radio StackDesignSHP Handling of errors should not be mixed with application code
Expect nodes to fail during transmissionExternal influences change communication behaviour of nodes
Weather
SHPRoutingOther LayersDemo Weather
Closing doors
Sender must know if transmission failed on intermediate
Comparison
KSNTeam
nodes End-to-End ACKAcitivitiesResearch
Q&A
Sender Receiver
ACK
Slide 11Markus Bestehorn
Design Targets - Extendability
Different applications have different demandsRun Multiple Stacks parallely on one SPOT
IntroductionData-IntensiveS St k
p p yAdding / implementing new layersNetwork Management might require another stack than Query Processing
Sun Stack
KSN Radio StackDesignSHP Processing
Stack with less complex interfaces for student experiments, more sophisticated stack to gather the result of their experiments
SHPRoutingOther LayersDemo experimentsComparison
KSNTeamAcitivitiesResearch
Q&A
Slide 12Markus Bestehorn
Further Design Targets
Compatibility with 802.15.4Interface-Compatibility to Sun Stack
IntroductionData-IntensiveS St k Interface Compatibility to Sun Stack
Users have written applications using the Sun StackMigrating to our stack should not require rewriting the application
Sun Stack
KSN Radio StackDesignSHP application
Link-Quality-awarenessProbability for failures increases, as link quality decreases
SHPRoutingOther LayersDemo
Communication hardware on SPOTs allows estimations about link qualityExample: Quality-Aware Routing Layer
Comparison
KSNTeam p y g yAcitivitiesResearch
Q&A
Slide 13Markus Bestehorn
Optimization is not a Design Target
Communication stacks for sensor nodes are usually optimized regarding energy usage
IntroductionData-IntensiveS St k
p g g gy gNodes are usually battery-powered
Reliability is the most important step towards efficiencyU t k t i i f ti
Sun Stack
KSN Radio StackDesignSHP Users query a sensor network to gain information
demand for information has to be satisfied (efficiently)If failures prevent delivery of information
SHPRoutingOther LayersDemo
Energy used to acquire information until failure occured is wasted!Users might retry Failure likely to occur again more waste!
Optimization is the step after functionality is ensured
Comparison
KSNTeam p p y
“We should forget about small efficiencies, say about 97% of th ti t ti i ti i th t f ll il ”
AcitivitiesResearch
Q&Athe time: premature optimization is the root of all evil.” (Donald Knuth)
Slide 14Markus Bestehorn
Foundation for Reliable Communication
Basic Operation of 802.15.4:Sending a packet of 127 byte
IntroductionData-IntensiveS St k g p y
Receiver is a node within the radio range of the senderTwo variants of the Basic Operation:
B d R i dd i bl k“
Sun Stack
KSN Radio StackDesignSHP Broadcast: Receiver address is „blank“
No acknowledgementUnicast: Receiver address identifies node
SHPRoutingOther LayersDemo
If transmission of 127 byte was successful, acknowledgement is sentIf there was a failure, no acknowledgement is received and a i i
Comparison
KSNTeam
timeout expires.
Reliable communication is based on this basic operationFirst Step:
AcitivitiesResearch
Q&A First Step:Design communication protocol for messages larger than 127 byte
Slide 15Markus Bestehorn
SHP – Single Hop Protocol
Single Hop Protocol (SHP) Layer provides interface forUnicast of messages of arbitrary size
IntroductionData-IntensiveS St k g y
Broadcast of messages of arbitrary sizePreparation for sending (unicast or broadcast)
L t M M h i f b b t
M
Sun Stack
KSN Radio StackDesignSHP Let Message M have a size of b bytes
Decompose M into f fragmentsAssign a sequence number s={1…p}
41 32SHPRoutingOther LayersDemo g p
to each fragmentCompute checksum C from M
Sending process for unicast and broadcast different
CComparison
KSNTeam Sending process for unicast and broadcast different
starting with broadcastAcitivitiesResearch
Q&A
Slide 16Markus Bestehorn
Single Hop Protocol - Broadcast
Two types of packetsBroadcastData: Contains fragments
IntroductionData-IntensiveS St k g
of 104 Byte, used for first f-1 fragmentsBroadcastEnd: Contains last fragmentwith sequence number s=f
Sun Stack
KSN Radio StackDesignSHP with sequence number s f
Possible failures:Unexpected sequence number
SHPRoutingOther LayersDemo
Timeout while waiting for next/lastfragment
Limitations (current implementation)
Comparison
KSNTeam ( p )
Sequence Number is 16-bit longmax. Broadcast ~ 6 MBsufficient for SPOTs
AcitivitiesResearch
Q&A
Slide 17Markus Bestehorn
SHP – Possible Broadcast Improvement
Problem: Broadcast still inherently unreliableSender broadcasts f fragments to surrounding nodes
IntroductionData-IntensiveS St k f g g
Some receivers only receive k<f fragmentsReceiver has spent energy, but message is incomplete
receiver discards all received fragments energy wasted!
Sun Stack
KSN Radio StackDesignSHP receiver discards all received fragments, energy wasted!
Possible improvement (not yet implemented):Each receiver uses sequence numbers to determine, which k
SHPRoutingOther LayersDemo
fragments are missingIf k is sufficiently small compared to f, ask sender to resend missing fragments with unicast
Comparison
KSNTeam
Open questions:Caching mechanisms for broadcast messages on senderWhat is sufficiently small“?
AcitivitiesResearch
Q&A What is „sufficiently small ?
Slide 18Markus Bestehorn
Single Hop Protocol - Unicast
SHP - Unicast Protocol1. Send UnicastRequest to receiver
IntroductionData-IntensiveS St k q
Contains Checksum CSize b of Message M in bytes
receiver can abort transfer
Sun Stack
KSN Radio StackDesignSHP
2. Send f fragments to receiverReceiver has to acknowledge each fragment
SHPRoutingOther LayersDemo g
Unacknowledged fragments are retransmitted after a timeout
3. Receiver checks if data is not
Comparison
KSNTeam
disrupted using checksum CAcitivitiesResearch
Q&A
Slide 19Markus Bestehorn
SHP – Unicast Improvements
Evaluation has shown:Data rates with Sun stack higher than with KSN stack
IntroductionData-IntensiveS St k g
Comparable only for small messages due to reliabilityReason for lower data rate:
A k l d f h f
Sun Stack
KSN Radio StackDesignSHP Acknowledgment for each fragment
congestionLess payload due to larger sequence numbers
SHPRoutingOther LayersDemo
Ideas for improvements: „TCP/IP-like ACK“Aggregate ackowledgements and send 1 packet to acknowledge several received fragments
Comparison
KSNTeam acknowledge several received fragments
Increase number of packets between ackowledgements depending on link quality
AcitivitiesResearch
Q&A
Slide 20Markus Bestehorn
Summary Single Hop Protocol
SHP offers reliable delivery to 1-hop neighborsBroadcast
IntroductionData-IntensiveS St k
UnicastMessage size
B d d 6 MB f b d SPOT h
Sun Stack
KSN Radio StackDesignSHP Bounded to 6 MB for broadcast
Theoretically unbounded for unicastVM defines boundaries for max. array length
SPOT has 512KB ofRAM
SHPRoutingOther LayersDemo
Layer still not fine-tunedlarge room for improvements!
Comparison
KSNTeam
Design targets so far?Extendability not yet
AcitivitiesResearch
Q&A802.15.4 compatiblity doneReliability only 1 hop
Slide 21Markus Bestehorn
Extendability – Multiple Stacks, 1 SPOT
All communication is based on reliable 1-hop communicationSHP usable as a foundation
IntroductionData-IntensiveS St k
Idea to allow multiple stacksEach Stack is assigned a globally unique ID
we used a simple byte value
Sun Stack
KSN Radio StackDesignSHP we used a simple byte value
max. 256 different stacksSpecial byte indicates stack IDE h d Di t h t
SHPRoutingOther LayersDemo
Each node uses a Dispatcher toPass incoming data to correct stack depending on stack IDPass outgoing data to SHP Layer
Comparison
KSNTeam
SHP Dispatcher has 4 functionsRegister / unregister new stack
AcitivitiesResearch
Q&ABroadcast / unicast datausing SHP
Slide 22Markus Bestehorn
Extendability – More Stack-Layers
All new layers must implement LayerInterfaceMethods for broadcast / unicast of data from upper layers
IntroductionData-IntensiveS St k pp y
Method, which takes incoming data from lower layers or the SHP Level Dispatcher
Abstract Layer implementation is provided with our software
Sun Stack
KSN Radio StackDesignSHP Abstract Layer implementation is provided with our software
New Layers can be implemented with very few lines of codeExample of a AODV Routing Layer follows now
SHPRoutingOther LayersDemoComparison
KSNTeamAcitivitiesResearch
Q&A
Slide 23Markus Bestehorn
Example Layer – Multi-Hop Routing
Up to this point, only 1-hop communication coveredExample for a new Layer: Routing Layer
IntroductionData-IntensiveS St k
p y g yUsed Routing Mechanism: Ad-Hoc On Demand Distance Vector Routing (AODV) [2]
Sun Stack
KSN Radio StackDesignSHP
Sun Stack also includes AODV implementation, butNo (working) End-to-End ACKs for Multi-Hop Unicasts
SHPRoutingOther LayersDemo ( g) p
Only 1 entry per Receiver no backup routesBoth problems affect reliability
Comparison
KSNTeam
will be addressed in the following
AcitivitiesResearch
Q&A
Slide 24Markus Bestehorn
AODV Routing Mechanism
Basics of AODV: Sender S wants to send message to Receiver R
IntroductionData-IntensiveS St k
gS broadcasts Route Request (RREQ)Nodes receiving RREQs rebroadcast if
RREQ has not been broadcasted before
Sun Stack
KSN Radio StackDesignSHP RREQ has not been broadcasted before
Node already has a route to R stored in routing tableReceiver R receives the RREQ
Route Report (RREP) is sent back to S
SHPRoutingOther LayersDemo Route Report (RREP) is sent back to S
Message is sent through shortest / fastest-available routeComparison
KSNTeam
RREQRREQAcitivitiesResearch
Q&A
RREQRREQ RREQ RREPRREQACKACKACK
Slide 25Markus Bestehorn
Sender Receiver
AODV – Routing Table Format
Routing Table without backup entries1 entry for each receiver R
IntroductionData-IntensiveS St k y
If transfer fails, new RREQ is broadcast by sender SProblem: RREQ very small message (1 packet)
might be transmitted reliably but larger messages fail
Sun Stack
KSN Radio StackDesignSHP might be transmitted reliably, but larger messages fail
same Route will be returnedtransfer might fail again for larger message energy
wasted!
SHPRoutingOther LayersDemo wasted!
Solution: Several entries for 1 receiver R
Comparison
KSNTeam
Use depth-first search to transmitlarger message to RCan be adapted to use
AcitivitiesResearch
Q&Aquality information!
Slide 26Markus Bestehorn
AODV – End-to-End ACK
SHP sends ACK if message is transmitted correctlyProblem:
IntroductionData-IntensiveS St k Problem:
Intermediate node fails while sendingIntermediate node has sent ACK already, but message is lost!
Sun Stack
KSN Radio StackDesignSHP Solution: Receiver sends End-to-End ACK to sender
Sender waits for End-to-End ACKLength of timeout determined using hop count of routing table
SHPRoutingOther LayersDemo e g o eou de e ed us g op cou o ou g ab e
SHP-ACK
Comparison
KSNTeam
Design targets so far?Sender ReceiverEnd-to-End ACK
AcitivitiesResearch
Q&A g gExtendability done802.15.4 compatiblity doneReliability done
Slide 27
Reliability done
Markus Bestehorn
Other Layers
Reducing Data SizeCompression layer
IntroductionData-IntensiveS St k p y
Can be used with abitrary compression algorithmWe use a modified ZIP algorithm
Should be used above routing layer
Sun Stack
KSN Radio StackDesignSHP Should be used above routing layer
Avoids decompression on every hop
Protocol Dispatcher
SHPRoutingOther LayersDemo
Applications can use different protocols on top of single stack!Examples:
Comparison
KSNTeam p
PC-like with portsLowPan
AcitivitiesResearch
Q&A
Slide 28Markus Bestehorn
KSN Radio Stack Demo
Message Size: 50 KBTested up to 1 MB with more than 10 hops
IntroductionData-IntensiveS St k p p
4 HopsOutput Power -30
Sun Stack
KSN Radio StackDesignSHP Difference to demo before
„Simulation“ of node failures by removing/exchanging nodesSimulated „failure“ will cause delay
SHPRoutingOther LayersDemo S u a ed „ a u e cause de ay
Message delivered despite topology changes„Application“ has not been changed
Comparison
KSNTeamAcitivitiesResearch
Q&A
Sender Receiver
Slide 29Markus Bestehorn
Comparison of both Stacks
Sun StackVery fast and efficient for small messages
IntroductionData-IntensiveS St k y g
use for experiments where „every second counts“Unreliable if
Messages become large
Sun Stack
KSN Radio StackDesignSHP Messages become large
Messages must be transmitted over a large number of hopsOther transmissions from other SPOTs run parallely
Was not shown here
SHPRoutingOther LayersDemo Was not shown here
IPv6 compatibleKSN Radio Stack
Comparison
KSNTeam
Reliable for large message sizes and large number of hopsUp to 1 MB And 15 hops tested without losing messages
AcitivitiesResearch
Q&AMore overhead slower
Use for experiments where „counting bytes“ is sufficientCurrently not IPv6 compatible
Slide 30
Currently not IPv6 compatible
Markus Bestehorn
Agenda
Motivation: Why do we need another stack?What does „data-intensive“ in sensor networks mean
IntroductionData-IntensiveS St k „
Demo and reliability evaluation dataKSN Radio Stack
D i & ddi i l f
Sun Stack
KSN Radio StackDesignSHP Design targets & additional features
The core of the KSN StackOptional KSN stack layers
SHPRoutingOther LayersDemo p y
Possibilities for Optimization / ImprovementsReliability evaluation and Demo of the KSN stackComparison: Sun Stack vs KSN Stack
Comparison
KSNTeam Comparison: Sun Stack vs. KSN Stack
The KSN TeamProjects
AcitivitiesResearch
Q&AResearch Agenda
Slide 31Markus Bestehorn
Who is who @ KSN?
Stephan KesslerStudent Assistant
IntroductionData-IntensiveS St k
KSN Serialization & StackSun Stack
KSN Radio StackDesignSHP Andreas Leppert
Student AssistantKSN Stack, Query Dissemination
SHPRoutingOther LayersDemo S S ac , Que y sse a o
Sven Meisinger
Comparison
KSNTeam
Student AssistantKSN Serialization, Simulator
AcitivitiesResearch
Q&A
Markus BestehornPhD student
Slide 32
Project Head
Markus Bestehorn
KSN – Other Projects
Management ApplicationControlling large testbeds of SPOTs
IntroductionData-IntensiveS St k g g
Software deployment uses KSN StackSupport for experiments, e.g., collect data
S i li ti f SPOT
Sun Stack
KSN Radio StackDesignSHP Serialization for SPOTs
Serialization used in JDK to store/send objectsnot supported by Squawk VM
SHPRoutingOther LayersDemo
Pure Java serializationTestbed
30+ nodes deployed at the IPD
Comparison
KSNTeam 30+ nodes deployed at the IPD
Real network for experimentsAcitivitiesResearch
Q&AMany more…Homepage: www.ipd.uni-karlsruhe.de/KSN
Slide 33Markus Bestehorn
KSN – Sensor Databases
Research Topic: Sensor DatabasesProblem: Every new application for WSN requires complete
IntroductionData-IntensiveS St k y pp q p
development processDesign & implement new hardwareDesign & implement new software
Sun Stack
KSN Radio StackDesignSHP Design & implement new software
very costlyIdea: Provide database-like interface for WSNAd t U ft f WSN li ti l
SHPRoutingOther LayersDemo Advantage: Use same software for new WSN application, only
change queryExample: SPOT 1 SPOT 2
Comparison
KSNTeam
Measurement stored distributedly in tables
Temp: 25.3°CHum.: 78%Light: 124
Temp: 23.4°CHum.: 77%Light: 120
AcitivitiesResearch
Q&A Measurement stored distributedly in tablesUse SQL to query data, e.g., SELECT nodeID, temp FROM Sensors
Slide 34
Size of result depends on query data-intensive!
Markus Bestehorn
KSN – Current Research Topics
Approximate Query ProcessingReduce result quality to save energy
IntroductionData-IntensiveS St k q y gy
Different quality parameters possiblePrecision of resultSecurity
Sun Stack
KSN Radio StackDesignSHP Security
Consistency
Query Distribution
SHPRoutingOther LayersDemo
Broadcast of query very energy consumingUse structure of query to choose distribution strategy
try to reach all relevant nodes, but not all nodes!
Comparison
KSNTeam
Spatio-Temporal query processing in WSNMoving object DBs provide operators to query object movement
Only for historical data stored in a DB server
AcitivitiesResearch
Q&A Only for historical data stored in a DB serverIdea: Try to provide these operators for object tracking in WSN
Slide 35Markus Bestehorn
Thank you for your attention!
Questions?Introduction
Data-IntensiveS St k Questions?Sun Stack
KSN Radio StackDesignSHP
References
SHPRoutingOther LayersDemo
No. Reference[1] MICA2 Sensor Node, http://www.xbow.com/
P ki R Ad h d d di t t ti M bil C ti
Comparison
KSNTeam
[2] Perkins, Royer: Ad-hoc on-demand distance vector routing; Mobile Computing Systems and Applications, 1999
AcitivitiesResearch
Q&A
Slide 36Markus Bestehorn
Top Related