0% found this document useful (0 votes)
18 views

Lecture slides for Topic 2 and 3

Uploaded by

root23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Lecture slides for Topic 2 and 3

Uploaded by

root23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Pervasive & Ubiquitous Computing

(CoSc 6304)
2. Infrastructures and middleware
of pervasive computing
Wireless Technologies - Overview
Wireless technologies represent a rapidly emerging area
providing pervasive/ubiquitous access to the network.

Internet-enabled cell phones and Personal Digital Assistants


(PDAs) have emerged as the newest products that can connect
to the Internet across a wireless network.
Among such technologies are:
 Infrared
 RFID
 Bluetooth
 WLAN - IEEE 802.11/WiFi
Wireless Technologies - Overview
RFID
 Radio Frequency IDentification (Bar code replacement)
 Exists in the form of Passive and Active tags

Bluetooth
 Low-cost, short-range wireless links between mobile PCs,
mobile phones, and other portable handheld devices (to
avoid annoying wires)
 Connection between cell phone and headset
 Point to point (serial wire replacement)
 Point to multipoint (ad-hoc networking)
Wireless Technologies - Overview
WLAN (WiFi)
 Wireless Local Area Networks (WLAN) are implemented as an
extension to wired LANs
 They are based on the IEEE 802.11 standard
 New protocols such as Wireless Application Protocol (WAP)
are introduced
 New languages such as WML (Wireless Markup Language) have
been developed
 Requires Access Point
 An access point/base station connects to a LAN by means of
Ethernet cable
 Usually installed in the ceiling
Wireless Technologies - Overview
WLAN (WiFi) – cont.
 Access points receive, buffer, and transmit data between
the WLAN and the wired network infrastructure.
 A single access point supports on average of twenty users
at a time
 Has a coverage varying from 20 meters in areas with
obstacles (walls, stairways, elevators) and up to 100 meters
in areas with clear line of sight.
 A building may require several access points to provide
complete coverage and allow users to roam seamlessly
between access points.
 Wireless Client Adapter - A wireless adapter connects
users via an access point to the rest of the LAN.
Wireless Technologies - Overview
WLAN (WiFi) – Standards
 WiFi standard exists as IEEE 802.11a/b/g/n
 The number "11" indicates the IEEE working group assigned to 802 standards, and
the a/b/g/n refers to a special task group within this body, known as TGa, TGb,
TGg and TGn.
 The 802.11n is a newer standard of WiFi LAN. It operates on the 2.4 gigahertz
(GHz) band, like 802.11b and 802.11g. This frequency does not require line-of-
sight availability like 802.11a, which works in the regulated 5 GHz band.
 802.11n uses MIMO (multiple-input multiple-output) technology and incorporate
OFDM (orthogonal frequency-division multiplexing) that splits signal frequencies
up into several modulated channels for increased throughput.

Standard Frequency Speed


802.11b 2.4 GHz 5-11 mbps
802.11g 2.4 GHz 25-54 mbps
802.11a 5.0 GHz 25-54 mbps
802.11n 2.4 GHz 100-200+ mbps
Pervasive Infrastructure
As computing devices become more pervasive, the nature of
interactions between users and computers must evolve.

Applications need to
 Become autonomous
 Place greater reliance on knowledge of context reducing
interactions with users.
 Cope with highly dynamic environments in which resources,
such as network connectivity and software services,
frequently vary over time.
Pervasive Infrastructure Requirements
Components that place requirements on both the supporting
infrastructure and the manner in which software components
and user interfaces are constructed include

Devices
Software components
Users
User interfaces
Pervasive Infrastructure Requirements
Device related requirements that must be addressed
by pervasive computing infrastructure include:
Heterogeneity and Mobility
Heterogeneity
 Devices in a pervasive computing environment include sensors
and actuators; embedded devices in objects such as watches
and vehicles; home and office appliances such as videos and
telephones; mobile devices such as PDAs, cell phones and
notebooks; desktop machines, etc.
 Heterogeneous devices will be required to interact seamlessly,
despite wide differences in hardware and software capabilities.
 Requires an infrastructure that maintains knowledge of device
characteristics and manages the integration of devices into a
coherent system that enables arbitrary device interactions.
Pervasive Infrastructure Requirements
Device related requirements …

Mobility
 Mobility introduces problems such as the maintenance of
connections as devices move between areas of differing
network connectivity, and the handling of network
disconnections.
 While protocols for wireless networking handle some of
the problems of mobility, such as routing and handovers,
some problems cannot be solved at the network level, as
they require knowledge of application semantics.
 It should be the role of the computing infrastructure to
