IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Distributed Objects and Remote Invocation
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.
Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) September 20, 2012 Lecture 8 RPCs and Distributed.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Remote Object Invocation
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Chapter 5: Distributed objects and remote invocation
Communication in Distributed Systems –Part 2
.NET Mobile Application Development Remote Procedure Call.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
CS425 /CSE424/ECE428 – Distributed Systems – Fall Nikita Borisov - UIUC1 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S.
Communication between distributed objects Remote procedure call
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.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Chapter 4: Interprocess Communication‏ Pages
Lecture 15-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) October 12, 2010 Lecture 15 RPCs and Distributed.
RPC Design Issues Presented By Gayathri Vijay S-8,CSE.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
Systems Prog. & Script. - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 11: The Distributed Object Model.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION. Introduction This chapter is concerned with programming models for distributed applications... Familiar programming.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
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.
1 Distributed Objects and Remote Invocation – 5.1 Introduction  Foci: –Communication among distributed objects via RMI  Recipients of remote invocations.
Remote Procedure Call RPC
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
1 Distribuerede systemer og sikkerhed – 28. februar 2002 From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) September 19, 2013 Lecture 8 RPCs and Distributed.
Distributed objects and remote invocation Pages
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems Lecture 8 RPC and marshalling 1.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
RPC 6/14/20161BALAJI K - AP. Design issues of RPC Programming with interfaces Call Semantics associated with RPC Transparency and related to procedure.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
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
Communication between distributed objects Remote procedure call
CSE 486/586 Distributed Systems Remote Procedure Call
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
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Creating a Distributed System with RMI
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote method invocation (RMI)
Distribution Infrastructures
Remote invocation (call)
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation

Dr. Almetwally Mostafa2 OUTLINE Applications Middleware layers request-reply protocol marshalling and external data representation UDP and TCP This chapter RMI, RPC, and events

Dr. Almetwally Mostafa3 OUTLINE  Distributed Programming Models.  Distributed Module Interfaces.  Distributed Objects Model.  Remote Procedure Call.  Events and Notifications.  Java RMI Case Study.

Dr. Almetwally Mostafa4 Distributed Programming Models  A distributed programming model is as an abstraction layer above communication protocols details.  Different Programming models provided by middleware to support distributed applications include: Remote Procedure Call (RPC): Client programs call procedures in server programs running in separate remote hosts but in the same way as local procedure call. Remote Method Invocation (RMI): Client objects may invoke methods of remote objects residing in another process running on another host also in the same way as local method invocation. Event-based processing and event notification: The behavior of the system is driven by events, which represent local state changes within objects. Objects receive notifications of events at other objects in which they have registered interest.

Dr. Almetwally Mostafa5  Middleware is the provision of transparency and heterogeneity challenges: Location transparency: RMI and RPC invoked without knowledge of the location of invoked method/procedure. Transport protocol transparency: e.g., request/reply protocol used to implement RPC can use either transport protocols (UDP or TCP). Transparency of computer hardware and operating system: e.g., use of external data representations. Transparency of programming language used e.g., by use of programming language independent Interface Definition Languages, such as CORBA IDL. Distributed Programming Models

Dr. Almetwally Mostafa6 Distributed Module Interfaces  Allow interaction between modules of distributed programs.  Specify procedures and variables that can be accessed from other modules.  Modules are implemented to hide all information about them except the available through their interfaces. Module implementation can be changed without affecting its users.  Specifics for interfaces in distributed systems: No direct access to remote variables: Use message passing mechanism to transmit data variables. Local parameter passing mechanisms (by value, by reference) not applicable to remote invocations. Specify input or output as parameters attribute. Input parameters are transmitted with request message and output parameters are transmitted with reply message. Pointers are not valid in remote parameter passing.

Dr. Almetwally Mostafa7  RPC and RMI interfaces are often seen as: Service interface (in client/server model for RPC) Each server provides a set of procedures available for use by clients Defining the types of input and output arguments for each procedure. Remote interface (in distributed object model for RMI) Specify the methods of an object that can be invoked by objects in other processes. Defining the types of input and output arguments for each method. Methods can receive objects or object references (not pointers) as arguments and may return objects as results. Distributed Module Interfaces

Dr. Almetwally Mostafa8 Distributed Interface Definition  Language-specific approach: The RMI/RPC mechanism is integrated with a particular programming language if its notation can be used to define the interfaces and deal with input and output parameters. Allows the distributed applications programmers to use a single language for local and remote invocation. Example: Java RMI.  Interface definition language approach: Allows objects implemented in different languages to invoke useful objects implemented in one another. Uses a general IDL notation for defining interfaces including input and output parameters with their types. Example: CORBA IDL.

