Distributed Computing

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
CSE 486/586 Distributed Systems Remote Procedure Call
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Distributed Objects and Remote Invocation
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) September 20, 2012 Lecture 8 RPCs and Distributed.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Introduction to Remote Method Invocation (RMI)
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Communication in Distributed Systems –Part 2
.NET Mobile Application Development Remote Procedure Call.
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
CS425 /CSE424/ECE428 – Distributed Systems – Fall Nikita Borisov - UIUC1 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S.
Information Management NTU Interprocess Communication and Middleware.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Lecture 15-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) October 12, 2010 Lecture 15 RPCs and Distributed.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Abhishek Bachchan Vishal Patangia
Java Remote Method Invocation RMI. Idea If objects communicate with each other on one JVM why not do the same on several JVM’s? If objects communicate.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
CORBA Common Object Request Broker Architecture. Basic Architecture A distributed objects architecture. Logically, an object client makes method calls.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
Distributed Objects and Remote Invocation Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network.
Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) September 19, 2013 Lecture 8 RPCs and Distributed.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Distributed objects and remote invocation Pages
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems Lecture 8 RPC and marshalling 1.
Topic 5: CORBA RMI Dr. Ayman Srour
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
CORBA & Design Pattern Csc8350 Advanced Software Engineering Georgia State University Dr. Xiaolin Hu.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
CORBA & Design Pattern Csc8350 Advanced Software Engineering Georgia State University Dr. Xiaolin Hu.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
CSE 486/586 Distributed Systems Remote Procedure Call
CORBA Alegria Baquero.
What is RMI? Remote Method Invocation
Distributed Systems Course Topics in distributed objects
Programming Models for Distributed Application
Inventory of Distributed Computing Concepts and Web services
DISTRIBUTED COMPUTING
CORBA Alegria Baquero.
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Inventory of Distributed Computing Concepts
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote method invocation (RMI)
Distribution Infrastructures
Remote invocation (call)
Java Remote Method Invocation
Presentation transcript:

Distributed Computing Selo 2 Agustus 2005

Outline Distributed Computing RMI CORBA Comparasion RMI vs CORBA summary

Distributed Computing Distributed computing is an application design model in which the program, data and the actual computation is spread across the network

Distributed Computing (You can think about) Distributed computing: braking down an application into individual computing agents that can be distributed on a network of computers, yet still work together to do cooperative tasks.

Motivations use of small available computers instead of larger (unavailable) ones; not to move (huge) data; fault tolerance (if a machine or agent goes down, the job can still carry on); …

Example of Distributed Computing How are “transactions” executed between a client ATM and a bank server? Bank Database: Think of two simultaneous deposits of $10,000 into your bank account, each from one ATM. Both ATMs read initial amount of $1000 concurrently from the bank server Both ATMs add $10,000 to this amount (locally at the ATM) Both write the final amount to the server What’s wrong? The ATMs need mutually exclusive access to your account entry at the server

Distributed Programming low level: sending data among distributed computations network is visible (to the programmer) programmer must deal with many details higher level: supporting invocations among distributed computations network is invisible (to the programmer) programmer focuses on application

Remote Procedure Call

Remote Object Systems

Anatomy processes; threads; objects; agents. : (a significant functional element of a distributed application)

Issues to face when developing distributed systems partitioning and distributing data and functions; flexible, extendible communication protocol; security issues, generating stubs/proxies serialization or arguments and return values heterogeneity of data representations locating servers in a distributed environment authentication of called and calling procedures semantics of invocation

Distributed Computing Techniques Sockets Remote Procedural Call Java Message Services Remote Method Invocation CORBA DCOM

provide a protocol for transmitting data over a network. Distribution schemes CORBA, RMI, … provide a protocol for transmitting data over a network.

Middleware Layers Applications RPCs and RMIs, e.g., CORBA Middleware Provide support to the application Request reply protocol External data representation Operating System RPCs and RMIs, e.g., CORBA RMI=Remote Method Invocation CORBA=Common Object Request Brokerage Architecture