cooperate with applications in order to perform tasks
related to device mobility.
Pervasive Infrastructure Requirements

Software related requirements that must be addressed by


pervasive computing infrastructure include

Context awareness
Adaptation
Mobility and distribution
Interoperability
Development and deployment
Component discovery services
Scalability
Pervasive Infrastructure Requirements
Software related requirements …
Context awareness
 Invisibility of applications will be accomplished in part by reducing
input from users and replacing it with knowledge of context.
 Context-aware software components will exploit information such as
the activities in which the user is engaged, proximity to other devices
and services, location, time of day and weather conditions, etc.
 Knowledge of context will also be required to enable adaptation to
changing environmental conditions, such as changing bandwidth and
devices, which can be brought about by mobility.
 The infrastructure for pervasive computing should support context
awareness by facilitating the gathering of information from sources
such as sensors and resource monitors; performing interpretation and
dissemination of contextual information in a scalable and timely
fashion; and providing models for programming context-aware
applications.
Pervasive Infrastructure Requirements
Software related requirements …

Adaptation
 Adaptation is required in order to overcome the dynamic
nature of pervasive computing. Mobility of users, devices
and software components can occur, leading to changes in
the physical and virtual environments of these entities.
 It should be the role of the infrastructure for pervasive
computing to facilitate adaptation, which may involve
adapting individual software components and/or
reconfiguring bindings of components by adding,
removing or substituting components.
Pervasive Infrastructure Requirements
Software related requirements …

Mobility and distribution


As users can be mobile and able to exploit the
capabilities of several devices simultaneously,
mechanisms will be required to enable the
mobility and distribution of software.
These mechanisms should be largely transparent
to component developers, who should not be
concerned with program and data migration or
synchronization and coordination of distributed
components.
Pervasive Infrastructure Requirements
Software related requirements …

Interoperability
 The infrastructure for pervasive computing must support
diverse types of software component.
 The infrastructure is required to integrate software
components to successfully interact and cooperate to achieve
common tasks.
 Applications are formed dynamically from available software
components. This will require dynamic interoperability at the
component level.
 Components will need to be capable of dynamically acquiring
knowledge of each other’s interfaces and behaviour, in order
to learn how to interact with previously unknown
components.
Pervasive Infrastructure Requirements
Software related requirements …

Development and deployment


The number and diversity of software components
that will be required in pervasive computing
environments will necessitate methods for their
rapid development and deployment.
Infrastructural support for rapid application
deployment can be achieved through the provision
of execution environments into which applications
can be placed without regard for configuration or
adaptation.
Pervasive Infrastructure Requirements
Software related requirements …

Component discovery services


 The issue of discovery of software components has been
addressed in various research areas. In open distributed
computing, resource discovery is supported by a type
management repository, which maintains descriptions of
service interface types. Resource discovery is also addressed
by network directory protocols such as LDAP, and in other
technologies such as Jini and Bluetooth.
 The main challenge in pervasive computing environments,
which are characterized by their heterogeneity, will be to
integrate the different approaches into a single scalable
resource discovery system by mapping requests between
resource discovery domains.
Pervasive Infrastructure Requirements
Software related requirements …

Scalability
One of the features of pervasive computing is the
increasing ubiquity of devices and software. Thus,
the infrastructure, the interactions between
components, and the software services provided in
the pervasive computing environment must all be
scalable.
A powerful software platform on which scalable,
fault-tolerant and distributed components can be
built is essential.
Pervasive Infrastructure Requirements

User related requirements that must be addressed by


pervasive computing infrastructure include

Maintaining knowledge of users context


Managing tasks related to user mobility
Pervasive Infrastructure Requirements
User related requirements …

Maintaining knowledge of users context


 The infrastructure should maintain context data related to
users, including their preferences, current activities and
active computing sessions.
 The uses of user-related context include allowing
applications to provide adaptation to user requirements and
enabling the amount of input that applications require from
users to be reduced.
 For example: With knowledge that a user is engaged in
driving a car, an application can ensure interaction is
carried out through a speech-based interface, rather than a
screen based one, in order to enable the user to focus on the
road.
Pervasive Infrastructure Requirements
User related requirements …

Managing tasks related to user mobility


User mobility between devices should be
supported by enabling automated migration (or
reinstantiation in a new location) of application
components.
The tasks of identifying the need for application
migration and then carrying out the migration
should be performed by the computing
infrastructure in a manner that makes the
migration as transparent as possible.
Pervasive Infrastructure Requirements

User interface related requirements that must be addressed by


pervasive computing infrastructure include

