Brief survey of RMI protocols

Although Java provides an interface for programming with sockets,
typical applications require a higher-level protocol that can handle
encoding and decoding of messages. Java RMI [25] is an API
for remote method invocation - the invocation of a method in a remote
object by a locally resident object. The polymorphism inherent in
method calls makes the Java RMI API a more flexible alternative to
RPC-based (Remote Procedure Call) APIs [30]. The actual
class implementing the method can be dynamically loaded into the
running application. The communication between the client and server
is implemented by stub class on the client end and a skeleton class on
the server end. The stub converts the arguments of the method
invocation into a format used for transporting across the network to
the remote object (this process is called serialization), and
assembled together back again by the skeleton (deserialization) at the
remote end. The result object is likewise serialized by the skeleton
and deserialized by the stub.

Nexus RMI [6] is an implementation of the Java RMI API
that uses Nexus [17] as the communication medium. Object
serialization is achieved by adding public methods to serializable
objects so that their private and protected fields can be accessed.
Our experiments (see
Figure 4, for example)
show that Java RMI is at least four times faster than Nexus RMI.
However the important feature of Nexus RMI is that it allows
interoperability between Java and C++ [6].
Several recent efforts have addressed the problem of improving RMI
performance. Philippsen et al. [28] have built
drop-in replacements for JDK implementations that significantly
improve performance. Thiruvathukal et al. [29] use
explicit methods for serialization and deserialization in order to
read and write an object's internal state. Manta [22]
achieves impressive performance for RMI based on transparent
extensions of Java for distributed environments. A native compiler
generates efficient serial code and specialized serialization routines
for argument classes. As a result these classes avoid run-time
inspection.