30
Architectures and Architectures and Applications for Applications for Wireless Sensor Wireless Sensor Networks (204525) Networks (204525) Data-Centric and Data-Centric and Content-Based Content-Based Networking Networking Chaiporn Jaikaeo Chaiporn Jaikaeo [email protected] [email protected] Department of Computer Engineering Department of Computer Engineering Kasetsart University Kasetsart University Materials taken from lecture slides by Karl and Willig

Chaiporn Jaikaeo [email protected] Department of Computer Engineering Kasetsart University

  • Upload
    raziya

  • View
    30

  • Download
    0

Embed Size (px)

DESCRIPTION

Architectures and Applications for Wireless Sensor Networks (204525) Data-Centric and Content-Based Networking. Chaiporn Jaikaeo [email protected] Department of Computer Engineering Kasetsart University. Materials taken from lecture slides by Karl and Willig. Overview. - PowerPoint PPT Presentation

Citation preview

Page 1: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

Architectures and Architectures and Applications for Applications for Wireless Sensor Wireless Sensor

Networks (204525)Networks (204525)

Data-Centric and Data-Centric and Content-Based Content-Based

NetworkingNetworkingChaiporn JaikaeoChaiporn Jaikaeo

[email protected]@ku.ac.thDepartment of Computer EngineeringDepartment of Computer Engineering

Kasetsart UniversityKasetsart UniversityMaterials taken from lecture slides by Karl and Willig

Page 2: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

2

OverviewOverview Interaction patterns and Interaction patterns and

programming modelprogramming model Data-centric routingData-centric routing Data aggregationData aggregation Data storageData storage

Page 3: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

3

Interaction PatternsInteraction Patterns Standard networking interactionStandard networking interaction

Client/server, peer-to-peerClient/server, peer-to-peer Explicit or implicit partners, explicit Explicit or implicit partners, explicit

cause for communicationcause for communication Desirable properties for WSN (and Desirable properties for WSN (and

other applications)other applications) Decoupling in space Decoupling in space – neither sender – neither sender

nor receiver need to know their partnernor receiver need to know their partner Decoupling in time Decoupling in time – “answer” not – “answer” not

necessarily directly triggered by necessarily directly triggered by “question”, asynchronous “question”, asynchronous communicationcommunication

Page 4: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

4

Publish/Subscribe Publish/Subscribe InteractionInteraction Achieved by Achieved by publish/subscribe publish/subscribe

paradigmparadigm Idea: Entities can publish data under Idea: Entities can publish data under

certain namescertain names Entities can subscribe to updates of Entities can subscribe to updates of

such such named datanamed data

Software bus

Publisher 1 Publisher 2

Subscriber 1 Subscriber 2 Subscriber 3

VariationsVariations Topic-based:Topic-based:

Inflexible Inflexible Content-Content-

basedbased use general use general

predicates over predicates over named datanamed data

Page 5: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

5

P/S Implementation P/S Implementation OptionsOptions Central server: mostly not applicable Central server: mostly not applicable Topic-based: group communication Topic-based: group communication

(multicast)(multicast) Content-based: does not directly map to Content-based: does not directly map to

multicastmulticast Needs content-based routing/forwarding for Needs content-based routing/forwarding for

efficient networkingefficient networking

t < 10

t > 20

t < 10

t < 10 ort > 20

t > 20

t > 40

t > 20

t < 10 ort > 20

t = 35!

t = 35!

t = 35!

t = 35!

t = 35!

Page 6: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

6

OverviewOverview Interaction patterns and Interaction patterns and

programming modelprogramming model Data-centric routingData-centric routing Data aggregationData aggregation Data storageData storage

Page 7: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

7

One-Shot InteractionsOne-Shot Interactions Too much overhead to explore topologyToo much overhead to explore topology For small data setsFor small data sets

Flooding/gossipingFlooding/gossiping For large data setsFor large data sets

Idea: exchange data summary with neighbor, Idea: exchange data summary with neighbor, ask whether it is interested in data ask whether it is interested in data

Only transmit data when explicitly requested Only transmit data when explicitly requested Nodes should know about interests of further Nodes should know about interests of further

away nodesaway nodes E.g., E.g., Sensor Protocol for Information via Sensor Protocol for Information via

Negotiation Negotiation (SPIN)(SPIN)

Page 8: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

8

SPIN example SPIN example

ADVADV

(1)

REQ

(2)

DATA

(3)

(4) ADV

ADV

AD

V

(5) REQ

RE

Q

(6)DATA

DA

TA

Page 9: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

9

Repeated InteractionsRepeated Interactions More interesting: Subscribe once, More interesting: Subscribe once,

