Remote procedure call

From Infogalactic: the planetary knowledge core
Jump to: navigation, search


In computer science, a remote procedure call (RPC) is client/server system in which a computer program causes a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction.[1] That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. When the software in question uses object-oriented principles, RPC might be called remote invocation or remote method invocation (RMI).

Many different (often incompatible) technologies have been used to implement the concept.

History and origins

Remote procedure calls used in modern operating systems trace their roots back to the RC 4000 multiprogramming system,[2] which used a request-response communication protocol for process synchronization.[3] The idea of treating network operations as remote procedure calls goes back at least to the 1970s in early ARPANET documents.[4] In 1978, Per Brinch Hansen proposed Distributed Processes, a language for distributed computing based on "external requests" consisting of procedure calls between processes.[5] Bruce Jay Nelson is generally credited with coining the term "remote procedure call."[6][7][8] One of the first business uses of RPC was by Xerox under the name "Courier" in 1981. The first popular implementation of RPC on Unix was Sun's RPC (now called ONC RPC), used as the basis for Network File System.

Message passing

RPC is a kind of request–response protocol. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.

An important difference between remote procedure calls and local calls is that remote calls can fail because of unpredictable network problems. Also, callers generally must deal with such failures without knowing whether the remote procedure was actually invoked. Idempotent procedures (those that have no additional effects if called more than once) are easily handled, but enough difficulties remain that code to call remote procedures is often confined to carefully written low-level subsystems.

Sequence of events during an RPC

  1. The client calls the client stub. The call is a local procedure call, with parameters pushed on to the stack in the normal way.
  2. The client stub packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling.
  3. The client's local operating system sends the message from the client machine to the server machine.
  4. The local operating system on the server machine passes the incoming packets to the server stub.
  5. The server stub unpacks the parameters from the message. Unpacking the parameters is called unmarshalling.
  6. Finally, the server stub calls the server procedure. The reply traces the same steps in the reverse direction.

Standard contact mechanisms

To let different clients access servers, a number of standardized RPC systems have been created. Most of these use an interface description language (IDL) to let various platforms call the RPC. The IDL files can then be used to generate code to interface between the client and servers.

Other RPC analogues

The RPC paradigm was invented by Sun Microsystems with their implementation, now known as the Open Network Computing Remote Procedure Call. Other RPC analogues and implementations can now be found elsewhere:

  • D-Bus open source IPC program provides similar function to CORBA.
  • Java's Java Remote Method Invocation (Java RMI) API provides similar functionality to standard Unix RPC methods.
  • SORCER provides the API and exertion-oriented language (EOL) for a federated method invocation
  • Modula-3's network objects, which were the basis for Java's RMI[9]
  • XML-RPC is an RPC protocol that uses XML to encode its calls and HTTP as a transport mechanism.
  • JSON-RPC is an RPC protocol that uses JSON-encoded messages
  • JSON-WSP is an RPC protocol that uses JSON-encoded messages
  • SOAP is a successor of XML-RPC and also uses XML to encode its HTTP-based calls.
  • RPyC implements RPC mechanisms in Python, with support for asynchronous calls.
  • Spyne defines primitives for doing RPC in Python. It also contains implementations of some of the most popular protocols and transports.[10]
  • Pyro object-oriented form of RPC for Python.
  • ZeroC's Internet Communications Engine (Ice) distributed computing platform.
  • Delta V Software's Remote Call Framework[11]
  • Etch framework for building network services.
  • Apache Thrift protocol and framework.
  • BERT-RPC is an RPC protocol in use by Github [12][13]
  • CORBA provides remote procedure invocation through an intermediate layer called the object request broker.
  • Distributed Ruby (DRb) allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes.
  • Action Message Format (AMF) allows Adobe Flex applications to communicate with back-ends or other applications that support AMF.
  • Libevent provides a framework for creating RPC servers and clients.[14]
  • Windows Communication Foundation is an application programming interface in the .NET framework for building connected, service-oriented applications.
  • Microsoft .NET Remoting offers RPC facilities for distributed systems implemented on the Windows platform. It has been superseded by WCF.
  • The Microsoft DCOM uses MSRPC which is based on DCE/RPC
  • The Open Software Foundation DCE/RPC Distributed Computing Environment (also implemented by Microsoft).
  • Google Protocol Buffers (protobufs) package includes an interface definition language used for its RPC protocols.[15]
  • Google Web Toolkit uses an asynchronous RPC to communicate to the server service.[16]
  • Apache Avro provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.
  • Spike-Engine provides cross platform RPC facilities for .NET framework, web and mobile architectures with auto-generated stubs.
  • Twitter Finagle is a network stack for the JVM that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any JVM-hosted language.
  • SAP Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. RFC calls a function to be executed in a remote system.
  • Elixir (programming language) builds on top of the Erlang VM and allows process communication (Elixir/Erlang processess, not OS processes) of the same network out-of-the-box via Agents and message passing.

See also

Notes

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found. PhD thesis.
  9. The A-Z of Programming Languages: Modula-3 - a-z of programming languages. Computerworld. Retrieved on 2013-07-17.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. libevent: Main Page. Monkey.org. Retrieved on 2013-07-17.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.

External links