CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.

Slides:



Advertisements
Similar presentations
Remote Procedure Call Design issues Implementation RPC programming
Advertisements

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Remote Method Invocation CS587x Lecture Department of Computer Science Iowa State University.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Remote Method Invocation
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.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Introduction to Remote Method Invocation (RMI)
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
CS603 Communication Mechanisms: DCE RPC (cont.) 23 January 2002.
1 Java Programming II Java Network II (Distributed Objects in Java)
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
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.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
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.
Presentation 18: RMI introduction. Goals of this lesson After this 35 min. lesson you will be: Introduced to Java RMI Ready to present RMI’s position.
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 Continued IS Outline  Review of RMI  Programming example.
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.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Presentation: RMI introduction. Goals of this lesson After this 35 min. lesson you will be: Introduced to Java RMI Ready to present RMI’s position in.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Presentation 11: RMI introduction. Ingeniørhøjskolen i Århus Slide 2 af 20 Goals of this lesson After these 2x35 lessons you will be –Introduced to Java.
1 Java Remote Method Invocation java.rmi.* java.rmi.registry.* java.rmi.server.*
Remote Procedure Call RPC
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Presentation: RMI Continued 2 Using The Registry & Callbacks.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION 1. 2 Topics  Middleware  Remote Method Invocation  Remote Procedure Call.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
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.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Java Distributed Computing
CSE 486/586 Distributed Systems Remote Procedure Call
Remote Method Invocation
What is RMI? Remote Method Invocation
Remote Method Invocation
Java RMI (more) CS-328 Internet Programming.
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Remote Procedure Call (RPC) Neil Tang 11/26/2008
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote method invocation (RMI)
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Java Remote Method Invocation
Last Class: Communication in Distributed Systems
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

CSE331: Introduction to Networks and Security Lecture 11 Fall 2002

CSE331 Fall Announcements Reminder: –Project 1 due on Monday, Oct. 7 th –In-class midterm Wednesday, Oct. 9 th

CSE331 Fall Recap Transport Level Protocols TCP (Transmission Control Protocol) UDP (User Datagram Protocol) Remote Procedure Call (RPC) –Java’s remote method invocation (RMI) Today

CSE331 Fall Remote Procedure Call (RPC) Mechanism for structuring distributed programs –Commonly used in OS kernels, for instance Application-level transparency –To the programmer, RPC looks just like local procedure call

CSE331 Fall Remote Procedure Call (RPC) Request/Reply Paradigm –Sender (i.e. client) sends request to server –Receiver (i.e. server) sends back response More than UDP –Reliable –At-most-once message semantics Less than TCP –Not byte-stream oriented –Establishing full duplex reliable channels is sometimes overkill

CSE331 Fall RPC Mechanism Caller (client) Client stub RPC protocol argsreturn val. requestreply Callee (server) Server stub RPC protocol argsreturn val. requestreply

CSE331 Fall Challenges for RPC Dealing with network properties –Limited message sizes –Lost messages –Reordered messages –Multiple deliveries Dealing with architectural differences –big vs. little endian –Data structure layout –Pointer representation Language semantics –What about network failure? –Garbage collection Language & Compiler support

CSE331 Fall Networks & RPC Message Size –Use fragmentation/reassembly Reliability –Use ACK’s, timeouts, and retransmission In-order & at-most-once delivery –Use sequence numbers

CSE331 Fall Data Exchange Issues Different hosts may use different data representations –Sizes of integers, floating points, characters –Big vs. Little endian –Data structure layout in memory Padding of arrays and structs –Pointers and structured data Pointer representation might differ Trees, lists, etc. must be serialized –Objects and functions closures (contain code!) Typically don’t transmit code

CSE331 Fall Marshalling/Unmarshalling data Marshalling/Unmarshalling –Process of putting data into a form that can be sent over a network Strategy 1: Receiver Makes Right –Send data in sender’s native form –Receiver fixes it up if necessary Strategy 2: Canonical Intermediate Representation –Sender marshals data into common format –Receiver unmarshals data into its own format –(More commonly used)

CSE331 Fall Tagging Data A tag is additional information that describes the structure of the marshalled data –Type information –Array lengths –Architecture information Untagged representations are also possible –Sender and receiver know a priori the types of data being transmitted

CSE331 Fall Marshalling Using Tags int16byte8array5 ptr16struct{ int16,ptr16 }

CSE331 Fall Stubs A stub is a piece of code that implements marshalling/unmarshalling –Can be interpreted or compiled –Typically generated from the procedure interface by a stub compiler

CSE331 Fall Stub Compiler Call Proc. P Client stub RPC protocol args Marshalled args Code for P Client stub RPC protocol args Source code for P Stub Compiler Marshalled args

CSE331 Fall Which Procedure to Run? Need to identify code to execute Host x Port x Procedure Identifier Sometimes provided by well-known numbers Sometimes given by external mapping

CSE331 Fall SunRPC Implemented on top of UDP Designed for LAN use –Does not support at-most-once semantics A program called Port Mapper –Maps ports to program numbers –Runs on well-known UDP port 111 Uses the External Data Representation (XDR) –Canonical intermediate form –Handles C types (except function pointers) –No tags

CSE331 Fall Distributed Computing Environment DEC’s RPC protocol Implemented on top of UDP Does support at-most-once semantics Used with Network Data Representation stub compiler –Receiver makes right strategy –Architecture tags –Description written in Interface Definition Language (IDL) –Essentially supports C’s type system Underlying mechanism for the Common Object Request Broker Architecture (CORBA)

CSE331 Fall Java RMI (Remote Method Invocation) Provides RPC Mechanism See java.rmi.* classes & documentation – Built on top of TCP –Quite heavy weight –Reliable Incorporates Java’s security model

CSE331 Fall Java RMI Details Classes implement Remote interface Use the RMI Naming class to name and advertise remote objects –Naming.rebind maps URLs to Objects –Naming.lookup used by client to find Object references Java stub compiler is rmic Objects passed via RMI must implement the Serializable interface Non-remote arguments (and results) are passed by copying Remote arguments (and results) are passed by reference

CSE331 Fall Using Java’s Remote interface /* File: Hello.java */ import java.rmi.Remote; import java.rmi.RemoteException; public interface Hello extends Remote { String sayHello() throws RemoteException; }

CSE331 Fall Server Implementation /* File: HelloServer.java */ import java.rmi.*; public class HelloServer extends UnicastRemoteObject implements Hello { public HelloServer() throws RemoteException { super(); } public String sayHello() { return "Hello World!"; } /* continued on next slide */

CSE331 Fall Server code continued public static void main(String args[]) { // Create and install a security manager if (System.getSecurityManager() == null) { System.setSecurityManager( new RMISecurityManager()); } try { HelloServer obj = new HelloServer(); // Bind this object instance to the // name "HelloServer" Naming.rebind("//host/HelloServer", obj); System.out.println ("HelloServer bound in registry"); } catch (Exception e) {…} }

23 Client Code /* File: HelloClient.java */ import java.rmi.*; public class HelloClient { String message = "blank"; // "obj" refers to the remote object Hello obj = null; public static void main(String args[]) { try { obj = (Hello)Naming.lookup ("//host/HelloServer"); message = obj.sayHello(); System.out.println(message); } catch (Exception e) {…} }

CSE331 Fall Compilation & Execution Compile both files with javac –Produces HelloServer.class and HelloClient.class Generate stubs by using rmic on HelloServer.class –Produces HelloServer_stub.class and HellowServer_skel.class Run Java’s rmiregistry program Start the server on host Start the client on another