Presented by: Sriram Gopal

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

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)
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
RPC Robert Grimm New York University Remote Procedure Calls.
RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
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.
Fast Communication Firefly RPC Lightweight RPC  CS 614  Tuesday March 13, 2001  Jeff Hoy.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Implementing Remote Procedure Calls Authored by: Andrew D. Birrel and Bruce Jay Nelson Presented by: Terry, Jae, Denny.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
Introduction to Remote Method Invocation (RMI)
Remote Procedure Calls (RPC) - Swati Agarwal. RPC – an overview Request / reply mechanism Procedure call – disjoint address space clientserver computation.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Communication in Distributed Systems –Part 2
Implementing Remote Procedure Calls ANDREW D. BIRRELL and BRUCE JAY NELSON Presented by Tony Bock.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
09/14/05 1 Implementing Remote Procedure Calls* Birrell, A. D. and Nelson, B. J. Presented by Emil Constantinescu *ACM Trans. Comput. Syst. 2, 1 (Feb.
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Implementing Remote Procedure Calls Andrew D. Birrell and Bruce Jay Nelson 1894 Xerox Palo Alto Research Center EECS 582 – W16.
Implementing Remote Procedure Calls Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Published: ACM Transactions on Computer Systems,
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Java Distributed Computing
Chapter 4 Remote Method Invocation
Java Distributed Object System
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
Java Distributed Computing
CSE 486/586 Distributed Systems Remote Procedure Call
Java RMI CS-328 Internet Programming.
What is RMI? Remote Method Invocation
Implementing RPC by Birrell & Nelson
Remote Method Invocation
Knowledge Byte In this section, you will learn about:
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
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
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
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
CS-502, Operating Systems Fall 2009 (EMC)
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Java Remote Method Invocation
Lecture 7: RPC (exercises/questions)
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Presented by: Sriram Gopal CS5204 “Implementing Remote Procedure Calls” by Andrew Birrell & Bruce Nelson Presented by: Sriram Gopal

Outline Motivation Idea of RPC Design Issues Basic RPC Implementation Discussion on Existing Systems Conclusions

Motivation Networks have changed the way computers are used Distributed programming is hard Partial Failure Latency Memory Access Natural multi-threading Sockets Interface [Connect] -> [ Read/Write ] -> [Disconnect] Not the way we generally program Q: Can we make distributed computing resemble traditional (centralized) computing?

Hiding Distribution: The idea of RPC A mechanism for transferring control and data Principle: “Remote calls should resemble local calls” Advantages: Simple Semantics Efficiency Generality Location Transparency [Fig. Source: Tanenbaum & Van Steen, “Distributed Systems: Principles and Paradigms”]

Design Issues Marshaling Calling Semantics Interface Definition Binding Transport Protocol Exception Handling Security Integration into existing & future systems

Plausible Alternatives Message passing Dual of Procedure calls (Lauer & Needham, 1978) Remote fork Involves similar design issues Emulation of shared address space Integration into languages may not be feasible Acceptable efficiency may not be achieved

RPC Architecture [Source: Tanenbaum & Van Steen, “Distributed Systems: Principles and Paradigms”]

Marshaling Multiple machine types => Multiple data representations Marshaling: Process of converting data items into a standard data representation Examples of standard formats ASN.1/BER XDR [Fig. Source: Tanenbaum & Van Steen, “Distributed Systems: Principles and Paradigms”]

Calling Semantics Parameter passing in the absence of shared address space Types Call-by-value Call-by-reference Addresses do not make sense Q: How are pointers/references passed? 1) Forbid pointers/references 2) Copy the referenced data and recreate on server 3) (2) + Copy back after the call returns Q: How to handle aliases? “…although we can now handle pointers to simple arrays and structures, we still cannot handle the most general case of a pointer to an arbitrary data structure such as a complex graph…” - Tanenbaum & Van Steen, “Distributed Systems: Principles and Paradigms”

Interface Definition Interface: Contract between the caller & the callee Procedure names Type of arguments & results Enables independent compile-time type checking Specified using IDL (Mesa interface modules) Same Language Vs Different Language IDL Compiler (Lupine) Generates Client- & Server-stub from interface definitions Checks for arguments/results incompatible with lack of shared address space

Binding Process of connecting an importer to an exporter of an interface Aspects: Naming (Type & Instance) Refers to the service the client intends to use Locating Finding the transport address of the server

Binding Scenario

More on Binding… Features Choices of Binding Access control Fail-over Resilience against importer crashes Importing an interface has no effect on exporter’s data structures Resilience against exporter crashes/restarts Unique ID scheme ensures implicit breaking of connections Security Only explicitly exported procedures could be called Enables enforcing protection schemes Choices of Binding Static binding (Compile time) Dynamic binding (Runtime) Access control Fail-over

Transport Protocol - Requirements Generic Transport protocols Maintain large state information Involve Connection establishment overhead Suitable for bulk-data transfer (overhead <<< data-transfer cost) Transport protocol for RPC should Consider small but frequent data-transfer Minimize load on server Minimize elapsed time between call and return

Transport Protocol for RPC Behavior Call returns => Procedure invoked precisely once Otherwise => Invoked once/not at all Abort only on failure, not if server deadlocks or loops Issues Matching results with calls Eliminating duplicate packets

