36
Ubiquitous Computing Middleware: Application Sessions for Dynamic Environments Christine Julien Director, Mobile and Pervasive Computing Group EDGE Distinguished Lecture Series April 13, 2006

Ubiquitous Computing Middleware

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Ubiquitous Computing Middleware

Ubiquitous Computing Middleware: Application Sessions for Dynamic Environments

Christine JulienDirector, Mobile and Pervasive Computing GroupEDGE Distinguished Lecture SeriesApril 13, 2006

Page 2: Ubiquitous Computing Middleware

OutlineMotivation and ChallengesAn Application-Driven Approach

Defining a unique set of application characteristics

A Pervasive Application Virtual MachineIntroducing Middleware and Coordination The Application Sessions Middleware

Formalizing behaviorsProgramming interactions

Mobile and Pervasive Computing Group

Page 3: Ubiquitous Computing Middleware

MotivationSimplify application development for complex environments

Allow application developers to program directly to applications’ needsDynamically gather context informationSeamlessly adapt to environmental changes Transparently help programmers cope with problems inherent in ubiquitous networks

Page 4: Ubiquitous Computing Middleware

Challenges in Mobile Ubiquitous Computing

Transient connectivity to resourcesDemands opportunistic interactions and limited a priori knowledge

Rapid change due to user and environment dynamics

Demands awareness and adaptation

Lack of guaranteed connectivity to fixed infrastructure

Demands local, on-demand communication

Page 5: Ubiquitous Computing Middleware

An Application-Driven Approach

First Responder Applications

Intelligent Construction Sites

Sample Application Domains

sensors injured

surveillance

paramedic

Page 6: Ubiquitous Computing Middleware

Unique Set of Application Characteristics

Heterogeneous devicesUnpredictable and dynamic connectivity and availabilityData-driven resource requestsLarge scale and distributionIncreased need for application coordinationLocality of information and interactionsDependence on environmental factors

Page 7: Ubiquitous Computing Middleware

A Changing Set of AssumptionsThese new characteristics nullify common assumptions

No addresses for use in communicationLong-lived static overlays not feasibleLittle control over hardware deployment and maintenance

Top down approaches addresses these failings from application abstractions through communication mechanisms

Page 8: Ubiquitous Computing Middleware

A Pervasive Application Virtual MachineMiddleware for network and device transparency

Hide complexity of underlying communicationActively cooperate with application at runtime to provide dynamic functions

Algorithms for automatic and adaptive context collection

Sense and react to a changing environment

Protocols for application-sensitive communication

Provide local and dynamic connectivity

Page 9: Ubiquitous Computing Middleware

Why Middleware?Speed up application development in complex environments

Enhance level of programming abstraction Provide generic and flexible context operationsShift complex and non-application specific tasks to underlying infrastructureFacilitate rapid dissemination and adoption

Proven solutions for other domainsDistributed object systems

CORBA, Jini, DENOMobile agent systems

Aglets, D’Agents, µCodeCoordination systems

LIME, MARS, Jedi

Page 10: Ubiquitous Computing Middleware

Why Coordination?Separation of communication from computation into a coordination language

Enables reasoning about interactions separately from other behaviorPromotes reuse, modularity, rapid prototypingMost importantly, eases program understanding

Page 11: Ubiquitous Computing Middleware

The Application Sessions ApproachUbiquitous applications/users need to coordinate with changing set of resourcesMiddleware handles these interactions

without exposing their complexity without reducing their expressiveness

Developer focuses on interaction instead of the implementation of that interaction

Programming Abstraction

Session Implementations

Communication Options

Applications

Page 12: Ubiquitous Computing Middleware

The Application Sessions Approach (2)

Fundamental Questions:What is the correct programming abstraction for ubiquitous computing?

Object oriented programming?Aspect oriented programming?Service/resource oriented programming?

What is the most important thing with respect to ubiquitous programming?

Interactions

Session-oriented programming

Page 13: Ubiquitous Computing Middleware

The Application Sessions Contribution

Given session-oriented abstraction:Identify, formalize, and codify the interactions required by ubiquitous applicationsEncapsulate similarities and parameterize differences