Universal Interface
 Users in pervasive computing environments will demand
ubiquitous access to their computing applications, which will
create a requirement for universally available user interfaces.
Adaptation
 Device heterogeneity introduces a further requirement for user
interfaces that are highly adaptable.
Usability
 User interfaces for pervasive computing must be carefully
designed with several factors like ergonomics and novelty in
mind.
RFIDs, Sensors and Sensor Network

RFID – Radio Frequency Identification

RFIDs exist in two forms


RFID Readers/Sensors
RFID tags
RFIDs, Sensors and Sensor Network
Early History: Active Badge by Olivetti early 90’s
RFIDs, Sensors and Sensor Network
Early History: Active Badge by Olivetti early 90’s …
RFIDs, Sensors and Sensor Network

RFID reader/sensor devices exist as:

1. Wired Sensors with no serious power


constraints
 Has physical Sensors/Readers
 Has microprocessor for local data processing
and a network connection
 Has gateways and controllers
RFIDs, Sensors and Sensor Network

RFID reader/sensor devices …


2. PDA-like battery-driven mobile devices (embedded)
 Functionally, similar to the wired sensors
 Use wireless connections to the backbone network
 Used for RFID-based inventory control, personal smart
sensor systems for example medical control.
3. Battery-driven low-power, low-performance smart
sensors
 Needs a gateway to connect to a computer network
RFIDs, Sensors and Sensor Network

RFID Tags exist in the form of

Active tags
Have own energy source
Passive Tags
Have no own energy source
Powered by electromagnetic field generated
by reader
RFIDs, Sensors and Sensor Network
Common Applications
Military applications
Command, control, communications, computing
Intelligence, surveillance
Targeting system

Health care
Monitoring/Tracking patients
Assist disabled persons

Commercial applications
Managing inventory
Monitoring product quality
Monitoring disaster area
RFIDs, Sensors and Sensor Network
Common Applications…
Agriculture and environment
Air/Water/Noise/Light monitoring
Soil/weather/plant monitoring
Food/animal monitoring

Industrial
Process control
Equipment monitoring
Asset tracking
Personnel safety

Batch identification
Automatic clocking in marathon and other races
Automatic luggage sorting
Automatic inventory
RFIDs, Sensors and Sensor Network

How does it work?


