Remote Procedure Calls

In order to understand this section, a general understanding of procedure calls is needed. A remote procedure call (RPC) invokes a procedure on a remote system. The reason we call this a ‘procedure call’ is because the intent is to make it appear to the programmer that a normal procedure call is taking place (Stevens, p. 692). Figure 2 is the RPC model (Stevens, p. 693).

Why would someone want to execute a procedure on another person's machine?
The following scenario is realistic. A caller in Ottawa wants to insert a tuple into an Oracle database in Nashville and has no local installation of Oracle. A client could call a remote procedure to do the job. Provided the remote machine has a valid installation of Oracle, an insertion could be accomplished. A Server RPC could be set up in Nashville to accept an SQL statement from the client, execute it, then return the result.

Unfortunately RPCs are subject to the same idiosyncrasies of regular procedure calls and the same network problems mentioned in the socket section. RPC's essential concept is hiding all the network code in the stub procedures. The goal of the RPC is to make the writing of distributed applications easier (Stevens, p. 694). RPC transparency allows such; however, these transparencies raise other problems.

Transparency Issues (Stevens, p. 695):

Other Issues

To make programming even easier, Sun RPC offers a program called rpcgen, which takes a specification of a remote procedure and converts it to C programs containing all the network information to process the request. The programmer simply has to fill in the implementation of the actual procedure. Once again, all the network details are hidden.

Below are examples of remote procedure calls as implemented on hercules and the Dec stations at the University of Regina. The hand coded RPC is an example of a limiting rsh program, allowing one machine to remotely execute a command on another. Hercules includes a rpcgen program which is an automatic RPC generator. This is also illistrated below. The automatically generated RPC returns the date of the remote machine (Stevens, p. 702).


Hand Coded remote shell Remote Procedure Call

Automatically Generated Remote Procedure Call

Remember, the rpcgen RPC will only work on hercules !