Remote Method Invocation

What is RMI ?  Remote method invocation (RMI) is the action of invoking a method of a remote interface on a remote object. Java RMI is a distributed object model that makes distributed object easy to implement and to use.

Remote Method Invocation After a client is bound to an object, it can invoke the object’s method through the proxy. Such a remote method invocation (RMI) is similar to a RPC with respect to marshaling and parameter passing. The difference is that RMI supports systemwide object references.

Remote Method Invocation An interface definition language is used in RMI to specify the object’s interface. Static invocation implies using object-based languages (e.g., Java) to predefine interface definitions. Dynamic invocation permits composing a method invocation at run-time.

Remote Method Invocation Client Process Proxy object is a hollow container of Method names. Remote Reference Module translates between local and remote object references. Proxy Object B Object A Remote Reference Module Comm. Module Server Process Dispatcher sends the request to Skeleton Object Skeleton unmarshals parameters, sends it to the object, & marshals the results for return Comm. Module Remote Reference Module Dispatcher Object B Skeleton for B’s Class MIDDLEWARE

Remote Reference Module Is responsible for translating between local and remote object references and for creating remote object references. Has a remote object table An entry for each remote object held by the process. E.g., B at P2. An entry for each local proxy. E.g., B at P1. When a remote object is seen by the remote reference module, it creates a remote object reference and adds it to the table. When a remote object reference arrives in a request or reply message, the remote reference module is asked for the corresponding local object reference, which may refer to either a proxy or to a remote object. In case the remote object reference is not in the table, the RMI software creates a new proxy and asks the remote reference module to add it to the table.

Proxy Is responsible of making RMI transparent to clients by behaving like a local object to the invoker. The proxy implements (Java term, not literally) the methods in the interface of the remote object that it represents. But,… Instead of executing an invocation, the proxy forwards it to a remote object. Each method of the proxy marshals the following into a request message: (i) a reference to the target object, (ii) its own method Id and (iii) the argument values. Request message is sent to the target, then proxy awaits the reply message, un-marshals it and returns the results to the invoker.

Marshalling & Unmarshalling External data representation: an agreed, platform-independent, standard for the representation of data structures and primitive values. CORBA Common Data Representation (CDR) Allows a Windows client (little endian) to interact with a Unix server (big endian). Marshalling: the act of taking a collection of data items (platform dependent) and assembling them into the external data representation (platform independent). Unmarshalling: the process of disassembling data that is in external data representation form, into a locally interpretable form.

What about Server Side? Dispatcher and Skeleton Each process has one dispatcher, and a skeleton for each local object (actually, for the class). The dispatcher receives the request message from the communicating module. It uses the method Id to select the appropriate method in the skeleton, passing on the request message. Skeleton implements the methods in the remote interface. A skeleton method un-marshals the arguments in the request message and invokes the corresponding method in the remote object. It waits for the invocation to complete and marshals the result, together with any exceptions, in a reply message.

Java RMI  Distributed objects have been integrated in the Java language with a goal of a high degree of distribution transparency. Java adopts remote objects as the only form of distributed objects. [i.e., objects whose state only resides on a single machine] Java allows each object to be constructed as a monitor by declaring a method to be synchronized.

What does Java provide? Object Oriented environment; abstract interfaces; platform independence; fault tolerance through exception handling; network support; security (runtime environment, secure remote transactions); multithreading support.

Java RMI However there are problems with distributed synchronization. Thus, Java RMI restricts blocking on remote objects only to the proxies. This means remote objects cannot be protected against simultaneous access from processes operating on different proxies by using synchronization methods. Explicit distributed locking techniques must be used.

Java Remote Object Invocation Any primitive or object type can be passed as a parameter to an RMI provided the type can be marshaled. [i.e, it must be serializable.] Platform dependent objects such as file descriptors and sockets cannot be serialized. In Java RMI reference to a remote object is explained on slide 14. A remote object is built from a server class and a client class.

