Distributed Systems

Distributed Systems

Distributed Systems Topic 9: Mobile and Ubiquitous Computing Dr. Michael R. Lyu Computer Science & Engineering Department The Chinese University of Hong Kong Chinese University, CSE Dept. Distributed Systems / 9 - 1 Outline 1. 2. 3. 4. 5. Overview

Association Interoperation Sensing and Context-Awareness Summary Chinese University, CSE Dept. Distributed Systems / 9 - 2 Background Mobile computing People traveling with their computers while retaining connected to other machines or the Internet Exploit the connectedness of devices that move around in the everyday physical world Ubiquitous Computing Also known as Pervasive Computing Means to be found everywhere Exploiting the increasing integration of computing

devices with our everyday physical world Chinese University, CSE Dept. Distributed Systems / 9 - 3 Background: Computing Evolution Chinese University, CSE Dept. Distributed Systems / 9 - 4 Ubiquitous Computing Era Chinese University, CSE Dept. Distributed Systems / 9 - 5 1 Overview The ubiquitous computing vision (Mark Weiser, 1993) Ubiquitous computing enhances computer use by making

many computers available throughout the physical environment, but making them effectively invisible to the user. The purpose of a computer is to help you do something else The best computer is a quiet, invisible servant Physically invisible hidden Mentally invisible not centers of attention The more you can do by intuition the smarter you are The computer should extend your unconscious Technology should create calm Chinese University, CSE Dept. Distributed Systems / 9 - 6 1 Overview IBMs definition of Pervasive Computing Convenient access, through a new class of appliances, to relevant information with the ability to easily take

action on it when and where you need to. Numerous, casually accessible, often invisible computing devices Frequently mobile or embedded in the environment The aim is for easier computing, more available everywhere when it's needed Chinese University, CSE Dept. Distributed Systems / 9 - 7 1.1 Introduction: Characteristics Ubiquitous/Pervasive computing characteristics Chinese University, CSE Dept. Distributed Systems / 9 - 8 1.1 Introduction: Time Are Changing

In 19th century, energy triggered the industrial revolution In 20th century, computing power triggered another economic revolution Entering 21st century, Internet is a worldwide network for everyone Decentralizing energy Decentralizing computer power Decentralizing connectivity Everywhere at anytime: Ubiquitous Computing Chinese University, CSE Dept. Distributed Systems / 9 - 9

1.1 Introduction: Major Trends in Computing size number mainframe era home phone party line One Computer/Phone for many people Ubiquitous computing PC era cell phone era One Computer/Phone for everyone Chinese University, CSE Dept.

Many Computers/Phones for everyone Distributed Systems / 9 - 10 1.1 Introduction: The Relationships Ubiquitous Computing Distributed Computing Mobile Computing Mobile networks Context-awareness Mobile information access Ad-hoc networks Adaptive applications

Smart sensors and devices Energy-aware systems Invisibility Location sensitivity Chinese University, CSE Dept. Distributed Systems / 9 - 11 1.1 Introduction: Where Do We Currently Stand? Ubiquitous devices (always at hand) Tab: accompanied or wearable centimeter sized devices e.g., smartphones, smart cards Pad: hand-held decimeter-sized

devices e.g., laptops Board: meter sized interactive display devices e.g., horizontal surface computers and vertical smart boards Chinese University, CSE Dept. Distributed Systems / 9 - 12 1.1 Introduction: Where Do We Currently Stand? Ubiquitous networks (always available) (W)LAN/MAN Ethernet, IEEE 802.11 PAN (Personal Area Network) Bluetooth, BLE, IrDA, NFC, etc.

GSM/GPRS/3G/4G/5G Ubiquitous services Currently mostly location-based Chinese University, CSE Dept. Distributed Systems / 9 - 13 1.2 Volatile System A common model for mobile and ubiquitous computing Certain changes are common rather than exceptional Relevant forms of volatility include Failures of devices and communication links Changes in the characteristics of communication such as bandwidth The creation and destruction of association between software components resident on the devices association: logical communication relationships

Chinese University, CSE Dept. Distributed Systems / 9 - 14 1.2.1 Volatility: Smart Spaces Physical spaces Form background for mobile/ubiquitous computing Smart spaces: environments within which volatile systems are presented Physical space where embedded services Wild, open space without infrastructure Such as environmental monitoring Or relatively stable computing infrastructure Such as room, building, town square, or train carriage Chinese University, CSE Dept.

