22
Saad Liaquat Kiani 1 Real Time & Multimedia Lab Real Time & Multimedia Lab Kyung Hee University Kyung Hee University Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Embed Size (px)

Citation preview

Page 1: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 1

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Mobile Computing Middleware -A Peek into Jini, UPnP and OSGI

Saad Liaquat KianiRTMM Lab

Page 2: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 2

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Mobile Computing

• Mobile, computing means that the computing device is not continuously connected to the base or central network.

• Mobile devices include PDAs, laptop computers, and many of today’s cell phones (aptly called "smart phones").

• These products may communicate with a base location with or without a wireless connection. – An example of a wireless mobile application is

using a modem-equipped PDA to receive text messages via satellite technology.

Page 3: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 3

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Types of Mobile Devices• A categorization of five different types of mobile devices:

– Laptop computers – PDAs and handheld PCs – Pagers – Smart phones and cellular phones – Task devices, such as bar code scanners

• Laptops are typically used and supported in the same way as desktop PCs. – Many organizations have replaced desktops with their portable cousins as the

workforce has grown increasingly mobile.• PDAs are the least planned-for and supported devices.

– They are undergoing rapid evolution and are being brought into organizations in the same way the earliest PCs were.

• Smart phones that allow users to – access phone calls,– two-way radio transmissions– paging and data transmissions

• Pagers• Task devices such as the parcel tracking devices used by Federal Express

(FedEx) and the United Parcel Service (UPS)

Page 4: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 4

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Types of Mobile users

• Three types of mobile users:– Telecommuters who

work away from the office but connect directly to the office from a remote location.

– Casual telecommuters and other workers who work a few days per month outside the office.

– Predominantly mobile employees

Pe

rcen

tag

e o

f W

orkfo

rce

Mobility

Page 5: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 5

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Distributed Middleware• Middleware is an enabling layer of software that resides between the

application program and the networked layer of heterogeneous platforms and protocols. – It decouples applications from any dependencies on the plumbing layer that

consists of heterogeneous operating systems, hardware platforms and communication protocols

• Most distributed applications and services were designed with the assumption that the terminals were powerful, stationary and connected to fixed networks. – Conventional middleware technologies thus have focused on masking out

the problems of heterogeneity and distribution to facilitate the development of distributed systems.

– They allow the application developers to focus on application functionality rather than on dealing explicitly with distribution issues. Different middleware systems such as CORBA, DCOM and Java RMI have proved their suitability for standard client-server applications.

• However, under the highly variable computing environment conditions that characterize mobile platforms, it is believed that existing traditional middleware systems are not capable of providing adequate support for the mobile wireless computing environment. – There is a great demand for designing modern middleware systems that can

support new requirements imposed by mobility.

Page 6: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 6

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Why separate middleware for mobile computing ?

• There are at least three common factors that affect the design of the middleware infrastructure required for mobile computing: – mobile devices– network connection– mobility

• Mobile devices vary from one to another in term of resource availability– Devices like laptops can offer fast CPUs and large amount of RAM and

disk space while others like pocket PCs and phones usually have scarce resources.

– It is either impossible or too expensive to augment the resource availability

• Hence, middleware should be designed to achieve optimal resource utilization. • Network connection in mobile scenarios is characterized by

– limited bandwidth– high error rate– higher cost– frequent disconnections due to

• power limitations• available spectrum• Mobility

Page 7: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 7

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Why separate middleware for mobile computing ?

• Physical host mobility can greatly affect network connection– Mobile clients may interact with different types

of networks, services, and security policies as they move from one area to another.

• This requires applications to behave differently to cope with dynamic changes of the environment parameters.

• Due to these limitations, conventional middleware technologies designed for fixed distributed systems are not prepared to support mobile systems. – They target a static execution platform where

the host location is fixed, the network bandwidth does not fluctuate, and services are well defined

Page 8: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 8

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Mobile Computing: Reference Technologies

