Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Remote Procedure Call Design issues Implementation RPC programming
Distributed Objects and Remote Invocation
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Remote Object Invocation
Distributed Systems Lecture #3: Remote Communication.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
Java RMI, JAX-RPC and JWSDP
Introduction to Remote Method Invocation (RMI)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
Distributed systems (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
.NET Mobile Application Development Remote Procedure Call.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Process-to-Process Delivery:
Introduction to Ice Copyright © ZeroC, Inc. Ice Programming with Java 1. Introduction to Ice.
CS425 /CSE424/ECE428 – Distributed Systems – Fall Nikita Borisov - UIUC1 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S.
Information Management NTU Interprocess Communication and Middleware.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Chapter 4: Interprocess Communication‏ Pages
Distributed Systems Concepts and Design Chapter 4.
Java Remote Method Invocation RMI. Idea If objects communicate with each other on one JVM why not do the same on several JVM’s? If objects communicate.
Systems Prog. & Script. - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 11: The Distributed Object Model.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Distributed Objects & Remote Invocation
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Distributed Objects and Remote Invocation Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Distributed systems (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Distributed objects and remote invocation Pages
Java Distributed Object Model A remote object is one whose methods can be invoked from another JVM on a different host. It implements one or more remote.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Distributed Systems Lecture 8 RPC and marshalling 1.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Topic 3: Remote Invocation Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
MCA – 405 Elective –I (A) Java Programming & Technology
Distributed Systems Course Topics in distributed objects
Programming Models for Distributed Application
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Process-to-Process Delivery:
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote method invocation (RMI)
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Distribution Infrastructures
Remote invocation (call)
Process-to-Process Delivery: UDP, TCP
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan

Introduction

Request-Reply Protocols (1)  Low level support for requesting the execution of a remote operation  Direct support for RPC and RMI  Synchronous and reliable communication

Request-Reply Protocols (2)

Message Identifiers  A request ID  Taken from increasing sequence of integers  Reset to zero when reaches maximum  Unique to the sender  An identifier  Ports and internet addresses of the sender/receiver  Unique in the distributed system

Failure Model of Request-Reply Protocol  Implementing doOperation, getRequest and sendRequest over UDP  Omission failures  No guarantee of ordered delivery  Suffering from the failure of processes  Using timeouts by doOperation  Returning with an error message  Sending request message repeatedly  Filtering out duplicate requests (server side)  Keeping record of reply messages (server side)

TCP Streams in the Request-Reply Protocol  Problem of determining buffer size in UDP  Limitted length of datagrams for arguments or results in RMI or RPC  TCP allows arguments and results of any size  JAVA object serialization  Stream protocol  Arguments and results sent over streams b/w client and server  Objects of any size to be transmitted reliably

HTTP: An example of request-reply protocol  Web servers manage resources implemented as:  Data – text of an HTML page, images  A program – e.g., servlets, or PHP or Python programs  HTTTP protocol specifies  The messages involved in request-reply exchange  Methods  Arguments  Results  Marshalling rules  Content negotiation  Specification of data representation from client‘s side  Authentication  Checking client’s credentials

Remote Method Invocation  A calling object invokes a method in a remote object  Commonalities b/w RMI and RPC  Both support programming with interfaces  Both offer a similar level of transparency, i.e., local and remote calls employ the same syntax  Allows the programmer to pass parameters both by value and by reference  Passing references is attractive if the parameter is large or complex  The remote end, on receiving an object reference, can then access this object using remote method invocation, instead of having to transmit the object value across the network

Design Issues for RMI (1) The Object Model  Object references  Objects can be accessed via object references  To invoke a method in an object, the object reference and method name are given, together with any necessary arguments  Interfaces  Define types of arguments, return values and exceptions  An object provides an interface if its class that contains code which implements the methods of that interface  Actions  A method invoked by an object in another object  Contains additional information (arguments) needed to carry out the method  The receiver executes the appropriate method and returns control to the invoking object

Design Issues for RMI (2) The Object Model  Exceptions  dealing with errors, unexpected conditions, inconsistent values, etc  Failures, attempt to read/write to files or network sockets  Provide a clean way to deal with error conditions without complicating the code  Garbage Collection  The mechanism of freeing the space occupied by objects when no longer needed  Automatic space recovery from objects in Java  Manual method of freeing space in C++

Design Issues for RMI (3) Distributed Objects  The state of a program partitioned into separate parts, each associated with an object  Physical distribution of objects into different processes or computers  Replication and migration of objects  To obtain the benefit of fault tolerance, enhanced performance, availability  Client-server  Distributed objects managed by servers  Clients invoke the methods using RMI  Invoking request sent via a message  Invocation carried out by executing a method of the object at the server and returning the results

Design Issues for RMI (4) Distributed Object Model  Each process contains a collection of objects  Only local invocations  Both local and remote invocations  Invocations b/w objects in different processes, whether in the same computer or not, are called RMI  Invocations b/w objects in the same process are local

Design Issues for RMI (5) Distributed Object Model

Design Issues for RMI (6) Actions in a distributed object system  In RMI, remote reference of the object must be available to the invoker  Remote object references may be obtained as the result of RMI  When an object leads to the instantiation of a new object, that object will normally live within the process where the constructor was used  Remote objects with methods of instantiating objects that can be accessed by RMI

Implementation of RMI (1)  Communication module  Carry out the request-reply protocol (request & reply messages)  Message type, requestId, remote reference  Dispatches the request to the object’s method from the reference obtained from the request

Implementation of RMI (2)  Remote reference module  Translating b/w local and remote object references, creating remote object references  Remote object table to record the correspondence b/w local object references in a process and remote object references

Implementation of RMI (3)  Servants  Instance of a class that provides the body of a remote object  Lie within the server process  Handles the remote requests  Created when remote objects are instantiated

Implementation of RMI (4)  The RMI Software  A layer of software b/w the application-level objects and the communication and remote reference modules  Proxy Makes RMI transparent to clients Hides the details of remote object reference, marshalling, unmarshalling, sending and receiving of messages

Implementation of RMI (5)  The RMI Software  Dispatcher One dispatcher and one skeleton for each class representing a remote object Receives request message from the communication module Uses the operationId to select the appropriate method in the skeleton

Implementation of RMI (6)  The RMI Software  Skeleton Class of a remote object has a skeleton, which implements the methods in the remote interface Unmarshals the arguments in the request message and invokes the corresponding method in the servant Waits for the invocation to complete and marshals the results in a reply message to the sending proxy’s method

Distributed Garbage Collection  Ensuring the existence of a local or remote reference of an object anywhere in a set of distributed objects  Collecting object and recovering memory  Whenever a remote object reference enters a process, a proxy will be created and will stay there for as long as it is needed  The process where the object lives should be informed of the new proxy at the client  When there is no longer a proxy at the client, the server should be informed