Remote procedure call
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, a remote procedure call (RPC) is an inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 that allows a computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 to cause a subroutine
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....

 or procedure to execute in another address space
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.- Overview :...

 (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction.
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 can be used to implement the concept.

History and origins

The idea of treating computer network operations as remote procedure calls goes back at least to the 1970s in early ARPANET
ARPANET
The Advanced Research Projects Agency Network , was the world's first operational packet switching network and the core network of a set that came to compose the global Internet...

 documents.
Bruce Jay Nelson
Bruce Jay Nelson
Bruce Jay Nelson was an American computer scientist best known as the inventor of the remote procedure call concept for computer network communications....

 is generally credited with coining the term.
One of the first business uses of RPC was by Xerox
Xerox
Xerox Corporation is an American multinational document management corporation that produced and sells a range of color and black-and-white printers, multifunction systems, photo copiers, digital production printing presses, and related consulting services and supplies...

 under the name "Courier" in 1981. The first popular implementation of RPC on Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 was Sun's RPC (now called ONC RPC), used as the basis for Network File System.

Message passing

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. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols. 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.

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 a RPC

  1. The client calls the client stub
    Stub (distributed computing)
    A stub in distributed computing is a piece of code used for converting parameters passed during a Remote Procedure Call .The main idea of an RPC is to allow a local computer to remotely call procedures on a remote computer...

    . The call is a local procedure call, with parameters pushed on to the stack in the normal way.
  2. The client stub
    Class stub
    In the distributed computing environment, stub stands for client side object participating in the distributed object communication.The stub acts as a gateway for client side objects and all outgoing requests to server side objects that are routed through it...

     packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling
    Marshalling (computer science)
    In computer science, marshalling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission...

    .
  3. The kernel sends the message from the client machine to the server machine.
  4. The kernel on the server machine passes the incoming packets to the server stub
    Class skeleton
    -As pattern:A class skeleton is an outline of a class that is used in software engineering. It contains a description of the class's roles, and describes the purposes of the variables and methods, but does not implement them...

    .
  5. 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
An interface description language , or IDL for short, is a specification language used to describe a software component's interface...

 (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. The most common tool used for this is RPCGEN
RPCGEN
RPCGEN is an interface generator pre-compiler for Sun Microsystems RPC. It uses an interface definition file to create client and server stubs in C.-RPC Language:...

.

Other RPC analogues

RPC analogues found elsewhere:
  • Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

    's Java Remote Method Invocation
    Java remote method invocation
    The Java Remote Method Invocation Application Programming Interface , or Java RMI, is a Java application programming interface that performs the object-oriented equivalent of remote procedure calls ....

     (Java RMI) API provides similar functionality to standard Unix RPC methods.
  • Modula-3
    Modula-3
    In computer science, 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 it has not been adopted widely in industry...

    's network objects, which were the basis for |Java's RMI
  • XML-RPC
    XML-RPC
    XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism. "XML-RPC" also refers generically to the use of XML for remote procedure call, independently of the specific protocol...

     is an RPC protocol that uses XML
    XML
    Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

     to encode its calls and HTTP as a transport mechanism.
  • JSON-RPC
    JSON-RPC
    JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol , defining only a handful of data types and commands...

     is an RPC protocol that uses JSON
    JSON
    JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

    -encoded messages
  • SOAP
    SOAP
    SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks...

     is a successor of XML-RPC and also uses XML to encode its HTTP-based calls.
  • Microsoft .NET
    .NET Framework
    The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

     Remoting
    .NET Remoting
    .NET Remoting is a Microsoft application programming interface for interprocess communication released in 2002 with the 1.0 version of .NET Framework. It is one in a series of Microsoft technologies that began in 1990 with the first version of Object Linking and Embedding for 16-bit Windows...

     offers RPC facilities for distributed systems implemented on the Windows platform.
  • RPyC
    RPyC
    RPyC , or Remote Python Call, is a python library for remote procedure calls , as well as distributed computing. Unlike regular RPC mechanisms, such as ONC RPC, CORBA or Java RMI, RPyC is transparent, symmetrical, and requires no special decoration or definition languages...

     implements RPC mechanisms in Python, with support for asynchronous calls.
  • Pyro
    PYthon Remote Objects
    PYro is an acronym for PYthon Remote Objects, a Python-based Distributed Object Technology similar to Java's Remote Method Invocation ....

     object-oriented form of RPC for Python.
  • ZeroC
    ZeroC
    ZeroC, Inc. is a company based in Palm Beach Gardens, Florida, U.S., revolving around the development and licensing of the Internet Communications Engine, or ICE, an object middleware system considered an alternative to CORBA and SOAP...

    's Internet Communications Engine (Ice)
    Internet Communications Engine
    The Internet Communications Engine, or Ice, is an object-oriented middleware that provides object-oriented Remote Procedure Call, grid computing and Publish/subscribe functionality developed by ZeroC and dual-licensed under the GNU GPL and a proprietary license...

     distributed computing platform.
  • Etch (protocol)
    Etch (protocol)
    Etch is an open source, cross-platform framework for building network services, first announced in May 2008 by Cisco Systems. Etch encompasses a service description language, a compiler, and a number of language bindings...

     framework for building network services.
  • Facebook
    Facebook
    Facebook is a social networking service and website launched in February 2004, operated and privately owned by Facebook, Inc. , Facebook has more than 800 million active users. Users must register before using the site, after which they may create a personal profile, add other users as...

    's Thrift
    Thrift (protocol)
    Thrift is an interface definition language that is used to define and create services for numerous languages. It is used as a remote procedure call framework and was developed at Facebook for "scalable cross-language services development"...

     protocol and framework.
  • CORBA
    Çorba
    Chorba , ciorbă , shurpa , shorpo , or sorpa is one of various kinds of soup or stew found in national cuisines across Middle East...

     provides remote procedure invocation through an intermediate layer called the object request broker.
  • Distributed Ruby
    Distributed Ruby
    Distributed Ruby or DRb allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation to pass commands and data between processes.- External links :* * *...

     (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
    Action Message Format
    Action Message Format is a binary format used to serialize objects graphs such 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
    Adobe Flex
    Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform...

     applications to communicate with back-ends or other applications that support AMF.
  • Libevent
    Libevent
    libevent is an asynchronous event notification software library.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. Furthermore, libevent also supports callbacks due to signals or regular...

     provides a framework for creating RPC servers and clients.
  • Windows Communication Foundation
    Windows Communication Foundation
    The Windows Communication Foundation , previously known as "Indigo", is an application programming interface in the .NET Framework for building connected, service-oriented applications.-The architectures:...

     is an application programming interface in the .NET framework for building connected, service-oriented applications.
  • Google Protocol Buffers
    Protocol Buffers
    Protocol Buffers are a serialization format with an interface description language developed by Google. The original Google implementation for C++, Java and Python is available under a free software, open source license....

     (protobufs) package includes an interface definition language used for its RPC protocols.
  • Google Web Toolkit
    Google Web Toolkit
    Google Web Toolkit is an open source set of tools that allows web developers to create and maintain complex JavaScript front-end applications in Java. Other than a few native libraries, everything is Java source that can be built on any supported platform with the included GWT Ant build files...

     uses an asynchronous RPC to communicate the server service.

See also

  • Local Procedure Call
    Local Procedure Call
    The Local Procedure Call is an internal, undocumented inter-process communication facility provided by the Microsoft Windows NT kernel for lightweight IPC between processes on the same computer...

  • SOAP
  • HTTP
  • ODBC
  • Remote function call
    Remote Function Call
    Remote Function Call is the proprietary SAP AG interface for communication between a SAP System and other SAP or third-party compatible system over TCP/IP or CPI-C connections...

  • External Data Representation
    External Data Representation
    External Data Representation 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 XDR is called encoding. Converting from XDR to the local...

  • ROA (Resource-oriented architecture)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK