Remote procedure call

From Wikipedia, the free encyclopedia - View original article

Jump to: navigation, search

In computer science, a remote procedure call (RPC) is an inter-process communication that allows a computer program to cause 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 is called remote invocation or remote method invocation.

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

History and origins[edit]

The idea of treating network operations as remote procedure calls goes back at least to the 1980s in early ARPANET documents.[2] Bruce Jay Nelson is generally credited with coining the term.[3][4][5] 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[edit]

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[edit]

  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[edit]

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 server.

Other RPC analogues[edit]

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:


Further information: Web service § Styles of use

See also[edit]


  1. ^ Arpaci-Dusseau, Remzi H.; Arpaci-Dusseau, Andrea C. (2014), Introduction to Distributed Systems, Arpaci-Dusseau Books 
  2. ^ Anand M. White (December 23, 1975). "A High-Level Framework for Network-Based Resource Sharing". RFC 707. Augmentation Research Center. Retrieved July 11, 2011. 
  3. ^ "1994 – Andrew Birrell, Bruce Nelson: Remote Procedure Call". Software System Award citation. Association for Computing Machinery. Retrieved July 11, 2011. 
  4. ^ "SIGOPS Hall of Fame Award". Special Interest Group on Operating Systems. Association for Computing Machinery. Retrieved July 11, 2011. 
  5. ^ Bruce Jay Nelson (May 1981). Remote Procedure Call. PARC CSL-81-9 (Also CMU-CS-81-119) (Xerox Palo Alto Research Center).  PhD thesis.
  6. ^ The A-Z of Programming Languages: Modula-3 - a-z of programming languages. Computerworld. Retrieved on 2013-07-17.
  7. ^ "Spyne". Spyne Website. Retrieved Feb 1, 2013. 
  8. ^ "Introducing bert and bert rpc". Github blog. Retrieved July 17, 2012. 
  9. ^ "How we made github fast". Github blog. Retrieved July 17, 2012. 
  10. ^ libevent: Main Page. Retrieved on 2013-07-17.
  11. ^ "Protocol Buffers - Google's data interchange format". Google project website. Retrieved November 1, 2011. 
  12. ^ "Google Web Toolkit". Google project website. Retrieved November 1, 2011. 


This article is based on material taken from the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.

External links[edit]