Distributed System – Transparency of RPC
RPC is an effective mechanism for building client-server systems that are distributed. RPC enhances the power and ease of programming of the client/server computing concept. A transparent RPC is one in which programmers can not tell the difference between local and remote procedure calls. The most difficult aspect of designing an RPC facility is ensuring that it is transparent.
There are two kinds of transparencies that must be used:
- Syntactic transparency: The syntax of a remote process and a call to a local procedure should be the same.
- Semantic transparency: A remote procedure call and a local procedure call have the same semantics.
Syntactic transparency is not a problem, but semantic transparency is difficult to achieve due to variations between remote and local procedure calls. Following are the variations between Remote Procedure Calls and Local Procedure Calls:
- Remote Procedure Calls have disjoint address space i.e. different address space, unlike Local Procedure Calls.
- Remote Procedure Calls are more prone to failures due to possible processor failure or communication issues of a network than Local Procedure Calls.
- Because of the communication network, remote procedure calls take longer than local procedure calls.
How Transparency can be achieved in RPC:
- RPC’s main goal is to make a remote procedure call appear transparent. The calling process should have no idea that the called procedure is running on a different computer. In a similar way, RPC achieves transparency.
- When the read is used as a remote procedure, a client stub version of the reading is added to the library. The calling sequence is used to call it.
- The parameters are encapsulated in a message, which is then transmitted to the server. The server’s operating system forwards the message to the server stub, which calls receive and rejects incoming messages when it arrives at the server.
- The server unpacks parameters and calls the server procedure, completes its task, and delivers the result to the caller in the usual manner of packing and sending the result to the client stub.
- When the client gets a message from the server, the client’s operating system recognizes it as being addressed to the client process. When the caller has control after the call to read all it knows is that its data is available.
- It is completely unaware that the task was performed remotely rather than on the local operating system. Transparency is gained in this manner.
The Syntax Transparency can be achieved of RPC but total Semantic Transparency is impossible to achieve because of the variations in the procedure calls (local and remote).