Distributed Systems / 9 - 15 1.2.1 Smart Spaces Movement into and out of smart spaces Physical mobility Smart spaces act as environments for devices to visit and leave Logical mobility process or agent may move in or out of a smart space or a personal device Chinese University, CSE Dept. Distributed Systems / 9 - 16 1.2.2 Volatility: Device Model New class of computing device Limited energy Smaller and lighter device has lower battery capability

Resource constraints Limited processor speed, storage capability and network bandwidth Sensors and actuators Sensors: devices that measure physical parameters Actuators: software-controllable devices that affect the physical world Chinese University, CSE Dept. Distributed Systems / 9 - 17 1.2.2 Device Examples Motes Devices intended for autonomous operations such as environment sensing. Chinese University, CSE Dept.

Distributed Systems / 9 - 18 1.2.2 Device Examples Smart phone A mobile phone built on a mobile computing platform, with more advanced computing ability and connectivity than a feature phone Chinese University, CSE Dept. Distributed Systems / 9 - 19 1.2.3 Volatility: Volatile Connectivity Wireless connection technologies e.g. Bluetooth, WiFi, 3G, 4G, etc. Vary in their nominal bandwidth and latency, and communication costs Volatility of connectivity Variability at runtime of the state of connection or

disconnection between devices The QoS between devices Chinese University, CSE Dept. Distributed Systems / 9 - 20 1.2.4 Volatility: Spontaneous Interoperation Association Logical relationship formed when at least one of a given pair of components communicates with the other over some well-defined period of time Association is distinct from (physical) connectivity Interoperation The interactions during the association Chinese University, CSE Dept. Distributed Systems / 9 - 21

1.2.4 Examples of Pre-configured versus Spontaneous Association Pre-configured Service-driven: email client and server Spontaneous Human-driven: web browser and web servers Data-driven: P2P file-sharing applications Physically-driven: mobile and ubiquitous systems Chinese University, CSE Dept. Distributed Systems / 9 - 22

1.3 New Services with Ubiquitous Computing Services are an important counterpart to technology New services increase the value for the user Examples: Ubiquitous Systems Ubiquitous Healthcare Smart Homes Ubiquitous City Chinese University, CSE Dept. Distributed Systems / 9 - 23 1.3.1 Ubiquitous Systems Chinese University, CSE Dept. Distributed Systems / 9 - 24 1.3.2 Ubiquitous Healthcare

Chinese University, CSE Dept. Distributed Systems / 9 - 25 1.3.3 Smart Homes Chinese University, CSE Dept. Distributed Systems / 9 - 26 1.3.4 Ubiquitous City Chinese University, CSE Dept. Distributed Systems / 9 - 27 2 Association Volatile components need to interoperate A device appearing in a smart space need to bootstrap

itself in the network to enable communication Preferably without user intervention Network bootstrapping Communication takes place over a local network The device must first acquire an address on the local network or register a name Association Components on the device either associate to services in the smart space or provide services to components elsewhere in the smart space, or both Chinese University, CSE Dept. Distributed Systems / 9 - 28 2 Association Association problem How to associate appropriately within a smart space?

Solutions should address two main aspects Scale: efficiently choosing interoperating components Scope: constrain the association within the smart space Boundary principle Smart spaces need to have system boundaries that correspond accurately to meaningful spaces as they are normally defined territorially and administratively Chinese University, CSE Dept. Distributed Systems / 9 - 29 2.1 Discovery Services One attempt at solving the association problem A discovery service is a directory service in which services in a smart space are registered and looked up by their attributes Takes account of volatile system properties The directory data is dynamically determined as a

function of the clients context No infrastructure to host a directory server Services in the directory may spontaneously disappear Need to be sensitive to the energy and bandwidth Chinese University, CSE Dept. Distributed Systems / 9 - 30 2.1 Major Components in Service Discovery Protocols 1 Service and attribute naming Template-based Template-based and predefined A client searches a service by specifying a service name and attributes Many discovery protocols use a template-based approach to naming Several protocols offer a predefined set of common attributes and frequently used service

