Implementing
Remote Procedure Calls (RPC)
Andrew S Birrel and Bruce Jay Nelson
Xerox, PARC
RPC
Inter-machine process to process communication
 Local
networks, internets
Procedure calling interface
arguments – get results
 Fits into high-level programming languages
 Well understood
 Pass
Is it a general communication protocol ?
 IPC
within single machine?
 File transfer protocols?
Scope of use…
Distributed Computing
 Task
and data partitioned environments
 Task distribution

Front-end load-balances across functional back ends
Services
 Client-server model
 Mail
servers, databases (transaction servers)
Alternative to message passing?
Problem being addressed…
Efficient RPC implementation to meet aims and in
given environment
Set down semantics of making the call
 What

type of arguments
Crossing address boundaries
 Compiling
 Naming,
binding
Data integrity and security
 Public
internets
Cedar Environment
internet: telephone
and satellite links
Ethernet:3, 10Mbps
(usage 10-40%)
RTT ~120 us
RPC
Dorado
Local call
~10 us
Aims
Simplify construction of distributed applications
 Difficult

to write communication modules
Low level interfaces – first popular TCP/IP distribution in ’83
Make RPC highly efficient
 Latency: <=5
times transmission
Make RPC as complete a protocol as possible
 Prevent
supplementary communication protocols
Secure end-to-end communication
Design Decisions
Why not message passing interface?
 Face same challenges
 Channel reliability, argument (de)serialization, security
– procedure calls – primary data/control transfer
mechanism
 Mesa
Remote fork
Shared address space
 Severe
modifications to programming language,
machine
Make RPC look similar to local calls
 No
timeout mechanism!
Waldo’s Opinion…
“…a local member function call and a crosscontinent invocation are not the same thing.”
 Single
underlying implementation
Location of the object should be exposed to the
programmer
Provide a variety of implementations, chosen
based on location of object
Components
How to rendezvous?
Naming
 Type
and instance names
Locating the server
 Grapevine

– distributed database
Service type, member-list, connect-site for each member
 Alternatives -
explicit addressing, broadcast query
Binding
• Exporter: specifies network address, identifier, table index
• Importer: can iterate through member list returned by Grapevine
Consequences of Binding protocol
Delayed Binding
 Client can
choose among multiple instances
Stateless servers
 Binding
does not add to server state
Fault resilience
 Can
rebind to alternate instances
Authentication server
 Access
control
Binding granularity – interface (set of methods)
Wiring the packets…
Existing communication protocols are heavyweight
 Byte
stream protocols for high rate data transfer
 RPC call/ACK packets often are small
Eliminate connection set up costs
 Connections
are not persistent
Minimize state on server side
 No
transmission windows
Call Sequence
Simple calls – 1 packet with embedded arguments
Implicit acknowledgement
RPC runtime on callee stores activity data
Complicated calls
Failures
Machine failures are handled through:
 Retransmission,
rebinding
Mesa has exceptions and catch phrases!
 RPC
runtime passes back exception packets
Only pass back exceptions defined in interfaces
Call failed exceptions
 Difference
in local and remote calls
To block, or not to block?
To spawn, or not to spawn?
Process swapping, creation are inexpensive!
 RPCs
have a lot of them – it can become costly
 Callee – controlled pool of server processes
 Process
identifier in the call arguments saves ACKs
Caller - blocking
Each call results in 4 process swaps
 Can
reduce it to 2
Performance
Large arguments tend to hide the RPC overhead
Serialization of arbitrary data types can be
burdensome
Summary
High performance inter-machine IPC
 Custom
transport protocol
RPC Semantics - Exactly once execution
 Robust
against server, client and network failures
Eases the implementation of distributed
applications
Can be used for high data rate communication
without the flow & congestion control features
Performance over the years
Systems vary in processor, network, kernel-tokernel or user-to-user, stub generation, ……
Java’s RPC - RMI
Fast Ethernet 10/100 ; RTT ~80usec
Descargar

Implementing Remote Procedure Calls (RPC)