DISTRIBUTED COMPUTING

Similar documents
JAVA RMI. Remote Method Invocation

Remote Method Invocation

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

Remote Method Invocation

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP)

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

Generic architecture

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Remote Procedure Call

Last Class: Network Overview. Today: Distributed Systems

Chapter 4 Remote Procedure Calls and Distributed Transactions

Outline. Chapter 4 Remote Procedure Calls and Distributed Transactions. Remote Procedure Call. Distributed Transaction Processing.

Communication and Distributed Processing

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

CSci Introduction to Distributed Systems. Communication: RPC In Practice

Communication and Distributed Processing

Chapter 4: Processes. Process Concept. Process State

BSc ( Hons) Computer Science with Network Security. Examinations for / Semester 2

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

presentation DAD Distributed Applications Development Cristian Toma

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

CHAPTER - 4 REMOTE COMMUNICATION

Course Snapshot. The Next Few Classes

Verteilte Systeme (Distributed Systems)

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

Distributed Objects SPL/ SPL 201 / 0 1

IBD Intergiciels et Bases de Données

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

Distributed Computing

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

CSci Introduction to Distributed Systems. Communication: RPC

Remote Objects and RMI

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

Distributed Systems. 5. Remote Method Invocation

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

Last Class: RPCs. Today:

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Distributed Software Systems

Lecture VI: Distributed Objects. Remote Method Invocation

3. Remote Procedure Call

Figure 6.1 System layers

Chapter 4: Processes

Distributed Systems COMP 212. Lecture 8 Othon Michail

COMP 6231: Distributed System Design

CS 5523 Operating Systems: Remote Objects and RMI

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI

Remote Method Invocation

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Communication. Distributed Systems Santa Clara University 2016

RPC and RMI. 2501ICT Nathan

Written by: Dave Matuszek

Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Chapter 5: Remote Invocation. Copyright 2015 Prof. Amr El-Kadi

Diagram of Process State Process Control Block (PCB)

Remote Method Invocation in Java

Concurrency Control in Distributed Environment

Distributed Systems COMP 212. Lecture 10 Othon Michail

RMI. Remote Method Invocation. 16-Dec-16

DS 2009: middleware. David Evans

5 Distributed Objects: The Java Approach

Chapter 4 Communication

Communication. Communication. Distributed Systems. Networks and protocols Sockets Remote Invocation Messages Streams. Fall /10/2001 DoCS

Distributed Information Processing

Distributed Information Systems

5.4. Events and notifications

CS193k, Stanford Handout #12. Threads 4 / RMI

Last Class: RPCs. Today:

RMI: Design & Implementation

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 22: Remote Procedure Call (RPC)

Distributed Systems Principles and Paradigms. Distributed Object-Based Systems. Remote distributed objects. Remote distributed objects

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void

Communication. Overview

Applications. RMI, RPC and events. Request reply protocol External data representation. Operating System

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Network. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark

Architecture of So-ware Systems RMI and Distributed Components. Mar<n Rehák

RMI. (Remote Method Invocation)

RMI Example RMI. CmpE 473 Internet Programming RMI

Concurrent Programming (RIO) Lesson 9. Ch 8 [BenA 06] Messages Channels Rendezvous RPC and RMI. X=f(..); send X to B. OS kernel.

Remote Invocation. Today. Next time. l Overlay networks and P2P. l Request-reply, RPC, RMI

Chapter 5: Distributed objects and remote invocation

Remote Invocation Vladimir Vlassov and Johan Montelius

CSC 634: Networks Programming

Distributed object component middleware I - Java RMI

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

Distributed object component middleware I - Java RMI

Operating System Support

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line

CC755: Distributed and Parallel Systems

Modulo II Socket, RMI e Corba

Java Programming Language Advance Feature

The Big Picture So Far. Chapter 4: Processes

IPC. Communication. Layered Protocols. Layered Protocols (1) Data Link Layer. Layered Protocols (2)

THE UNIVERSITY OF WESTERN AUSTRALIA SAMPLE EXAM QUESTIONS 2007 WITH SOLUTIONS SCHOOL OF COMPUTER SCIENCE CITS3213 CONCURRENT PROGRAMMING (PART II)

Transcription:

DISTRIBUTED COMPUTING SYSTEMS 1

REMOTE PROCEDURE CALL RPC-REMOTE PROCEDURE CALL RMI-REMOTE METHOD INVOCATION 2

3 RPC TECHNOLOGY Remote procedure call is a technology that allows computer programs to call the function or procedure in a different address space. Process A Process B proc1(arg1, arg2) proc2(arg1) proc3(arg1,arg2,arg3)

