Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

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.
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.
Distributed Systems Lecture #3: Remote Communication.
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)
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
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.
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
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.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
Lecture 5: RPC and Distributed Objects Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
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,
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
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
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.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
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.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
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
Distributed Systems CS
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
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Distribution Infrastructures
Lecture 6: RPC (exercises/questions)
Remote invocation (call)
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Distributed Systems CS
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Object Interaction: RMI and RPC 1

Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products - Java RMI,CORBA,DCOM - Sun RPC - JINI

Why Middleware? 3 Location transparency - client/server need not know their location Sits on top of OS, independent of: - communication protocols: use abstract request-reply protocols over UDP,TCP - computer hardware: use external data representation e.g. CORBA CDR - operating system: use e.g. socket abstraction available in most systems - programming language: e.g. CORBA supports Java, C++

Middleware Layer 4 Applications Request-reply protocol External data representation RMI, RPC and events Operating System Middleware layer

Objects 5 Objects = data + methods Interact via interfaces: - define types of arguments and exceptions of methods Data Implementation of methods object Data Implementation of methods object interface m1 m2 m3 m4 m5

The object model 6 Programs logically partitioned into objects - distributing objects natural and easy Interfaces - the only means to access data, make them remote? Actions - via method invocation -interaction, chains of invocations -may lead to exceptions, part of interface

--exceptions system as well as programmer-defined reactions on unexpected or error situations -Garbage collection -disposal of resources (memory) that are occupied by objects that are no longer referenced and will not be needed any more in the future - reduced effort, error-free (Java, not C++)

The distributed object model 9 Objects distributed (client-server models) Extend with - Remote object reference - Remote interfaces - Remote method invocation (RMI) A B C D E REMOTE INVOCATION LOCAL INVOCATION LOCAL INVOCATION LOCAL INVOCATION F REMOTE INVOCATION

Advantages of distributed objects 11 Data encapsulation gives better protection - concurrent processes, interference Method invocations - can be remote or local Objects - can act as clients, servers, etc - can be replicated for fault-tolerance and performance

Remote Object Reference 12 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

Remote Object Reference 13 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 Interface of remote object Object number timePort numberInternet address 32 bit 32 bit 32 bit 32 bit

Remote Object and its interfaces 14 CORBA: Interface Definition Language (IDL) Java RMI: as other interfaces, keyword remote m1 m2 m3 Data Implementation Of method Remote object m4 m5 m6 Local interface Remote interface

 if implemented over UDP, then the following failures may occur: – message omission – messages not delivered in send order – message duplication  additionally, process failures are possible (crash)  consequence: cannot be guaranteed, that remote operations are executed exactly once (as it can be guaranteed for local operations)

RMI issues 16 Local invocations -executed exactly once Remote invocations - via Request-Reply - may suffer from communication failures! retransmission of request/reply message duplication, duplication filtering

Invocation semantics summary 17 Fault tolerance measures Invocation semantics Retransmit request Duplicate Re-execute procedure message filtering 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...

Invocation Semantics choices in the implementation – retransmit request message until reply or server presumed failed – filtering of duplicates at server if retransmit is used – when retransmitted request arrives: 1. result retransmission if retransmitted request arrives (requires keeping of history at server) or 2.repeated execution of procedure  leads to different invocation semantics

Maybe invocation 19 Remote method - may execute or not at all, invoker cannot tell - useful only if occasional failures Invocation message lost… - method not executed Result not received… - was method executed or not? Server crash… - before or after method executed? - if timeout, result could be received after timeout...

At-least-once invocation 20 Remote method - invoker receives result (executed exactly) or exception (no result, executed once or not at all) - retransmission of request message Invocation message retransmitted… - method may be executed more than once - arbitrary failure (wrong result possible) - method must be non-indempotent(repeated execution has the same effect as a single execution) Server crash… - dealt with timeouts, exceptions

At-most-once invocation 21 Remote method - invoker receives result (executed once) or exception (no result) - retransmission of reply & request messages - duplicate filtering Best fault-tolerance… - arbitrary failures prevented if method called at most once Used by CORBA and Java RMI

Implementation of RMI 22 Skeleton &dispatcher for B’s class Client object A proxy for B Request Reply Remote object B Remote reference module Communication module Communication module Remote reference module Server Object A invokes a method in a remote object B: communication module reference module,RMI software.

Communication modules 23

Remote reference module 24 Translates remote to local references (object table): – correspondence between remote and local object references (proxies) Directs requests to proxy (if exists) when marshalling / un marshalling

RMI Software architecture 25 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

Remote Procedure Call (RPC) 26 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 –sun RPC RPC software architecture – similar to RMI (communication,dispatcher and stub in place of proxy / skeleton)

RPC client and server 27 Client process Client stub procedure Client program Communication module Request Reply Communication module dispatcher Service procedure Server stub procedure Server process Implemented over Request-Reply protocol

Remote Procedure Call (cont.) Client procedure calls the client stub in a normal way Client stub builds a message and traps to the kernel Kernel sends the message to remote kernel Remote kernel gives the message to server stub Server stub unpacks parameters and calls the server Server computes results and returns it to server stub Server stub packs results in a message and traps to kernel Remote kernel sends message to client kernel Client kernel gives message to client stub Client stub unpacks results and returns to client

Summary 30 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 – event notification (for heterogeneous,asynchronous systems)