events happen multiple timesevents happen multiple times Exploring the network topology might Exploring the network topology might

actually pay offactually pay off But: unknown which node can provide But: unknown which node can provide

data, multiple nodes might ask for datadata, multiple nodes might ask for data How to map this onto a “routing” How to map this onto a “routing”

problem?problem?

Page 10: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

10

Repeated InteractionsRepeated Interactions Idea: Put enough information into Idea: Put enough information into

the network so that publications and the network so that publications and subscriptions can be mapped onto subscriptions can be mapped onto each othereach other But try to avoid using unique identifiersBut try to avoid using unique identifiers

One option: One option: Directed diffusionDirected diffusion Try to rely only on Try to rely only on local interactions local interactions

for implementation for implementation

Page 11: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

11

Directed DiffusionDirected Diffusion Two-phase PullTwo-phase Pull Phase 1Phase 1: nodes : nodes

distribute distribute interestsinterests Interests are Interests are

flooded in the flooded in the networknetwork Apparently obvious Apparently obvious

solution: remember solution: remember from where interests from where interests came, set up a came, set up a convergecast treeconvergecast tree

Problem? Problem?

Sink 1

Sink 2

Sink 3SourceX

Sink SourceX

Page 12: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

12

Direction DiffusionDirection Diffusion Option 1: Node X forwarding Option 1: Node X forwarding

received data to all “parents” in a received data to all “parents” in a “convergecast tree” “convergecast tree” Not attractive, many needless packet Not attractive, many needless packet

repetitions over multiple routesrepetitions over multiple routes Option 2: node X only forwards to Option 2: node X only forwards to

one parentone parent Not acceptable, data sinks might miss Not acceptable, data sinks might miss

eventsevents

Page 13: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

13

Direction DiffusionDirection Diffusion Option 3: Only provisionally send Option 3: Only provisionally send

data to all parents, but ask data data to all parents, but ask data sinks to help in selecting which paths sinks to help in selecting which paths are redundant, which are neededare redundant, which are needed Information from where an interest Information from where an interest

came is called came is called gradientgradient Forward all published data along all Forward all published data along all

existing gradientsexisting gradients

Page 14: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

14

Gradient Gradient ReinforcementReinforcement Gradients express not only a link in a Gradients express not only a link in a

tree, but a quantified “strength” of tree, but a quantified “strength” of relationshiprelationship Initialized to low valuesInitialized to low values Strength represents also rate with Strength represents also rate with

which data is to be sentwhich data is to be sent Intermediate nodes forward on all Intermediate nodes forward on all

gradientsgradients Can use a data cache to suppress Can use a data cache to suppress

needless duplicatesneedless duplicates

Page 15: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

15

Directed DiffusionDirected Diffusion Second phaseSecond phase: Nodes that contribute : Nodes that contribute

new data (not found in cache) should new data (not found in cache) should be encouraged to send more databe encouraged to send more data Sending rate is increased, the gradient is Sending rate is increased, the gradient is

reinforcedreinforced Gradient reinforcement can start from the Gradient reinforcement can start from the

sink sink If requested rate is higher than available If requested rate is higher than available

rate, gradient reinforcement propagates rate, gradient reinforcement propagates towards original data sources towards original data sources

Adapts to changes in data sources, Adapts to changes in data sources, topology, sinkstopology, sinks

Page 16: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

16

Directed Diffusion - Directed Diffusion - ExampleExample

Page 17: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

17

Directed Diffusion – Directed Diffusion – Extensions Extensions Two-phase pull suffers from interest Two-phase pull suffers from interest

flooding problemsflooding problems Mitigated by combining with topology Mitigated by combining with topology

control, in particular, passive clustering control, in particular, passive clustering Geographic scoping & directed Geographic scoping & directed

diffusion diffusion

Page 18: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

18

Directed Diffusion – Directed Diffusion – Extensions Extensions Push diffusion – few senders, many Push diffusion – few senders, many

receiversreceivers Same interface/naming conceptSame interface/naming concept Do not flood interests, but flood the Do not flood interests, but flood the

data data Interested nodes will start reinforcing Interested nodes will start reinforcing

the gradients the gradients Pull diffusion – many senders, few Pull diffusion – many senders, few

receivers receivers Still flood interest messages, but Still flood interest messages, but

directly set up a real treedirectly set up a real tree

Page 19: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

19

OverviewOverview Interaction patterns and Interaction patterns and

programming modelprogramming model Data-centric routingData-centric routing Data aggregationData aggregation Data storageData storage

Page 20: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

20

Data Aggregation Data Aggregation Packets may combine their data into Packets may combine their data into

fewer packetsfewer packets Data AggregationData Aggregation

