Csc 253 paul grace
1 / 22

Technical Stream Session 7: Resource Discovery and Jini - PowerPoint PPT Presentation

  • Uploaded on

CSC 253 Paul Grace. Technical Stream Session 7: Resource Discovery and Jini. Distributed Systems. Overview of the Session. Introduce the Jini platform Provide motivation for a new distributed services technology Illustrate example Jini scenarios Discuss approaches to resource discovery

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Technical Stream Session 7: Resource Discovery and Jini' - leif

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Csc 253 paul grace

CSC 253

Paul Grace

Technical Stream Session 7: Resource Discovery and Jini

Distributed Systems

Overview of the session
Overview of the Session

  • Introduce the Jini platform

    • Provide motivation for a new distributed services technology

    • Illustrate example Jini scenarios

    • Discuss approaches to resource discovery

  • Examine the Jini architecture

    • The discovery, join and lookup protocols

    • Jini proxy-based service interaction

    • Jini service leases

  • Programming Jini services and applications

    • Examples of advertising and searching for Jini applications

Why do we need jini
Why do we need Jini?

  • The motivation for Jini is to provide Plug and Play of Network Services

    • Form a community of devices, users and services without pre-planning, installation or human intervention

      • Create spontaneous distributed applications

    • Example network services:

      • Storage

      • Computation

      • Hardware device

      • Software service

      • User

    • Network-centric rather than disk-centric applications

Plug and play scenarios
Plug and Play Scenarios

Camera finds light

switch to turn on before

taking picture

  • Common themes

    • Service/Resource discovery

    • Service interaction

Camera finds disk

drive to save pictures

Camera finds network

printer to print pictures

What is jini
What is Jini

  • A runtime infrastructure to add, remove, locate, and access network services

    • Developed by Sun Microsystems

      • Adopts the Java programming model: One language everywhere

      • Utilises the benefits of mobile code in Java

  • Jini supports:

    • Discovery of Jini services

      • Find me a service that matches my requirements

    • Service interaction

      • Dynamic use of a found service

    • Services leases

      • Track active Jini services. Services live for a period of time

    • Distributed events

      • Services notify interested services of changes in their status

See lecture on

mobile agents

What is resource discovery
What is Resource Discovery?

  • Find a resource that meets the application requirements

    • Match resource type

      • e.g. Printer, CPU, Coursework submission service

    • Match attributes

      • e.g. ink=colour, speed>500MHz, course=253

    • Wildcard lookup

      • Range queries over all known resources

      • e.g. (ProcessorType=*) && (Speed = [300-500MHz])

  • Well known problem in resource discovery

    • An identical resource type and attribute match may not match the semantic requirements

      • Ongoing research: “Semantic Web” solutions

  • Two styles of resource discovery

    • Directory-based

    • Multicast-based

Directory based discovery
Directory-based Discovery

  • Centralised directory services

    • Service connects directly (using unicast protocols) and sends service advertisement information

    • Client connects directly and sends lookup request, directory service responds

  • Good

    • Scalablility

    • Minimises network traffic about discovery

  • Bad

    • Requires third-party administration

    • Cannot support spontaneous interaction

      • Requires directory to be available in the network

      • Clients and services must know the location of the directory

  • Examples

    • RMIRegistry, DNS, Lightweight Directory Access Protocol (LDAP), and others

Multicast based discovery
Multicast-based Discovery

  • Common multicast address

    • Services listen for discovery requests sent by clients directly

      • Respond if they have a matching services

  • Good

    • No third party administration

    • Supports ad-hoc resource lookup

  • Bad

    • Additional Network traffic

    • Client must deal with multiple results

  • Examples

    • Universal Plug and Play (UPnP)

    • Service Location Protocol (SLP)

      • Hybrid of the multicast and directory approach

Joining and using jini services

a lookup service- a service locator

Joining and Using Jini Services

  • Jini provides a suite of protocols to add, locate, and interact with Jini services

    • Jini defines a discovery protocol to locate a nearby Jini lookup service

      • Directory based discovery

    • A Join protocol to enable a service to register itself with a lookup service

    • A Lookup protocol to enable a client to query a lookup service for available services

    • The result of lookup is a Jini service proxy

      • Returns mobile code

      • The client uses the proxy to interact directly with the service

The jini discovery protocol



The Jini Discovery Protocol

  • All entities must find a Jini Lookup service in the network

    • Either local to the network or remote

  • Three alternative approaches

    • Multicast dynamic discovery

    • Unicast discovery

    • Multicast announcement

  • In each approach the Lookup Service returns a ServiceRegistrar Proxy Object using RMI

    • This is the reference to do service advertisement and service lookup

Multicast discovery protocol
Multicast Discovery Protocol

  • Reasons for using multicast discovery

    • Find a nearby lookup service

    • Starting service has no knowledge of network

  • The multicast discovery protocol

Discovering Entity