Result a new programming paradigmfor mobile ubiquitous computing

Page 14: Ubiquitous Computing Middleware

Application Session: A DefinitionTemporary logical connection among two or more networked devices

Over which application data is exchanged

State maintained for the session involves an application-level dialog

Includes the set of operations the application intends to perform

Functionality provided by session definitions closer to application requirements than other sessions

Not just for end-to-end connectivity

Page 15: Ubiquitous Computing Middleware

A ModelExplicit separation of user program (behavior) from session management (interactions)

Coordination through shared variablesInteractions are defined by the coordination language

Session is:Defined by specAccessed through s

s

Page 16: Ubiquitous Computing Middleware

Precise Behavioral SpecificationsDifferent session types provide different coordination semanticsEach session is defined (partially) by a specification

Content-based restriction over resource descriptionImplemented using tuples and patternsOther description languagespossible

Applications codeinteractions as session declarations

spec = specification[request session]⟨await s ≠ ⊥⟩if s ≠ ε then

[use s]fi

Page 17: Ubiquitous Computing Middleware

The Query SessionThe simplest session: retrieve a data value

Very short-lived interaction, but fundamental to many applications

In programmatic notation, just s = specFormally,s = s’.(s’ spec ∧ s’.connected)

Read as: “s’ satisfies spec”“connected” models communication capabilitiesNon-deterministic selection says: “any match is as good as any other match”

Page 18: Ubiquitous Computing Middleware

The Query Session: Some SubtletiesThe s the application can use is just an instantaneous view of a matching resource

The resource was connected at the instant the await statement unblockedNo further guarantees regarding the selected resource spec = specification

s = spec⟨await s ≠ ⊥⟩if s ≠ ε then

[use s]fi

Query session declaration

Page 19: Ubiquitous Computing Middleware

The Provider SessionFind and connect to amatching resourceMaintain the connection as long as possible at all costsProgrammatically: s ← specFormally:s = s’.(s’ spec ∧ s’.connected)if s ≠ ε then

⟨await ¬ s.connected → s = ε⟩fi

vital statistics

treatment plan

Page 20: Ubiquitous Computing Middleware

Using a Provider SessionAfter assigning the specification to the handle and receiving a resource

Must periodically verify that the resource is still connectedFormalized as a loop; implemented as a callback the session user must handle

spec = specifications ← spec⟨await s ≠ ⊥⟩while s ≠ ε do

[use s]od

Provider session declaration

Periodic handleverification

Page 21: Ubiquitous Computing Middleware

The Type SessionFind any matching resource and stay connected to any matching resourceProgrammatically:s ⇐ specFormally:s = s’.(s’ spec ∧ s’.connected)while s ≠ ε do

⟨await ¬s.connected → s = s’.(s’ spec ∧ s’.connected)⟩od

location servers

sessiontransfer

Page 22: Ubiquitous Computing Middleware

Using a Type SessionSimilar to provider session

s is set to ε only if there does not exist another matching resource

Maintenance of state across sessionsFuture work

spec = specifications ⇐ spec⟨await s ≠ ⊥⟩while s ≠ ε do

[use s]od

Type session declaration

Periodic handleverification

Page 23: Ubiquitous Computing Middleware

The Group SessionFind and connect to all matching resources

Under dynamics, automatically update the group Interact with s using set operations

Programmatically:s ⇐{} specFormally:s = ⟨set s’ : s’ spec ∧ s’.connected :: s’⟩while s ≠ Ø do

⟨await group-change → s = ⟨set s’: s’ spec ∧ s’.connected :: s’⟩ ⟩od

crane arc

Page 24: Ubiquitous Computing Middleware

Multiple Matches and PreferencesIs non-deterministic matching sufficient?

Resource preferenceslower relative mobilitycloserlower error rateshigher remaining battery poweretc.

Specified through a preference function f (R)Formalization: evaluated as part of the matching algorithmImplementation: separated from specification and (at times) used to parameterize communication

Page 25: Ubiquitous Computing Middleware

