Remote Procedure Calls
Remote Procedure Calls
Introduction
IPC part of distributed system can often be
conveniently handled by message-passing model.
It doesn't offer a uniform panacea for all the needs.
It can be said as the special case of message-passing
model.
RPC
It has become widely accepted because of the
following features:
Simple call syntax and similarity to local procedure calls.
It specifies a well defined interface and this property
supports compile-time type checking and automated
interface generation.
Its ease of use, efficiency and generality.
It can be used as an IPC mechanism between processes on
different machines and also between different processes on
the same machine.
RPC Model
It is similar to commonly used function / procedure
call model. It works in the following manner:
1. For making a procedure call, the caller places arguments
to the procedure in some well specified location.
2. Control is then transferred to the sequence of instructions
that constitutes the body of the procedure.
3. The procedure body is executed in a newly created
execution environment that includes copies of the
arguments given in the calling instruction.
Cont…
4. After the procedure execution is over, control returns to
the calling point, returning a result.
Since the caller and the callee processes have disjoint address
space, the remote procedure has no access to data and
variables of the callers environment.
Cont…
Therefore RPC facility uses a message-passing scheme for
information exchange between the caller and the callee
processes.
It is responsible for
Retransmission,
Acknowledgement,
Routing &
Encryption.
Server Stub
It is responsible for the following two tasks:
Server implementation
Server creation
Server Implementation
Types of servers :
Stateful servers
Stateless servers
Stateful Server
A Stateful Server maintains clients state
information from one RPC to the next.
Return(bytes 0 to 99)
Instance-per-call Servers
Instance-per-session Server
Persistent Servers
Instance-per-call Servers
These exist only for the duration of a single call.
Advantages:
Most commonly used.
Improves performance and reliability.
Shared by many clients.
If there are any orphan calls, it takes the result of the first
response message and ignores the others, whether or not the
accepted response is from an orphan.
Exactly-Once Call Semantics
It is Request / Reply / ACK protocol.
Request message
First Procedure
RPC execution
Reply message
Also serves as acknowledge-
Ment for the request message
Request message
Next Procedure
RPC execution
Reply message
Also serves as acknowledge-
Ment for the request message
Request /Reply /Acknowledge-Reply
(RRA) protocol
Client Server
Request message
First Procedure
RPC execution
Reply message
Reply acknowledgement msg
Request message
Next Procedure
RPC execution
Reply message
Reply acknowledgement msg
Complicated RPC’s
Types of complicated RPCs
Issues
Providing server with clients handle
Making the client process wait for the callback RPC
Handling callback deadlocks
Cont…
Client Server
Call (parameter list)
Start Procedure execution
Simple stubs