names Chinese University, CSE Dept. Distributed Systems / 9 - 31 2.1 Major Components in Service Discovery Protocols 2 Initial communication method Unicast Multicast Broadcast Unicast is the most efficient initial communication method Requiring to configure network addresses with prior knowledge User Datagram Protocol multicast Only need to set a few multicast addresses initially Broadcast

Usually limited within a single hop of wired or wireless networks Chinese University, CSE Dept. Distributed Systems / 9 - 32 2.1 Major Components in Service Discovery Protocols 3 Discovery and registration Query-based Announcement-based Clients, services, and directories have two basic options for exchanging discovery and registration information Query-based A party receives an immediate response to a query and doesnt need to process unrelated announcements Announcement-based Interested parties listen on a channel. When a service

announces its availability and information, all parties hear the information. Chinese University, CSE Dept. Distributed Systems / 9 - 33 2.1 Major Components in Service Discovery Protocols 4 Service discovery infrastructure Directory-based Nondirectory-based The directory-based model has a dedicated component: a directory Flat directory structure Tree-like hierarchical directory structure The nondirectory-based model has no dedicated component. When a query arrives, every service processes it

If the service matches the query, it replies Chinese University, CSE Dept. Distributed Systems / 9 - 34 2.1 Major Components in Service Discovery Protocols 5 Discovery scope Network topology User role Context Network topology Some protocols use LANs as the default, while others use a single-hop wireless network range User role Support administrative domains as a discovery scope Reflect an ambient environment according to a users roles

Context High-level context information such as temporal, spatial, and user activity information Chinese University, CSE Dept. Distributed Systems / 9 - 35 2.1 Major Components in Service Discovery Protocols 6 Service usage Explicitly released Lease-based In some service discovery protocols, a client must explicitly release a services resources once service usage is granted Lease-based mechanism A client and a service negotiate a service usage period, which the client can later cancel or renew Chinese University, CSE Dept.

Distributed Systems / 9 - 36 2.1 Sample Interface to a Discovery Service Methods for service de/registration Explanation lease := register(address, attributes) Register the service at the given address with the given attributes; a lease is returned refresh(lease) Refresh the lease returned at registration deregister(lease)

Remove the service record registered under the given lease Method invoked to look up a service serviceSet := query(attributeSpecification) Chinese University, CSE Dept. Return a set of registered services whose attributes match the given specification Distributed Systems / 9 - 37 2.1 Service Discovery in Practice 1. Jinis discovery protocol Client Printing service

1. finance lookup service admin Client Lookup service 4. Use printing service Corporate info service Chinese University, CSE Dept. admin 2. Here I am: .....

Network Printing service 3. Request printing finance Lookup service admin, finance Distributed Systems / 9 - 38 2.1 Service Discovery in Practice 2. Bluetooth Bluetooth is a short-range RF-based (non-IPbased) communication technology

Discoverability is based on actual physical proximity, rather than closeness in the IP routing infrastructure Separates device discovery from the discovery of services on a given device Higher level: Bluetooth Service Discovery Protocol Lower level: Link Manager Protocol and Logical Link Control and Adaptation Protocol Chinese University, CSE Dept. Distributed Systems / 9 - 39 2.2 Physical Association Shortcomings of network discovery service systems The use of subnet (a poor approximation to a smart space) Inadequacies in the way services are described The shortcomings of network discovery

systems can be solved to some extent using physical means Solutions often require human involvement (the next slide) Chinese University, CSE Dept. Distributed Systems / 9 - 40 2.2 Techniques on Physical Association Human input to scope discovery Sensing and physically constrained channels to scope discovery (e.g., GPS) Direct association Address-sensing Physical stimulus Temporal or physical correlation Chinese University, CSE Dept. Distributed Systems / 9 - 41

2.3 Service Composition Combining existing services to create new pervasive computing services A frequently emphasized feature of ubiquitous computing is the ad hoc, seamless composition of services from various devices Chinese University, CSE Dept. Distributed Systems / 9 - 42 2.3 The Goals of Service Composition in Ubiquitous Computing Context-awareness Sensitive to context changes Managing contingencies Devicesand thus servicesoften have unpredictable availability

Leveraging heterogeneous devices Ubiquitous computing systems use a variety of devices Empowering users Users might compose or recompose applications according to their preferences Chinese University, CSE Dept. Distributed Systems / 9 - 43 3. Interoperation How two or more components interoperate? Communication protocols Programming models Software interface compatibility Allow interfaces to be heterogeneous, but adapt interfaces to one another (this approach is difficult)

Constrain interfaces to be identical in syntax across as wide a class of components as possible (as much as possible) UNIX pipe, HTTP methods: GET, POST, Chinese University, CSE Dept. Distributed Systems / 9 - 44 3. Interoperation Three different support levels Application contexts Specific to an application domain Communication mechanisms Remote Procedure Call and its variations Service location network addresses Chinese University, CSE Dept.

Distributed Systems / 9 - 45 3.1 Data-Oriented Programming for Volatile Systems Data-oriented (or content-oriented) Systems that use an unvarying service interface such as UNIX pipes and the Web Enforce compatibility Through standardized data-type descriptors supplied as metadata Or by checking the data values Chinese University, CSE Dept. Distributed Systems / 9 - 46 3.1 Data-Oriented Programming for Volatile Systems

Two programming models for interoperation between indirectly associated components Event systems Publishers publish events to subscribers Tuple spaces Fixed, generic interface to add and retrieve structured data called tuples Example camera software/hotel picture frame Chinese University, CSE Dept. Distributed Systems / 9 - 47 3.2 Indirect Associations and Soft State System volatility makes it undesirable to rely on a service provided by a particular component since that component could leave or fail at any time Some of the examples of data-oriented programming systems involved indirect, anonymous association

Components that interoperate via an event system or tuple space do not necessarily know one anothers names or addresses As long as the event service or the tuple space persist, the individual components can come and go and be replaced Chinese University, CSE Dept. Distributed Systems / 9 - 48 4 Sensing and Context-Awareness Processing data collected from sensors Context-aware systems respond to sensed physical surroundings What is context? By example Location, time, temperature, the identity of an associated users, the presence and state of an object, etc. By synonym

Situation, environment, circumstance By definition The context of an entity (person, place, or thing) is an aspect of its physical circumstances of relevance to system behavior Chinese University, CSE Dept. Distributed Systems / 9 - 49 4.1 Context-Awareness A key concept in ubiquitous computing: deal with linking changes in the environment (physical world) with computing systems Acquisition of context Abstraction and understanding of context Application behavior based on the recognized context Build intelligence about physical world in computing systems Context

acquisition Context understanding Context-aware behavior Computing systems Environment Chinese University, CSE Dept. Users Distributed Systems / 9 - 50 4.2 Sensing Architectures Four functional challenges to be overcome in designing context-aware systems

Integration of idiosyncratic (peculiar) sensors Specialized knowledge to correctly deploy sensors in the physical scenario of interest Abstracting from sensor data Agreement on the meaning of contextual attributes, and software to infer those attributes from raw sensor values Sensor output may need to be combined Require output from sensors of different types in order to gather several contextual attributes that it needs to operate Context is dynamic Response to changes in context, and not simply to read a snapshot Chinese University, CSE Dept. Distributed Systems / 9 - 51 4.2 A General Context-Aware Application:

The Context Toolkit The IdentityPresence Widget Class Attributes (accessible by polling) Explanation Location Location the widget is monitoring Identity ID of the last user sensed Timestamp Time of the last arrival Callbacks PersonArrives(location, identity, timestamp)

PersonLeaves(location, identity, timestamp) Chinese University, CSE Dept. Triggered when a user arrives Triggered when a user leaves Distributed Systems / 9 - 52 4.2 A General Context-Aware Application: The Context Toolkit A PersonFinder widget constructed using IdentityPresence widgets PersonFinder Room A IdentityPresence Floor pressure (generators) Chinese University, CSE Dept.

Widgets Room B IdentityPresence Footstep recognition (interpreter) Video (generator) Face recognition (interpreter) Distributed Systems / 9 - 53 4.2 Wireless Sensor Networks Large number of small, low-cost devices or nodes Each with facilities for sensing, computing and wireless communications Two main design requirements

Energy conservation Continuous operation despite volatility Three main architectural features In-network processing Disruption-tolerant networking Data-oriented programming models (e.g., directed diffusion) Chinese University, CSE Dept. Distributed Systems / 9 - 54 4.2 Directed Diffusion Diffusion: propagate interests from a sink through the network Programmer specifies interests of events Source node: a node that matches an interest sink sink