4 THE STACK WHEN CALLING LOCAL PROCEDURES The local variables of the main program The local variables of the main program The local variables of the main program SP SP Data The return address Procedure local variables SP Prior call execution During call execution After return

5 RPC IMPLEMENTATION The idea: remote procedure call "transparent" for the local process Instead of the local procedure we use the client stub. It is called as a local procedure, but instead of execution it sends a message the remote machine.

6 REMOTE PROCEDURE CALL Client machine The server machine Client process (1) Procedure call (3) Procedure call Procedure (6) Result Client stub Server stub (4) Result Client kernel Server kernel (2) Message-call (5) Message-result

7 RPC PSEUDO CODE main { mytype a = remoteprocedure (arg1, arg2); mytype remoteprocedure (int arg1, int arg2) { byte [] mess, response; string name = remoteprocedure ; string addr = remote.host:1122 ; mess = (6) Result Client (1) Procedure call encremoteprocedure (arg1, arg2); response = (2) Messagecall (5) Messageresponse callremoteprocedure (addr, name, mess); return decremoteprocedureresponce (response); Server byte[] serverstab (string name, byte[] mess) { switch name: case remoteprocedure : int a, b; decremoteprocedure (mess, &a, &b); mytype res = remoteprocedure (a, b); byte [] response = encremoteprocedureresponce (res); return response; case (4) Response (3) Procedure call mytype remoteprocedure (arg1, arg2) { return process(arg1, arg2);

8 STAGES OF THE RPC Call procedure stub Client Execute the procedure Server Prepare a message buffer Organize parameters in the buffer Add header fields to the message Execute kernel interruption Switch to kernel context Copy the message into the kernel Determine the destination address Put the address in the message header Install the network interface Enable timer Client stub Kernel Call the server Place the parameters onto the stack Unpack the parameters Switch to the server stub context Copy the message to the server stub Determine whether the stub is waiting Determine the stab, which send the packet Validate a package Interrupt the process The server stub Kernel

9 REMOTE METHOD INVOCATION In terms of OOP the Remote Method Invocation (RMI) concept was implemented. RMI allows to provide transparent access to the methods of remote objects, providing delivery of parameters of the invoked method, message to the remote object to execute the method and the transfer of a return values back to the client

10 REMOTE OBJECT The remote object is a collection of some data that determine its State. This State can be changed by calling some of his methods. Methods and fields of an object that can be used via remote calls, are available through the external interface of the objects class.

11 REMOTE PROCEDURE VS REMOTE OBJECT Remote Procedure Remote Object 1 2 call Clients response procedure Server procedure 1 2 call Clients state read write response method A1 Server A2 Class A 3 3 A3

12 A PROXY AND A SCELETON A client stub that invokes a remote object is called the proxy. Proxy implements the same interface as the remote object. The server-side stub is called the skeleton (in Java RMI) The skeleton is associated with a specific instance of the remote object and invokes the method with the desired settings

13 REMOTE OBJECT USAGE The client machine The server machine Client process Proxy reference Remote object interface Proxy Server process Object Remote object interface Skeleton Middleware Middleware OS network serivece OS network serivece Data transfer channel

14 REMOTE METHOD INVOCATION RMI Interface: public interface ProductCatalogue extends java.rmi.remote { ProductDescription[] searchproduct(string producttype) throws java.rmi.remoteexception; Product provideproduct(productdescription d) throws java.rmi.remoteexception; int deleteproduct(productdescription d) throws java.rmi.remoteexception; int updateproduct(product p) throws java.rmi.remoteexception;... Server interface realization: public class ProductCatalogueImpl extends java.rmi.server.unicastremoteobject implements ProductCatalogue { public ProductCatalogueImpl() throws java.rmi.remoteexception { super(); public ProductDescription[] searchproduct(string producttype) throws java.rmi.remoteexception { ProductDescription[] desc = ProductCatalogue.getDescriptionByType(productType); return desc;...

15 Server realization: Client Realization: REMOTE METHOD INVOCATION RMI public class ProductCatalogueServer { public ProductCatalogueServer() { try { ProductCatalogue c = new ProductCatalogueImpl(); Naming.rebind("rmi://localhost:1099/ProductCatalogueService", c); catch (Exception e) { public static void main(string args[]) { new ProductCatalogueServer(); public class ProductCatalogueClient { public static void main(string[] args) { try { ProductCatalogue c= (ProductCatalogue)Naming.lookup( "rmi://hostname/productcatalogueservice"); System.out.println( c.searchproduct("book"); catch (Exception e) {