Remote Object Invocation

Similar documents
Last Class: Communication in Distributed Systems. Today: Remote Procedure Calls

Lesson 4 Web Service Interface Definition (Part I)

Communication. Layered Protocols. Topics to be covered. PART 1 Layered Protocols Remote Procedure Call (RPC) Remote Method Invocation (RMI)

Infrastructure that supports (distributed) componentbased application development

Chapter 2: Remote Procedure Call (RPC)

Middleware Lou Somers

How To Write A Network Operating System For A Network (Networking) System (Netware)

Introduction CORBA Distributed COM. Sections 9.1 & 9.2. Corba & DCOM. John P. Daigle. Department of Computer Science Georgia State University

Chapter 6. CORBA-based Architecture. 6.1 Introduction to CORBA 6.2 CORBA-IDL 6.3 Designing CORBA Systems 6.4 Implementing CORBA Applications

Report of the case study in Sistemi Distribuiti A simple Java RMI application

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Module 17. Client-Server Software Development. Version 2 CSE IIT, Kharagpur

Introduction to CORBA. 1. Introduction 2. Distributed Systems: Notions 3. Middleware 4. CORBA Architecture

Transport layer protocols. Message destination: Socket +Port. Asynchronous vs. Synchronous. Operations of Request-Reply. Sockets

Interface Definition Language

It is the thinnest layer in the OSI model. At the time the model was formulated, it was not clear that a session layer was needed.

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

COM 440 Distributed Systems Project List Summary

Distributed Network Management Using SNMP, Java, WWW and CORBA

Web Services. Copyright 2011 Srdjan Komazec

The Advantages of CorBA For Network Based Training Systems

Introduction to Distributed Computing using CORBA

Transparent Redirection of Network Sockets 1

Getting Started with the Internet Communications Engine

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Middleware. Chapter 8: Middleware

Distributed Systems. Distributed Systems

Network Attached Storage. Jinfeng Yang Oct/19/2015

Elements of Advanced Java Programming

A Java-based system support for distributed applications on the Internet

CORBAservices. Naming. Part of the CORBA Naming Service Interface in IDL. CORBA Naming Service

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, Socket Programming

File Transfer And Access (FTP, TFTP, NFS) Chapter 25 By: Sang Oh Spencer Kam Atsuya Takagi

Project 1: Implement a simple hosts framework using UNIX TCP Sockets to demonstrate the concept of Mobile Agents

Transparent Redirection of Network Sockets 1

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

We mean.network File System

Java and Distributed Object Models: An Analysis

Event-based middleware services

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Architecture of the CORBA Component Model CORBA 3.0

Category: Standards Track August 1995

Network File System (NFS) Pradipta De

Lecture 7: Java RMI. CS178: Programming Parallel and Distributed Systems. February 14, 2001 Steven P. Reiss


PERFORMANCE COMPARISON OF COMMON OBJECT REQUEST BROKER ARCHITECTURE(CORBA) VS JAVA MESSAGING SERVICE(JMS) BY TEAM SCALABLE

Middleware: Past and Present a Comparison

Resource Utilization of Middleware Components in Embedded Systems

Architecture of a Distributed Object Firewall Proxy. Abstract

