Remote Procedure calls (or remote method invocations)
- The notion of Remote Procedure Call (RPC) was introduced in the 1980ies. It is like a procedure call, except that the caller and the callee reside in different computers. Therefore the information concerning the procedure call must be passed between these computers in the form of some agreed protocol. Different RPC protocols have been defined and implemented. Such a protocol needs a reliable message transmission medium (for instance TCP or a secure session could be used for this purpose) and must foresee at least two protocol message:
- RPC request: It must include the following information
- identification of the process (or object instance) that should execute the procedure call. Note: The IP address used by the TCP connection identifies already the computer on which the process resides; the part number used by TCP may identify an application process in that computer which understands the RPC protocol; the message should include enough information to identify the process or object instance (within the context of that application) which should perform the requested operation.
- name of the method (procedure) to be called
- values of the input parameters, or pointers to the parameters (which must be valid pointers in the context of the process performing the operation)
- When the procedure is executed, an RPC response message is returned which must include the following information
- result parameter(s) of the operation call
- any exceptional conditions that may have occurred
- While the nature of the information exchanged in an RPC protocol is always similar to what is said above, the way this information is encoded depends very much on the particular protocol. The following RPC protocols are to be mentioned:
- CORBA was designed to realize RPC for object-oriented systems where the software components within the different computers could be written in different languages (language heterogenity). It is based on the standardization effort on Open Distributed Processing (in the early 1990ies) which had the aim of facilitating the interworking between heterogeneous systems and considered that the early system design stages should be transparent to several dimensions, including the physical distribution of the different system functions (see Corba-ODP comparison slide) << On Corba, see for instance the book [Bake 97] S. Baker, CORBA Distributed Objects: Using Orbix, Addison-Wesley, 1997. >>
- CORBA introduced the IDL notation for writing abstract class interfaces which can be automatically translated into equivalent interfaces in the programming language that is used for the implementation of one of the CORBA component implementations.
- CORBA uses a particular RPC protocol, called IIOP.
- In this context, the notion of stub (also called proxy) and skeleton became popular (see also RMI below). Here are some slides: ORB-structure , Stub-and-Skeleton
- CORBA also introduced the directory service which allows a client program to find a globally valid pointer to an object instance which has previously been registered in that directory under a given name (which must be known to the client). Usually, only the first remote object instance will be found through the directory, other object references may be obtained as results from method calls during the execution of a distributed application.
- The term Remote Method Invokation (RMI) was used for the RPC facility included in the Java plateform. See basic tutorial (only the first section "Getting started using RMI" is discussed in the course) << there is also a more advanced tutorial on RMI and a white paper can be found on the "RMI home page" at http://www.oracle.com/technetwork/java/javase/tech/index-jsp-138781.html >>
- For the transfer of object instances that are passed by value (as method call parameters, or in results), the Java RMI protocol uses the object serialization protocol of Java.
- RMI also uses proxies to locally represent the remote service object.
- Note: Java RMI can also be used with the CORBA RPC protocol IIOP, thus building CORBA components using a version of the Java RMI API. << see http://docs.oracle.com/javase/6/docs/technotes/guides/rmi-iiop/index.html >
- SOAP - the Simple Object Access Protocol used for Web Services, is yet another way of defining remote method invokation on objects << see defining document by W3C at http://www.w3.org/TR/SOAP/ >>
- This protocol is based on XML. The called process is identified by an URL and the method call and its parameters are coded in XML like a struct structure, as discussed in the article by D. Carlson above (the name of the method is treated like the name of the struct type, the parameters like the fields of the structure) . The RPC message format foresees a so-called header component which is interpreted and possibly modified by intermediate processes. The body component contains the actual method call information.
Last updated: September 11, 2002 (revised 2003, 2012, 2013, 2016)