Distributed Software Systems Group - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Distributed Software Systems Group

Description:

... medium abstraction separates sensor network problem into two largely independent ... The dilation runs only within the boundaries containing the source. ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 14
Provided by: pruetb
Category:

less

Transcript and Presenter's Notes

Title: Distributed Software Systems Group


1
Programming a Sensor Network as an Amorphous
Medium
  • Jonathan Bachrach and Jacob Beal
  • DCOSS 06
  • Pruet _at_ DSSG

bachrach06programming
2
Outline
  • Introduction
  • Programming Amorphous Media
  • Approximating Amorphous Media

3
Introduction
  • To develop an application on a wireless sensor
    network, application developers should focus on
    writing code in the application domain level
  • rather than developing in network or individual
    sensor node level.
  • The spatial nature of sensor network applications
    can be naturally expressed in terms of global
    behavior of an Amorphous medium.
  • Amorphous medium is a theoretical continuous
    computational material which fills space of
    interest.
  • Every point in the medium is an independent
    computational device.
  • Each point executes the same code, but can behave
    differently based on local condition.
  • Each point has a neighborhood of devices nearby
    whose state it can access.

4
Introduction
  • Amorphous medium abstraction separates sensor
    network problem into two largely independent
    domains.
  • above the abstraction barrier, developer has to
    concern with the long-range coordination (global)
    and concise description of applications.
  • below the barrier, developer has to concern with
    the fast, efficient and robust communication
    between neighboring devices.

5
Programming Amorphous Media
  • Programs in Amorphous Media are written in Proto
    programming language.
  • A program in Proto compute on an amorphous medium
    by manipulating fields.
  • A field is a map assigning a value to each point
    in the space.
  • When executed, the program is evaluated against
    the space at regular intervals to produce a
    stream of output fields.
  • Primitives in Proto are either
  • terminals which produce fields, or
  • operators which calculate an output field from
    input fields.

6
Programming in Amorphous Media
  • a) create a field of value 2.
  • b) create a field by adding the value of input
    fields pointwise.
  • c) two input values are selected pointwise based
    on the boolean condition of the third field.

7
Programming in Amorphous Media
  • d) value 2 and 5 are assigned to two different
    fields, the their value are sum to create the
    third field.
  • e) operator sq is defined as x x
  • f) a field with value 9 is created by input a
    field with value 3 to operator sq.

8
Proto
  • Primitives in Proto are composed to form complex
    expression by connecting outputs to inputs to
    form a directed graph.
  • LISP-like syntax is used, e.g. ( 2 5)
  • A new primitive can be created by a fragment of
    graph, using lambda expression.
  • E.g. (lambda (x) ( x x))
  • A named lambda can be defined using def
  • E.g. (def sq (a) ( a a))
  • Syntax (def name(input) (operation))

9
Proto
  • Instead of exchanging messages between neighbors
    to perform area-based calculation,
  • e.g. find an average sensor reading among all
    neighbors,
  • Proto provides implicit communication through the
    reduce-nbrs operator.
  • reduce-nbrs summarizes the values in the
    neighborhood using a uncountable sets(continuous)
    quantifier.
  • Five quantifiers are implemented integral (sum),
    forall and exists (AND and OR), limsup and liminf
    (min and max)
  • E.g.,
  • (def local-average(v)
  • ( /
  • (reduce-nbrs v integral) //sum of value v
    of all neighbors
  • (reduce-nbrs 1 integral) //number of
    neighbors
  • )
  • )

10
Proto
  • Proto also provides operators for measuring
    distance in space and time, nbr-range and
    nbr-lag, respectively.
  • Persistent state is established using delay
    loops.
  • Proto is functional programming language which
    does not have side-effect.
  • The delay loop can hold the output from this
    round to the next round.
  • E.g. to define a discrete-time integrator
  • (def integrator (x) (letfed ((v 0 ( x v))) v))

Output field
performed each round
initial field
internal state field
11
Proto
  • Example gradient operator
  • Create gradient toward a point
  • (def gradient (src)
  • (letfed
  • ((n infinity
  • ( 1 (mux src 0
  • (reduce-nbrs
  • ( n nbr-range)
  • limsup
  • )
  • )
  • )
  • ))
  • (- n 1)
  • )
  • )

n 0
n 5
5
20
5
5
n 20
n 10
n inf
n inf
n 0
n 5
n inf
n inf
n 15
n 10
n 0
n inf
n inf
n inf
n 0
n 5
n 20
n inf
12
Proto
  • if operator restricts the field against which an
    expression is evaluated.
  • (def dilate (r source) (lt (gradient source) r))
  • (def bound (source max boundary)
  • (if (not boundary) (dilate max source)))
  • The dilation runs only within the boundaries
    containing the source.

13
Approximating Amorphous Media
  • In order to execute Proto program on a sensor
    network, the kernel(VM) has to
  • approximately simulates the amorphous medium
  • approximates global evaluation with local code,
  • approximates continuous space with discrete
    devices.
  • Rather than attempt to synchronize the operations
    between devices,
  • each device executes independently once every t
    seconds by its own clock.
  • So, each program has to be executed within t
    seconds.
  • The program is executed at the base station
    first, then distributed to the sensor network
    dynamically.
  • For each operation that requires information from
    neighboring nodes, e.g. reduce-nbrs or nbr-range,
    sensor nodes broadcast a request and wait for the
    respond from neighbors.
  • The integral quantifier sums the values from the
    neighborhood, weighted by the estimated area each
    represents.
Write a Comment
User Comments (0)
About PowerShow.com