Java Remote Object Invocation Proxies are serializable in Java. This means proxies can be marshaled. In actually an implementation handle is generated, specifying which classes are needed to construct the proxy. The implementation handle replaces the marshaled code as part of a remote object reference. This passing of proxies as parameters works only because each process is executing the same Java virtual machine.

Java RMI Architecture

Java RMI Client Server Interaction

Java RMI Security Manager Since RMI involves access to/from a foreign host, and possibly object downloading, it is important for both the server and the client to protect its system from malicious access. The RMISecurityManager is a class provided Java, and can be instantiated in both the client and the server for limiting access priviledges. You can write your own security manager, if so desired. try { System.setSecurityManager(new RMISecurityManager( )); } catch { …}

Algorithm for building an RMI Application Server side: Open a directory for all the files to be generated for this application. Specify the remote-server interface, and compile it to generate the interface class file. Build the remote server class by implementing the interface, and compile it using javac. Use rmic to process the server class to generate a stub.class file and a skelton.class file: rmic SomeServer If stub downloading is desired, copy the stub file to an appropriate directory on the HTTP host. Activate the RMIRegistry, if it has not already been activated. Set up a java.policy file. Activate the server, specifying (i) the codebase if stub downloading is desired, (ii) the server host name, and (iii) the security policy file.  

Alogorithm for building an RMI Application Client side: Open a directory for all the files to be generated for this application. Implement the client program or applet, and compile it to generate the client class. If stub downloading is not in effect, copy the server interface stub class file by hand. Set up a java.policy file. Activate the client, specifying (i) the server host name, and (ii) the security policy file.  

CORBA

Why CORBA The needs of distributed computing arise in 1980s, the central characteristics of which are: Distributed applications – i.e. applications that run on a network of machines The integration of legacy applications into new systems The use of different programming languages to write new components or to wrap legacy codes

Solution prior to CORBA Remote procedure calls (RPCs) Enabling functions to be invoked by clients on one machine and executed by servers on a different machine Low-level; provides very little in the way of encapsulation Other problems include queuing of requests, event notification, transaction management…

CORBA – an Integration of RPCs and Object Oriented Concept Gives rise to notions of distributed components and interface-based programming Clients program to an interface where different implementations of the interface (components) are possible Notions like inheritance, delegation, dynamic binding are kept in CORBA

What Does CORBA Bring to Us? A uniformity to a disparate and varied world of computing Interoperability among largely distinct, distributed, and legacy programs Fostering the development of open architectures – i.e., designs that are more easily evolvable and maintainable

Essential CORBA concepts A CORBA component is an object A CORBA interface is specified in CORBA IDL A CORBA class implements one or more CORBA interfaces CORBA is programming-language neutral The execution of a CORBA component is location transparent

Distributed Objects Distributed objects are partitioned into sets; all objects in a set belongs to the same process. Each set is identified an a pair (M,P) where M is a unique machine name and P is a process id Machine M1 Process P1 Machine M2 Process P2 Machine M2 Process P7

IDs and Names of Objects All CORBA objects have globally unique identifiers called Interoperable Object References (IORs), which are machine generated and not intended for human use A named object has a well-known, unique, human-friendly name that clients use to access it A server process advertises one or more named objects; client processes have no named objects

Access to Remote Objects Clients access remote objects via references --- light-weight objects that have the same interface as remote objects, except their task is to forward all methods invocations to the server for remote object execution References can be exchanged among processes, but the location of the remote objects remains unchanged.

Access to Remote Objects (cont.) named remote object unnamed object reference

Object Request Broker (ORB) Runs in every CORBA process, responsible for communicating with other ORBs Acts as a message bus between objects Interacts with each other via General Inter-ORB Protocol (GIOP)

What an ORB Does Locate the object to which the message is to be sent If the object is at another process, pass the message to the ORB of that process If the object is within the same process as the ORB, ensures that the object is ready to receive the request and pass the parameters to the object

CORBA Interface Definition Language (IDL) IDL is the basis of CORBA interface-centric programming, which enables the development of language-neutral interfaces that CORBA objects implements. Language-specific compilers will translate IDL specifications into language-specific source codes that is used to implement those interfaces

