Remote procedure call

From Wikipedia for FEVERv2
Jump to navigation Jump to search

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 (local) procedure call, without the programmer explicitly coding the details for the remote interaction. Remote procedure call_sentence_0

That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. Remote procedure call_sentence_1

This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system. Remote procedure call_sentence_2

In the object-oriented programming paradigm, RPCs are represented by remote method invocation (RMI). Remote procedure call_sentence_3

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 procedure call_sentence_4

Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important. Remote procedure call_sentence_5

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. Remote procedure call_sentence_6

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

History and origins Remote procedure call_section_0

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. Remote procedure call_sentence_8

Bruce Jay Nelson is generally credited with coining the term "remote procedure call" in 1981. Remote procedure call_sentence_9

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. Remote procedure call_sentence_10

The idea of treating network operations as remote procedure calls goes back at least to the 1970s in early ARPANET documents. Remote procedure call_sentence_11

In 1978, Per Brinch Hansen proposed Distributed Processes, a language for distributed computing based on "external requests" consisting of procedure calls between processes. Remote procedure call_sentence_12

One of the earliest practical implementations was in 1982 by Brian Randell and colleagues for their Newcastle Connection between UNIX machines. Remote procedure call_sentence_13

This was soon followed by "Lupine" by Andrew Birrell and Bruce Nelson in the Cedar environment at Xerox PARC. Remote procedure call_sentence_14

Lupine automatically generated stubs, providing type-safe bindings, and used an efficient protocol for communication. Remote procedure call_sentence_15

One of the first business uses of RPC was by Xerox under the name "Courier" in 1981. Remote procedure call_sentence_16

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). Remote procedure call_sentence_17

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 (CORBA, 1991) and Java remote method invocation. Remote procedure call_sentence_18

RMIs in turn fell in popularity with the rise of the internet, particularly in the 2000s. Remote procedure call_sentence_19

Message passing Remote procedure call_section_1

RPC is a request–response protocol. Remote procedure call_sentence_20

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. Remote procedure call_sentence_21

The remote server sends a response to the client, and the application continues its process. Remote procedure call_sentence_22

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. Remote procedure call_sentence_23

There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols. Remote procedure call_sentence_24

An important difference between remote procedure calls and local calls is that remote calls can fail because of unpredictable network problems. Remote procedure call_sentence_25

Also, callers generally must deal with such failures without knowing whether the remote procedure was actually invoked. Remote procedure call_sentence_26

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. Remote procedure call_sentence_27

Sequence of events Remote procedure call_section_2

Remote procedure call_ordered_list_0

  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.Remote procedure call_item_0_0
  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.Remote procedure call_item_0_1
  3. The client's local operating system sends the message from the client machine to the server machine.Remote procedure call_item_0_2
  4. The local operating system on the server machine passes the incoming packets to the server stub.Remote procedure call_item_0_3
  5. The server stub unpacks the parameters from the message. Unpacking the parameters is called unmarshalling.Remote procedure call_item_0_4
  6. Finally, the server stub calls the server procedure. The reply traces the same steps in the reverse direction.Remote procedure call_item_0_5

Standard contact mechanisms Remote procedure call_section_3

To let different clients access servers, a number of standardized RPC systems have been created. Remote procedure call_sentence_28

Most of these use an interface description language (IDL) to let various platforms call the RPC. Remote procedure call_sentence_29

The IDL files can then be used to generate code to interface between the client and servers. Remote procedure call_sentence_30

Analogues Remote procedure call_section_4

See also Remote procedure call_section_5

Remote procedure call_unordered_list_1

Credits to the contents of this page go to the authors of the corresponding Wikipedia page: procedure call.