sink source source A. Interest propagation Chinese University, CSE Dept. source source B. Gradients set up source source C. Data delivery Distributed Systems / 9 - 55 4.3 Location-Sensing Location is an obvious parameter for mobile, context-aware computing

It is natural to make applications and devices behave in a way that depends on where the user is, such as the context-aware phone Location-sensing systems Designed to obtain data about the position of entities (objects and humans) within some type of region of interest E.g., Location sensing with scene analysis Chinese University, CSE Dept. Distributed Systems / 9 - 56 4.3 More Location-Sensing Technologies a) Proximity: within a small distance from device b) Trilateration: distance measurements to device c) Triangulation: angels relative to device (a) Chinese University, CSE Dept.

(b) (c) Distributed Systems / 9 - 57 4.3 Some Location-Sensing Technologies Type GPS Radio Beaconing Active Bat Ultra Wide Band Active Badge Mechanism

Limitations Accuracy Type of location data Multilateration from satellite radio sources Broadcasts from wireless base stations (GSM, 802.11, Bluetooth) Multilateration from radio and ultrasound Outdoors only (satellite visibility)

Areas with wireless coverage 110m Absolute geographic Yes coordinates (latitude, longitude, altitude) Proximity to known Yes entity (usually semantic) Ceiling mounted sensors 10cm

Relative (room) coordinates. Bat identity disclosed Multilateration from reception of radio pulses Infrared sensing Receiver in stallations 15cm Relative (room) coordinates Tag identity

disclosed Sunlight or fluorescent light Room size Proximity to known Badge entity (usually semantic) identity disclosed Reader installations 1cm10m Proximity to known Tag identity

entity (usually semantic) disclosed Camera installations Variable Relative (room) coordinates Automatic RFID, Near Field Identification Communication, Tag Visual tag (e.g. barcode) Easy Living Vision, triangulation Chinese University, CSE Dept.

10m1km Privacy No Distributed Systems / 9 - 58 4.3 Locating an Active Bat within a Room 1. Base station sends timing signal to ultrasound receivers and radio signal to bat simultaneously 3. Ultrasound receivers report times of flight of ultrasound pulse Chinese University, CSE Dept. 4. Base station computes distances to ultrasound receivers from

times of flight, and thus position 2. Active bat of bat emits ultrasound signal on receipt of radio signal Distributed Systems / 9 - 59 4.4 Modern Sensors for Contextual Values Sensors are combinations of hardware and/or software used to measure contextual values Location, velocity and orientation GPS Accelerometer, gyroscope Digital compass Ambient (surrounding, encompassing) conditions

Microphone Camera, ambient light sensor Proximity sensor Barometer, humidity sensor, thermometer Presence Devices that read electronic identifiers on tags brought near to them Infrared readers used to sense active badges Chinese University, CSE Dept. Distributed Systems / 9 - 60 4.4 Sensors Are Becoming Ubiquitous 85% of mobile devices ship with GPS

50% of mobile devices ship with accelerometers and ~50% with gyroscopes Shipments of mobile motion sensors (accelerometers, compasses, gyroscopes, and pressure sensors) will reach USD 8.17B market by 2022. Contextual Computing will be a USD$125B market by 2024 Chinese University, CSE Dept. Distributed Systems / 9 - 61 4.4 Phone Functionalities Enabled by Sensors With additional sensors and sensor fusion Human location & health monitoring

Market introduction Barometer Market acceptance Indoor navigation Intelligent 3D sound management In-air signature & authentification With gyroscopes Pointing High resolution camera stabilization Menu navigation & advanced user interface 3D gaming Location-based service

With compass Map navigation & GPS assistance Pedometer With accelerometers Gaming Portrait/Landscape switching, Tap/double tap and shake control 2008 Chinese University, CSE Dept. 2010 2012 2014

2016 2018 Distributed Systems / 9 - 62 4.4 Sensors and Context-Aware Solutions Are on the Market Already Chinese University, CSE Dept. Distributed Systems / 9 - 63 6 Summary We presented the main challenges raised by mobile and ubiquitous computer systems We discussed aspects of volatility, some techniques for association components, and enabling them to interoperate despite the

difficulties of constant change The integration of devices with physical world involves sensing and context awareness Read Textbook Chapter 19 Chinese University, CSE Dept. Distributed Systems / 9 - 64

Recently Viewed Presentations