Interface Centric Programming Suppose the server is written in language L1, and the client is written in L2 Define the interface (I) of server object by CORBA IDL (language neutral) Compile I to I’ written in L1; the server object implements I’ Compile I to I’’ written in L2

Interface Centric Programming (cont.) The client object creates a reference of the the server object that has I’’ as its interface Whenever the client object needs to call the server object to perform some operation, it calls the corresponding method of the reference instead. CORBA will automatically forward the method call to the remote server object

IDL Syntax Based on C++ concepts and syntax Supports typedefs, unions, enumerated types, sequences Needs language-specific compilers to translate it into language-specific interface – will not be discussed here

Modules A module is a basic unit that defines a distributed application A module has three parts: structure definition, exception definition and interface definition module M { struct S1 {…}; struct S2 {…}; … exception E1 {…}; interface I1 {…}; };

Structures A structure is a named sequence of data members The type of a data member can be CORBA primitive types, another structure, or an interface struct MyData { short x; string y; AnotherStruct s; MyInterface o; };

Exceptions The standard way of processing errors in CORBA Syntactically identical to structures – it has a name and a list of public data members that are to be transmitted with the exception exception Oops { string whatiswrong; long exceptioncode; };

Interfaces Interfaces of remote objects are defined by the interface declaration An IDL interface I is a sequence of one or more constants and/or method declaration interface I { // constant declarations // method declarations };

An Example Written in CORBA IDL //M.idl Module M { exception Oops { string whatisworng; }; interface MyInfo { string name; void setName( in string aName); } interface InfoManager { void register ( in MyInfo info ) raises (Oops); boolean find ( in string name, out MyInfo info);

Summary CORBA is an infrastructure for building distributed applications, Servers advertise named objects with known interfaces. Client uses these names to create references to server objects in order to invoke their methods.

Summary (cont.) CORBA objects are created within the confines of a process which executes object request broker (ORBs). The ORB handles all inter-process communication among different CORBA objects, and largely hides the ugly details of writing distributed systems.

Summary (cont.) CORBA is based on interface-centric programming. CORBA designs center around language-neutral interfaces that CORBA objects implement. The centerpiece pf CORBA is its interface definition language (IDL), the language in which language-neutral interfaces are expressed. Language-specific compilers translate IDL specifications to language-specific source code.

Comparasion CORBA vs RMI

Invocation Semantics Fault tolerance measures Invocation semantics whether to keep a history of result messages to enable lost results to be retransmitted without re-executing the operations Whether or not to retransmit the request message until either a reply is received or the server is assumed to be failed when retransmissions are used, whether to filter out duplicate requests at the server. Fault tolerance measures Invocation semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Yes Not applicable At-least-once Maybe CORBA (ok for idempotent operations) Java RMI, CORBA Idempotent=same result if applied repeatedly

Generation of Proxies, Dispatchers and Skeletons In CORBA, programmer specifies interfaces of remote objects in CORBA IDL; then, the interface compiler automatically generates code for proxies, dispatchers and skeletons. In Java RMI The programmer defines the set of methods offered by a remote object as a Java interface implemented in the remote object. The Java RMI compiler generates the proxy, dispatcher and skeleton classes from the class of the remote object.

Binder and Activator Binder: A separate service that maintains a table containing mappings from textual names to remote object references. (sort of like DNS) Used by servers to register their remote objects by name. Used by clients to look them up. E.g., Java RMI Registry, CORBA Naming Svc. Activation of remote objects A remote object is active when it is available for invocation within a running process. A passive object consists of (i) implementation of its methods; and (ii) its state in the marshalled form. Activation creates a new instance of the class of a passive object and initializes its instance variables. It is called on demand. An activator is responsible for Registering passive objects (recording the names of the servers against the names of the passive objects) Starting named server processes and activating remote objects in them. Keeping track of the locations of the servers for remote objects it has already activated E.g., Activator=Inetd, Passive Object/service=FTP (invoked on demand)

Selesai