12
Self-Awareness in 8 KB and 7 ms Maarten van Steen VU University Amsterdam Dept. Computer Science The Network Institute 1/36 Background The facilitators The facilitators: increasingly smaller nodes Plug computer Smart phones Crossbow mote MyriaNed 2/36 Background The facilitators 2/36 Background The facilitators The facilitators: increasingly smaller nodes A TinyOS watch (thanks to Univ. Warsaw) 3/36 Background The facilitators 3/36

Mvs handout

Embed Size (px)

DESCRIPTION

by Maarten van-steen

Citation preview

Page 1: Mvs handout

Self-Awareness in 8 KB and 7 ms

Maarten van Steen

VU University AmsterdamDept. Computer Science

The Network Institute

1 / 36

Background The facilitators

The facilitators: increasingly smaller nodes

Plug computer Smart phones

Crossbow mote MyriaNed

2 / 36

Background The facilitators

2 / 36

Background The facilitators

The facilitators: increasingly smaller nodes

A TinyOS watch (thanks to Univ. Warsaw)

3 / 36

Background The facilitators

3 / 36

Page 2: Mvs handout

Background The facilitators

Extreme Wireless Distributed Systems

In what sense extreme?Scale (size #1): extremely large system: 1000s to 100,000s ofwireless nodesScale (size #2): potentially extremely small nodes: severely,resource-constrained devices

Additional characteristicsHighly dynamic: nodes join/leave/moveHighly heterogeneous: many different communication protocolsand different types of nodesLarge parts of the underlying communication network fairlyunreliable with asymmetric linksIn essence a sparse network compared to the wired case.

4 / 36

Background The facilitators

4 / 36

Background The facilitators

General architecture

Wireless/hybrid network

Applications

Sensors/actuators

Externalfeedbacksystem

ArchitectureNetwork consists of many different (wireless) devicesSensor/actuators may be shared between applicationsExternal feedback system: reasoning component for apps & networkthat cannot be (easily) handled through in-network processing

5 / 36

Background The facilitators

5 / 36

Background Problems

Well-known problems: Resource constraints

Algorithmic requirementsEnergy awareness:

Duty cycles⇒ synchronization problemsPeriodic algorithmsPreferred: fewer messages, but each with “lots” of data

Simplicity of algorithms:No time/memory/energy for sophisticated computations (e.g.: nocrypto?)Don’t be too simple, but cleverly optimize (e.g., cross-layer design)

6 / 36

Background Problems

6 / 36

Page 3: Mvs handout

Background Problems

Well-known problems: Wireless communication

False assumptionsUnit disk radio patternsLinks are symmetricLinks are reliableLink quality is stable

7 / 36

Background Problems

7 / 36

Background Problems

Overview

1 BackgroundThe facilitatorsProblems

2 Application scenariosCrowdsSocial games

3 System-level self-awarenessDuty-cycled networksDecisionNotification

4 Application-level self-awarenessGossip-based ad hoc routingWhat we need to discover

8 / 36

Background Problems

8 / 36

Application scenarios Crowds

Application scenarios: crowds

Crowd managementSituation: a large event without fixed routes (trade fair, festival)Goal: guide people using social information:

Direct people having similar interests to the same locationsDirect the same social group to the same place (scheduling)

Goal: keep groups together (such as a family)

9 / 36

Application scenarios Crowds

9 / 36

Page 4: Mvs handout

Application scenarios Crowds

Very different types of crowds

structured unstructured

semi-structured semi-structured10 / 36

Application scenarios Crowds

10 / 36

Application scenarios Social games

Application scenarios: social games

Stimulate minglingSituation: Conference with people fromdifferent groups.Goal: Stimulate people from different groupsto interact.Approach: Keep track of group interactions:

When Maarten from Amsterdam talks toMarco from Groningen: bonus points foreither one, as well as their respectivegroups.Group points are distributed to eachmember.Mingling achievements are displayed onelectronic badges (feedback and socialintervention).

11 / 36

Application scenarios Social games

11 / 36

Application scenarios Social games

Application scenarios: social games

ATxmega CPU (32 MHz): 4 KBEEPROM, 8 KB SRAM, 128 KBFlashUSB/JTag connectors8 MB external data flash (good forlogging)various sensors (light, accelerometer,microphone)

FYIWe have been running many simulations, but also experiments with upto nearly 250 badges.

12 / 36

Application scenarios Social games

12 / 36

Page 5: Mvs handout

Application scenarios Social games

30 years of Informatics in Amsterdam

13 / 36

Application scenarios Social games

13 / 36

Overview

1 BackgroundThe facilitatorsProblems

2 Application scenariosCrowdsSocial games

3 System-level self-awarenessDuty-cycled networksDecisionNotification

4 Application-level self-awarenessGossip-based ad hoc routingWhat we need to discover

14 / 36 14 / 36

System-level self-awareness

System-level self-awareness

Some observationsWith (tens, hundreds of) thousands of nodes, there is no way thattraditional sensor-network techniques can be used for:

extracting sensed data for real-time, offline processingrouting messages between (distant) nodesdiscovering properties of the network (size, topology, etc.)

Sensor badges need to be small:small, low-capacity batteriesstrict energy budgets

15 / 36

System-level self-awareness

15 / 36

Page 6: Mvs handout

System-level self-awareness Duty-cycled networks

Example: Duty-cycled networks

EssenceNodes simultaneously power on their radios only periodically in orderto communicate:

Can lead to substantial energy savingsAlgorithms tend to have a strong periodic natureAlgorithms are often necessarily simple: you may need to finish bythe end of the duty cycleOur interest: extreme low duty cycles (less than 1% of the timeactive).

16 / 36

System-level self-awareness Duty-cycled networks

16 / 36

System-level self-awareness Duty-cycled networks

Duty Cycling

Crucial problemClocks tend to drift....

(a)

(b)

(c)

17 / 36

System-level self-awareness Duty-cycled networks

17 / 36

System-level self-awareness Duty-cycled networks

TDMA-based Media Access

RX RX TX RX Idle Idle Idle Join Idle Idle Idle Idle

Guard time Guard timeTX time

RX Time

slot

tick

frame

Offset between nodes

Node A

Node B

1 tick = 1/32768 secs ≈ 30µsecs1 slot = 28 ticks ≈ 850µsecsFrame length is a parameter

18 / 36

System-level self-awareness Duty-cycled networks

18 / 36

Page 7: Mvs handout

System-level self-awareness Duty-cycled networks

GMAC’s Duty-cycled TDMA protocol

RX RX TX RX Idle Idle Idle Join Idle Idle Idle Idle

Guard time Guard timeTX time

RX Time

slot

tick

frame

Offset between nodes

Node A

Node B

Active period: 8 slots (i.e., 6.8 millisecs), frame length: 1170 slots⇒duty cycle: 8

1170 = 0.68%.For each frame length, nodes select a random slot in the active period tobroadcast, and listen to the other 7.Nodes broadcast a join message during a random slot in the idle period.

19 / 36

System-level self-awareness Duty-cycled networks

19 / 36

System-level self-awareness Duty-cycled networks

Frame Synchronization

r r+1

Two distinct aspects of synchronizationMaintenance of synchronized clustersMerging of separate clusters

20 / 36

System-level self-awareness Duty-cycled networks

20 / 36

System-level self-awareness Duty-cycled networks

Synchronization maintenance: the median algorithm

median average

offset from local clock

1 Sort all received messages by offset from local clock2 Choose the median offset to synchronize with3 Adjust local clock by one-half the median offset

ObservationWorks good enough; improvements are possible allowing for lowerduty cycles.

21 / 36

System-level self-awareness Duty-cycled networks

21 / 36

Page 8: Mvs handout

System-level self-awareness Duty-cycled networks

Cluster merging

r r+1

Three subproblemsDetectionDecisionNotification

22 / 36

System-level self-awareness Duty-cycled networks

22 / 36

System-level self-awareness Duty-cycled networks

Active detection

1 The sensor network is partitioned into two temporally disjointclusters, red and blue

2 A node from the red cluster node broadcasts a join messageduring its idle period

3 Several blue cluster nodes neighboring the red node receive themessage and merge

23 / 36

System-level self-awareness Duty-cycled networks

23 / 36

System-level self-awareness Duty-cycled networks

Passive detection

1 The sensor network is partitioned into two temporally disjointclusters, red and blue

2 Red cluster node broadcasts a normal application messageduring its active period

3 A single blue cluster node is listening in its idle period, receivesthe message, and merges

24 / 36

System-level self-awareness Duty-cycled networks

24 / 36

Page 9: Mvs handout

System-level self-awareness Decision

Decision

r r+1

ObservationDecision algorithm should implement a total-ordering relation � overclusters: A� B⇒ cluster A is superior to cluster B.Wrong example: “Join if I’m active in X ’s first half round.”

All nodes have a unique hardware IDNodes use this unique ID as their cluster ID at startupThe ordering of IDs (integers) provides a total ordering of clusters

25 / 36

System-level self-awareness Decision

25 / 36

System-level self-awareness Notification

Active detection with notification

1 The sensor network is partitioned into two temporally disjointclusters, with red � blue.

2 A node from the red cluster node broadcasts a join messageduring its idle period

3 Several blue cluster nodes receive the message, but staysynchronized to their current cluster for one frame before merging

26 / 36

System-level self-awareness Notification

26 / 36

System-level self-awareness Notification

Active detection with notification

1 All merging blue nodes notify their neighbors (via a field in anapplication message) of the superior red cluster

2 The merging nodes finally complete their merge, while the finalblue node begins the same process

27 / 36

System-level self-awareness Notification

27 / 36

Page 10: Mvs handout

System-level self-awareness Notification

Active detection with targeted joins

1 The sensor network is partitioned into two temporally disjointclusters, but now blue � red.

2 A node from the red cluster node broadcasts a join messageduring its idle period

3 Several blue cluster nodes receive the message, but will nowsend a join message during the red node’s active period.

28 / 36

System-level self-awareness Notification

28 / 36

System-level self-awareness Notification

Evaluation: Active versus passive detection

Time (rounds) Time (rounds) 8000800010

100

1000

10 000

100 000

sta

nd

ard

de

via

tio

n (

se

c)

μ

2000 2000

Active detection Passive detection

29 / 36

System-level self-awareness Notification

29 / 36

System-level self-awareness Notification

Evaluation: Active detection with targeted joins

Fra

ction s

ynchro

niz

ed n

odes

Active detection

0

1

Active + Merge + Target

Time (rounds) Time (rounds)3000 3000

Low density

High density

Moderate density

ObservationSelf-awareness at the system level in WSNs is all about about findingthe right reactive (simple) algorithms.

30 / 36

System-level self-awareness Notification

30 / 36

Page 11: Mvs handout

Overview

1 BackgroundThe facilitatorsProblems

2 Application scenariosCrowdsSocial games

3 System-level self-awarenessDuty-cycled networksDecisionNotification

4 Application-level self-awarenessGossip-based ad hoc routingWhat we need to discover

31 / 36 31 / 36

Application-level self-awareness

Information dissemination as a building block

ObservationsExtreme geospatial distributed systems require decentralizedsolutions:

In geospatial systems (including wireless systems), each node hasa location in a 2D (or 3D) planeLatency is a nonnegligible factor⇒ centralized solutions mayimpose unacceptable request/response delays

We also need to minimize the dependencies between nodesEssential: let nodes make decisions based on as much current,locally available information as needed/possible

ImportantBy supporting efficient and effective information dissemination, weprovide a building block for local-only decision-making. This brings usto gossiping.

32 / 36

Application-level self-awareness

32 / 36

Application-level self-awareness Gossip-based ad hoc routing

Gossip-based data dissemination

From flooding to gossiping: Basic modelEach node can broadcast data items only to its 1-hop neighbor.A source injects (broadcasts) a data item.A node receives data item x ⇒ broadcast x with probability p.

ModificationWhen the source has only few neighbors, a data item may not beforwarded at all⇒ for the first k hops, a received data item isbroadcast with probability 1.

33 / 36

Application-level self-awareness Gossip-based ad hoc routing

33 / 36

Page 12: Mvs handout

Application-level self-awareness Gossip-based ad hoc routing

Improving data dissemination

ObservationIf messaging does not die out, i.e., most of the nodes are reached⇒with n neighbors expect to see approximately p ·n messages fromthose neighbors (assuming ideal communication medium).

ImprovementIf a node does not see a message from at least m neighbors, itbroadcasts the message if it hadn’t done so before. It turns out thatm = 1 is (often) good enough!

NoteThis type of gossiping is great, but when it comes to crowded networksa lot of fine-tuning and local feedback is needed to avoid a collapse.

34 / 36

Application-level self-awareness Gossip-based ad hoc routing

34 / 36

Application-level self-awareness What we need to discover

The speculative part

35 / 36

Application-level self-awareness What we need to discover

35 / 36

Application-level self-awareness What we need to discover

Questions

36 / 36

Application-level self-awareness What we need to discover

36 / 36