Text extensions to slides © David E. Bakken,

Slides:



Advertisements
Similar presentations
DISTRIBUTED OBJECTS AND REMOTE INVOCATION
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.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 4: Interprocess.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Exercises for Chapter 4: Interprocess 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.
Slides for Chapter 5: Communication between distributed objects
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
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.
Chapter 4: Interprocess Communication‏ Pages
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.
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.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Slides for Chapter 5: Distributed objects and remote invocation From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition.
1 Distribuerede systemer og sikkerhed – 28. februar 2002 From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
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.
Slides for Chapter 5: Remove Invocation From Coulouris, Dollimore, Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Kindberg andBlair.
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.
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
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Chapter 5 Remote Procedure Call
CSE 486/586 Distributed Systems Remote Procedure Call
Edition 5, © Addison-Wesley 2012
Distributed Systems Course Topics in distributed objects
Programming Models for Distributed Application
Text extensions to slides © David E. Bakken,
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
Slides for Chapter 5: Distributed objects and remote invocation
Text extensions to slides © David E. Bakken,
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
Text extensions to slides © David E. Bakken,
Remote invocation (call)
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:

Text extensions to slides © David E. Bakken, 2012-2018 Slides for Chapter 5: Remote Invocation From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Text extensions to slides © David E. Bakken, 2012-2018

Remote Procedure Call (RPC) Remove Method Invocation (RMI) Introduction [5.1] This chapter: how processes/objects/components/services communication via remote invocation (Chap 2) Request-reply Small/thin pattern on top of message passing Can use directly in app (“app protocols”), or build RPC/RMI on Remote Procedure Call (RPC) Make a remote procedure look (almost) like a local one to call Remove Method Invocation (RMI) Make a remote object look (almost) like a local one to invoke Note: ‘RMI’ is generic category, Java RMI is a specific instance © 2012-2018David E. Bakken

Figure 5.1 Middleware layers Applications This chapter Remote invocation, indirect communication (and Chapter 6) Middleware Underlying interprocess communication primitives: layers Sockets, message passing, multicast support, overlay networks UDP and TCP Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Request-reply protocols [5.2] Support low-level client-server interactions Usually synchronous and reliable Built on top of send and receive operations from Chapter 4 Usually use UDP datagrams, could use TCP streams Three primitives doOperation: client sends request message to server getRequest: server receives request msg, selects+invokes oper. sendReply: server sends reply message back to (blocked) client © 2012-2018David E. Bakken

Figure 5.2 Request-reply communication Client Server Request doOperation message getRequest select object (wait) execute method Reply message sendReply (continuation) Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 5.3 Operations of the request-reply protocol public byte[] doOperation (RemoteRef s, int operationId, byte[] arguments) sends a request message to the remote server and returns the reply. The arguments specify the remote server, the operation to be invoked and the arguments of that operation. public byte[] getRequest (); acquires a client request via the server port. public void sendReply (byte[] reply, InetAddress clientHost, int clientPort); sends the reply message reply to the client at its Internet address and port. Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Figure 5.4 Request-reply message structure messageType requestId remoteReference operationId arguments int (0=Request, 1= Reply) int RemoteRef int or Operation array of bytes Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Request-reply protocols (cont.) Message identifiers: must identify request uniquely requestId: usually a sequence counter (makes unique at client) Client/sender identifier endpoint (with requestId, globally unique) Failure model Over UDP: omission, misordering Over UDP or TCP: server crash failure (later, Byzantine…) Timeouts: doOperation uses when blocked for reply Options to use? Duplicate request msgs: server may get >1 times how? problem? Soln: server tracks what got from client (how?) © 2012-2018David E. Bakken

Request-reply protocols (cont.) Lost reply messages Idempotent operation: just redo Else store reply history (how many? How to use?) Q: should client and/or server ACK messages? © 2012-2018David E. Bakken

Figure 5.5 RPC exchange protocols Name Messages sent by Client Server Client R Request R R Request Reply R R A Request Reply Acknowledge reply Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Using TPC streams to implement request-reply protocol Advantages Never need multi-packet protocols “Reliable” Disadvantages More CPU intensive: scale © 2012-2018David E. Bakken

HTTP RR protocol SUMMARY (Read rest on in CDKB5 text) HTTP protocol specifies Messages in RR exchange Methods Arguments Results Marshalling rules Content negotiation Authentication Implemented over TCP streams Early versions: new connection for each request (later persistent) Zinky(Akamki): http3 will replace virtually all current TCP+UCP Request & reply msgs marshalled into ASCII Resource data can be represented as a byte sequence © 2012-2018David E. Bakken

Remote procedure call [5.3] Design issues Style of programming promoted by RPC: using interfaces Call semantics Transparency © 2012-2018David E. Bakken

Programming with interfaces Explicit interface Hide a lot of implementation details Tell exactly how a client can access the server Keeping implementation separate from interface Good idea? Why? Differences from local procedure interface Can’t access shared memory variables between client and server Call by reference does not make sense for RPC Parameters are in, out, or inout Can’t pass pointers Anything else? IDL originally developed for RPC © 2012-2018David E. Bakken