• The remaining of the presentation will briefly describe 3 middleware technologies that can aid mobile devices in utilizing existing network infrastructure and resources– UPnP– Jini (Java RMI)– OSGI

Page 9: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 9

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Universal Plug and Play

• Universal Plug and Play (UPnP) is a standard software architecture for peer-to-peer network connectivity of intelligent appliances, wireless devices, and PCs.

• A device can dynamically • join a network• obtain an IP address• convey its capabilities• discover other devices• learn the capabilities of other devices.

• A UPnP enabled device can control remote devices, and transfer data to and from remote devices.

• Devices can subscribe to events that may occur as state variables change.– Subscription to events allows a distributed device to react to

remote events• e.g., when a track stops playing, start playing the next track.

• A device can leave a network smoothly and automatically without leaving any unwanted state behind.

Page 10: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 10

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

UPnP

• UPnP leverages Internet technologies• Internet Protocol (IP) [TCP, UDP] • HTTP• XML.

• Like the Internet, UPnP is based on wire protocols that are expressed in XML, and communicated via HTTP

• IP internetworking is a strong choice for UPnP because– its proven ability to span different physical media– to enable real world multiple-vendor interoperation– to achieve synergy with the Internet and many home

and office intranets.

Page 11: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 11

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

UPnP

• UPnP devices can be implemented using any programming language, and on any operating system.

• UPnP does not specify or constrain the design of an API for applications running on control points;– OS vendors may create APIs that suit

their customers' needs.

Page 12: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 12

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

UPnP Coordination in a NutShell

• Announcing presence– Use SSDP and Directory service proxies (optional)

• Discovering other devices– Listen to SSDP multicast channel directly or contact a

directory service proxy.

• Describing capabilities– XML description of the device is made available at a

specified URL

• Self configuration– This is primarily DHCP or AutoIP, and multicast DNS. – Auto configuration seems to be the strongest feature of UPnP

as yet.

• Invoking Services• Transports: TCP/IP and proxies to other transports

Page 13: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 13

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

UPnP Example

• You wake at 6 a.m. to a view of the mountains and a current ski report:– snow is falling and the powder is piling up.– You send an alert via your alarm clock to

your children's alarm clocks and the coffeepot.

– The coffee starts brewing, you hear the patter of steps upstairs as the kids get out of bed, and soon you're all off to an early start to the mountains for a day of skiing.

Page 14: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 14

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Jini

• Motivation• Enable devices / services enter and leave the network without

requiring explicit reconfiguration

• Jini is a Java based distributed computing environment, that offers “network plug and play”• Allows devices to dynamically establish communication to share and

exchange services across a network• Simplifies interactions with a network and connections between

devices anytime anywhere.• Enables devices to plug together to form an impromptu community-a

community put together without any planning, installation or human intervention.

Page 15: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 15

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Jini operations

Service Registry

(Lookup Service)

ServiceProvider

ServiceUser

register

lookup

• Lookup service The Service Registry– supports searching for services that meet

certain criteria, e.g. those that have a particular Java type

• Services Devices or Software• Service Object Contains the Java

programming language interface for the service. Contains methods that users and clients will invoke to execute the service

• A Device hosting a service registers with the Lookup service to announce its presence

• A Client wishing to use a particular service, asks the Lookup service for contact information about the service to be used

• The process of finding a Lookup service, either by client or device/service is called Discovery

• The process of registering a device/service with a Lookup service is called Join

• The process by which a client finds a service/device of interest from a Lookup services is called Lookup

• The process of using a service by the client is called Service Invocation

Page 16: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 16

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Jini Architecture

x86

Solaris Mac Windows

Java Java Java

Lookup

Java Spaces Other Services

Jini

NetworkServices •••

Discovery/Join

RMI

Page 17: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 17

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Jini Benefits

• Self Healing Networks through Leasing– Leasing provides a method of managing resources in an

environment where network failures can occur• A service is only provided for a certain amount of time unless the provider re-registers

it (renews the lease)

• Similarly, resource is not granted to a consumer for indefinite period, but “leased” for a finite time