Lookup Server

1. Sets up a TCP server; instance of the multicast response service

2. Lookup servers run instances of the multicast request service; listens for requests from discoverers

TCP response

UDP Multicast

3. Performs a multicast request to lookup services

4. Connects to the discoverer’s multicast response server and sends a reference to itself

Unicast discovery protocol
Unicast Discovery Protocol

  • Reasons for using unicast discovery

    • Client knows location of a specific lookup service

      • e.g. jini://

    • Client must access a Jini service in another network

      • Multicast discovery only works in local network

  • Unicast protocol

    • Client directly establishes a TCP connection with the lookup service and downloads the registrar proxy

TCP connection established

Unicast request sent

Unicast response sent

Discovering entity

Lookup service

Multicast announcement protocol
Multicast Announcement Protocol

  • Reasons to use multicast announcement

    • Lookup services announce their existence

      • E.g. when a new lookup service is started

    • Recover from network failure

      • Clients lose track of lookup service  when lookup service is restarted they are made aware of its return

  • The Announcement protocol

Discovering Entity

Lookup Server

1. Listens on multicast announcement address

UDP Multicast

2. Sends a multicast announcement

TCP request - response

3. Performs unicast discovery

4. Sends response to unicast discovery



a lookup service

The Join Protocol

  • Allows the Jini service to advertise itself with the Lookup Service

  • Invoke register() passing a ServiceItem object and a lease duration

register(ServiceItem, long)

ServiceItem Class:

  • ID for the service (automatically generated by Lookup Service)

  • object implementingthe Jini Service

  • attributes for service - list of objects

Leasing in jini
Leasing in Jini

  • When Services die

    • How do you stop their references accumulating in the lookup servers?

  • Solution = Leases

    • A service is provided for a given amount of time (LEASE)

      • Services must renew their leases

    • Avoids third-party management for Lookup services

    • Support failure detection

      • Removes unreachable services

  • Programming leases

    • Services can use defaults or set manually

      • Lease.ANY - the service lets the lookup service decide on the time

      • Lease.FOREVER - the request is for a lease that never expires

        • Avoid!!

The lookup protocol



a lookup service

The Lookup Protocol

  • The client creates a service template

    • Contains the search query

      • Combination of 3 parameters

      • ServiceID, ServiceType (Class), attributes

  • Invoke Lookup(ServiceTemplate) on the Lookup Service

    • Via the registrar proxy

Lookup(ServiceTemplate t)

Jini Client


Example service templates

Search by service type

Search for a service with a specific class

Class = HelloWorldService.class

Example Service Templates

  • Search by attribute only

    • Search for a service with attribute

      • Name = MyServer

aeAttributes = new Entry[1];

aeAttributes[0] = new Name ("MyServer");

template = new ServiceTemplate (null, null, aeAttributes);

Class[] types = {HelloWorldService.class};

template = new ServiceTemplate(null, types, null);

Interacting with jini services
Interacting with Jini Services

  • Jini Service Proxies are of three types

    • Proxy performs the service itself

      • Code is self contained

      • Does not require any remote interactions

    • Proxy is an RMI stub for a remote service

      • Minimal code; only the interface to the remote object

      • Client invokes operations on the proxy; RMI used to invoke operation on the services

    • Proxy is a smart adaptor

      • Contains code to interact with the service

        • Sockets

        • CORBA

        • Proprietary protocol




Jini in Full

7. Jini client uses Java proxy to communicate and use the Jini service

Jini Client


Jini Services

6. Invokes lookup() on

ServiceRegistrar to locate desired service (returns Java proxy)

3. invokes register() on ServiceRegistrar

object to register


2. receives a



5. receives a

ServiceRegistrar object

1. Jini service discovers LUS

4. Jini client discovers LUS


Jini Lookup Service

Delving deeper
Delving Deeper


    • Community of Jini developers

    • Sample code downloads, Jini articles, and blogs


    • Download the Jini platform from Sun

  • Books

    • Core JINI, W. K. Edwards, Prentice Hall

      • Covers technical aspects of Jini

    • JINI Example by Example, W.K. Edwards and T. Rodden, Prentice Hall

      • Learn to program in Jini

Upnp a related technology
UPnP: A Related Technology

  • Universal Plug and Play (UPnP) from Microsoft

    • Includes discovery, interaction, and event notification

    • Based upon Web technologies (http, SOAP, XML) rather than Java technologies

      • No mobile code

  • Multicast based lookup

    • XML descriptions of devices and services

      • Matches DeviceType, ServiceType, and attribute matches

  • Service interaction

    • Via the SOAP protocol

Expected learning outcomes
Expected Learning Outcomes

At the end of this Unit:

  • You should understand why resource discovery is important in distributed systems

  • You should know the different styles of resource discovery available

  • You should know the key architectural features of the Jini technology

  • You should know the benefits that Jini provides distributed application developers