Figure 5.8 CORBA IDL example // In file Person.idl struct Person { string name; string place; long year; } ; interface PersonList { readonly attribute string listname; void addPerson(in Person p) ; void getPerson(in string name, out Person p); long number(); }; Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Choices for implementing doOperation RPC call semantics Choices for implementing doOperation Retry request message Duplicate request filtering at server Retransmission of results: keep reply history, or re-execute procedure © 2012-2018David E. Bakken

How can each of these happen? Figure 5.9 Call semantics Fault tolerance measures Call semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Yes Not applicable Retransmit reply At-most-once At-least-once Maybe How can each of these happen? What would you call local procedure call semantics? Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

RPC tries to offer at least location and access transparency Does client need to know call semantics? Implement RPC with stub/proxy over an RR protocol (Fig 5.10) Note: not covering Sun RPC (5.3.3), not testable © 2012-2018David E. Bakken

Figure 5.10 Role of client and server stub procedures in RPC Request Reply Communication module dispatcher service client stub server stub procedure client process server process program Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Remote method invocation [5.4] Fundamental difference between a procedure and an obj.? Similarities between RPC and RMI Programming with interfaces Both constructed on top of some RR protocol and have same choices in call semantics Similar level of transparency Differences providing added expressiveness in RMI Full expressive power of OO programming (not just a “fad”…) Can cleanly pass object references as parameters © 2012-2018David E. Bakken

On Objects and QoS “I have a cat named Trash. In the current political climate, it would seem that if I were trying to sell him (at least to a Computer Scientist), I would not stress that he is gentle to humans and is self-sufficient, living mostly on field mice. Rather, I would argue that he is object- oriented.” Prof. Roger King, U. Colorado at Boulder, 1989 “My cat is CORBA-compliant”. Dr. John Nicol, GTE Labs, 1995 “My CORBA-compliant cat has great quality of service.” Dr. David Bakken, BBN, 1996 “The DCOM architecture is fundamentally ugly and unclean, at a profound and deeply- disturbing level.” Dr. David Bakken, BBN, 1998 © 2012-2018David E. Bakken

Design issues for RMI: object model! Local object model (C++, Java, …) Collection/packaging of code and data Communicate by invoking methods Sometimes allowed to invoke instance variables directly Object references are first-class values: assigned to variables, passed as parameters, … Interfaces:impl sometimes 1:1 (C++), or many:1 (Java class can implement multiple interfaces) Action: invocation can have side effects at invoked object: state changed, instantiate new object, invoked object invokes another… Exceptions Garbage collection (manual or automatic) © 2012-2018David E. Bakken

Distributed objects and distribited object models Most ways similar/identical to local object model Client-server architecture (encapsulation), with variations Replication Migration Distributed object model (Fig 5.12) Process is a collection of objects (some remotely invoke-able) Remote object references: need one to invoke a remote object Remote interfaces: each object must have one © 2012-2018David E. Bakken

Figure 5.12 Remote and local method invocations B C D E F Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Remote object references and remote interfaces ID that can be used throughout a DS Strongly analogous to local object references Remote interfaces A class implements one or more remote interfaces (Fig 5.13) CORBA: see previous, uses IDL Java RMI: just like any other Java interface (extends it) Multiple inheritance of interfaces in both CORBA and Java © 2012-2018David E. Bakken

Figure 5.13 A remote object and its remote interface Data implementation object { of methods Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Actions in a distributed object system Can result in chain of invocations across computers Can instantiate new objects Usually local Or via a factory interface Garbage collection Harder than local garbage collection (why?) Local GC and distributed GC module cooperate (using ref. counts) Exceptions: Similar to local But more for remote problems Also can have app-level exceptions (e.g., CORBA cross-language) © 2012-2018David E. Bakken

Figure 5.14 Instantiation of remote objects Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Communication modules: cooperate to implement the call semantics Implementation of RMI (See Fig 5.15) Communication modules: cooperate to implement the call semantics Remove reference modeue Translate between local and remote object references Create remote object references Servant: instance of a class, body of remote object RMI software Proxy: provide transparency Dispatcher & Skeleton: one per class of a remote object © 2012-2018David E. Bakken

Figure 5.15 The role of proxy and skeleton in remote method invocation Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Implementation of RMI (cont.) Dynamic invocation Don’t use a compiler-generatated proxy (doOperation body), program one! Useful when IDL not available when compiling program CORBA Interface Repository Examples: debugger, class browser, shared whiteboard Dynamic skeletons: server side analogue Binder: mapping from text names to remote obj. refs Activator: manages object activation and passivation Registers passive objects available for activation Start named server processes (incl. remote object in them) Keep track of servers for activated remote objects

Implementation of RMI (cont.) Persistent object stores Persistent object: one guaranteed to live between activations Managed by a persistent object store Marshalled state in file or database Object location Objects can migrate! Location service: maps from object references to probable current locations

Distributed garbage collection Job: recycle objects no longer “pointed to” by a reference Typical scheme Use reference counting Local garbage collector Distributed garbage collector (cooperates with locals) Algorithm Each server tracks names of processes that have references to its remote object If local GC notices proxy not reachable, lets GC on object host know When no references to object, recycle it Complications: ref in msg

Client has “lease” of object for fixed time Leases Used in Java, Jini Client has “lease” of object for fixed time Has to renew it before expiration Way of removing un-freed refs Avoids the complicated distributed GC algorithm Note: not covering Section 5.5 (Case Study: Java RMI)