Lecture 5: Object Interaction: RMI and RPC

Similar documents
Lecture 06: Distributed Object

Distributed Systems. 5. Remote Method Invocation

Chapter 5: Distributed objects and remote invocation

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

RMI: Design & Implementation

Remote Invocation. 1. Introduction 2. Remote Method Invocation (RMI) 3. RMI Invocation Semantics

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

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

MODELS OF DISTRIBUTED SYSTEMS

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

Lecture 5: RMI etc. Servant. Java Remote Method Invocation Invocation Semantics Distributed Events CDK: Chapter 5 TVS: Section 8.3

MODELS OF DISTRIBUTED SYSTEMS

Chapter 5 Distributed Objects and Remote Invocation

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

CHAPTER - 4 REMOTE COMMUNICATION

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Distributed Systems. The main method of distributed object communication is with remote method invocation

COMMUNICATION IN DISTRIBUTED SYSTEMS

Distributed Information Systems

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

Slides for Chapter 5: Remote Invocation

Structured communication (Remote invocation)

Today: Distributed Objects. Distributed Objects

Last Class: RPCs. Today:

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

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

Remote Invocation. Today. Next time. l Indirect communication. l Request-reply, RPC, RMI

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

5 Distributed Objects: The Java Approach

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

Operating System Support

Distributed Middleware. Distributed Objects

Distributed Information Processing

Object-Oriented Distributed Technology

Communication Paradigms

Communication. Distributed Systems Santa Clara University 2016

Remote Invocation. To do. Request-reply, RPC, RMI. q Today q. q Next time: Indirect communication

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Today: Distributed Middleware. Middleware

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

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

Chapter 5 Remote Invocation. Gandeva Bayu Satrya, ST., MT. Telematics Labz. Informatics Department Telkom

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

Lecture 15: Network File Systems

Java RMI Middleware Project

3. Remote Procedure Call

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

Object-based distributed systems. INF 5040/9040 autumn Lecturer: Frank Eliassen

Distributed Object-Based Systems The WWW Architecture Web Services Handout 11 Part(a) EECS 591 Farnam Jahanian University of Michigan.

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

Networked Systems and Services, Fall 2018 Chapter 4. Jussi Kangasharju Markku Kojo Lea Kutvonen

DISTRIBUTED COMPUTER SYSTEMS

RPC and RMI. 2501ICT Nathan

Distributed Objects. Object-Oriented Application Development

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

DS 2009: middleware. David Evans

Module 3 - Distributed Objects & Remote Invocation

A Report on RMI and RPC Submitted by Sudharshan Reddy B

CSci Introduction to Distributed Systems. Communication: RPC

Chapter 4 Communication

Electronic Payment Systems (1) E-cash

Remote Objects and RMI


CS 5523 Operating Systems: Remote Objects and RMI

Remote Invocation Vladimir Vlassov and Johan Montelius

Unit 7: RPC and Indirect Communication

Chapter 10 DISTRIBUTED OBJECT-BASED SYSTEMS

Interprocess Communication

Programming with RMI Reminder

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

Distributed Systems Principles and Paradigms

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Distributed Technologies - overview & GIPSY Communication Procedure

Networks and Operating Systems Chapter 3: Remote Procedure Call (RPC)

416 Distributed Systems. RPC Day 2 Jan 11, 2017

JAVA RMI. Remote Method Invocation

Distributed Systems Recitation 3. Tamim Jabban

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

CS153: Communication. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

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

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

CORBA (Common Object Request Broker Architecture)

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

416 Distributed Systems. RPC Day 2 Jan 12, 2018

Last Class: RPCs. Today:

5.4. Events and notifications

Distributed Systems 8. Remote Procedure Calls

Advanced Topics in Operating Systems

Modulo II Socket, RMI e Corba

Process. Program Vs. process. During execution, the process may be in one of the following states

Q.1. (a) [4 marks] List and briefly explain four reasons why resource sharing is beneficial.

Object-based Distributed Systems

KTH ROYAL INSTITUTE OF TECHNOLOGY. Remote Invocation. Vladimir Vlassov and Johan Montelius

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

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

Distributed Systems Middleware

Verteilte Systeme (Distributed Systems)

Overview. Distributed Systems. Distributed Software Architecture Using Middleware. Components of a system are not always held on the same host

Today CSCI Remote Method Invocation (RMI) Distributed Objects

Transcription:

06-06798 Distributed Systems Lecture 5: Object Interaction: RMI and RPC Distributed Systems 1

Recap Message passing: send, receive synchronous versus asynchronous No global Time types of failure socket abstraction: Internet address + port number Java API for sockets: UDP, TCP Distributed Systems 2

Overview Distributed applications programming distributed objects model RMI, invocation semantics RPC events and notifications Products Java RMI, CORBA, DCOM Sun RPC Jini Distributed Systems 3

