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.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call Design issues Implementation RPC programming
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Remote Procedure Call sockets TCP, UDP Internet Protocol (IP) Remote Procedure Call: hides communication details behind a procedure call and helps bridge.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
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.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
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.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
.NET Mobile Application Development Remote Procedure Call.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Distributed Programming CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
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.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the.
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed objects and remote invocation Pages
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
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.
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.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
What is RMI? Remote Method Invocation
Programming Models for Distributed Application
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Chapter 40 Remote Method Invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Distribution Infrastructures
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

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 3.Object brokers 4.Object monitors 5.Message-oriented middleware 6.Message brokers 

9 September 2008CIS 340 # 2 Basic Middleware: RPC - motivation One cannot expect the programmer to implement a complete infrastructure for every distributed application. –Sockets API = send & recv calls = I/O Instead, one can use an RPC system –our first example of low level middleware Remote Procedure Calls (RPC) –Goal: to provide a procedural interface for distributed (i.e., remote) services –To make distributed nature of service transparent to the programmer Remote Method Invocation (RMI) –RPC + Object Orientation –Allows objects living in one process to invoke methods of an object living in another process

9 September 2008CIS 340 # 3 Basic Middleware: RPC What does an RPC system do? Hides distribution behind procedure calls interface definition language (IDL)Provides an interface definition language (IDL) to describe the services Generates all the additional code necessary to make a procedure call remote and to deal with all the communication aspects binder/bindingProvides a binder/binding in case it has a distributed name and directory service system Basis for 2-tier, client/server First introduction of elements common to all middleware

Middleware layers 11 September 2008CIS 340 # 4

Request-reply communication 11 September 2008CIS 340 # 5

Conventional Procedure Call (a) Parameter passing in a local procedure call: the stack before the call to read(fd,buf,bytes) (b) The stack while the called procedure is active 11 September 2008CIS 340 # 6

Remote Procedure Call 11 September 2008CIS 340 # 7

Remote Procedure Calls Remote procedure call (RPC) abstracts procedure calls between processes on networked systems. Stubs – client-side proxy for the actual procedure on the server. The client-side stub locates the server and marshalls the parameters. The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server. 11 September 2008CIS 340 # 8

9 September 2008CIS 340 # 9 IDL sources interface headers IDL compiler IDL client code client stub language specific call interface server code server stub language specific call interface client processserver process development environment Copyright Springer Verlag Berlin Heidelberg 2004 Remote Procedure Call (RPC): Development Components/Aspects interface definition language – “specification of the services” == parameters 1 2 piece of code compiled & linked with client local call does not take care of the implementation implements the invocation “possesses” code for receiving, formatting,....

9 September 2008CIS 340 # 10 communication module client procedure call client stub bind marshal serialize send client process communication module server procedure server stub unmarshal deserialize receive server process dispatcher (select stub) Copyright Springer Verlag Berlin Heidelberg 2004 Remote Procedure Call (RPC): Functioning Elements

Steps of a Remote Procedure Call 1.Client procedure calls client stub in normal way 2.Client stub builds message, calls local OS 3.Client's OS sends message to remote OS 4.Remote OS gives message to server stub 5.Server stub unpacks parameters, calls server 6.Server does work, returns result to the stub 7.Server stub packs it in message, calls local OS 8.Server's OS sends message to client's OS 9.Client's OS gives message to client stub 10.Stub unpacks result, returns to client 11 September 2008CIS 340 # 11

Passing Value Parameters (1) 11 September 2008CIS 340 # 12

Passing Value Parameters (2) 11 September 2008CIS 340 # 13 a) Original message on the Pentium b) The message after receipt on the SPARC c) The message after being inverted. The little numbers in boxes indicate the address of each byte

Parameter Specification and Stub Generation 11 September 2008CIS 340 # 14

Writing a Client and a Server 11 September 2008CIS 340 # 15

9 September 2008CIS 340 # 16 Dynamic Binding vs. static binding Adds a layer of “indirection” Layer == name and directory server Invocation of remote procedure by client stub  Requests name and directory server to identify server to execute procedure  Response by name and directory server == address of server Tightly coupled COST for dynamic flexibility? Additional layer

11 September 2008CIS 340 # 17