Dr. Almetwally Mostafa9 Distributed Objects Model  The logical partition of object-based programs into objects is naturally extended by the physical distribution of objects into different processes or computers in a distributed system.  Distributed object systems adopt the client-server architecture: Objects are managed by servers and their clients invoke their methods using remote method invocation. The client’s RMI request is sent in a message to the server managing the invoked method object. The method of the object at the server is executed and its result is returned to the client in another message. Objects in servers are allowed to become clients of objects in other servers.  Distributed objects can be replicated and migrated to obtain the benefits of fault tolerance, enhanced performance and availability.  Having client and server objects in different processes enforces encapsulation due to concurrency and heterogeneity of RMI calls.

Dr. Almetwally Mostafa10 Distributed Objects Model invocation remote invocation remote local invocation A B C D E F Remote and local method invocations

Dr. Almetwally Mostafa11 Distributed Objects Model  Each process contains a collection of objects, some of which can receive both local and remote invocations and others can receive only local invocations.  Objects that can receive remote invocations are called remote objects.  Other objects need to know the remote object reference in another process in order to invoke its methods. A remote object reference is an identifier that can be used through a distributed system to refer to a particular unique remote object.  Every remote object has a remote interface to specify which of its methods can be invoked remotely. Objects in other processes can invoke only the methods that belong to the remote interface of the remote object. Local objects can invoke the methods in the remote interface as well as other methods of the remote object.