Transport Protocol for RPC (Contd.) Call Identifier Callee maintains Table of last call IDs received Caller maintains Machine-wide counter Sender retransmits until ACKed No pinging when Idle Connection Establishment Packet reception from an unknown activity Connection Termination Time-out on idle connection Machine ID Process ID Sequence # Activity

Simple Call Arguments/Results fit in a single packet Frequent calls Result of a call serves as ACK for the caller Subsequent call serves as ACK for the callee

Complicated Call Retransmissions request explicit ACK Long duration calls Probe packets sent periodically & ACKed by callee Long argument calls Sent as multiple packets All but last packet request ACK (Simple flow-control strategy) Call-relative identifier to detect duplicates Alternative retransmission strategy – ACK if next packet will take time

Complicated Call

Exception Handling Imitate exceptions in local calls Special packets to send exceptions defined in the interface Call Failed Exception Communication failure Difficulty (Ex. Server crash)

Processes Problem Solution Process creation & swaps can be expensive Maintain a pool of idle server processes Include source & destination process id in packets - Handing over the paccets to the same server process, which will be waiting for ACK

Optimizations No cost for connection establishment / termination Piggybacking of ACK Reduction in # of context switches Bypassing of protocol layers

About the Paper A seminal paper on RPC (Cited by 1263) Demonstrates RPC’s simplicity, efficiency, power & support for security Simple & sticks to the principle of making remote calls resemble local calls For instance, no time-out mechanism for calls Comments Calling semantics restricted to call-by-value Caller unaware of location/cause of failure Unaddressed issues like interoperability Not fully applicable in the context of Object-based systems

Some Existing Implementations Java RMI CORBA XML-RPC/ SOAP DCE RPC SUN RPC

Case(1): Java RMI RPC Vs RMI “…RPC[, however] does not translate well into distributed object systems where communication between program-level objects residing in different address spaces is needed. In order to match the semantics of object invocation, distributed object systems require remote method invocation or RMI…” -Wollrath et al., “A Distributed Object Model for JavaTM System”, USENIX ‘96

1. Marshalling Serialization Class Versioning Process of converting object instances with references to each other into a linear stream of bytes Involves traversal of the object graph Objects should implement java.rmi.Serializable interface Static & Transient fields are NOT serialized Class Versioning Q: What if an object is serialized using class v.1 & de-serialized using class v.2?

1. Marshalling Serialization Class Versioning Process of converting object instances with references to each other into a linear stream of bytes Involves traversal of the object graph Objects should implement java.io.Serializable interface Static & Transient fields are NOT serialized Class Versioning Q: What if an object is serialized using class v.1 & de-serialized using class v.2? serialVersionUID generated for each class De-serialization checks serialVersionUID of the object and its class Exception thrown if unequal Alternative: Specify one yourself

2. Calling Semantics Parameters Calling semantics Non-remote objects All argument reachable data are serialized Remote objects Replaced with stubs during serialization Calling semantics Call-by-copy/value Call-by-copy-restore Referential Integrity Multiple references (args.) to same object preserved in parameter passing Class Annotation Class descriptor annotated with URL of the class ( annotateClass() and resolveClass() ) Resolving references – Inheritence – implements Remote Class downloading – works due to byte codes in JVM

3. Interface Definitions Interfaces defined in Java Interface definition public interface IRetrieval extends Remote{ String getData() throws RemoteException; } RMI Compiler (RMIC) Generates stubs, skeletons, and ties for remote objects rmic [options] package-qualified-class-name(s)

4. Binding rmiregistry (default port:1099) Import: Naming Service to register remote objects Export: Java.rmi.Naming.bind(“//test.com/object”, ref); Import: myObject obj = (myObject) Naming.lookup(“//test.com/object”);

5. Protocols Homogeneous environment of JVMs JRMP over TCP/IP Heterogeneous, multi-language environment IIOP over TCP/IP RMI-IIOP A marriage of RMI & CORBA RMI-JRMP Vs RMI-IIOP Ease of programming Vs Interoperability Reason for using the generic TCP as opposed to a specialized transport protocol as proposed in paper? [Figure Source: www.javaworld.com/jw-12-1999/jw-12-iiop.html]

6. Processes & Exception Handling Follows instance-per-call (threads) style connections Stateless (a desirable property in DS) Main process remains active listening for requests Exception Handling Throws exceptions exposing the reason/location Exception handling semantics for Futures can be tricky

Case(2): MS-RPC Architecture [Source: Microsoft Windows Server Tech Center]

Case(3): CORBA Architecture Provides Interoperability (Language & platform neutral) Supports dynamic invocations [Source: "Distributed Object Computing with CORBA”, http://www.cs.wustl.edu/~schmidt/corba-overview.html]

RPC Pitfalls Failure Performance Need to deal with different modes Ex: User program bug, kernel crash, catastrophic failure etc. Performance “RPC is cheap but not free”

RPC Pitfalls Failure Performance Questions/ Comments Need to deal with different modes Ex: User program bug, kernel crash, catastrophic failure etc. Performance “RPC is cheap but not free” Questions/ Comments