Example from own work: Modeling indoor positioning using
(WiFi) RF signal strength
(a work presented and published at IEEE-ICPS'06)

Methods exist to detect positions in an (x, y) coordinate but


neighbourhood relation between users is expressed not by the
physical proximity but by the perception of the presence in the
same bounded space/room.

Inline with this requirement, in addition to physical


proximity, our proposed neighbourhood localisation brings
some semantic information concerning the space containing
the entities.
RFIDs, Sensors and Sensor Network

Modeling indoor positioning using RF signal strength …

Among localization and distance measuring methods are


 Global Positioning Systems (GPS)
 Radio Frequency (RF) delay measurement
 Association to nearest Access Point (AAP)
 Received RF signal strength

Systems like GPS are good for outdoor positioning services.


Most of the other techniques are based on triangulation
methods and they assume prior knowledge of position of
the access point infrastructure.
RFIDs, Sensors and Sensor Network
Modeling indoor positioning using RF signal strength …

Learning phase: data is collected, classified, and


interpreted to create the prediction model
Prediction phase: uses the model for location prediction
based on the real-time data values
Learning phase Prediction phase
(Offline) (Real time)
Signal Signal
Tracking Distributed on Tracking
Capable Peers

Data
Calibration and Calibration and Data Calibration
Treatment Treatment Rules Context –Aware
Service
(Interpretation
Data Mining Prediction Rules and Action)
Prediction Context
(Decision Tree) (PMML Format)
room name
Architecture of our learning and prediction model
RFIDs, Sensors and Sensor Network
Learning Phase …

A person holding a PDA moves around the rooms in the


building including meeting halls, offices, common rooms,
printing rooms and corridors
201 203 205 207 209 215 217 221 223 225 227
Salle Serveurs D. Magnin M. Martinez
WC
Atelier
Détente AEDI TP 5IF1 TP PC4 Réseau G.Neubert I. El Kalkali
Elèves
TP PC5
211 213 219 Y.Ouzrout P.A. Millet

Ascenseur
B501225A PRISMA

PRISMA PRISMA
L.Frécon PRISMA
M.MATAR Salle réunion
TP PC3 TP PC2 TP 5IF2 TP PC1 TP PC0 Salle TD secretariat étudiants
202 204 208 J.FAVREL
210 212
214 216 218 220 222 224
206

N
305 307 309 311 313 315 317 319 321 323
301 325
Benel

Passerelle Masson Besson Berhe Salle TD Salle TD Salle TP - FC Salle TD Amphi FC


Réseau WC
Salle de Réunion Direction Sécrétariat Laforest Servigne Verdier Saoula Samir Piersno Meger Leschi Robardet Seitz 329 331 333 335 337

Tchounikine Miquel Cardenas Arias Ahmed- Leleu Rigotti Prensa Tribollet


Ascenseur

Servin Ouamer
Suela Bohé Hunor Dejene

30

Taher Ahmed Andrianarisoa Secrétariat


Chatti Egyed Coulondre Calabretto Alvarez Boumediene Ou-halima Varet
Arara Keita Flory Badr EDIIS
Salle Balhoul Boulicaut
Manzi Accary Amghar Rifaieh Coquil Brunie Secrétariat Abbas Demars Direction Secrétariat Coquard
Jossan Pozzoli détente Réseau Taqafi Kouloumdjian Salle TD Salle TD
Berkane Oularbi Pivano Pech EDIIS formation Formation
Ouziri Ridh Hadj 340 342
Chaari Jouve continue continue
M’tir Lebel
302 314 324
304 306 308 316 318 320 322 326 328 330 332 334 336 338

Topology of the two floors used in our experiments Passerelle


RFIDs, Sensors and Sensor Network
Learning Phase …
A WiFi-Spotter and management program tracks,
processes and stores received signal strength from all n
visible access points at each tracking location.
Tracking signals coming
from different access
points
RFIDs, Sensors and Sensor Network
Learning Phase …

For each tracking point i in room k, we have a vector with


the signal strength values and a label corresponding to the
literal name of the place (room) where the point is situated.

ap 1
k ,i
2 n
, ap ,..., ap , roomk ,i
k ,i k ,i  i 1, 2,....
Room 00:06:5A:40:0D:C6 00:06:5A:40:0D:D7 00:06:5A:10:0D:C6 00:06:5A:10:0D:D7
501.317 -60 -60 -60 -57
501.317 -60 -60 -60 -57
501.317 -68 -63 -59 -65
501.319 -60 -62 -64 -100
501.319 -57 -57 -60 -100
501.319 -57 -66 -57 -100

Sample attribute-value table showing tracked values.


RFIDs, Sensors and Sensor Network
Learning Phase …

Signal strength values are classified for pattern identification


using data mining tool (decision tree algorithm
implemented).

The result from this process become working model


that can later be used for real-time location
detection.

The model is represented in the predictive model


mark-up language – PMML - format.
RFIDs, Sensors and Sensor Network
Prediction Phase…
The two important input parameters for prediction are:
 Decision rules obtained from the prediction model created during the
learning phase
 Real-time signal strength values collected at a specific location

If Value is in this region If Value is in this region


Predict Room-501_317 Predict Room-501_319
with 56% Accuracy with 90% Accuracy

Simple
prediction model
using two APs
and three rooms.

If Value is in this region If Value is in this region


Predict Room-501_315 Predict Room-501_317
with 88% Accuracy with 80% Accuracy
RFIDs, Sensors and Sensor Network
Prediction Model

IF 00_06_5A_E0_0D_FA < -74,00 and 00_06_5A_80_0D_C9 >=-


87,00 THEN LOCATION in [501.342] with accuracy 1,0000

IF 00_06_5A_E0_0D_FA < -74,00 and 00_06_5A_80_0D_C9 < -


87,00 and 00_06_5A_60_0D_C6 < -68,50 and 00_06_5A_20_0D_DB
< -77,50 and 00_06_5A_80_0C_BD >=-73,50 and
00_06_5A_C0_0D_D7 >=-92,50 and 00_06_5A_E0_0D_D7 < -85,00
THEN LOCATION in [501.329] with accuracy 0,9877

IF 00_06_5A_E0_0D_FA < -74,00 and 00_06_5A_80_0D_C9 < -


87,00 and 00_06_5A_60_0D_C6 < -68,50 and 00_06_5A_20_0D_DB
< -77,50 and 00_06_5A_80_0C_BD >=-73,50 and
00_06_5A_C0_0D_D7 >=-92,50 and 00_06_5A_E0_0D_D7 >=-85,00
THEN LOCATION in [501.210] with accuracy 1,0000
Sample rules generated as a
prediction model
RFIDs, Sensors and Sensor Network
Prediction Model…

Using the Principal Component Analysis (PCA) algorithm,


projection of multidimensional data from all visible APIs into 2
dimensions space: Clear color grouping shows that the data is
well separable.
RFIDs, Sensors and Sensor Network
Sensor Network

Smart, networked sensors will soon be all


around us
Homes, offices, factories, automobiles,
shopping centers, supermarkets, farms, forests,
rivers, and lakes
Collectively processing vast amounts of
previously unrecorded data to help run factories,
optimize farming, monitor the weather, and even
watch for earthquakes
RFIDs, Sensors and Sensor Network
Network of sensors …

New developments are bringing wireless


sensors that talk with each other, forming
intelligent networks spread over wide areas.
Wireless sensor networks are one of the first
real-world examples of "pervasive"
computing—small, smart, cheap sensing and
computing devices that will flood the
environment.
RFIDs, Sensors and Sensor Network
Network of sensors …

©2005
EATON
Corporation

Leads towards the realization of the vision of


“Internet of things”!
Peer-to-peer computing
Why Peer-to-Peer?

How can we connect a set of devices in such a way that they


can share information, resources, and services?

This requires answering several implied questions:


 How does one device learn of another device’s presence?
 How do devices organize to address common interests?
 How does a device make its capabilities known to
others?
 What information is required to uniquely identify a
device?
 How do devices exchange data?
Peer-to-peer computing
Client/Server architecture:

In the traditional Client/Server architecture,


clients connect to a server using a specific
communications protocol, such as FTP and
HTTP, to obtain access to a specific service.

The processing involved in delivering a


service usually occurs on the server side,
leaving the client relatively unburdened.
Peer-to-peer computing
Client/Server …
Client Responsibilities:
-Sending commands to request a
service
-Receiving responses to a request
for a service

Server Responsibilities:
- Receiving commands requesting
a service
-Processing service requests and
executing the requested service
-Sending response with results of
the requested service
Peer-to-peer computing
Client/Server - drawbacks

In addition to the single point-of-failure problem


in the client/server architecture, scalability is
another important concern.

Scalability: As the number of clients increases,


the load and bandwidth demands on the server
also increase, eventually preventing the server
from handling additional clients.
Peer-to-peer computing
Why clients can not be used as servers?
Clients in the client/server architecture have a passive role, capable of
demanding services from servers but incapable of providing services.

Finite supply of IP addresses


 Service providers dynamically allocate IP addresses to machines
each time they connect to the network
 The dynamic nature of these machines’ IP addresses effectively
prevent users from running useful servers

Isolation of machines by firewalls


 Clients machines can’t run servers because they are part of a private
network usually isolated from the Internet by a firewall
 Computers outside the private network can’t connect to a computer
within the private network to obtain services.
Peer-to-peer computing
Peer-to-peer (P2P) architecture:

Peer-to-peer (P2P) is a communication model in which each


party has the same status/right and either party can initiate
a communication session.

Peer-to-peer computing uses diverse connectivity between


participants in a network typically used for connecting
nodes via largely ad-hoc connections.

P2P networks are useful for many purposes:


 Sharing content files containing audio, video, data or anything in
digital format
 Sharing real-time data, such as telephone traffic, road traffic,
weather condition, etc
Peer-to-peer computing
Peer to peer …
Peer responsibilities, as a Client:
- Sending commands to other
peers to request a service
- Receiving responses to a request
for a service

Peer responsibilities, as a server:


- Receiving commands from other
peers requesting a service
- Processing service requests and
executing the requested service
- Sending response with results of
the requested service
- Propagating requests for service
to other peers
Peer-to-peer computing

Peer-to-peer …

P2P has three structural classifications


 Centralized (E. g. Napster)
 Structured Decentralized (E.g. Chord, Pastry)
 Unstructured Decentralized (E.g. Gnutella, Kazaa)

Reading Assignment:
 Read about: Napster, Chord, Gnutella and Kazaa
 Note their differences
Peer-to-peer computing

Peer-to-peer …
Centralized P2P
 The network has a central
index that all peers contact
(like DNS / directory service)
 Advantages: Minimize
network traffic, search whole
Query
network quickly Response

 Disadvantages: Central point


Request
of failure, scalability, not a
“true” P2P
Peer-to-peer computing

Peer-to-peer …

Structured Decentralized P2P


No central point
Nodes organize themselves
in relation to data
Advantages: true p2p,
expected search times
Disadvantages: Extra
overhead for structure
Peer-to-peer computing

Peer-to-peer …

Unstructured Decentralized P2P


No central point
No relation between topology
and data
Advantages: true p2p, low cost
to create
Disadvantages: lack of overall
data knowledge, efficiency
Peer-to-peer computing
Peers in peer-to-peer networks

Simple peers: Limited to allowing the user to provide


services from his device and consuming services
provided by other peers on the network
Rendezvous peers: Provide peers with a network
location to discover other peers and peer resources.
Peers issue discovery queries to a rendezvous peer, and
the rendezvous provides information on the peers it is
aware of on the network
Router peers: Provide a mechanism for peers to
communicate with other peers separated from the
network by firewall or NAT equipment
Peer-to-peer computing
Alem’s hand held device (PDA-
Alem)
Now, has got a has
PDA_Alem context message
the necessary
that says Alem’s professor is now in
C
Pla oCA
information about the concept tfo
rm

d
«salle d’attente»

lle
«salle d’attente» .toInperform
order to

ta
Context Data Transfer

Ins
Discovery? perform and
reasoning reasoning and suggest
to suggest actions to
PDA-Alem some action to Alem,
its owner Alem PDA-Alem Response+ Peer21
needs some semantics on the
concept “salle d’attente”.
C Pl Co
Pla oCA at CA
tfo
rm fo
rm
d
lle
ta

C tfo
le

Pl
Ins

oC rm
a
al

A
st
Discovery?
Discovery? d

In
le
al
Discovery? Discovery? In
st

Discovery?
Rendezvous Rendezvous Peer22
(Router)
CoCA Peers (Router)
Peer1 Peer2
C
(Example from own work) C
Pla oCA
Pla oCA
tfo
rm

d
 Self-organize into peer

lle
tfo

ta
rm
d

Ins
lle

groups
ta
Ins

 Discover each other Peer23


Peer12
 Discover each other’s
services and resources Peer Group2
Peer Group1
 Uses JXTA P2P protocol
Peer-to-peer computing
Towards a standard solution - JXTA
The explosion in the number of peer-to-peer (P2P) solutions has
underlined the importance of this technology to the continued
growth and development of the Internet.
The proprietary and specialized nature of current solutions indicate
the need for a standard set of protocols to address its particular
requirements.
The JXTA platform provides developers with a flexible and
standardized set of protocols and reference libraries.
Using JXTA, developers can focus on implementing their
collaborative applications rather than on the specifics of P2P
technology. They can create new applications that will communicate
with any number of distributed peers, providing distributed search,
file sharing, and collaboration services without relying on the
traditional client/server hierarchy.
Peer-to-peer computing
JXTA protocols
Project JXTA (juxtapose), from Sun Microsystems is a set
of protocol specifications
1. Peer Discovery Protocol- Enables peers to discover peer services
on the network
2. Peer Resolver Protocol- Allows peers to send and process generic
requests
3. Rendezvous Protocol- Handles the details of propagating
messages between peers
4. Peer Information Protocol- Provides peers with a way to obtain
status information from other peers on the network
5. Pipe Binding Protocol- Provides a mechanism to bind a virtual
communication channel to a peer endpoint
6. Peer Endpoint Routing Protocol- Provides a set of messages used
to enable message routing from a source peer to a destination peer
Peer-to-peer computing

JXTA
Protocol
Stack
3. Context-Aware Computing
Context-Aware Computing
Context-awareness in a pervasive environment?

“A Traditional Office”
“A Pervasive Office”
Person engaged in a
Crowded with varieties
regular duty
of ubiquitous devices
(Person Busy)
surrounding the person
(Person Super Busy)

“Problem”
Devices that are meant to improve “Solution”
user’s working and living condition my Context-aware services that make
users less aware of the gadgets but
interfere with regular duties to the
benefits from their existence
extent that they become destructive (Person Productive, happy …)
(Person Frustrated)
Context-Aware Computing
What is context-awareness?

The ability of computer systems to:


 Acquire contextual knowledge
 Process and reason about the context
 Perform dynamic adaptation to the
changing context
 Act in a proactive manner
Context-Aware Computing
Context-awareness in pervasive computing

Pervasiveness makes it more complex due to:


 Frequent change of context
 Heterogeneity of devices
 High mobility and dynamism
 Anytime-anywhere paradigm
 Lack of centralized service/control
Context-Aware Computing
Context-awareness in PvC: Requirements
Context Capturing: Gather context information
Context Modelling: Organize context into the
appropriate format
Aggregation/Interpretation: Combine context
information to generate a higher meaningful context
Reasoning: Draw new knowledge and perform
decisions
Actions: Take proactive/reactive actions
Collaboration: Make the context information
accessible to the neighborhood
Context-Aware Computing
Context! … What is it?

“Any information that can be used to characterize the


situation of an entity. An entity is a user, a place, or a
physical or computational object that is considered relevant
to the interaction between a user and an application,
including the user and application themselves.” Dey

“A dynamic and operational term whose definition depends


not only on the inherent characteristics of the entity but also
on the interpretation of the operations involved on an entity
at a particular time.” Winogard
Context-Aware Computing
Context Modeling
Context Modeling
 To define and store context data in a machine processable form
Context Modeling Approaches
 Key-Value Models  Object Oriented Models
 Most simple category of  Encapsulation and reusability
models  Logic Based Models
 Not very efficient for more  Context is defined as facts,
sophisticated structuring expressions and rules
purposes
 High degree of formality
 Markup Scheme Models
 Ontology Based Models
 Markup schemes implement
 Ontology used as explicit
the model
specification of a shared
 Graphical Models conceptualization
 Useful for structuring, usually  Context is modeled as concept and
not used on instance level facts
Context-Aware Computing
Generic
Context Entity
Layer Entity
(& literals)
Symmetric
is
isA isA isA Hierarchical
locatedWith
Activity Person Device relation
engagedIn locatedWith
(by symmetric axiom)

Domain Relation
hasOwner
Layer isA isA isA
(entity &
isA
attribute type
Lecture Student Professor Phone
attends relationships)
InverseOf
InstanceOf InstanceOf InstanceOf InstanceOf
owns Axiomatic
Geography Bob Alice SPhone095 relation
attends hasProfessor hasOwner
(by inverse axiom)
hasMemory
hasAccuracy
The EHRAM model Metadata
85% (own work) 1024 relation
Context-Aware Computing
Context Modeling: RDF/OWL
Me type Person
RDF Graph
Me PersonalTitle Dr
Me mailBox [email protected]
Http:/www.w3.org/people/
EM/contact#Person Dr Me fullName EricMiller

Http:/www.w3.org/1999/02/ Http:/www.w3.org/2000/10/sw
22-RDF-syntax-ns#type ap/pim/contact#personalTitle

Http:/www.w3.org/peo
ple/EM/contact#me
Http:/www.w3.org/2000/10/ Http:/www.w3.org/2000/10/sw
swap/pim/contact#mailBox ap/pim/contact#fullName

Mailto:[email protected] Eric Miller


Context-Aware Computing
Context Modeling: RDF/OWL
Context data using rdf triples
<ns:Hana ns:locatedIn ns:Library/>
Reification (using blank node XX )
<ns:XX rdf:type resource=rdf:Statement/>
<ns:XX rdf:subject resource= ns:Hana/>
<ns:XX rdf:predicate resource=ns:locatedIn/>
<ns:XX rdf:object resource= ns:Library/>
Context metadata
<ns:XX ns:reportedBy “Sensor#5”/>
<ns:XX ns:hasTimeStamp “T200805102000”/>
<ns:XX ns:hasAccuracy “95%”/>
Context-Aware Computing
Context Reasoning: Three categories of input
Ontology of concepts (E.g. The concept owns is an inverse of the concept
ownedBy)
nsp:Hana rdf:type nsp:Student //defined context (isa/instanceOf)
nsp:Phone-01 rdf:type nsp:Phone //defined context (isa/instanceOf)
<rdf:Description rdf:about= “#owns”>
<owl:inverseOf rdf: resource = “#ownedBy”>
</rdf:Description>
Context data ( E.g. Phone-01 is locatedIn the Library)
nsp:Hana nsp:owns nsp:Phone-01 //defined context
nsp:Phone-01 nsp:locatedIn nsp:Library //sensed context
Rules (E.g. Assuming: A person always keeps his phone with him)
[locationRule:(?sphone nsp:locatedIn ?location)
(?sphone nsp:ownedBy ?person) -> (?person nsp:locatedIn ?location)]
Question: Where is Hana now?
Context-Aware Computing
Context Reasoning …
In semantic ontology, for example, the ability to express equivalences using
owl:sameAs can be used to state the following.
<rdf:Description rdf:about= “#ClassRoom”>
<owl:sameAs rdf: resource = “#LectureRoom”>
</rdf:Description>
Ontology enhanced by defining rules:
(?user1 nsp:locatedIn ?loc) (?user2 nsp:locatedIn ?loc)
(?user1 nsp:locatedWith ?user2)]
We can also define locatedWith as a symmetric property and we can associate
meanings to the data by using definitions on domain and range :
<owl:SymmetricProperty rdf:ID= locatedWith">
<rdfs:domain rdf:resource="#Person"/>
<rdfs:range rdf:resource="#Person"/>
</owl:SymmetricProperty>
Context-Aware Computing
Context Reasoning: Putting them together – “ForumOntology.owl ”

