HOME

TheInfoList



OR:

In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (
subroutine In computer programming, a function or subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Functions may ...
) to execute in a different
address space In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity. For software programs to save and retrieve st ...
(commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system. In the object-oriented programming paradigm, RPCs are represented by remote method invocation (RMI). The RPC model implies a level of location transparency, namely that calling procedures are largely the same whether they are local or remote, but usually, they are not identical, so local calls can be distinguished from remote calls. Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important. RPCs are a form of
inter-process communication In computer science, inter-process communication or interprocess communication (IPC) refers specifically to the mechanisms an operating system provides to allow the processes to manage shared data. Typically, applications can use IPC, categori ...
(IPC), in that different processes have different address spaces: if on the same host machine, they have distinct virtual address spaces, even though the physical address space is the same; while if they are on different hosts, the physical address space is different. Many different (often incompatible) technologies have been used to implement the concept.


History and origins

Request–response protocols date to early distributed computing in the late 1960s, theoretical proposals of remote procedure calls as the model of network operations date to the 1970s, and practical implementations date to the early 1980s.
Bruce Jay Nelson Bruce Jay Nelson (January 19, 1952 – September 19, 1999) was an American computer scientist best known as the inventor of the remote procedure call concept for computer network communications. Bruce Nelson graduated from Harvey Mudd College in ...
is generally credited with coining the term "remote procedure call" in 1981. Remote procedure calls used in modern operating systems trace their roots back to the RC 4000 multiprogramming system, which used a request-response communication protocol for process synchronization. The idea of treating network operations as remote procedure calls goes back at least to the 1970s in early ARPANET documents. In 1978, Per Brinch Hansen proposed Distributed Processes, a language for distributed computing based on "external requests" consisting of procedure calls between processes. One of the earliest practical implementations was in 1982 by Brian Randell and colleagues for their
Newcastle Connection The Newcastle Connection (or UNIX United) was a software subsystem from the early 1980s that could be added to each of a set of interconnected UNIX-like systems to build a distributed system. The latter would be functionally indistinguishable, a ...
between UNIX machines. This was soon followed by "Lupine" by Andrew Birrell and Bruce Nelson in the Cedar environment at Xerox PARC. Lupine automatically generated stubs, providing type-safe bindings, and used an efficient protocol for communication. 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 (NFS). In the 1990s, with the popularity of object-oriented programming, an alternative model of remote method invocation (RMI) was widely implemented, such as in
Common Object Request Broker Architecture The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between sys ...
(CORBA, 1991) and Java remote method invocation. RMIs, in turn, fell in popularity with the rise of the internet, particularly in the 2000s.


Message passing

RPC is a
request–response In computer science, request–response or request–reply is one of the basic methods computers use to communicate with each other in a network, in which the first computer sends a ''request'' for some data and the second ''responds'' to the requ ...
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 XMLHttpRequest. 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

# The client calls the client
stub Stub or Stubb may refer to: Shortened objects and entities * Stub (stock), the portion of a corporation left over after most but not all of it has been bought out or spun out * Stub, a tree cut and allowed to regrow from the trunk; see Pollardi ...
. The call is a local procedure call, with parameters pushed on to the stack in the normal way. # The client stub packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling. # The client's local operating system sends the message from the client machine to the server machine. # The local operating system on the server machine passes the incoming packets to the server stub. # The server stub unpacks the parameters from the message. Unpacking the parameters is called unmarshalling. # 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 interface description language or interface definition language (IDL), is a generic term for a language that lets a program or object written in one language communicate with another program written in an unknown language. IDLs describe an inter ...
(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.


Analogues

Notable RPC implementations and analogues include:


Language-specific

* Java's Java Remote Method Invocation (Java RMI) API provides similar functionality to standard Unix RPC methods.
Go
provide
package rpc
for implementing RPC, with support for asynchronous calls. * Modula-3's network objects, which were the basis for Java's RMI *
RPyC RPyC (pronounced ''are-pie-see''), or Remote Python Call, is a Python library for remote procedure calls (RPC), as well as distributed computing. Unlike regular RPC mechanisms, such as ONC RPC, CORBA or Java RMI, RPyC is transparent, symmetri ...
implements RPC mechanisms in Python, with support for asynchronous calls. * 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. * Erlang is process oriented and natively supports distribution and RPCs via message passing between nodes and local processes alike. * Elixir builds on top of the Erlang VM and allows process communication (Elixir/Erlang processes, not OS processes) of the same network out-of-the-box via Agents and message passing.


Application-specific

* Action Message Format (AMF) allows Adobe Flex applications to communicate with back-ends or other applications that support AMF. * Remote Function Call is the standard SAP interface for communication between SAP systems. RFC calls a function to be executed in a remote system.


General

* NFS ( Network File System) is one of the most prominent users of RPC * Open Network Computing Remote Procedure Call, by
Sun Microsystems Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, the ...
* D-Bus open source
IPC IPC may refer to: Computing * Infrastructure protection centre or information security operations center * Instructions per cycle or instructions per clock, an aspect of central-processing performance * Inter-process communication, the sharin ...
program provides similar function to CORBA. * SORCER provides the API and ;exertion-oriented language (EOL) for a federated method invocation * 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 JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
-encoded messages * JSON-WSP is an RPC protocol that uses
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
-encoded messages * SOAP is a successor of XML-RPC and also uses XML to encode its HTTP-based calls. * ZeroC's Internet Communications Engine (Ice) distributed computing platform. * Etch framework for building network services. * Apache Thrift protocol and framework. * CORBA provides remote procedure invocation through an intermediate layer called the ''object request broker''. * Libevent provides a framework for creating RPC servers and clients. * 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 open sourced in 2015 as gRPC. * WAMP combines RPC and Publish-Subscribe into a single, transport-agnostic protocol. * Google Web Toolkit uses an asynchronous RPC to communicate to the server service. * Apache Avro provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.


See also

* 9P * Microsoft RPC * Local Procedure Call * HTTP *
ODBC In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An ...
* Remote evaluation *
External Data Representation External Data Representation (XDR) is a standard data serialization format, for uses such as computer network protocols. It allows data to be transferred between different kinds of computer systems. Converting from the local representation to XD ...
(serialization format used by e.g. NFS) *
Network Data Representation Network Data Representation (NDR) is an implementation of the presentation layer in the OSI model. It is used for DCE/RPC and Microsoft RPC (MSRPC). See also * DCE/RPC * Microsoft RPC Microsoft RPC (Microsoft Remote Procedure Call) is a modified v ...
(serialization format used by e.g. Microsoft RPC) * Resource-oriented architecture * Distributed object middleware * Fragmented object * gRPC


References


External links

* - Specifies version 1 of ONC RPC *{{IETF RFC, 5531, link=no - Specifies version 2 of ONC RPC
Remote Procedure Calls (RPC)
— A tutorial on ONC RPC by Dr Dave Marshall of Cardiff University

— A developer's introduction to RPC and XDR, from SGI IRIX documentation. Inter-process communication Middleware Distributed computing