Discuss the procedure of remote procedure call with the help of suitable diagram.


Remote Procedure Call (RPC): - 

RPC is a powerful technique for constructing distributed, client-server based applications. It is based on extending the notion of conventional, or local procedure calling, so that the called procedure need not exist in the same address space as the calling procedure. The two processes may be on the same system, or they may be on different systems with a network connecting them. By using RPC, programmers of distributed applications avoid the details of the interface with the network. The transport independence of RPC isolates the application from the physical and logical elements of the data communications mechanism and allows the application to use a variety of transports.  

There are 3 components on each side in case of RPC System
  • a user program (client or server)
  • a set of stub procedures
  • RPC runtime support


Server program defines the server’s interface using an interface definition language (IDL).The IDL specifies the names, parameters, and types for all client-callable server procedures.

A stub compiler reads the IDL and produces two stub procedures for each server procedure: a client-side stub and a server-side stub

The server writer writes the server and links it with the server-side stubs; the client writes her program and links it with the client-side stubs.

The stubs are responsible for managing all details of the remote communication between client and server.


A client-side stub is a procedure that looks to the client as if it were a callable server procedure.

•A server-side stub looks to the server as if it’s a calling client.
•The client program thinks it is calling the server; in fact, it’s calling the client stub.
•The server program thinks it’s called by the client; in fact, it’s called by the server stub.
•The stubs send messages to each other to make the RPC happen.

Binding:-


Binding is the process of connecting the client and server
•The server, when it starts up, exports its interface, identifying itself to a network name server and telling the local runtime its dispatcher address.
•The client, before issuing any calls, imports the server, which causes the RPC runtime to lookup the server through the name service and contact the requested server to setup a connection.
•The import and export are explicit calls in the code.

Marshalling:

•Marshalling is the packing of procedure parameters into a message packet.
•The RPC stubs call type-specific procedures to marshall (or unmarshall) all of the parameters to the call.
•On the client side, the client stub marshalls the parameters into the call packet;  on the server side the server stub unmarshalls the parameters in order to call the server’s procedure.
•On the return, the server stub marshalls return parameters into the return packet;  the client stub unmarshalls return parameters and returns to the client.

0 comments:

Feel free to contact the admin for any suggestions and help.