– Keeps dead services from accumulating in the lookup servers over time

• Distributed Events• Extends Java event model to allow it to work in a distributed network

– Register interest, receive notification

• Event Mailboxes (Asynchronous event mechanism)

– receive event notifications on behalf of their clients and deliver them later upon request

– supports disconnected operations, unexpected failures of modules and maintaining history of events of interest

Page 18: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 18

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

OSGI• The OSGi™ specifications define a standardized , component oriented ,

computing environment for networked services . – Adding an OSGi Service Platform to a networked device (embedded as well as

servers), adds the capability to manage the life cycle of the software components in the device from anywhere in the network.

• Software components can be installed, updated, or removed on the fly without having to disrupt the operation of the device.

• Software components are libraries or applications that can dynamically discover and use other components.

• Software components can be bought off the shelf or are developed in house. – The OSGi Alliance has developed many standard component interfaces that are

available from common functions like • HTTP servers• Configuration• Logging• Security• user administration• XML

– Plug compatible implementations of these components can be obtained from different vendors with different optimizations.

• Software component architectures address an increasing problem in software development: – The large number of configurations that need to be developed and maintained. – The standardized OSGi component architecture simplifies this configuration

process significantly.

Page 19: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 19

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

OSGI Framework• The OSGI Framework provides a standardized environment to

applications (called bundles). • The Framework is divided in a number of layers.

– L0: Execution Environment – L1: Modules – L2: Life Cycle Management – L3: Service Registry

• The L0 Execution environment is the specification of the Java environment. – Java 2 Profiles, like J2SE, CDC,, MIDP etc. are all valid execution

environments.  • The L1: Modules layer defines the class loading policies.

– The OSGi Framework is a powerful and rigidly specified class loading model. – It is based on top of Java but adds modularization.

• The L2: Life Cycle layer adds bundles that can be dynamically installed, started, stopped, updated and uninstalled. – The L3 layer adds a Service Registry. – The service registry provides a comprehensive model to share objects between

bundles. – A number of events are defined to handle the coming and going of services– Many services are server like objects, like an HTTP server, other services

represent an object in the real world, for example a Bluetooth phone that is nearby

Page 20: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 20

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

OSGi

• The OSGi specifications are so widely applicable because it is a small layer that allows multiple, Java™ based, components to efficiently cooperate in a single Java Virtual Machine (JVM).

• The presence of OSGi based middleware in many different industries is creating a large software market for OSGi software components.

• The rigid definition of the OSGi Service Platform enables components that can run on a variety of devices, from very small to very big.

Page 21: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 21

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

Protocol Services

• The OSGi Alliance has defined a number of services that map an external protocol to an OSGi service. – Http Service – The Http Service is, among other things, a

servlet runner. • Bundles can provide servlets, which becomes available over the

Http protocol. • The dynamic update facility of the OSGi Service Platform makes

the Http Service a very attractive web server that can be updated with new servlets, remotely if necessary, without requiring a restart.

– UPnP Service – Universal Plug and Play (UPnP) is an emerging standard for consumer electronics.

• The OSGi UPnP Service maps devices on a UPnP network to the Service Registry.

• Alternatively, it can map OSGi services to the UPnP network. This is a recommended Release 3 specification.

– Jini Service – Jini is a network protocol used to discover Jini services on a network and download those services in the host as Java code and execute them.

• This is recommended Release 3 specification.

Page 22: Real Time & Multimedia Lab Saad Liaquat Kiani 1 Mobile Computing Middleware - A Peek into Jini, UPnP and OSGI Saad Liaquat Kiani RTMM Lab

Saad Liaquat Kiani 22

Real Time & Multimedia LabReal Time & Multimedia Lab

Kyung Hee UniversityKyung Hee University

References

• UPnP– http://www.upnp.org

• Jini– http://www.artima.com/jini – http://www.jini.org – http://www.sun.com/software/jini/

• OSGI– http://www.osgi.org