1. <?xml version="1.0"?>
2. <rdf:RDF
3. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4. xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
5. xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
6. xmlns:owl="http://www.w3.org/2002/07/owl#"
7. xmlns:assert="http://www.owl-ontologies.com/assert.owl#"
8. xml:base="http://www.cocasp.fr/forumf.owl">
9. <owl:Ontology rdf:about=" ">
10. <owl:imports rdf:resource="file:ForumFinder_Nodata.owl"/> //Ontology
11. </owl:Ontology>
12. <owl:Ontology rdf:about="">
13. <owl:imports rdf:resource="file:ForumContext1.owl"/> //Static (defined) context
14. </owl:Ontology>
15. <owl:Ontology rdf:about="">
16. <owl:imports rdf:resource="file:ForumContext2.owl"/> //Dynamic (sensed) context
17. </owl:Ontology>
18. </rdf:RDF>
Context-Aware Computing
Context Reasoning: Putting them together using - JENA
1. import com.hp.hpl.jena.rdf.model.* ;
2. import com.hp.hpl.jena.ontology.*;
3. import com.hp.hpl.jena.reasoner.rulesys.* ;
4. import com.hp.hpl.jena.util.*;
5. public class ……..
6. public InfModel getCompleteModel(){
7. GenericRuleReasoner reasoner = new
GenericRuleReasoner((List)Rule.rulesFromURL("file:ForumRules.rules"));
8. OntModel omodel =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_
9. MICRO_RULE_INF,
ModelLoader.loadModel("file:ForumOntology.owl"));
10. InfModel cocaModel=ModelFactory.createInfModel(reasoner,omodel);
11. return cocaModel;
12. }
13. ……
Context-Aware Computing
Context Reasoning: The SPARQL query

