A Software Engineering Perspective on Context-Awareness in Ad Hoc Mobile Networks Christine Julien Mobile Computing Laboratory Washington University in Saint Louis March 27, 2022
Dec 19, 2015
A Software Engineering Perspective on Context-Awareness in Ad Hoc Mobile Networks
Christine JulienMobile Computing Laboratory
Washington University in Saint LouisApril 18, 2023
April 18, 2023 Christine Julien 2
Motivation• Simplify mobile application development
— Individually address application-specific needs— Dynamically gather context information from the
network— Seamlessly adapt to environmental changes — Transparently help programmers cope with
problems inherent in ad hoc networks
April 18, 2023 Christine Julien 3
Ad Hoc Network Challenges
• Form opportunistically • Change rapidly in response to
mobility• Rely on no fixed infrastructure• Provide transient interactions• Foster decoupled computing• Embody open environments with
limited guarantees
April 18, 2023 Christine Julien 4
Computational Model• Ad hoc network• Host (mobile or stationary)
— Defines location in physical space• Agents/Application Components
— Unit of mobility residing on a host• Data
— Owned and generated by each agent
Host 1
Host 2
Host 3
April 18, 2023 Christine Julien 5
Overview
• Context-aware computing• EgoSpaces conceptual model• EgoSpaces middleware• Network abstractions• Conclusions and future work
April 18, 2023 Christine Julien 6
Context-Aware Computing:
The Need for Context• Software and hardware constantly move and
change• Applications must opportunistically adapt • Perception of context varies by application• Current solutions:
— Use basic types of context information in specific ways • Fieldwork tools, guide tools
— Provide access to only a single component’s sensors at a time
• Context Toolkit, Context Fabric— Support only local or symmetric interactions
• MARS, LIME
April 18, 2023 Christine Julien 7
Context-Aware Computing:
Rethinking Applications (1)
TrafficCollision
April 18, 2023 Christine Julien 9
Context-Aware Computing:
Rethinking Applications (3)
Charlie
Angie
April 18, 2023 Christine Julien 10
Context-Aware Computing:
Novel Notion of Context
• Flexible adaptation in dynamic environments— Scope that extends beyond the local host — Generalized interaction with context types
• Context needs vary by task and situation— Asymmetric context interaction— Multiple contexts evolving over time
• Context computation must be scalable— Explicit control over the scope, size, and cost
April 18, 2023 Christine Julien 11
Overview
• Context-aware computing• EgoSpaces conceptual model• EgoSpaces middleware• Network abstractions• Conclusions
April 18, 2023 Christine Julien 12
EgoSpaces Conceptual Model:
The View Concept• Maximal context contains all available data• A view is a projection of the maximal context
— Egocentric abstraction of operating context— Tailored to an application’s individual needs
• Allow agent to control scope of views— Ease program development— Minimize performance penalties
Host 1
Host 2
Host 3
Reference agent’s view: yellow data within one
hop
April 18, 2023 Christine Julien 13
EgoSpaces Conceptual Model:
Declarative View Specification
• Allows simple yet meaningful view definitions
• Restrict context based on properties of the network, hosts, agents, and data
All location data owned by collision warning agents on cars within 100 meters of my current location
• Facilitate transparent context maintenance— Rely on underlying middleware for context
maintenance tasks
Roman, G.-C., Julien, C., and Murphy, A. L., "A Declarative Approach to Agent-Centered Context-Aware Computing in Ad Hoc Wireless Environments,” Software Engineering for Large-Scale Multi-Agent Systems, LNCS 2603, April 2003.
April 18, 2023 Christine Julien 14
EgoSpaces Conceptual Model:
View Interaction
• Present view contents as tuple space• Allows use of traditional Linda-like
operations— Content-based pattern matching for tuple
retrieval• retrieve tuples (rd)• remove tuples (in)
— Can affect overlapping views— Atomic blocking and probing operationsJulien, C., and Roman, G.-C., "Egocentric Context-Aware Programming in Ad Hoc Mobile Environments," in Proceedings of FSE-10, November 2002.
April 18, 2023 Christine Julien 15
EgoSpaces Conceptual Model:
Consistency Concerns
• Transactional semantics (e.g., money transfers)— Strong application guarantees— Can be expensive— Use atomic Linda-like operations
• “Best-effort” semantics (e.g., traffic)— Variety of implementations— Application chooses semantics based on its
particular situation— Use scattered probing operations
April 18, 2023 Christine Julien 16
EgoSpaces Conceptual Model:
Reactive Views• Facilitate behavioral adaptation
— Agents respond to presence of certain tuples
— Associate application-level reaction to the appearance of a tuple
• Scheduling modalities correspond to consistency requirements— Eager semantics provide transactional
guarantees— Lazy semantics provide fewer guarantees
• Allow more flexible implementation• Increase performance
April 18, 2023 Christine Julien 17
EgoSpaces Conceptual Model:
Active Views• Capture natural context interactions
— Transparent data migration— Automatic duplication— Event capture— Extensibility
• Simplify programming—Programming abstractions—Reduced code size
Julien, C. and Roman, G.-C., "Active Coordination in Ad Hoc Networks," to appear in Proceedings of Coordination 2004.
April 18, 2023 Christine Julien 18
EgoSpaces Conceptual Model:
Access Control Requirements• Ad hoc networks are open environments, yet
agents may need to restrict data access— No permanent trusted central server
• Current work— Administrative domains
• Mobile Ambients, SEAL— Specialized type systems
• KLAIM— Fine-grained access control
• SECOS
• Must scale to large systems• Must address needs of individualized agents
April 18, 2023 Christine Julien 19
EgoSpaces Conceptual Model:
Access Control Provision• Agent specified access control function
— Limits access based on agent properties— Allows fine-grained access control— Individualized to particular application’s needs
• Reference agent provides credentials and intended operations— Access control functions evaluated on a per-
tuple basis to determine inclusion in the view
• Can be used to define administrative domains
April 18, 2023 Christine Julien 20
Overview
• Context-aware computing• EgoSpaces conceptual model• EgoSpaces middleware• Network abstractions• Conclusions
April 18, 2023 Christine Julien 21
EgoSpaces Middleware:
Why Middleware?• Speed up application development in ad hoc
networks— Enhance level of programming abstraction — Provide generic and flexible context operations— Shift complex tasks to underlying infrastructure— Facilitate rapid dissemination and adoption
• Proven solutions for other domains— Distributed object systems
• CORBA, Jini, DENO— Mobile agent systems
• Aglets, D’Agents, Code— Coordination systems
• LIME, MARS, Jedi
April 18, 2023 Christine Julien 22
EgoSpaces Middleware:
EgoSpaces Middleware
• Programming interface simplifies application development burden— Allows declarative view specification— Presents view contents as tuple space— Provides standard Linda tuple space
operations on view definitions
• Includes light-weight implementations of tuple space operations
• Provides tailored access control
April 18, 2023 Christine Julien 23
EgoSpaces Middleware:
EgoSpaces Architecture
• Application provides declarative view specifications
• Middleware — Discovers neighbors — Monitors context
sensors — Provides data
contents of context to application through view abstraction
ad hoc physical network
discovery message sensing
sensor monitoring
network abstractions
EgoSpaces ELights
application
April 18, 2023 Christine Julien 24
EgoSpaces Middleware:
Demo Application
•Application-specific view restriction
—Hop-count based metric
—File-size restriction
•Content-based selection from view
—Songs displayed based on desired properties
•Reactive programming allows downloads to resume
April 18, 2023 Christine Julien 25
EgoSpaces Middleware:
Simplifying Application Development
• Abstracts network for application programmer— Removes concern for low-level network and
communication concerns— Provides high-level, abstract definition of needs
• Maintains contents of views as the environment changes— Programmer does not have to persistently poll
• Shifts developer focus to key components of applications— User interface design— Local data storage and representation
April 18, 2023 Christine Julien 26
Overview
• Context-aware computing• EgoSpaces conceptual model• EgoSpaces middleware• Network abstractions• Conclusions
April 18, 2023 Christine Julien 27
Network Abstractions:
Restricting the Network• Defining a view requires limiting
participating hosts— e.g., all hosts within five miles or
within three hops— Consider the overhead in defining
such a network— Deal with volatility of ad hoc
networks• Unannounced disconnection• Unpredictable reconnection• Heterogeneous devices
5mi
Roman, G.-C., Julien, C., and Huang, Q., "Network Abstractions for Context Aware Mobile Computing," in Proceedings of ICSE, May 2002.
April 18, 2023 Christine Julien 28
Network Abstractions:
Solution Overview
1. Represent the ad hoc network as a graph
2. Abstract properties of nodes and links to weights on edges in this graph
3. Calculate the cost of paths from the reference node
4. Determine the shortest path to each node and build a tree
5. Limit this tree using a bound, D
April 18, 2023 Christine Julien 29
Network Abstractions:
Weight Assignment• Individualized for an application• Abstracts varied properties of hosts and links
— Host properties form i; link properties form ij• i includes battery power, CPU power, location, etc.• ij includes physical distance, bandwidth, throughput, etc.
• Edge weights combine link properties and the properties of the connected nodes
mij = (i, j, ij)
ijiji
j
April 18, 2023 Christine Julien 30
Network Abstractions:
Computing Path Cost• Assuming each link has a single weight (mij), an
application can define a generalized cost function: v0(Pk) = Cost(v0(Pk-1), mk-1,k) v0(v0) = 0
• Cost function must be strictly increasing along a path
April 18, 2023 Christine Julien 31
Network Abstractions:
Limiting the Scope• Define a subtree of
the network by placing a bound on the cost of each path— Bound is useful only if
shortest path cost is strictly increasing
— Allows reference to restrict computation to a subnet
0
1
1
1
1
1
1
2
Note: All links have a weight of 1
21
2
2
3
April 18, 2023 Christine Julien 32
Network Abstractions:
Context Calculation Protocol• Service new queries
— Respond at the application level— Remember cost, parent, sequence number, and
information about the computation— Propagate the query
• Service shorter distances (same sequence number)— Remember cost and new parent— Propagate query
• Disregard longer distances (same sequence number)
— But remember cost and parent if within bound
• Halt when computation reaches boundary• Based on traditional ad hoc routing protocols
April 18, 2023 Christine Julien 33
Network Abstractions:
Protocol ExampleQuery= (source, new cost, …)
State= [cost, parent, ...]{(neighbor, cost through neighbor), …}
Bound = 6Cost = additive
c
(r, 4, …)(r, 2, …)
[0, null, …]
42
15
r
ba 1[2, r, …] [4, r, …]{(r,2)} {(r,4)}
d4
{(r,4)}{(r,2), (b,5)}
[5, b, …]{(b,5)}
[4, r, …][2, r, …]
(b, 5, …)
(b, 5, …)
(a, 3, …)
{(r,4), (a,3)}{(r,2), (b,5)}[2, r, …] [3, a, …]
[5, b, …]{(b,5)}
(b, 4, …)
{(r,4),(a,3)}{(r,2), (b,5)}[2, r, …] [3, a, …]
[4, b, …]{(b,4)}
April 18, 2023 Christine Julien 34
Network Abstractions:
Context Maintenance Protocol
• Persistent queries require context maintenance
• React to increase in link weight— If parent, adjust cost and propagate information— Otherwise, update local information
• React to decrease in link weight— If non-parent link, recalculate cost for neighbor on
the other end• Handle “count-to-infinity” problem
— Store entire shortest path at each hop• Regain resources when context is no longer
used
April 18, 2023 Christine Julien 35
Network Abstractions:
Maintenance Example
42
15
r
c
ba 1 [3, a, …]{(r,2), (b,5)} {(r,4),(a,3)}
[2, r, …]
[0, null, …]
6
[4, b, …]{(b,4)}
Query= (source, source cost, new cost, …)
State= [cost, parent, …]{(neighbor, cost through neighbor), …}
Bound = 6Cost = additive
d 4
(b, 5, …)
[5, b, …]{(b,5)}
{(r,2), (b,10)} {(r,4), (a,8)}[3, a, …][2, r, …]
{(r,2)} {(r,4)}[2, r, …] [4, r, …]
April 18, 2023 Christine Julien 36
Network Abstractions:
Evaluation• Simulation using ns-2 network simulator
— 100 node network in 1000x1000m2 space— Vary network density by changing
transmission range— Using random waypoint mobility model
adapted to avoid speed degradation
• Metrics— Context consistency— Settling time (at most 35ms)— Percentage of useful broadcasts
April 18, 2023 Christine Julien 37
Network Abstractions:
Context Building Consistency (1)
• Good consistency for reasonably sized contexts
one-hop context
two-hop context
three-hop context
four-hop context
Transmission range (meters)
Perc
enta
ge o
f co n
t ex t
rece
iving
mes
sage
April 18, 2023 Christine Julien 38
Network Abstractions:
Context Building Consistency (2)
• Consistency >80% with increased network load
five context definitions
one context definition
ten context definitions
Transmission range (meters)
Perc
enta
ge o
f co n
t ex t
rece
iving
mes
sage
April 18, 2023 Christine Julien 39
Network Abstractions:
Useful Broadcasts• Efficiency decreases with increasing density
one-hop context
two-hop context
three-hop context
four-hop context
Transmission range (meters)
Perc
enta
ge o
f us e
f ul b
road
cast
s
April 18, 2023 Christine Julien 40
Conclusions
• Melding of context-awareness and ad hoc networks
• Novel notion of context— Individualized declarative specification— Includes general facets of the environment— Extended in scope to remote components
• Asymmetric context interactions• EgoSpaces model and middleware
— Supporting algorithms and protocols
April 18, 2023 Christine Julien 41
Contributions (1)
• Algorithms for ad hoc mobile computing—Network abstractions—Consistent group membership
ab R
R a R
b
r
Huang, Q., Julien, C., and Roman, G.-C., "Relying on Safe Distance to Achieve Strong Partitionable Group Membership in Ad Hoc Networks," to appear in IEEE Transactions on Mobile Computing.
April 18, 2023 Christine Julien 42
Contributions (2)
• Middleware for context-awareness—Addressing software engineering
concerns of mobile environments—Facilitating rapid development of
mobile applications—Bringing application development to
the hands of novice programmers
Handorean, R., Payton, J., Julien C., and Roman, G.-C., "Coordination Middleware Supporting Rapid Deployment of Ad Hoc Mobile Systems", in Proceedings of the 1st ICDCS Workshop on Mobile Computing Middleware (MCM03), May 2003.
April 18, 2023 Christine Julien 43
Contributions (3)
• Formal models of context-aware and mobile computing—Specification and refinement using
Mobile UNITY—Building Context UNITY for direct
reasoning about context-aware systems•Roman, G.-G., Julien, C., and Payton, J., "A Formal Treatment of Context-
Awareness," (invited paper) to appear in Proceedings of FASE 2004.•Julien, C., Payton, J., and Roman, G.-C., "Reasoning About Context-Awareness in the Presence of Mobility," in Proceedings of FOCLASA, September 2003.
•Roman, G.-C., Julien, C., and Huang, Q., "Formal Specification and Design of Mobile Systems," in Proceedings of FMPPTA'2002, April 2002.
April 18, 2023 Christine Julien 44
Future Plans
• Addressing ad hoc network and communication concerns in software engineering— Transactional programming in ad hoc networks— Tailored communication and coordination
paradigms for applications in ad hoc networks• Context-aware routing and communication
• Applying formal methods to context-aware environments— Reasoning about mobile and context-aware
applications through formal notation and proof logic
April 18, 2023 Christine Julien 46
Publications www.cse.wustl.edu/~julien
• Roman, G.-G., Julien, C., and Payton, J., "A Formal Treatment of Context-Awareness," (invited paper) to appear in Proceedings of Fundamental Approaches to Software Engineering 2004.
• Julien, C. and Roman, G.-C., "Active Coordination in Ad Hoc Networks," to appear in Proceedings of Coordination 2004.
• Huang, Q., Julien, C., and Roman, G.-C., "Relying on Safe Distance to Achieve Strong Partitionable Group Membership in Ad Hoc Networks," to appear in IEEE Transactions on Mobile Computing.
• Julien, C., Payton, J., and Roman, G.-C., "Reasoning About Context-Awareness in the Presence of Mobility," in Proceedings of the 2nd International Workshop on Foundations of Coordination Languages and Software Architectures (FOCLASA03), September 2003.
• Handorean, R., Payton, J., Julien C., and Roman, G.-C., "Coordination Middleware Supporting Rapid Deployment of Ad Hoc Mobile Systems", in Proceedings of the First International ICDCS Workshop on Mobile Computing Middleware (MCM03), May 2003.
• Roman, G.-C., Julien, C., and Murphy, A. L., "A Declarative Approach to Agent-Centered Context-Aware Computing in Ad Hoc Wireless Environments (extended version)," Software Engineering for Large-Scale Multi-Agent Systems, A. Garcia et. al. (editors), LNCS 2603, April 2003.
• Julien, C., and Roman, G.-C., "Egocentric Context-Aware Programming in Ad Hoc Mobile Environments," in Proceedings of FSE-10, November 2002, pp. 21-30.
• Roman, G.-C., Julien, C., and Huang, Q., "Network Abstractions for Context Aware Mobile Computing," in Proceedings of the 24th International Conference on Software Engineering (ICSE'02), Orlando, FL (USA), May 2002, pp. 363-373.
• Roman, G.-C., Julien, C., and Murphy, A. L., "A Declarative Approach to Agent-Centered Context-Aware Computing in Ad Hoc Wireless Environments," in the 1st International Workshop on Software Engineering for Large-Scale Multi-Agent Systems (SELMAS'2002), May 2002.
• Roman, G.-C., Julien, C., and Huang, Q., "Formal Specification and Design of Mobile Systems," in Proceedings of FMPPTA'2002, April 2002.