the grid core technologies

7
2.2 TRADITIONAL PARADIGMS FOR DISTRIBUTED COMPUTING In this section, we review traditional computing paradigms for building distributed client/server applications. Figure 2.1 shows a simplistic sketch of the possible traditional client/server architecture using a variety of communication techniques such as sockets, Remote Procedure Calls (RPC) [8], Java Remote Method Invocation www.it-ebooks.info 14 OGSA AND WSRF Figure 2.1 Traditional paradigms for distributed computing (RMI) [9], Distributed Component Object Model (DCOM) [10] and Common Object Request Broker Architecture (CORBA) [11]. In the following sections, we give a brief overview of each technique. 2.2.1 Socket programming Sockets provide a low-level API for writing distributed client/ server applications. Before a client communicates with a server, a socket endpoint needs to be created. The transport protocol chosen for communications can be either TCP or UDP in the TCP/IP protocol stack. The client also needs to specify the hostname and port number that the server process is listening on. Socket-based programs can be written in any language, but the socket APIs will vary with each language use. Typically, the socket client and server will be implemented in the same language and use the same socket package, but can run on different operating systems. As mentioned above, socket programming is a low-level communication technique, but has the advantage of a low latency and high-bandwidth mechanism for transferring large amount of data compared with other paradigms. However, sockets are designed for the client/server paradigm, and today many applications have multiple components interacting in complex ways,

Upload: ksuganthivasu

Post on 07-Dec-2015

7 views

Category:

Documents


2 download

DESCRIPTION

The Grid Core Technologies

TRANSCRIPT

Page 1: The Grid Core Technologies

2.2 TRADITIONAL PARADIGMS FORDISTRIBUTED COMPUTINGIn this section, we review traditional computing paradigms forbuilding distributed client/server applications. Figure 2.1 shows asimplistic sketch of the possible traditional client/server architectureusing a variety of communication techniques such as sockets,Remote Procedure Calls (RPC) [8], Java Remote Method Invocationwww.it-ebooks.info14 OGSA AND WSRFFigure 2.1 Traditional paradigms for distributed computing(RMI) [9], Distributed Component Object Model (DCOM) [10] andCommon Object Request Broker Architecture (CORBA) [11]. In thefollowing sections, we give a brief overview of each technique.2.2.1 Socket programmingSockets provide a low-level API for writing distributed client/server applications. Before a client communicates with a server, asocket endpoint needs to be created. The transport protocol chosenfor communications can be either TCP or UDP in the TCP/IPprotocol stack. The client also needs to specify the hostname andport number that the server process is listening on. Socket-based programs canbe written in any language, but the socket APIs will vary witheach language use. Typically, the socket client and server willbe implemented in the same language and use the same socketpackage, but can run on different operating systems.As mentioned above, socket programming is a low-level communicationtechnique, but has the advantage of a low latencyand high-bandwidth mechanism for transferring large amountof data compared with other paradigms. However, sockets aredesigned for the client/server paradigm, and today many applicationshave multiple components interacting in complex ways,which means that application development can be an onerousand time-consuming task. This is due to the need for the developerto explicitly create, maintain, manipulate and close multiplesockets.www.it-ebooks.info2.2 TRADITIONAL PARADIGMS FOR DISTRIBUTED COMPUTING 152.2.2 RPCRPC is another mechanism that can be used to construct distributedclient/server applications. RPC can use either TCP or UDP for itstransport protocol.RPCrelies heavilyonan Interface Definition Language(IDL) interface to describe the remote procedures executingon the server-side. From an RPC IDL interface, an RPC compiler canautomatically generate a client-side stub and a server-side skeleton.With the help of the stub and skeleton, RPC hides the low-level communicationandprovidesahigh-levelcommunicationabstractionfora client to directly call a remote procedure as if the procedure werelocal. RPC itself is a specification and implementations such as OpenNetwork Computing (ONC) RPC [12] from Sun Microsystems and

Page 2: The Grid Core Technologies

DistributedComputingEnvironment(DCE)RPC[13]fromtheOpenSoftware Foundation (OSF) can be used directly for implementingRPC-based client/server applications.RPC is not restricted to any specific language, but most implementationsare in C. An RPC client and server have to be implementedin the same language and use the same RPC package. Whencommunicating with a server, a client needs to specify the hostnameor the IP address of the server.

Figure 2.2 shows the data-flowcontrol in an RPC-based client/server application.Compared with socket programming, RPC is arguably easierto use for implementing distributed applications. However, RPCFigure 2.2 Data-flow control in an RPC applicationwww.it-ebooks.info16 OGSA AND WSRFonly supports synchronous communication (call/wait) between theclient and server; here the client has to wait until it receives aresponse from the server. In addition,RPCis not object-oriented.Thesteps to implement and run a client/server application withRPCare:• Write an RPC interface in RPC IDL;• Use an RPC compiler to compile the interface to generate aclient-side stub and a server-side skeleton;• Implement the server;• Implement the client;• Compile all the code with a RPC library;• Start the server;• Start the client with the IP address of the server.2.2.3 Java RMIThe Java RMI is an object-oriented mechanism from Sun Microsystemsfor building distributed client/server applications. Java RMIis an RPC implementation in Java. Similar to RPC, Java RMI hidesthe low-level communications between client and server by usinga client-side stub and a server-side skeleton (which is not neededin Java 1.2 or later) that are automatically generated from a classthat extends java.rmi.UnicastRemoteObject and implements an RMIRemote interface.At run time there are three interacting entities involved in anRMI application. These are:• A client that invokes a method on a remote object.• A server that runs the remote object which is an ordinary objectin the address space of the server process.• The object registry (rmiregistry), which is a name server thatrelates objects with names. Remote objects need to be registeredwith the registry. Once an object has been registered, the registrycan be used to obtain access to a remote object using the nameof that object.Java RMI itself is both a specification and an implementation.Java RMI is restricted to the Java language in that an RMI client

