Slides for Chapter 5: Remove Invocation From Coulouris, Dollimore, Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Kindberg andBlair.

Slides:



Advertisements
Similar presentations
COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
Advertisements

DISTRIBUTED OBJECTS AND REMOTE INVOCATION
RPC Robert Grimm New York University Remote Procedure Calls.
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.
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
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
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
.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.
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.
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.
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.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
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.
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?
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.
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.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
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
Edition 5, © Addison-Wesley 2012
Distributed Systems Course Topics in distributed objects
Programming Models for Distributed Application
Text extensions to slides © David E. Bakken,
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
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
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)
Text extensions to slides © David E. Bakken,
Presentation transcript:

Slides for Chapter 5: Remove Invocation From Coulouris, Dollimore, Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Kindberg andBlair

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

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

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

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

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 The arguments specify the remote server, the the arguments of that operation. and returns the reply. operationtobeinvokedand public byte[] getRequest (); acquires a client request via the server port. public void sendReply (byte[] reply, InetAddress clientHost, intclientPort); 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 messagestructure int (0=Request,1=Reply) RemoteRef int or array Operation of bytes Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012 messageType requestId remoteReference operationId arguments

Request-reply protocols (cont.) Message identifiers: must identify request uniquely requestId : usually a sequence counter (makes unique at Client/sender identifier endpoint (with requestId, globally 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? client) unique) Duplicate request msgs: server may get how? problem? >1 times Soln: server tracks what got from client (how?) 8

Request-reply protocols (cont.) Lost reply messages Idempotent operation: just redo Else store replyhistory (how many? How to use?) Q:shouldclientand/orserverACKACKmessages? 9

Figure 5.5 RPCexchangeprotocols NameMessages sent by Server Client Request Client RRRRRARRRRRAR 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 Advantages Never need multi-packet protocols “Reliable” Disadvantages protocol MoreCPUCPUintensive:scale 11

HTTP RR protocol 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) Request & reply msgs marshalled into ASCII Resource data can be represented as a byte sequence 12

HTTP methods GET(URL,…) : send data from file or program output Can Only add args, e.g. formdata be conditional on modification date of resource grab only parts for idempotent like GET, but of the data requests no return data, just meta-data HEAD : POST(URL,data, …) : Run resource(programusually) that can handle the data Program may change data Uses? on the server 13

HTTP methods (cont.) PUT(URL,data, ….) : store data at URL; idempotent DELETE(URL) : delete resource at the URL; idempotent OPTIONS : tells client allowable methods&requirements TRACE : likepingforforIPIP 14

Figure 5.6 HTTP request messagemessage methodURL or pathnameHTTP versionheadersmessage body Messagebody optional Headers can contain Request modifiers Client info (last modify, Authentication info acceptablecontent types, …) Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012 GET // HTTP/ 1.1/ w.dcs.qmw.ac.uk/index.html

Figure 5.7 HTTPReply message HTTP versionstatuscodereasonheadersmessagebody Status and reason: did the server succeed Header can pass ExtraExtrainfoaboutserveroraccesstoresource(e.g.,challenge) Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012 HTTP/ OK resource data

Remote procedure call [5.3] Design issues Style of programming Call semantics Transparency promotedbyRPC:usinginterfaces 17

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 betweenclientandandserver Call by reference does not make sense Parameters are in, out, or inout Can’t pass pointers forRPC IDL originally developed for RPC 18

Figure 5.8 CORBA IDL example //InfilePerson.idl structPerson{ string name; place; long year; }; interfacePersonList{ readonlyattributestringlistname; void long addPerson(in getPerson(in number(); Person string p); name,outPersonp); }; Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

RPC call semantics Choices for implementing doOperation Retry request message Duplicate request filtering at server Retransmission procedure ofresults:keepreplyhistory,orre-execute 20

Figure 5.9 Callsemantics Call semantics Fault tolerance measures Retransmit request message No Yes Duplicate filtering Not applicable No Re-execute procedure or retransmit reply Not applicable Re-execute procedure Maybe At-least-once Yes Retransmit replyAt-most-once How caneach ofeach ofthesehappen? 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

Transparency RPC tries to offer at least location and access transparency Does client need to know call semantics? Implement 5.10) RPCwithstub/proxyoveranRRprotocol(Fig Note:notcoveringSunSunRPC (5.3.3),nottestable 22

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

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

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. oriented.” Prof. Roger King, U. Colorado at Boulder, 1989 Rather, Iwould argue that heis object- “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,

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: passed as parameters, … Interfaces:impl sometimes 1:1 (C++), or implement multiple interfaces) Action: invocation can have side effects assigned to variables, many:1 (Java class can at invoked object: state changed, instantiate new object, invoked object invokes another… Exceptions Garbage collection (manual or automatic) 26

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 oneto invoke aremoteobject interfaces:eachobjectmusthaveone 27

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

Remote object references and remote interfaces Remote object reference 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 CORBA: see previous, uses IDL Java RMI: just like any other Java interface (extends it) 5.13) MultipleinheritanceofinterfacesinbothCORBAandJava 29

Figure 5.13 Aremoteobjectandanditsremoteinterface remoteobject remote interface { m4 m5 m6 m1 m2 m3 implementation of methods Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012 Data

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

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

Implementation of RMI (See Fig 5.15) Communication modules: cooperate to semantics Remove reference modeue Translate between local and remote object Create remote object references implementthecallcall references Servant: instance of a class, body RMI software Proxy: provide transparency Dispatcher & Skeleton: one per class of remote object of a remote object 33

Figure 5.15 Theroleofproxy andproxy andskeletoninremotemethodinvocation 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 program one! Useful when IDL not available when compiling program CORBA Interface Repository Examples: debugger, class browser, shared whiteboard Dynamic skeletons: server side analogue body), 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 35

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:mapsfromobjectreferencestoprobable currentlocations 36

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

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:JavaRMI) WillcoverrightbeforeChapter8,ifwecover8 38