What is RPC ?

What is RPC ?

Cover Image Of What is RPC ?
Cover Image Of What is RPC ?

RPC stands for Remote Procedure Call. It's a technique used in distributed systems that allows a program on one computer to call a function (or procedure) on another computer as if it were a local function. This makes it easier to develop distributed applications because the programmer doesn't need to worry about the underlying communication details like network protocols or data marshalling.

Here's a breakdown of how RPC works:

1. The Client Makes a Call: 

The program on the client computer calls a local function, which is actually a stub for the remote procedure.

2. Stub Marshals the Data: 

The client-side stub marshals the function parameters into a message format suitable for network transmission.

3. Message Sent over Network: 

The message is sent over the network to the server computer.

4. Server Stub Demarshals Data: 

On the server side,
 another stub program demarshals the received message and extracts the parameters.

5. Server Executes Procedure: 

The server stub then calls the actual remote procedure with the extracted parameters.

6. Server Sends Response: 

Once the procedure execution is complete, the server stub marshals the return value back into a message and sends it back to the client.

7. Client Stub Demarshals Response:

The client-side stub receives the response message, demarshals it, and provides the return value to the calling program.

RPC essentially hides the complexity of network communication from the programmer, making it easier to develop distributed applications.

Post a Comment

Previous Post Next Post