Remote procedure call on client server computing, what is Remote procedure call on client server computing, Remote procedure call on java, Remote procedure call on client server computing
2. REMOTE PROCEDURE
CALL (RPC)
Is a protocol that one program can use to request a
service from a program located in another computer in
a network without having to understand network details.
A procedure call is also sometimes known as a function
call or a subroutine call.
The requesting program is a client and the service-
providing program is the server.
When program statements that use RPC are compiled
into an executable program, a stub is included in the
compiled code that acts as the representative of the
remote procedure code.
the server includes a runtime program and stub that
interface with the remote procedure itself.
4. STUBS
When the calling process calls a procedure, the action
performed by that procedure will not be the actual
code as written, but code that begins network
communication.
It has to connect to the remote machine, send all the
parameters down to it, wait for replies, do the right
thing to the stack and return. This is the client side stub.
The server side stub has to wait for messages asking for
a procedure to run.
It has to read the parameters, and present them in a
suitable form to execute the procedure locally. After
execution, it has to send the results back to the calling
process.
5. HOW RPC WORKS?
An RPC is analogous to a function call. Like a function
call, when an RPC is made, the calling arguments are
passed to the remote procedure and the caller waits
for a response to be returned from the remote
procedure.
The client makes a procedure call that sends a request
to the server and waits.
When the request arrives, the server calls a dispatch
routine that performs the requested service, and sends
the reply to the client.
After the RPC call is completed, the client program
continues. RPC specifically supports network
applications.
6.
7. RPC APPLICATION
DEVELOPMENT
To develop an RPC application the following steps are
needed:
• 1) Specify the protocol for client server
communication
• 2) Develop the client program
• 3) Develop the server program
The programs will be compiled separately.
The communication protocol is achieved by
generated stubs and these stubs and rpc (and other
libraries) will need to be linked in.
9. STUB
The client calls the local stub procedure. The stub packages up
the parameters into a network message. This is called marshaling.
Networking functions in the O/S kernel are called by the stub to
send the message.
The kernel sends the message(s) to the remote system. This may
be connection-oriented or connectionless.
A server stub unmarshals the arguments from the network
message.
The server stub executes a local procedure call.
The procedure completes, returning execution to the server stub.
The server stub marshals the return values into a network
message.
The return messages are sent back.
The client stub reads the messages using the network functions.
The message is unmarshalled. And the return values are set on
the stack for the local process.