Depending on network, aggregation Depending on network, aggregation can be useful or pointless can be useful or pointless

Page 21: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

21

Metrics for Data Metrics for Data AggregationAggregation AccuracyAccuracy

E.g., differences, ratios, statisticsE.g., differences, ratios, statistics CompletenessCompleteness

A form of accuracyA form of accuracy LatencyLatency Message overheadMessage overhead

Page 22: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

22

Expressing Aggregation Expressing Aggregation RequestRequest One option: Use database One option: Use database

abstractionabstraction Request by SQL clauses Request by SQL clauses

E.g.,E.g.,SELECT AVG(temperature), floor SELECT AVG(temperature), floor WHERE temperature > 30WHERE temperature > 30GROUP BY floorGROUP BY floorHAVING floor > 5HAVING floor > 5

Page 23: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

23

Intermediate ResultsIntermediate Results Aggregation requires partial Aggregation requires partial

information to represent information to represent intermediate resultsintermediate results Called Called Partial State RecordsPartial State Records E.g., to compute average, sum and E.g., to compute average, sum and

number of previously aggregated number of previously aggregated values is requiredvalues is required Expressed as <Expressed as <sum,countsum,count> >

Update rule:Update rule:

Final result is simplyFinal result is simply s/c s/c

Page 24: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

24

Categories of Categories of AggregationAggregation Classified by properties of Classified by properties of

aggregation functionsaggregation functions Duplicate sensitiveDuplicate sensitive

E.g., median, sum, histogramsE.g., median, sum, histograms Insensitive: maximum or minimumInsensitive: maximum or minimum

SummarySummary or or examplaryexamplary ComposableComposable: for aggregation function : for aggregation function ff, there exists a function , there exists a function gg such that such that

ff((WW11WW22) = ) = gg( ( ff((WW11), ), ff((WW22) )) ) MonotonicMonotonic

Page 25: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

25

Categories of Categories of AggregationAggregation Behavior of partial state recordsBehavior of partial state records

DistributiveDistributive – end results directly as – end results directly as partial state record, e.g., MINpartial state record, e.g., MIN

AlgebraicAlgebraic – p.s.r. has constant size; end – p.s.r. has constant size; end result easily derivedresult easily derived

Content-sensitiveContent-sensitive – size and structure – size and structure depend on measured values (e.g., depend on measured values (e.g., histogram)histogram)

HolisticHolistic – all data need to be included, – all data need to be included, e.g., median e.g., median

UniqueUnique – only distinct data values are – only distinct data values are neededneeded

Page 26: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

29

OverviewOverview Interaction patterns and Interaction patterns and

programming modelprogramming model Data-centric routingData-centric routing Data aggregationData aggregation Data storageData storage

Page 27: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

30

Data-Centric StorageData-Centric Storage Goal: Store data for later retrievalGoal: Store data for later retrieval

Difficult in absence of gateway Difficult in absence of gateway nodes/serversnodes/servers

Question: Where to put a certain Question: Where to put a certain datum?datum? Avoid a complex directory serviceAvoid a complex directory service

Page 28: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

31

Data-Centric StorageData-Centric Storage Idea: Let name of data describe Idea: Let name of data describe

which node is in chargewhich node is in charge Data name is hashed to a geographic Data name is hashed to a geographic

positionposition Node closest to this position is in Node closest to this position is in

charge of holding datacharge of holding data Similar to peer-to-peer networking Similar to peer-to-peer networking

(DHT)(DHT) Geographic Hash TablesGeographic Hash Tables ( (GHTGHT))

Use geographic routing to store/retrieve Use geographic routing to store/retrieve data at this “location” (in fact, the data at this “location” (in fact, the node)node)

Page 29: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

32

Geographic Hash Geographic Hash TablesTables Nodes not available at the Nodes not available at the

hashed locationhashed location Use nearest nodeUse nearest node

Failing and new nodes Failing and new nodes Replicate data to neighborsReplicate data to neighbors New nodes learn existing New nodes learn existing

value-key pairs from value-key pairs from neighborsneighbors

Limited storage per nodeLimited storage per node Distribute data to other Distribute data to other

nodes in the vicinitynodes in the vicinity

Key location

Timeout

New keylocation

Page 30: Chaiporn Jaikaeo chaiporn.j@ku.ac.th Department of Computer Engineering Kasetsart University

33

ConclusionConclusion Data-centric networking Data-centric networking

considerably changes considerably changes communication protocol design communication protocol design paradigmsparadigms Nicely supports an intuitive Nicely supports an intuitive

programming model – publish/subscribe programming model – publish/subscribe Aggregation is a key enabler for Aggregation is a key enabler for

efficient networkingefficient networking