Remote Procedure Calls (RPC)
SENG 41283 — Distributed and Cloud Computing
Remote Procedure Call (RPC) is a protocol which can be used by one program to request a service from a program installed on another network computer without having to understand the details of the network. RPC is used on remote systems to call other processes, like a local system. Often, a call to a process is also known as a call to a method or subroutine.
RPC uses the server-client model. The requesting software is a client, and it is the server that provides the service. Unlike a normal or local call of action, an RPC is a synchronous process requiring suspension of the requesting software before the results of the remote procedure are returned.
We can design a simple HelloWorld system using RPC. For that, we have to create 4 java files.
By looking at the above simple HelloWorld application following RPC concepts can be summarized.
When program statements using the RPC framework are compiled into an executable program, the compiled code includes a stub which acts as the representative of the remote procedure code. When the program runs and the call for the procedure are issued, the stub receives the request and forward it to a local computer runtime client. The first time the client stub is invoked it will contact a name server to decide where the server resides in the transport address.
The client runtime program has the knowledge of how to address the remote computer and server application and sends the remote procedure requesting message across the network. The server also includes a runtime program and stub which interfaces with the remote procedure itself. Response-request protocols come back the same way.