RMI RMI = RPC + Object-orientation –Java RMI –CORBA Middleware that is language-independent –Microsoft DCOM/COM+ –SOAP RMI on top of HTTP 11 September 2008CIS 340 # 18

Interfaces in distributed systems Programs organized as a set of modules that communicate with one another via procedure calls/method invocations Explicit interfaces defined for each module in order to control interactions between modules In distributed systems, modules can be in different processes A remote interface specifies the methods of an object that are available for invocation by objects in other processes defining the types of the input and output arguments of each of them 11 September 2008CIS 340 # 19

11 September 2008CIS 340 # 20

Object model Object references –Objects accessed via object references –Object references can be assigned to variables, passed as arguments and returned as results Interfaces –Provides a signature of a set of methods (types of arguments, return values and exceptions) without specifying their implementations Actions (invocations) Exceptions Garbage Collection 11 September 2008CIS 340 # 21

Distributed Objects Remote object references –An identifier that can be used throughout a distributed system to refer to a particular remote object Remote interfaces –CORBA provides an interface definition language (IDL) for specifying a remote interface –JAVA RMI: Java interface that extends Remote interface Actions: remote invocations Remote Exceptions may arise for reasons such as partial failure or message loss Distributed Garbage Collection: cooperation between local garbage collectors needed 11 September 2008CIS 340 # 22

Remote and local method invocations 11 September 2008CIS 340 # 23

A remote object and its remote interface 11 September 2008CIS 340 # 24

RMI Programming RMI software –Generated by IDL compiler –Proxy Behaves like remote object to clients (invoker) Marshals arguments, forwards message to remote object, unmarshals results, returns results to client –Skeleton Server side stub; Unmarshals arguments, invokes method, marshals results and sends to sending proxy’s method –Dispatcher Receives the request message from communication module, passes on the message to the appropriate method in the skeleton Server and Client programs 11 September 2008CIS 340 # 25

11 September 2008CIS 340 # 26

RMI Programming Binder –Client programs need a means of obtaining a remote object reference –Binder is a service that maintains a mapping from textual names to remote object references –Servers need to register the services they are exporting with the binder –Java RMIregistry, CORBA Naming service Server threads –Several choices: thread per object, thread per invocation –Remote method invocations must allow for concurrent execution 11 September 2008CIS 340 # 27

Java RMI Features –Integrated with Java language + libraries Security, write once run anywhere, multithreaded Object orientation –Can pass “behavior” Mobile code Not possible in CORBA, traditional RPC systems Distributed Garbage Collection Remoteness of objects intentionally not transparent 11 September 2008CIS 340 # 28

Remote Interfaces, Objects, and Methods Objects become remote by implementing a remote interface –A remote interface extends the interface java.rmi.Remote –Each method of the interface declares java.rmi.RemoteException in its throws clause in addition to any application-specific clauses 11 September 2008CIS 340 # 29

11 September 2008CIS 340 # 30

11 September 2008CIS 340 # 31

11 September 2008CIS 340 # 32

11 September 2008CIS 340 # 33

11 September 2008CIS 340 # 34

11 September 2008CIS 340 # 35

11 September 2008CIS 340 # 37 Machine independent representations: Marshalling, Serializing Consider (in C) sprintf and sscanf Message= “Vitolo” “GU” “2006” char *name=“Vitolo”, place=“GU”; int year=2006; sprintf(message, “%d %s %d %s %d”), strlen(name), name, strlen(place), place, year); Message after marshalling = “6 Vitolo 2 GU 2006” NOTE: type and number of parameters is known, ….only need to agree on the syntax... SUN XDR approach: Messages transformed into a sequence of 4 byte objects, each byte being in ASCII code Defines how to pack different data types into these objects expense of bandwidthGIST? To simplify computation at the expense of bandwidth 6 V i t o l o 2 G U String length cardinal eXternal Data Representation

11 September 2008CIS 340 # 38 Remote Procedure Call (RPC): Functionality of Stubs BINDINGMARSHALINGSERIALIZINGSENDING RECEIVINGDESERIALIZINGUNMARSHALING Client process Creates a local association – handle – to the server Think of “binding a variable” Client process Packages data into message format needed by the recipient server Client process Transforms data/message into bytes Server process Undoes the steps