Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by: Sriram Gopal

Similar presentations


Presentation on theme: "Presented by: Sriram Gopal"— Presentation transcript:

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

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

3 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?

4 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”]

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

6 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

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

8 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”]

9 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”

10 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

11 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

12 Binding Scenario

13 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

14 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

15 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

16 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

17 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

18 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

19 Complicated Call

20 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)

21 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

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

23 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

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

25 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

26 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?

27 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

28 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

29 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)

30 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”);

31 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:

32 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

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

34 Case(3): CORBA Architecture
Provides Interoperability (Language & platform neutral) Supports dynamic invocations [Source: "Distributed Object Computing with CORBA”,

35 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”

36 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


Download ppt "Presented by: Sriram Gopal"

Similar presentations


Ads by Google