Dr. Almetwally Mostafa12 Distributed Objects Model interface remote m1 m2 m3 m4 m5 m6 Data implementation remote object { of methods A remote object and its remote interface

Dr. Almetwally Mostafa13 Distributed Objects Model Design Issues  Although local invocations are executed exactly once, remote invocations cannot achieve this. Why not?  RMI usually applied via request/reply protocol which can suffer from many types of failure: Message omission and duplication can occur if implemented over UDP. Process failures (crash or arbitrary) are also possible.  Therefore, different choices of fault-tolerance measures can be applied: Retransmit request message until a reply is received or the server is assumed to be failed Filter out duplicate requests at the server if retransmit is used. Re-execute the operation when retransmitted request arrives or result retransmission (requires keeping a history at the server).  Combinations of fault-tolerance choices lead to a variety of invocation semantics for the reliability of remote invocation.

Dr. Almetwally Mostafa14 Distributed Objects Model Design Issues Fault tolerance measures Invocation semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Yes Not applicable No Yes Not applicable Re-execute operation Retransmit replyAt-most-once At-least-once Maybe Invocation semantics

Dr. Almetwally Mostafa15 Distributed Objects Model Design Issues  Maybe invocation semantics: No fault-tolerance measure is applied. The invoker cannot tell if a remote method has been executed or not. Suffer from the following types of failure: Omission failures if invocation or result message is lost. Crash failures if the server containing the remote object fails. Useful only for application accepting occasional failed invocations.  At-least-once invocation semantics: Uses only retransmission of request messages – masks omission failures. The invoker receives either a result (after at least one execution) or an exception informing no result was received. Suffer from the following types of failure: Crash failure if the server containing the remote object fails. Arbitrary failures when re-execute the method more than once which causing wrong values to stored or returned (non-idempotent operations). Applicable only if all the remote methods are idempotent operations.

Dr. Almetwally Mostafa16 Distributed Objects Model Design Issues  At-most-once invocation semantics: Uses all the fault-tolerance measures. The invoker receives either a result (after exactly one execution) or an exception informing no result was received. Prevents arbitrary failures by ensuring that a method is never executed more than once for the same RMI.  CORBA and Java uses at-most-once invocation semantics.  COBRA allows maybe invocation semantics to be requested for methods without results.  Sun RPC provides at-last-once call semantics.

Dr. Almetwally Mostafa17  Several separate objects and modules are involved to achieve a remote method invocation: Communication modules: Responsible for providing a specified invocation semantics. Carry out the request-reply protocol to transmit request and reply messages between the cooperating server and client. Use only the first three items of the request and reply messages: message type, request id, and the invoked remote object reference. Select the dispatcher software for the invoked object class in the server. Distributed Objects Model RMI Implementation

Dr. Almetwally Mostafa18 Distributed Objects Model RMI Implementation object A object B skeleton Request proxy for B Reply Communication Remote Remote reference Communication module reference module module for B’s class & dispatcher remote client server The proxy and skeleton role in remote method invocation

Dr. Almetwally Mostafa19 Remote reference modules: Translate between local and remote object references and create remote object references. Have a remote object table in each process to support the translation. An entry for all the remote objects held by the server in its table. An entry for each local proxy held by the client in its table. Create a remote object reference and add it to the table when a remote object is passed in a request or a replay message for the first time. Translate the remote object reference to the corresponding local object reference which refer either to a remote object (in the server) or to a proxy (in the client). Distributed Objects Model RMI Implementation

Dr. Almetwally Mostafa20 RMI Software: Proxy: Make remote method invocation transparent to clients by behaving like a local object to the invoker. Forward the call in a message to the remote object and hiding all in- between operations (send, receive, marshalling, and unmarshalling) from the client. A client has one proxy for each remote object to hold its remote reference and implement the methods in its remote interface. Marshal a reference to the target object, its own methodId and its arguments into a request message and send it to the target then await the reply message to unmarshal it and return the result to the invoker. Dispatcher: A server has one dispatcher for each class representing a remote object. Receive the request message from the communication module and use the methodId to select the appropriate method in the skeleton and passing on the request message. Distributed Objects Model RMI Implementation

Dr. Almetwally Mostafa21 RMI Software: (cont.) Skeleton: Each class representing a remote object has a skeleton in the server to implement each method in the remote interface. Unmarshal the argument in the request message and invoke the corresponding method in the remote object. Await the invocation to complete to marshal the result in the reply message to the client proxy’s method. The classes of the proxy, skeleton, and dispatcher used in RMI are generated automatically by an interface complier. The server program contains the classes for the dispatchers and skeletons together with the implementations of the classes of all remote objects that it supports – servant classes. The client program contains the classes of the proxies for all the remote objects that it will invoke and use a binder to look up remote object references. Distributed Objects Model RMI Implementation

Dr. Almetwally Mostafa22  Free resources occupied by objects that have no more reference to it in the system.  Work in cooperation with the local garbage collector in each process in the system.  Java Distributed Garbage Collection algorithm: Each server maintains a list of clients that hold remote object references for each of its remote objects. When a client C first receives a remote reference to a particular remote object X, it makes an addRef(X) invocation to the server of that remote object and then the server adds C to the list of object X. When a client C’s garbage collector notices that a proxy for a remote object X is no longer referenced, it sends removeRef(X) invocation to the corresponding server which deletes C from the list of object X. When the list of a remote object X is empty and there are no local references to it, the server’s local garbage collector collect resources held by the object X. Distributed Objects Model Distributed Garbage Collection

Dr. Almetwally Mostafa23  Java algorithm fault tolerance: Carried out by request/reply communication with at-most-once invocation semantics between the remote reference modules in processes. Toleration of communication failures: addRef and removeRef are indempotent. If addRef(X) returns exception, then client will not instantiate proxy but will send removeRef(X). Effect of removeRef(X) is correct no matter whether addRef(X) succeeded or not. Failure of removeRef(X) is masked by the use of leases. Leases Servers lease their objects to clients for limited periods of time, starting with addRef. Helps tolerate failures of removeRef as well as client failures. Avoids problem of having to maintain lists of remote object references if all object references are handled through leases. Distributed Objects Model Distributed Garbage Collection

Dr. Almetwally Mostafa24  Very similar to a remote method invocation A client process calls a procedure in a server process. Servers may be clients of other servers to allow chains of RPCs. Implemented to have one of the choices of invocation semantics. Implemented over a request-reply protocol. The contents of request and reply messages are the same as RMI except that the object reference field is omitted. The supported software is similar except that no remote reference modules are required and client proxies and server skeletons are replaced by client and server stub procedures.  The service interface of the server defines the procedures that are available for calling remotely.  The client and server stub procedures and the dispatcher are generated by an interface compiler from the definition of the service interface. Remote Procedure Call (RPC)

Dr. Almetwally Mostafa25 Remote Procedure Call (RPC) client Request Reply Communication module dispatcher service client stub server stub procedure client process server process procedure program Role of client and server stub procedures in RPC

Dr. Almetwally Mostafa26  Distributed event-based systems allowing multiple objects at different locations to be notified of an event occurrence at a particular object.  The publish-subscribe paradigm is used: An object generating events publishes the list of events available for observation by other objects. Objects requiring notifications subscribes to the notification service at an object offering notification for this particular event through its publication list.  When a publisher experiences an event, subscribers that expressed an interest in that type of event will receive notifications.  Events and notifications can be used in a wide variety of different applications: A piece of equipment or an electronically tagged book is at new location. A client has entered participation in a collaborative work environment. An electronic document has been modified. Events and Notifications

Dr. Almetwally Mostafa27  Allow dealers using computer to see the latest information about the market prices of the stocks. The market price for a single named stock is represented by an object with several instance variables. The information is arrived from different external sources in the form of updates to some or all instance variables of the stock objects and collected by information providers. Dealers are interested only in their specialist stocks.  Modeled by processes with two different tasks: An information provider process continuously receives information from a single external source to apply it to the appropriate stock objects as an event and notifies all the dealers subscribed to the corresponding stock. A dealer process creates a local object to represent each named stock to subscribe the stock object at the relevant information provider and receive all information sent in notifications to display it to the user. Events and Notifications Dealing Room System

Dr. Almetwally Mostafa28 Events and Notifications Dealing Room System

Dr. Almetwally Mostafa29  An event source can generate events of one or more different types.  Each event has attributes to specify information about that event: the name of object generated it, the operation, its parameters and the time.  Types and attributes are used in subscribing to events and in notifications.  Whenever an event of a specific type that matches the attributes occurs, the interested parties will be notified.  In dealing room system example: There is one type of event – the arrival of an update to a stock. The attributes might specify the name of a stock, its current price, and latest rice or fall. Dealers may specify the interesting in all the events of a particular stock. Events and Notifications Event Types