Distributed And Parallel Computing Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Now a day's java has become most popular for the Parallel and Distributed computing. It is one of the java Network programming. It is the most efficient programming language because it allows the programmers to develop distributed objects. At the initial they used RPC (Remote Procedure Call). In this paper we are going to explain the most advanced method called Java RMI (Remote Method Invocation).

Keywords: JAVA RMI, Stub, Skeleton, Java Virtual Machine (JVM), Remote Procedure Call (RPC), TS-RMI, IM-RMI, KA-RMI & JRMP.


Java RMI is a technology that let users to call up a method that is available in remote space. This is designed from the traditional version called RPC. In Java RMI Distributed Object Technology and Distributed Component Technologies are applied to the multilayer technology which is based on web. Some other trendy distributed technologies are Distributed Common Object Model (DCOM) and Common Object Request Broker Architecture (CORBA). But the CORBA is slightly varied from Java RMI such as language independence, functionalities, hard to understand etc. DCOM is purely a Platform Dependent one. Among these three technologies Java RMI is the best and I am going to talk about it in detail [Ref 1].

Area of Investigation: Java RMI

Java RMI is a widely used technology for Distributed and Web Based Technology. Sun Microsystems is the developer of this technology. At the initial stage it was JDK 1.1 after that it is updated and gone to further versions. Default RMI is known as JRMP (Java Remote Method Protocol) and it is embedded with Concrete Wire Protocol [Ref 3]. It can inter-communicate with COBRA and other Web Services. It overcomes the drawbacks of CORBA and DCOM also it is platform independent language. i.e.: runs in any platform. Java RMI is designed by the concept of Client-Server methodology. It allows the client to access objects from remote servers. [Ref 2]

Mainly for providing fast way of communication with java RMI the object serialization has been designed [Ref 4]. Communication in Java RMI is carried out by a middle ware layer. There are different types of communication such as synchronous and asynchronous. The Synchronous RMI communication will result in bottleneck so we use asynchronous communication in real time [Ref 5]. To avoid the running time for interpretation in object, the technique named partial evaluation is used [Ref 4].

JAVA RMI Architecture [Ref 6, 7, 8]:

The main goal of Java RMI is to support Distributed objects and it is developed in core java environment. It consists of two different programs, Server program and client program. The whole process is explained in the below diagram:

Fig 1: RMI Architecture [Ref 7]

The remote objects are created in server program and it provides accessible to the client program. This types of RMI system let the programmers to communicate with the remote object which are executed in Java Virtual Machine of the remote computer. Three layers are used to accomplish communication in RMI, they are:

Stub/Skeleton Layer

For interaction between client program and the server program this layer is used. Client process uses stub to send the remote object request, and the server process uses skeleton to receive the request.

Fig 2: Stub/Skeleton Layer [Ref 6].

Remote Reference Layer

The Remote Reference Layer act as a middleware between first layer i.e.: Stub/Skeleton Layer and the Transport Layer. Remote Object References are designed and managed in the layer.

Transport Layer

Transport Layer afford basic connectivity between the client and the server programs, also it take care of some firewall penetration policy. Communication takes place by the concept of TCP/IP protocol

Fig 3: Transport Layer [Ref 6].

In Fig 1 Server process is the one which provide access to the remote object, and the client process send a request to the server and access the remote object over the network. Application used by the server and the client to communicate and to send information is termed as Distributed Object Application. [Ref 6, 7, 8]

Applications of the area:

Implementation of RMI:

"Writing & compiling java code for the Interfaces.

Writing & compiling java code for Implementation classes.

Generating the class files of Stub and Skeleton from Implementation classes.

Develop the java code for remote service host.

Developing java code for RMI client program." [Ref 9]

Stubs and Skeletons act as an interface between the client and server. Stub act as a local representative of client. Caller always invokes the local stub's method, because it is responsible for carrying the call on remote object.

Processing steps of Stub:

"Stub initiates the connection with remote Java Virtual Machine (JVM).

It marshals the parameters to remote JVM.

Then, it waits to get result of invocation.

Unmarshals the value or exception returned.

Finally stub returns the value." [Ref 10]

RemoteStub Class, RemoteCall, RemoteRef, ServerRef and Skeleton Interface are the classes and interfaces used by stubs and skeletons. These interfaces and classes are generated by rmic stub complier.

java.rmi.Remote is used to design the Remote Interface.

For example, Lets we see the coding for RemoteStub Class.


Package java.rmi.server;