Multiple Matches and Preferences (2)An example: type sessions = ⟨max s’ : s’ spec ∧ s’.connected :: f (s’)⟩while o ≠ ε do

⟨await ¬s.connected ∨⟨∃s’ : s’.connected ∧ s’ spec ∧ f (s’) > f (s)⟩ →

s = ⟨max s’: s’ spec ∧ s’.connected :: f (s’)⟩od

Different types of preference:fn(r,a): network preference—defines the cost of a network path (static definition, dynamic values)fr(a): resource preference—defines the cost to a resource of servicing a request (resource load, battery power, intended length of usage, etc.)fa(r): application preference—defines the cost to an application of using a particular resource (latency of response, resource fidelity, proximity, availability, etc.)

Page 26: Ubiquitous Computing Middleware

Application Sessions: A MiddlewareMiddleware architecture

Requests arrive via underlying communication protocolsSession factory determines match in comparison to local repositorySession implementations handle maintenance (and, if necessary) tear-down of sessions

QuerySession

GroupSession

Type Session

Provider Session

Session Factory

Discovery RoutingC

DR

Hyb

rid

Reg

istry

GroupComm.

DSR

Applications

SICC

loca

lre

posi

tory

Page 27: Ubiquitous Computing Middleware

Handling Dynamics: Aspect-Oriented Techniques

Goal: hide resource discovery, migration, persistence, etc. behind single session interface

AOP techniques allow us to dynamically “plug in” functionality best suited to the application and environment

Dynamic object construction and run-time bindings

Allows application to perceive the session as a single (persistent) “object”

Implementation of method calls on that object may change over time and space

Page 28: Ubiquitous Computing Middleware

An Application ExampleGroup session

Resource: trajectories of allpeople within 100 mInteraction: periodic positionupdates displayed on thescreen

//provide no preferenceRater peopleR = null;//match all peopleFilter peopleF = new Filter(“people”); //find anyone within 100mRegion peopleRegion = new Region(100);IPeopleService peopleService =

factory.createGroupSession(peopleF, peopleR, region);

Page 29: Ubiquitous Computing Middleware

Application Sessions: ConclusionA new programming paradigm targeted for ubiquitous computing

Session-oriented programming

Provides formal specifications of target behavior

Includes ability to formally define preferences of network, resource, and application

Realized in a middleware that simplifies application development

Page 30: Ubiquitous Computing Middleware

Application Session Acknowledgements

Joint work with Drew StovallAppearing in:

Proceedings of the 8th International Conference on Coordination Models and Languages (Bologna, Italy, June 2006)

Page 31: Ubiquitous Computing Middleware

Mobile and Pervasive Computing Group

Middleware abstractions for simplifying developmentMobile communication and coordinationAdaptation and context-awarenessCollaborative ad hoc groupsIncorporation of RFID and sensors in ubiquitous environments

Page 32: Ubiquitous Computing Middleware

SMASH: Secure Mobile Agent SystemFacilitate secure mobile agents

Movement of autonomous software components

Enable a combination of trusted andanonymous interactions

Careful balance of admission control and an open system

Page 33: Ubiquitous Computing Middleware

CDR: Application-Aware Communication

Address-less discovery and routing combinedIntegrated reactive and proactive routing

Dynamic definition of optimal advertisement radius

Page 34: Ubiquitous Computing Middleware

DAIS: Middleware for Immersive Sensor Networks

Ubiquitous environments entailing heterogeneous devices

Allow direct data queries of local sensors

Resource constraints

Heterogeneous abstraction and aggregation using virtual sensorsStreamlined programming model that hides TinyOS

Page 35: Ubiquitous Computing Middleware

Questions?

http://mpc.ece.utexas.edu

Page 36: Ubiquitous Computing Middleware

Persistent (Active) SessionsThe polling function may not provide the best semantics for the applicationPersistent sessions make null s values legal over time

Require applications to be careful about handling null pointers

Active type session:s = s’.(s’ spec ∧ s’.connected)while ¬stop do

⟨await o = ε ∨ ¬s.connected → s = s’.(s’ spec ∧ s’.connected)⟩od