Email This Page  

RPC: Remote Procedure Call protocol

Remote Procedure Call (RPC) is a protocol for requesting a service from a program located in a remote computer through network without having to understand the under layer network technologies. RPC presumes the existence of a low-level transport protocol, such as TCP or UDP, for carrying the message data between communicating programs. RPC spans the Transport layer and the Application layer in the Open Systems Interconnection (OSI) model of network communication. RPC makes it easier to develop an application that includes multiple programs distributed in a network.

RPC uses the client/server model. The requesting program is a client and the service-providing program is the server. First, the caller process sends a call message that includes the procedure parameters to the server process. Then, the caller process waits for a reply message (blocks). Next, a process on the server side, which is dormant until the arrival of the call message, extracts the procedure parameters, computes the results, and sends a reply message. The server waits for the next call message. Finally, a process on the caller receives the reply message, extracts the results of the procedure, and the caller resumes execution.

There are several RPC models and implementations. Sun Microsystem originally introduced the RPC. IETF ONC charter modified the Sun version and made the ONC PRC protocol as an IETF standard protocol. A popular model and implementation is the Open Software Foundation's Distributed Computing Environment (DCE).
Protocol Structure - RPC: Remote Procedure Call protocol

The Remote Procedure Call (RPC) message protocol consists of two distinct structures: the call message and the reply message. The message flows are displayed as follows:

RPC Call Message: Each remote procedure call message contains the following unsigned integer fields to uniquely identify the remote procedure:

  • Program number
  • Program version number
  • Procedure number

The body of an RPC call message takes the following form:

struct call_body {   

unsigned int rpcvers;  

 unsigned int prog;   

unsigned int vers;   

unsigned int proc;  

opaque_auth cred;  

 opaque_auth verf;   

1 parameter   2 parameter . . .  

};

RPC Reply Message: The RPC protocol for a reply message varies depending on whether the call message is accepted or rejected by the network server. The reply message to a request contains information to distinguish the following conditions:

  • RPC executed the call message successfully.
  • The remote implementation of RPC is not protocol version 2. The lowest and highest supported RPC version numbers are returned.
  • The remote program is not available on the remote system.
  • The remote program does not support the requested version number. The lowest and highest supported remote program version numbers are returned.
  • The requested procedure number does not exist. This is usually a caller-side protocol or programming error.

The RPC reply message takes the following form:

enum reply_stat stat {   

MSG_ACCEPTED = 0,   

MSG_DENIED= 1

};    

Related Protocols
 

Sponsor Source

RPC is defined by many organizations such as Sun, IETF and IEEE



Reference

http://www.javvin.com/protocol/rfc1831.pdf : RPC: Remote Procedure Call Protocol Specification Version 2 (ONC version)
http://www.javvin.com/protocol/rfc1057.pdf : RPC: Remote Procedure Call Protocol Specification Version 2 (Sun version)
The IEEE defines RPC in its ISO Remote Procedure Call Specification, ISO/IEC CD 11578 N6561, ISO/IEC, November 1991.