public abstract class RemoteStub extends java.rmi.RemoteObject {

protected RemoteStub () {...}

protected RemoteStub (RemoteRef ref) {...}

protected static void setRef (RemoteStub stub, RemoteRef ref) {....}

"[Ref 11]

Consider the above code, the constructor protected RemoteStub is used to create a stub interface.

Experimental Research:

Nowadays, RMI is most extensively used technology and it developed into the core of J2EE technology. Considering plain RMI does not have sufficient security issues to construct production systems. So we have to fix some security vulnerabilities in the RMI. Lot of security issues is been taken care by the Sun Microsystems and they have been focusing only in the part of commercial work. There is no lot of concentration on the RMI part. Mainly RMI is termed as the obstruct for building the distribution systems. There are two technologies such as GSS (Generic Security Services), Kerberos, Java RMI, Java Authentication and Java Authorization for the various aspects of secure RMI. This ISO/OSI model is modifying the plain RMI to secure RMI and with help of these transparencies is easily attained. The various services used in server side components of the secure RMI such as discovery/authentication services and the dispatcher. The discovery services are used for passing the configuration obtained in the parameters and sending the network address from client to the server. This authentication services is used to obtain the ticket from the client to the server for the dispatcher purpose. Mainly the dispatcher used to cover and uncover parameters obtained in the RMI.

In the transport layer, custom socket can be created with the help of sockets, streams and factories. The applications under gone with performance of evaluation tests. Main problem is obtained from the server side for the creation of remote objects. The solution of the result is the secure RMI is used for static fields to pass arguments to the streams. So the client side for the security issues of attributes and client should use the static fields for this attributes.[Ref 12] To improve the standards of the RMI, the RMI is used in various analysis and investigations to obtain RMI frameworks. A system termed as KARMI to improve the performance and capabilities. This KARMI is replaced with the standard Java RMI, were this system is also written with the help of pure Java and develop the serialization. This system does not support the TCP/IP communication network and afford a proficient tool of RMI computation of cluster-wide components. But this KARMI does not operate with RMI applications and the services. This system is mature and turned into a disturbed system of framework of Java Party. The RMI involved with various multiprotocol applications in nature to exchange large of amount of data for obtaining efficient protocols.[Ref 3]

Mainly RMI clients use the JRMP of proprietary protocol over the TCP for transmission of invocation request from the client to remote servers. The serialization object is approved as the parameter for the invocation. RMI communication with the remote object is to identify a remote reference and the RMI stub will open the TCP channel. This TCP channel involved with the three way handshake process. Then the TCP parameters and the identifications are been switched over from the client to server. At last an invocation request is sent to server and separated into more TCP segments to be dispatched. The application for optimizing RMI is to obtain the RPC mechanisms to hide the communications and significant simplifies for the client and server programming. There is a problem with the sequential invocations in standard RMI. So this sequential invocations is compared with the optimized ninja RMI to obtain the results for the concurrent RMI invocations in the multithreading. There is only limited improvement in the optimized ninja RMI and with other asynchronous communication to make the improvement in ninja RMI. So this ninja RMI is modified into java RMI. This modifications is compared and founded the results to obtain the IIOP protocol.[Ref 5].

There are two techniques involved in the caching of object consistency such as time stamp and invalid message. The time stamp is used to compare the modified timer on the server with the cached time on the client. If client request to the server for consistency check of cached object. Client will provide TS to RMI. This type of modified RMI is termed as TS-RMI. The invalid message is used to update the message on clients with the help of cached object. When requirement of changes is happens in the server. To approach this requirement, the modified RMI is applied from IM to RMI and it is termed as IM-RMI. The problem in this to check average response time under the update of object frequency in equal computing environments. The solution for this problem is comparing the TS-RMI with the IM-RMI and founded the result as TS-RMI has the quicker response time than the IM-RMI.[Ref 13]

Example JAVA RMI Program for running Calculator Application:

First step in writing the Calculator program is creating an Interface.

public interface Calculator

extends java.rmi.Remote {

public long add(long a, long b)

throws java.rmi.RemoteException;

public long sub(long a, long b)

throws java.rmi.RemoteException;

public long mul(long a, long b)

throws java.rmi.RemoteException;

public long div(long a, long b)

throws java.rmi.RemoteException;


Save the above interface code as Calculator.java.

Next step is writing an Implementation program, which contains set of functions required for calculator such as add, subtract, multiply and division. Save this code as CalculatorImpl.java

public class CalculatorImpl

extends java.rmi.server.UnicastRemoteObject

implements Calculator {

// Implementations must have an explicit

// constructor in order to declare the

// RemoteException exception

public CalculatorImpl()

throws java.rmi.RemoteException {



public long add(long a, long b)

throws java.rmi.RemoteException {

System.out.println(a + "+" + b);

return a + b;


public long sub(long a, long b)

throws java.rmi.RemoteException {

System.out.println(a + "-" + b);

return a - b;


public long mul(long a, long b)

throws java.rmi.RemoteException {

System.out.println(a + "*" + b);

return a * b;


public long div(long a, long b)

throws java.rmi.RemoteException {

System.out.println(a + "/" + b);

return a / b;



This step contains the Server code to get Remote RMI services and save it as CalculatorServer.java

import java.rmi.RemoteException;

import java.rmi.registry.*;

public class CalculatorServer {

public CalculatorServer() {

try {

Calculator c = new CalculatorImpl();

// This server program creates an RMI registry

// to avoid the need to start it manually.

Registry registry =



"java RMI registry created.");

registry.bind("CalculatorService", c);

} catch (Exception e) {

System.out.println("Trouble: " + e);




public static void main(String args[]) {

new CalculatorServer();



Finally, a Client should be written as follows:

import java.rmi.Naming;

import java.rmi.RemoteException;

import java.net.MalformedURLException;

import java.rmi.NotBoundException;

public class CalculatorClient {

public static void main(String[] args) {

try {

Calculator c = (Calculator)Naming.lookup(


System.out.println( c.sub(8, 6) );

System.out.println( c.add(1, 2) );

System.out.println( c.mul(5, 4) );

System.out.println( c.div(15, 5) );


catch (MalformedURLException murle) {






catch (RemoteException re) {





catch (NotBoundException nbe) {






catch(java.lang.ArithmeticException ae) {








Save the above code as CalculatorClient.java

All the codes should be compiled using javac classname.java

Class files such as Calculator.class, CalculatorImpl.class, CalculatorServer.class & CalculatorClient.class will be generated after compilation.

Finally, CalculatorServer and CalculatorClient program should be compiled in different command prompt, thus it shows the output of our program.

Snapshot of the Output:

The above Calculator Application program has been taken from the source:

JGuru, "jGuru: Remote Method Invocation", Available online at: http://java.sun.com/developer/onlineTraining/rmi/RMI.html, Accessed on: 04-MAY-2011.

Advantages of Java RMI over Distributed and Parallel computing:

High Performance and simple implementation in RMI leads to support the robust, maintainable, flexibility in the applications.

In continuous decoupling of client and server object allows to the distributed system creations.

Possible ways to create no installation for client of the users and client installation does not required for the every browser expect the java browsers.

The server interface does not require to be recompiled but the server object to be recompiled at the time of changes required to the database.

In the multithreading advantage in parallel computing, server utilizes the java threads for better processing of client request. [Ref 15]

RMI is the core platform of JDK 1.1 version and that available in every JVM. So without the translation in protocol, RMI communicates with same public protocol with every java systems. [Ref 15]


Java RMI has been analyzed with Distributed and parallel computing. We have collected required research papers involved with various techniques for the RMI. The security issues have been clearly stated and optimization of various strategies involved in the RMI concepts is also described. The Processing steps of Java RMI with stub and skeleton with sample program has been given.


(Vignesh Murali) From this assignment I learned about java RMI, how it can be implemented in distributed and parallel computing. Now a day this concept is extended to J2EE also because of the distributed object facility. The first build JAVA RMI support authentication and authorization facilities. The plain RMI is converted to secure RMI by ISO/OSI model, this will make the communication more secure while transferring from client to server and vice versa.

(Vengatesh Ganesan) From this report, I learnt how the JAVA RMI is implemented with the distributed and parallel computing. Also I learned how the RMI is processed using Stub & Skeleton in relating server and client. As the group member in this assignment, I have understood the basic concepts in the RMI and the extension of this java code is very simple when compared to other language which support remote object. The performance of this JAVA RMI is good enough. We can easy import function from java library by using command "import". this will reduce the size of the code. The multiprotocol of the RMI is explained with the standards of KARMI. The comparative analysis made with the standard RMI and KARMI.

(Lathif) Reflection of an assignment involves many different stages. Generally, the process of reflection of myself is one the most challenging part in which I should explain what I have learnt from the study, how did I discussed and critized the supporting points and how I tried including my ideas. The various security enhancements are also studied in RMI. The various technologies and protocols are used for the secure communication from the client and the server.

(Ram Vinoj Raja) From this assignment, I learned about the java RMI, it is one of the most powerful tools to implement parallel and distributed computing, because java RMI supports distributed objects. Also I learned about what is client process, server process, the efficient implementations and comparing the TS-RMI with the IV-RMI for the server and the client are communicating each other. What is the main technique used by the Server/client like stub/skeleton etc. Java RMI considered being the most secure when compared with others like CORBA and DCOM, because it supports both authentication and authorization.

(AMIT) Java RMI is a part of the Java program which has a set of classes, objects and methods. This is one of the object oriented programming and platform independent- this is the main advantage of using this. Objects that are created by the java Rmi can be accessed from the remote computer ie: distributed object. The optimizing strategies involved in TCP channel communication with the help of RMI stub. The main methodology used here is client/Server. Security features available in this Java RmI program is very high. For accessing an object from the remote computer we need a component called Java Virtual Machine (JVM)

(Karnan Kandasamy)

This assignment gives me an opportunity to learn about the java language, its functionalities etc. Now a day's java has become one of the most popular languages in the IT industry, because of it is secure, reliable, efficient, high performance. Java rmi one of the components derived from the main java, so the java RMI also supports all the above mentioned features of java. The security enhancements are briefly explained and the creation of socket objects in the communication. The developed java code can be complied and interpreted using java compiler and interpreter. This interpreted code can be copied and run in any machine which supports java virtual machine.