Spatial Views: Space-aware Programming for Networks of Embedded Systems Yang Ni, Ulrich Kremer, and...

Post on 02-Apr-2015

212 views 0 download

Transcript of Spatial Views: Space-aware Programming for Networks of Embedded Systems Yang Ni, Ulrich Kremer, and...

Spatial Views: Space-aware Programming for Networks of Embedded

Systems

Yang Ni, Ulrich Kremer, and Liviu Iftode

Rutgers University

This work has been supported by NSF ITR Award ANI-0121416.

LCPC 2003 EEL Lab, Rutgers University 2

NES: A New Computing Platform

LCPC 2003 EEL Lab, Rutgers University 3

NES: A New Computing Platform

LCPC 2003 EEL Lab, Rutgers University 4

NES: A New-Generation Computing Platform

(contd.) Many potential applications for NES

What’s the traffic 10 miles ahead? Is there a man in red near Terminal A? Find a cab.

How to program them?Will existing models work?

LCPC 2003 EEL Lab, Rutgers University 5

What’s Special About NES?Location-sensitivity.

A node is interesting because of its location in addition to its functionality.Context-awareness often translates into location-awareness.

Volatility.Nodes join and leave at any time.

Resource-limitation.Execution time and battery life are limited.

LCPC 2003 EEL Lab, Rutgers University 6

How to program NES?Existing programming models do not sufficiently address all those issues specific to NES.We need a high-level programming model with:

Location-awarenessLocation specification at the programming levelLocation-based operation at the programming level

Dynamic integration of servicesDiscover and use services dynamically in an ad-hoc network

Adaptation to resource-limitationsQoR (Quality of Results) and resource tradeoff

LCPC 2003 EEL Lab, Rutgers University 7

MotivationSpatial Views Programming ModelSpatial Views Application Example

ExperimentsRelated WorkConclusions

LCPC 2003 EEL Lab, Rutgers University 8

Basic Programming Abstraction in Spatial Views

Nodes are abstracted as (service, location)

A physical node providing multiple services represent multiple virtual nodesA moving physical node represent multiple virtual nodesTime is an implicit dimension, the value of which is always the time when a node is visited and used

LCPC 2003 EEL Lab, Rutgers University 9

Spatial Views

A dynamic collection of virtual nodes that provide an interesting service and are located in an interesting space.

SV(service,space) {virtual node x | x.ofClass isA service and x.location space}.SV(service) = SV(service, anywhere).

Service: named with interfaces (abstract classes) with agreed-on semantics

LCPC 2003 EEL Lab, Rutgers University 10

Iterators and SelectorsIterators and Selectors instantiate Spatial Views.

Iterators enumerate all possible nodes in a view within a time constraint.Selectors stop after the first successful discovery, or timeout.

Time Constraint is necessary because Spatial Views can be infinite.

LCPC 2003 EEL Lab, Rutgers University 11

Application Example

Find a person in red on the third floor of a building

STARTSTOP

LCPC 2003 EEL Lab, Rutgers University 12

SpatialView cameraView = new SpatialView("Camera", BuschCampus.CoRE.Floor3);

foreach camera in cameraView do within 30000 {

Picture pic = camera.getPicture();

Rectangle redRegion = pic.findRegionInColor(Color.Red);

if (redRegion != null) {

SpatialView detectorView = new SpatialView("FaceDetector");

Rectangle face;

forany detector in detectorView do within 10000

face = detector.detectFaceInPicture(pic);

Location loc = camera.getLocation();

if (face !=null && face.isCloseTo(redRegion))

System.out.println("A person in red is found at " + loc);

else

System.out.println("Something red is found at " + loc);

}

}

LCPC 2003 EEL Lab, Rutgers University 13

MotivationSpatial Views Programming ModelSpatial Views Application Example

ExperimentsRelated WorkConclusions

LCPC 2003 EEL Lab, Rutgers University 14

Experiments: Implementation

Spatial Views Program

Spatial Views Compiler

Java Bytecode

Spatial Views Virtual MachineSpatial Views Library

Modified Sun javac 1.3.1Supporting space definition and Spatial View iteration.

Modified Sun KVM/CLDC 1.3Supporting migration and discovery

LCPC 2003 EEL Lab, Rutgers University 15

Experiment 1: Person Search Application

Execution TimeWith face detection: 23.1 secondsWithout face detection: 10.0 seconds

Routing: gossiping with backtracking

LCPC 2003 EEL Lab, Rutgers University 16

Experiment 2:Quality of Result v.s. Time/Resource Usage

QoR QoR

Resource Resource

LCPC 2003 EEL Lab, Rutgers University 17

Experiment 2:Effects of Time Constraints

Perfect answer: 8 nodes

Perfect Answer: 5 nodes

LCPC 2003 EEL Lab, Rutgers University 18

Execution time v.s. Network Link Failure Rate

(1)

0

2000

4000

6000

8000

10000

12000

60 70 80 90 100

Link Failure Rate (% )

Execu

tion T

ime (

ms)

w/ o constr.w/ constr.timeout

LCPC 2003 EEL Lab, Rutgers University 19

Quality of Result (QoR) v.s.

Network Link Failure Rate

0

1

2

3

4

5

6

7

8

Number of Nodes Visited

60 70 80 82 85 87 90 92 95 97 98

Link Failure Rate (% )

line

LCPC 2003 EEL Lab, Rutgers University 20

Execution time v.s. Network Link Failure Rate

(2)

0500

100015002000250030003500400045005000

60 70 80 90 100

Link Failure Rate (% )

Execu

tion T

ime (

ms)

w/ o constr.w/ constr.timeout

LCPC 2003 EEL Lab, Rutgers University 21

Quality of Result (QoR) v.s.

Network Link Failure Rate

00.5

11.5

22.5

33.5

44.5

5

Number of Nodes Visited

60 70 80 82 85 87 90 92 95 97 98

Link Failure Rate (% )

net

LCPC 2003 EEL Lab, Rutgers University 22

Related WorkLocation technology: GPS, APS(Rutgers), Cricket (MIT), RADAR (Microsoft Research), Active Badges (AT&T), Bats (AT&T).Service discovery: Jini (SUN), INS (MIT), SDS(Berkeley), SLP, Salutation, Bluetooth SDP.Migratory execution: Smart Messages (Rutgers), Active Messages (Berkeley) and Mobile Agents including D’Agent (Dartmouth), Java Aglet (IBM).Sensor Networks: nesC(Berkeley)

LCPC 2003 EEL Lab, Rutgers University 23

ConclusionsSpatial Views is a programming model for dynamic and resource-limited networks of embedded systemsThe first space-aware programming model with best-effort semanticsSimple and expressive, prototype and applications implemented

LCPC 2003 EEL Lab, Rutgers University 24

Thank you!

LCPC 2003 EEL Lab, Rutgers University 25

Experimental Setup

10 iPAQ PDA’sH3800 & H3600 Mercury camera sleeves

802.11b wireless networkFamiliar Linux, Kernel 2.4.18Customized KVM/CLDC 1.0.3Customized Javac 1.3.1

LCPC 2003 EEL Lab, Rutgers University 26

Experiment 2:One-hop Migration Time

050

100150200250300350400450

6928

4

7761

2

8580

8

9400

0

1021

92

1103

84

1185

76

Live data size

Mig

rati

on t

ime

iPAQ-wirelessPC-wired

LCPC 2003 EEL Lab, Rutgers University 27

Syntax<SpatialView> <identifier><Iterator> foreach <var> in <SpatialView> do <TimeConstraint> [constraints] <statement><Selector> forany <var> in <SpatialView> do <TimeConstraint> [constraints] <statement><TimeConstraint> within <NumberOfMilliSeconds>