Remote procedure call
   HOME

TheInfoList



OR:

In
distributed computing A distributed system is a system whose components are located on different computer network, networked computers, which communicate and coordinate their actions by message passing, passing messages to one another from any system. Distributed com ...
, 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 (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 (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 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 The RC 4000 Multiprogramming System (also termed Monitor or RC 4000 depending on reference) is a discontinued operating system developed for the RC 4000 minicomputer in 1969. For clarity, this article mostly uses the term Monitor. Over ...
, 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 The Advanced Research Projects Agency Network (ARPANET) was the first wide-area packet-switched network with distributed control and one of the first networks to implement the TCP/IP protocol suite. Both technologies became the technical fou ...
documents. In 1978,
Per Brinch Hansen Per Brinch Hansen (13 November 1938 – 31 July 2007) was a Danish-American computer scientist known for his work in operating systems, concurrent programming and parallel and distributed computing. Biography Early life and education Per B ...
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 Brian Randell (born 1936) is a British computer scientist, and Emeritus Professor at the School of Computing, Newcastle University, United Kingdom. He specialises in research into software fault tolerance and dependability, and is a noted auth ...
and colleagues for their Newcastle Connection between UNIX machines. This was soon followed by "Lupine" by Andrew Birrell and Bruce Nelson in the
Cedar Cedar may refer to: Trees and plants *''Cedrus'', common English name cedar, an Old-World genus of coniferous trees in the plant family Pinaceae *Cedar (plant), a list of trees and plants known as cedar Places United States * Cedar, Arizona * ...
environment at
Xerox PARC PARC (Palo Alto Research Center; formerly Xerox PARC) is a research and development company in Palo Alto, California. Founded in 1969 by Jacob E. "Jack" Goldman, chief scientist of Xerox Corporation, the company was originally a division of Xero ...
. 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 Xerox Holdings Corporation (; also known simply as Xerox) is an American corporation that sells print and electronic document, digital document products and services in more than 160 countries. Xerox is headquartered in Norwalk, Connecticut (ha ...
under the name "Courier" in 1981. The first popular implementation of RPC on
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
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 Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pr ...
, 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 In computing, the Java Remote Method Invocation (Java RMI) is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java classes and dist ...
. 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 XMLHttpRequest (XHR) is an API in the form of an object whose methods transfer data between a web browser and a web server. The object is provided by the browser's JavaScript environment. Particularly, retrieval of data from XHR for the purpos ...
. 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 Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
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. 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 An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
sends the message from the client machine to the server machine. # The local
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
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 In computer science, marshalling or marshaling ( US spelling) is the process of transforming the memory representation of an object into a data format suitable for storage or transmission. It is typically used when data must be moved between differ ...
. # 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 Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
's
Java Remote Method Invocation In computing, the Java Remote Method Invocation (Java RMI) is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java classes and dist ...
(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 Modula-3 is a programming language conceived as a successor to an upgraded version of Modula-2 known as Modula-2+. While it has been influential in research circles (influencing the designs of languages such as Java, C#, and Python) it has not be ...
's network objects, which were the basis for Java's RMI * RPyC implements RPC mechanisms in Python, with support for asynchronous calls. *
Distributed Ruby Distributed Ruby or DRb allows Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties ...
(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 ELIXIR (the European life-sciences Infrastructure for biological Information) is an initiative that will allow life science laboratories across Europe to share and store their research data as part of an organised network. Its goal is to bring t ...
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 Action Message Format (AMF) is a binary format used to serialize object graphs such as ActionScript objects and XML, or send messages between an Adobe Flash client and a remote service, usually a Flash Media Server or third party alternatives. ...
(AMF) allows
Adobe Flex Apache Flex, formerly Adobe Flex, is a software development kit (SDK) for the development and deployment of cross-platform rich web applications based on the Adobe Flash platform. Initially developed by Macromedia and then acquired by Adobe System ...
applications to communicate with back-ends or other applications that support AMF. *
Remote Function Call Remote Function Call is a proprietary SAP interface. Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. The RFC calls a function to be executed in a remote system. Remote function calls may be associat ...
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 Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun) in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, lik ...
) is one of the most prominent users of RPC *
Open Network Computing Remote Procedure Call __NOTOC__ Open Network Computing (ONC) Remote Procedure Call (RPC), commonly known as Sun RPC is a remote procedure call system. ONC was originally developed by Sun Microsystems in the 1980s as part of their Network File System project. ONC is ba ...
, 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 In computing, D-Bus (short for "Desktop Bus") is a message-oriented middleware mechanism that allows communication between multiple processes running concurrently on the same machine. D-Bus was developed as part of the freedesktop.org project, ...
open source IPC program provides similar function to
CORBA 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 ...
. *
SORCER The service-oriented computing environment (SORCER) is a distributed computing platform implemented in Java. It allows writing network-programs (called "''exertions''") that operate on wrapped applications ( services) to spread across the network ...
provides the API and ;exertion-oriented language (EOL) for a federated method invocation *
XML-RPC XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.Simon St. Laurent, Joe Johnston, Edd Dumbill. (June 2001) ''Programming Web Services with XML-RPC.'' O'Reilly. First Edit ...
is an RPC protocol that uses
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
to encode its calls and
HTTP The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
as a transport mechanism. *
JSON-RPC JSON-RPC is a remote procedure call protocol encoded in JSON. It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for m ...
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 JSON-WSP is a web service protocol that uses JSON for service description, requests and responses. It is inspired from JSON-RPC, but the lack of a service description specification with documentation in JSON-RPC sparked the design of 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 Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are surfactants usually used for washing, bathing, and other types of housekeeping. In industrial settings, soaps are use ...
is a successor of XML-RPC and also uses XML to encode its HTTP-based calls. *
ZeroC ZeroC is a software company based in Jupiter, Florida, United States. The company develops and publishes tools for software developers. Its main product is Ice, an open-source RPC framework that helps software developers build distributed appli ...
's
Internet Communications Engine The Internet Communications Engine, or Ice, is an open-source RPC framework developed by ZeroC. It provides SDKs for C++, C#, Java, JavaScript, MATLAB, Objective-C, PHP, Python, Ruby and Swift, and can run on various operating systems, inc ...
(Ice) distributed computing platform. * Etch framework for building network services. *
Apache Thrift Thrift is an interface definition language and binary communication protocol used for defining and creating services for numerous programming languages. It was developed at Facebook for "scalable cross-language services development" and as of ...
protocol and framework. *
CORBA 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 ...
provides remote procedure invocation through an intermediate layer called the ''object request broker''. *
Libevent libevent is a software library that provides asynchronous event notification. The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. libeven ...
provides a framework for creating RPC servers and clients. *
Windows Communication Foundation The Windows Communication Foundation (WCF), previously known as Indigo, is a free and open-source runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. .NET Core 1.0, released 2016, did not sup ...
is an application programming interface in the .NET framework for building connected, service-oriented applications. *
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 and ...
Remoting In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure ( subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal ( ...
offers RPC facilities for distributed systems implemented on the Windows platform. It has been superseded by WCF. * The Microsoft DCOM uses
MSRPC Microsoft RPC (Microsoft Remote Procedure Call) is a modified version of DCE/RPC. Additions include partial support for UCS-2 (but not Unicode) strings, implicit handles, and complex calculations in the variable-length string and structure paradig ...
which is based on
DCE/RPC DCE/RPC, short for "Distributed Computing Environment / Remote Procedure Calls", is the remote procedure call system developed for the Distributed Computing Environment (DCE). This system allows programmers to write distributed software as if it w ...
* The Open Software Foundation
DCE/RPC DCE/RPC, short for "Distributed Computing Environment / Remote Procedure Calls", is the remote procedure call system developed for the Distributed Computing Environment (DCE). This system allows programmers to write distributed software as if it w ...
Distributed Computing Environment (also implemented by Microsoft). * Google
Protocol Buffers Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs to communicate with each other over a network or for storing data. The method involves an i ...
(protobufs) package includes an interface definition language used for its RPC protocols open sourced in 2015 as
gRPC gRPC (Google Remote Procedure Calls) is a cross-platform open source high performance Remote procedure call, Remote Procedure Call (RPC) framework. gRPC was initially created by Google, which has used a single general-purpose RPC infrastructure ...
. *
WAMP LAMP (Linux, Apache, MySQL, PHP/Perl/Python) is an acronym denoting one of the most common Software stack, software stacks for many of the web's most popular web application, applications. However, LAMP now refers to a generic software stack mode ...
combines RPC and Publish-Subscribe into a single, transport-agnostic protocol. *
Google Web Toolkit Google Web Toolkit (GWT ), or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under the Apache License 2.0. GWT emphasizes reusab ...
uses an asynchronous RPC to communicate to the server service. *
Apache Avro Avro is a row-oriented remote procedure call and data serialization framework developed within Apache's Hadoop project. It uses JSON for defining data types and protocols, and serializes data in a compact binary format. Its primary use is in Ap ...
provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.


See also

* 9P *
Microsoft RPC Microsoft RPC (Microsoft Remote Procedure Call) is a modified version of DCE/RPC. Additions include partial support for UCS-2 (but not Unicode) strings, implicit handles, and complex calculations in the variable-length string and structure paradig ...
*
Local Procedure Call The Local Inter-Process Communication (LPC, often also referred to as Local Procedure Call or Lightweight Procedure Call) is an internal, undocumented inter-process communication facility provided by the Microsoft Windows NT kernel for lightweight ...
*
HTTP The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
*
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 In computer science, remote evaluation is a general term for any technology that involves the transmission of executable software code from a client computer to a server computer for subsequent execution at the server. After the code has finished ...
* External Data Representation (serialization format used by e.g. NFS) * Network Data Representation (serialization format used by e.g. Microsoft RPC) *
Resource-oriented architecture In software engineering, a resource-oriented architecture (ROA) is a style of software architecture and programming paradigm for supportive designing and developing software in the form of Internetworking of System resource, resources with "Represen ...
*
Distributed object middleware {{Unreferenced, date=June 2019, bot=noref (GreenC bot) Distributed Object Middleware (DOM) is a type of infrastructure that allows remote access to remote objects transparently. It is based on the Remote Procedure Call (RPC) mechanism. Some DOM sys ...
*
Fragmented object {{multiple issues, {{technical, date=June 2014 {{context, date=February 2018 In computing, fragmented objects are truly distributed objects. It is a novel design principle extending the traditional concept of stub based distribution. In contrast ...
*
gRPC gRPC (Google Remote Procedure Calls) is a cross-platform open source high performance Remote procedure call, Remote Procedure Call (RPC) framework. gRPC was initially created by Google, which has used a single general-purpose RPC infrastructure ...


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