Ingegneria del Software II academic year: Course Web-site: [

Network Programming TDC 561

The Service Revolution software engineering without programming languages

PA160: Net-Centric Computing II. Distributed Systems

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

2/9/2010. Standard Approach to Distribution. Remote Procedure Calls (RPC) Example: Music Jukebox in the Cloud

CORBA Component Model(CCM)

An Overview of Java. overview-1

Java Interview Questions and Answers

3F6 - Software Engineering and Design. Handout 10 Distributed Systems I With Markup. Steve Young

IMPLEMENTATION OF AN AGENT MONITORING SYSTEM IN A JINI ENVIRONMENT WITH RESTRICTED USER ACCESS

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Remote Method Invocation

UNIX Sockets. COS 461 Precept 1

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Architectural Patterns. Layers: Pattern. Architectural Pattern Examples. Layer 3. Component 3.1. Layer 2. Component 2.1 Component 2.2.

Communications Systems Application Layer

Naming vs. Locating Entities

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

A Distributed Object Model for the Java System

Migrating Legacy Software Systems to CORBA based Distributed Environments through an Automatic Wrapper Generation Technique

Robust Communication for Jungle Computing

1 Introduction: Network Applications

Jini. Kurzfassung als Kapitel für die Vorlesung Verteilte Systeme. (unter Nutzung von Teilen von Andreas Zeidler und Roger Kehr)

APPLICATION CODE APPLICATION CODE S ERVER PROCESS STUB STUB RPC RUNTIME LIBRARY RPC RUNTIME LIBRARY ENDPOINT MAP ENDPOINT MAP

CORBA. BY VIRAJ N BHAT

Introduction to Web Services

Distributed File Systems

Abstract. Introduction. Section I. What is Denial of Service Attack?

Simple Solution for a Location Service. Naming vs. Locating Entities. Forwarding Pointers (2) Forwarding Pointers (1)

Load balancing using Remote Method Invocation (JAVA RMI)

Tutorial on Socket Programming

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Chapter 3. Internet Applications and Network Programming

Dr Markus Hagenbuchner CSCI319. Distributed Systems

Modular Internet Programming with Cells. Ran Rinat Scott Smith

Remote Method Invocation in JAVA

Virtual machine interface. Operating system. Physical machine interface

Transport Layer Protocols

Network Communication

Socket Programming. Srinidhi Varadarajan

Implementing Java Distributed Objects with JDBC

Division of Informatics, University of Edinburgh

What is COM/DCOM. Distributed Object Systems 4 COM/DCOM. COM vs Corba 1. COM vs. Corba 2. Multiple inheritance vs multiple interfaces

How To Write A Mapreduce Program In Java.Io (Orchestra)

Caml Virtual Machine File & data formats Document version: 1.4

Dynamic Host Configuration Protocol (DHCP) 02 NAT and DHCP Tópicos Avançados de Redes

Service-Oriented Architecture and Software Engineering

Middleware and Distributed Systems. Introduction. Dr. Martin v. Löwis

ELEN 602: Computer Communications and Networking. Socket Programming Basics

Transcription:

Remote Object Invocation Distributed Software Systems RMI 1 Middleware layers Applications, services RMI and RPC request-reply protocol marshalling and external data representation Middleware layers UDP and TCP RMI 2 1

Distributed Objects 2-16 Common organization of a remote object with client-side proxy. RMI 3 Compile-time vs run-time objects Objects can be implemented in many different ways compile-time objects, i.e. instances of classes written in object-oriented languages like Java, C++ database objects procedural languages like C, with a appropriate wrapper code that gives it the appearance of an object Systems like Java RMI support compile-time objects Not possible or difficult in language-independent RMI middleware such as CORBA these systems use object adapters implementations of object interfaces are registered at an object adapter, which acts as an intermediary between the client and object implementation RMI 4 2

Persistent vs transient objects Persistent objects continue to exist even if they are not contained in the address space of a server process The state of a persistent object has to be stored on a persistent store, i.e., secondary storage Invocation requests result in an instance of the object being created in the address space of a running process many policies possible for object instantiation and (de)instantiation Transient objects only exist as long as their container server processes are running RMI 5 Static vs dynamic remote method invocations Typical way for writing code that uses RMI is similar to the process for writing RPC declare the interface in IDL, compile the IDL file to generate client and server stubs, link them with client and server side code to generate the client and the server executables referred to as static invocation requires the object interface to be known when the client is being developed Dynamic invocation the method invocation is composed at run-time invoke(object, method, input_parameters, output_parameters) useful for applications where object interfaces are discovered at run-time, e.g. object browser, batch processing systems for object invocations, agents RMI 6 3

Design Issues for RMI RMI Invocation Semantics Invocation semantics depend upon implementation of Request- Reply protocol used by R MI Maybe, At-least-once, At-most-once Transparency Should remote invocations be transparent to the programmer? Partial failure, higher latency Different semantics for remote objects, e.g. difficult to implement cloning in the same way for local and remote objects or to support synchronization operations, e.g. wait/notify Current consensus: remote invocations should be made transparent in the sense that syntax of a remote invocation is the same as the syntax of local invocation (access transparency) but programmers should be able to distinguish between remote and local objects by looking at their interfaces, e.g. in Java RMI, remote objects implement the Remote interface RMI 7 Issues in implementing RMI Parameter Passing Request-Reply Protocol Handling failures at client and/or server Supporting persistent objects, object adapters, dynamic invocations, etc. RMI 8 4

Request-reply communication Client Server dooperation (wait) (continuation) Request message Reply message getrequest select object execute method sendreply RMI 9 Operations of the request-reply protocol public byte[] dooperation (RemoteObjectRef o, int methodid, byte[] arguments) sends a request message to the remote object and returns the reply. The arguments specify the remote object, the method to be invoked and the arguments of that method. public byte[] getrequest (); acquires a client request via the server port. public void sendreply (byte[] reply, InetAddress clienthost, int clientport); sends the reply message reply to the client at its Internet address and port. RMI 10 5

Request-reply message structure messagetype requestid objectreference methodid arguments int (0=Request, 1= Reply) int RemoteObjectRef int or Method array of bytes RMI 11 Representation of a remote object reference 32 bits 32 bits 32 bits 32 bits Internet address port number time object number interface of remote object RMI 12 6

CORBA interoperable object references IOR format IDL interface type nameprotocol and address details Object key interface repository identifier IIOP host domain name port number adapter name object name RMI 13 Request-Reply protocol Issues in marshaling of parameters and results Input, output, Inout parameters Data representation Handling reference parameters Distributed object references Handling failures in request-reply protocol Partial failure Client, Server, Network RMI 14 7

Marshalling Pack method arguments and results into a flat array of bytes Use a canonical representation of data types, e.g. integers, characters, doubles Examples SUN XDR CORBA CDR Java serialization RMI 15 Parameter Passing: local vs remote objects The situation when passing an object by reference or by value. 2-18 Remote object references are passed by reference where local object references are passed by value RMI 16 8

CORBA CDR for constructed types Type sequence string array struct enumerated union Representation length (unsigned long) followed by elements in order length (unsigned long) followed by characters in order (can also can have wide characters) array elements in order (no length specified because it is fixed) in the order of declaration of the components unsigned long (the values are specified by the order declared) type tag followed by the selected member RMI 17 CORBA CDR message index in sequence of bytes 0 3 4 7 8 11 12 15 16 19 20-23 24 27 4 bytes 5 "S mit" "h " 6 "Lond" "on " 1934 notes on representation length of string Smith length of string London unsigned long The flattened form represents a Person struct with value: { Smith, London, 1934} RMI 18 9

Indication of Java serialized form Serialized values Explanation Person 8-byte version number h0 class name, version number 3 int year java.lang.string name: java.lang.string place: number, type and name of instance variables 1934 5 Smith 6 London h1 values of instance variables The true serialized form contains additional type markers; h0 and h1 are handles RMI 19 RPC exchange protocols Name Messages sent by Client Server Client R Request RR Request Reply RRA Request Reply Acknowledge reply RMI 20 10

Handling failures Types of failure Client unable to locate server Request message lost Reply message lost Server crashes after receiving a request Client crashes after sending a request RMI 21 Handling failures Client cannot locate server Reasons Server has crashed Server has moved (RPC systems) client compiled using old version of service interface System must report error (remote exception) to client Loss of transparency RMI 22 11

Handling failures Lost request message Retransmit a fixed number of times before throwing an exception Lost reply message Client resubmits request Server choices Re-execute procedure service should be idempotent so that it can be repeated safely Filter duplicates server should hold on to results until acknowledged RMI 23 Invocation semantics Fault tolerance measures Invocation semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Not applicable Not applicable Maybe Yes No Re-execute procedure At-least-once Yes Yes Retransmit reply At-most-once RMI 24 12

Handling failures Server crashes REQ REQ REQ REP Recv Exec Reply NO REP Recv Exec Crash NO REP Recv Crash Client cannot tell difference RMI 25 Handling failures Server crashes At least once (keep trying till server comes up again) At most once (return immediately) Exactly once impossible to achieve SUN RPC At least once semantics on successful call and maybe semantics if unsuccessful call CORBA, Java RMI at most once semantics RMI 26 13

Handling failures Implementing the request-reply protocol on top of TCP Does it provide applications with different invocation semantics? NO! TCP does not help with server crashes If a connection is broken, the end pts do not have any guarantees about the delivery of messages that may have been in transit RMI 27 Handling failures Client crashes If client crashes before RPC returns, we have an orphan computation at server Wastes resources, could also start other computations Orphan detection Reincarnation (client broadcasts new epoch when it comes up again) Expiration (RPC has fixed amount of time T to do work) RMI 28 14

RMI Software Components Communication module Implements the request-reply protocol Remote reference module Responsible for translating between local and remote object references and for creating remote object references Maintains remote object table that maintains a mapping between local & remote object references E.g. Object Adaptor in CORBA RMI 29 RMI Object Activation Activation of remote objects Some applications require that information survive for long periods of times However, objects not in use all the time, so keeping them in running processes is a potential waste of resources Object can be activated on demand E.g. standard TCP services such as FTP on UNIX machines are activated by inetd RMI 30 15

Object Activation Active and passive objects Active object = instantiated in a running process Passive object = not currently active but can be made active Implementation of its methods, and marshalled state stored on disk Activator responsible for Registering passive objects that are available for activation Starting named server processes and activating remote objects in them Keeping track of locations of servers for remote objects that it has already activated Examples: CORBA implementation repository, JAVA RMI has one activator on each server computer RMI 31 RMI Other topics Persistent object stores An object that is guaranteed to live between activations of processes is called a persistent object Stores the state of an object in a marshalled (serialized) form on disk Location service Objects can migrate from one system to another during their lifetime Maintains mapping between object references and the location of an object RMI 32 16

RMI Other topics Distributed Garbage Collection Needed for reclaiming space on servers Passing behavior Java allows objects (data + code) to be passed by value If the class for an object passed by value is not present in a JVM, its code is downloaded automatically See Java RMI tutorial example Use of Reflection in Java RMI Allows construction of generic dispatcher and skeleton RMI 33 Distributed Garbage Collection Java approach based on reference counting Each server process maintains a list of remote processes that hold remote object references for its remote objects When a client first removes a remote reference to an object, it makes an addref() invocation to server before creating a proxy When a clients local garbage collector notices that a proxy is no longer reachable, it makes a removeref() invocation to the server before deleting the proxy When the local garbage collector on the server notices that the list of client processes that have a remote reference to an object is empty, it will delete the object (unless there are any local objects that have a reference to the object) Other approaches Evictor pattern Leases RMI 34 17