Remote Procedural Call
Introduction
Remote procedure calls allow a local computer (client) to remotely call procedures on a different computer (server). It is a software communication protocol, One program can use to request a service from a program located on another computer on a network without having to understand the network's details. Remote Procedure Call (RPC) provides a different paradigm for accessing network services. Instead of accessing remote services by sending and receiving messages, a client invokes services by making a local procedure call. The local procedure hides the details of the network communication.
Call on one computer/machine and Execution on Different computer/machine done for below reasons
RPC calls are synchronous operations, requiring the requesting program gets suspended until the result of the RPC call is returned from the callee.
Before understanding How RPC calls Works need to go through the below understandings.
What is a stub?
The stub is an auto-generated code, It creates a common interface between client and server, It is an abstracted layer for client and server, Which takes care of packing and unpacking of messages, also transmission and reception of the message to the next Layer. Stub in also takes care of converting parameters passed between client and server during a remote procedure call (RPC). The client and server may also use different data representations, even for simple parameters (e.g., big-endian versus little-endian for integers). Stubs perform the conversion of the parameters, so a remote procedure call looks like a local function call for the remote computer.
The interface definition language (IDL)
IDL provides a bridge between the machines at either end of the link that may be using different operating systems and computer languages. Stub code generation IDL file feed to the compiler which will generate stub shared libraries. The IDL language is used to describe a software component's API interface between client and server (application programming interface).
领英推荐
This technique is most commonly used in Remote Procedure Call software. An interface definition has information to indicate whether each argument is input, output, or both. Only input arguments need to be copied from client to server and only output elements need to be copied from server to client.
Advantages of using RPC
Disadvantages of RPC
1.?????RPC systems aren't always suited for transferring large amounts of data
2.?????RPC is vulnerable to failure because it involves a communication system, another machine, and another process
3.?????The main goal of RPC is to hide the existence of the network from a program. As a result, RPC doesn't quite fit into the OSI model: Call-by-reference is not possible, and the client and server don't share an address space. (This point is no more valid when client and server are sharing the same address space, In the case of distributed computing it is the case)
4.??????RPC calls are synchronous calls, As an exception handling call Time out needs to define
5.?????It is difficult to define timeout and raise an exception or report failure to the client because every call takes diff amount of time
Teacher of Physics at Sant Atulanand Convent School, Varanasi
2 年Impressive
System Architect |Product development Lead|Connected Car|Infotainment|OTA|SDV|PSPO certified|People enabler| Aspiring Impactful Leader|Cricket enthusiast
2 年Thanks for sharing Vinit.