Middleware layer Here Applications RMI, RPC and events Request-reply protocol External data representation Middleware layers Operating System Distributed Systems 4

Objects object object data implementation of methods interface m1 m2 m3 m4 m5 data implementation of methods Objects = Data (attributes) + Operations (methods) encapsulating Data and Methods State of Objects: value of its attributes Interact via interfaces: define types of arguments and exceptions of methods Distributed Systems 5

The object (local) model Programs: a collection of objects Interfaces the only means to access data, make them remote? Actions via method invocation interaction, chains of invocations may lead to exceptions, specified in interfaces Garbage collection reduced effort, error-free (Java, not C++) Distributed Systems 6

The distributed object model A remote invocation B local C invocation local E invocation local invocation D remote invocation F Objects distributed (client-server models) Extend with Remote object reference Remote interfaces Remote Method Invocation (RMI) Distributed Systems 7

Remote object reference Object references used to access objects which live in processes can be passed as arguments, stored in variables,... Remote object references object identifiers in a distributed system must be unique in space and time error returned if accessing a deleted object can allow relocation (see CORBA case study) Distributed Systems 8

Remote object reference Constructing unique remote object reference IP address, port, interface name time of creation, local object number (new for each object) Use the same as for local object references If used as addresses cannot support relocation (alternative in CORBA) 32 bits 32 bits 32 bits 32 bits Internet address port number time object number interface of remote object Distributed Systems 9

Remote interfaces Specify externally accessed variables and procedures no direct references to variables (no global memory) local interface separate Parameters input, output or both, instead of call by value, call by reference No pointers No constructors Distributed Systems 10

Remote object and its interfaces remote object Data remote interface m1 { implementation m2 m3 of methods local interface m4 m5 m6 CORBA: Interface Definition Language (IDL) Java RMI: as other interfaces, keyword Remote Distributed Systems 11

Handling remote objects Exceptions raised in remote invocation clients need to handle exceptions timeouts in case server crashed or too busy Garbage collection distributed garbage collection may be necessary combined local and distributed collector cf Java reference counting Distributed Systems 12

RMI issues Local invocations executed exactly once Remote invocations via Request-Reply (see DoOperation) may suffer from communication failures! retransmission of request/reply message duplication, duplication filtering no unique semantics Distributed Systems 13

Invocation semantics summary Fault tolerance measures Invocation semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Not applicable Not applicable Maybe Yes No Re-execute procedure At-least-once Yes Yes Retransmit reply At-most-once Re-executing a method sometimes dangerous... Distributed Systems 14

Implementation of RMI object A client proxy for B Request server skeleton & dispatcher for B s class remote object B Reply Remote Communication reference module module Communication module Remote reference module Object A invokes a method in a remote object B: communication module, remote reference module, RMI software. Distributed Systems 15

Communication modules Reside in client and server Carry out Request-Reply jointly use unique message ids (new integer for each message) implement given RMI semantics Server s communication module selects dispatcher within RMI software converts remote object reference to local Distributed Systems 16

Remote reference module Creates remote object references and proxies Translates remote to local references (object table): correspondence between remote and local object references (proxies) Directs requests to proxy (if exists) Called by RMI software when marshalling/unmarshalling Distributed Systems 17

RMI software architecture Proxy behaves like local object to client forwards requests to remote object Dispatcher receives request selects method and passes on request to skeleton Skeleton implements methods in remote interface unmarshals data, invokes remote object waits for result, marshals it and returns reply Distributed Systems 18

The binder Binding and activation mapping from textual names to remote object references used by clients as a look-up service (cf Java RMIregistry) Activation objects active (within running process) and passive (=implementation of methods + marshalled state) activation = create new instance of class + initialise from stored state Activator records location of passive and active objects starts server processes and activates objects within them Distributed Systems 19

Object location issues Persistent object stores stored on disk, state in marshalled form readily available cf Persistent Java Object migration need to use remote object reference and address Location service assists in locating objects maps remote object references to probable locations Distributed Systems 20

Remote Procedure Call (RPC) RPC historically first, now little used over Request-Reply protocol usually at-least-once or at-most-once semantics can be seen as a restricted form of RMI cf Sun RPC RPC software architecture similar to RMI (communication, dispatcher and stub in place of proxy/skeleton) Distributed Systems 21

RPC client and server client process server process Request client program client stub procedure Communication module Reply server stub procedure Communication module dispatcher service procedure Implemented over Request-Reply protocol. Distributed Systems 22

Summary Distributed object model capabilities for handling remote objects (remote references, etc) RMI: maybe, at-least-once, at-most-once semantics RMI implementation, software architecture Other distributed programming paradigms RPC, restricted form of RMI, less often used Distributed Systems 23