Example of SPARQL query on rdf triples:


Query
SELECT ?phone
WHERE{
coca:Hana coca:owns ?phone.
?phone coca:setRingTone coca:Silent.
}
Context-Aware Computing
Context Reasoning: Querying the model – using SPARQL
1. public static void main(String[] args) {
2. //Model Setup
3. GenericRuleReasoner reasoner = new GenericRuleReasoner((List)Rule.rulesFromURL("file:ForumRules.rules"));
4. OntModel tempModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF,
ModelLoader.loadModel("file:ForumOntology.owl"));
5. InfModel cocaModel=ModelFactory.createInfModel(reasoner, tempModel);
6. //Query setup
7. String queryString = "PREFIX coca: <http://www.owl-ontologies.com/unnamed.owl#> "+
8. "SELECT ?phone WHERE {?phone coca:setRingTone coca:Silent.}";
9. Query cocaQry = QueryFactory.create(queryString) ;
10. QueryExecution qexec=QueryExecutionFactory.create(cocaQry, cocaModel) ;
//Query result
11. ResultSet cocaResults = qexec.execSelect() ;
12. for ( ; cocaResults.hasNext() ; )
13. {
14. QuerySolution res = cocaResults.nextSolution() ;
15. RDFNode phn = res.get(“?phone") ;
16. String phone=trimResult(phn.toString());
17. System.out.println("Setting ringing tone of "+ phone + “ to silent”);
18. triggerAction(phone, “RingingTone”, “silent”);
19. }
20. qexec.close();
21. }
Context-Aware Computing
Context Reasoning: Querying the model ….

String queryString = "PREFIX rdfsyntax: »+


" <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+
"PREFIX xmlschema: <http://www.w3.org/2001/XMLSchema#> "+
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+
"PREFIX owl: <http://www.w3.org/2002/07/owl#> "+
Query query = QueryFactory.create(queryString) ;
"PREFIX coca: <http://www.cocasp.fr/forumf.owl#> "+
QueryExecution qexec = QueryExecutionFactory.create(query, CoCAsystem.model) ;
ResultSet results = qexec.execSelect() ;
"SELECT DISTINCT ?Instance "+
int k=0;
"WHERE "+ String[] qryResult=new String[1000];
"{ "+ for ( ; results.hasNext() ; )
"?GenericClass rdfs:subClassOf
{ coca:Context."+
"?DomainSubClass rdfs:subClassOf
QuerySolution ?GenericClass."+
res = results.nextSolution() ;
"?Instance rdf:type ?DomainSubClass."+
RDFNode inst = res.get("?Instance");
"}"; String instance=trimResult(inst.toString());
qryResult[k]=instance;
k++;
}
qexec.close() ;

You might also like