1
RPCs
an early middleware model. It’s an extension of local
procedure calling.
Programs are organized as a set of modules. Each module
defines its interface: procedures variables.
Advantage of communicating through interface, is that
programmer can update the implementation, keep its interface, and don’t need to update the implementation in
- ther modules.
Direct variable access is not allowed in distributed situation. RPC vs. LPC:
Error handling: In RPC, failures of the remote server and
failures of network.
Performance: RPCs operate much slower than LPCs. Authentication: insecure networks, authentication is
necessary.
RPC uses client/server model Service interface response-based transient synchronous communication Remote procedures appear local through stub functions. Two stubs: client stub and server stub. In RPC, stubs are compiled and linked with the applications.
Steps in one RPC
Before call a remote procedure, client initiates a connection to
server.
When client process calls a remote procedure, client stub:
Retrieves the required parameters from the client address space. Translates the parameters into a standard network data
representation (NDR) format for transmission over the network.
Calls functions in the RPC client run-time library to send the
request and its parameters to the server.
At the server side,
The server RPC run-time library functions accept the request
and call the server stub procedure.
The server stub retrieves the parameters from the network buffer
and converts them from the network transmission format to the format the server needs.
The server stub calls the actual procedure on the server. After the remote procedure returns its data to the server stub, the
server stub converts return value to the network message and call the RPC run-time library functions.
The server RPC run-time library functions transmit the reply
message to the client computer.
At the client side,
The client RPC run-time library receives the return values and
returns them to the client stub.
The client stub converts the data into the format used by the
- client. The stub returns the result to the calling program.
The calling procedure continues.