Page 3: The Grid Core Technologies

and server have to be implemented in Java, but they can run onwww.it-ebooks.info2.2 TRADITIONAL PARADIGMS FOR DISTRIBUTED COMPUTING 17Figure 2.3 Data-flow control in a Java RMI applicationdifferent operating systems in distributed locations. When communicatingwith a server, an RMI client has to specify the server’shostname (or IP address) and use the Java Remote Method Protocol(JRMP) to invoke the remote object on the server. Figure 2.3 showsthe data-flow control in a Java RMI client/server application.Java RMI uses an object-oriented approach, compared to theprocedural one that RPC uses. A client can pass an object as aparameter to a remote object. Unlike RPC which needs an IDLinterface, a Java RMI interface is written in Java. RMI has goodsupport for marshalling, which is a process of passing parametersfrom client to a remote object, i.e. a Serializable Java object can bepassed as a parameter. The main drawbacks of Java RMI are itslimitation to the Java language, its proprietary invocation protocol-JRMP, and it only supports synchronous communications.The steps to implement and run a Java RMI client/serverapplication are:• Write an RMI interface;• Write an RMI object to implement the interface;• Use RMI compiler (rmic) to compile the RMI object to generatea client-side stub and an server-side skeleton;• Write an RMI server to register the RMI object;www.it-ebooks.info18 OGSA AND WSRF• Write an RMI client;• Use Java compiler (javac) to compile all the Java source codes;• Start the RMI name server (rmiregistry);• Start the RMI server;• Start the RMI client.2.2.4 DCOMThe Component Object Model (COM) is a binary standard forbuilding Microsoft-based component applications, which is independentof the implementation language. DCOM is an extensionto COM for distributed client/server applications. Similar to RPC,DCOM hides the low-level communication by automatically generatinga client-side stub (called proxy in DCOM) and a server-sideskeleton (called stub in DCOM) using Microsoft’s Interface DefinitionLanguage (MIDL) interface. DCOM uses a protocol called theObject Remote Procedure Call (ORPC) to invoke remoteCOMcomponents.The ORPC is layered on top of the OSF DCE RPC specification.Figure 2.4 shows the data-flow control in a client/serverapplication with DCOM.DCOM is language independent; clients and DCOM componentscan be implemented in different languages. Although DCOM isavailable on non-Microsoft platforms, it has only achieved broadpopularity on Windows. Another drawback of DCOM is that itFigure 2.4 Data-flow control in a DCOM application

Page 4: The Grid Core Technologies

www.it-ebooks.info2.2 TRADITIONAL PARADIGMS FOR DISTRIBUTED COMPUTING 19only supports synchronous communications. The steps to implementand run a DCOM client/server application are:• Write an MIDL interface;• Use an interface compiler (midl) to compile the interface to generatea client-side stub and a server-side skeleton;• Write the COM component to implement the interface;• Write a DCOM client;• Compile all the codes;• Register the COM component with a DCOM server;• Start the DCOM server;• Start the DCOM client.2.2.5 CORBACORBA is an object-oriented middleware infrastructure fromObject Management Group (OMG) [14] for building distributedclient/server applications. Similar to Java RMI and DCOM, CORBAhides the low-level communication between the client and serverby automatically generating a client-side stub and a server-sideskeleton through an Interface Definition Language (IDL) interface.CORBA uses Internet-Inter ORB Protocol (IIOP) to invokeremote CORBA objects. The Object Request Broker (ORB) is thecore of CORBA; it performs data marshaling and unmarshallingbetween CORBA clients and objects. Figure 2.5 shows the dataflowcontrol in a client/server application using the CORBA.Compared with Java RMI and DCOM, CORBA is independent oflocation, a particular platform or programming language. CORBAsupports both synchronous and asynchronous communications.CORBA has an advanced directory service called COSNaming,which provides the mechanisms to allow the transparent locationof objects. However, CORBA itself is only an OMG specification.There are many CORBA products available that can be used tobuild CORBA applications. The steps to implement and run aCORBA client/server application are:• Write a CORBA IDL interface;• Use an IDL compiler to compile the interface to generate a clientsidestub and a server-side skeleton;www.it-ebooks.info20 OGSA AND WSRFFigure 2.5 Data-flow control in a CORBA application• Write a CORBA object to implement the interface;• Write a CORBA server to register the CORBA object;• Write a CORBA client;• Compile all the source codes;• Start a CORBA name server;• Start the CORBA server;• Start the CORBA client.