U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
RPC Robert Grimm New York University Remote Procedure Calls.
RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
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.
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
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Network Operating Systems Users are aware of multiplicity of machines. Access to resources of various machines is done explicitly by: –Logging into the.
FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.
Distributed Systems Lecture #3: Remote Communication.
Operating Systems CMPSCI 377 Lecture 11: Memory Management
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.
DISTRIBUTED FILE SYSTEM USING RMI
Java RMI. What is RMI? RMI is an RPC system for an object based language. Objects provide a natural granularity for the binding of functions. –RMI allows.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.
Introduction to Remote Method Invocation (RMI)
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Communication in Distributed Systems –Part 2
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Internet Software Development Remote Method Invocation Paul Krause.
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.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
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.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Processes & Threads Emery Berger and Mark Corner University.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between.
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.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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,
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Shuman Guo CSc 8320 Advanced Operating Systems
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
© 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.
Operating Systems Distributed-System Structures. Topics –Network-Operating Systems –Distributed-Operating Systems –Remote Services –Robustness –Design.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Remote Method Invocation
Chapter 16: Distributed System Structures
DISTRIBUTED COMPUTING
Chapter 40 Remote Method Invocation
Chapter 46 Remote Method Invocation
Remote Procedure Call Hank Levy 1.
Chapter 46 Remote Method Invocation
Lecture 6: RPC (exercises/questions)
Remote Procedure Call Hank Levy 1.
Java Remote Method Invocation
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture 20: Distributed Systems (RPC)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 2 Today Key challenges to distribution in operating systems Resource sharing Timing (synchronization) Critical sections Deadlock detection & recovery Failure recovery

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 3 Computation vs. Communication Communication fast & cheap ) can utilize all resources in distributed environment Communication slow & expensive ) do most processing locally Reality: somewhere in the middle Where are the tradeoffs?

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 4 Resource Sharing Data migration: move data Computation migration: move computation to data Job migration: move job (computation & data) Fundamental tradeoff: speed vs. cost

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 5 Data Migration: Copying Process at site A accesses file at site B = copy file B to process A Costly if file is large Data format conversion Multiple copies ) consistency problems All subsequent accesses at A are local

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 6 Data Migration: Remote Access Keep file at B, access remotely from A Saves file transfer cost Converting may be difficult in pieces Single copy of file = no consistency problems Performance bottleneck

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 7 Computation Migration More efficient to transfer computation than data Example: database query Motivates remote procedure calls (RPC) A sends message to process at B Process performs requested action Sends result back to A

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 8 Job Migration May be required: Job needs hardware somewhere in system Job requires licensed software Can improve performance: Load balancing: Even workload across distributed system Computational speedup: Concurrent (parallel) execution of parts of job

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 9 Client/Server Model Common structure for distributed computation Server: process/processes providing service Name servers, file servers, database server May exist on more than one node Client uses service Binds to server locates on network, establishes connection Request-response interaction May use RPC

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 10 Remote Procedure Call Servers export procedures for clients to call Client does procedure call to use server OS manages communication

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 11 RPC Implementation Issues For each procedure for which we want to support RPC: RPC mechanism uses procedure signature (number & type of args & return value) Generates client stub: bundles RPC arguments, sends to server Generates server stub: unpacks message, invokes procedure call

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 12 RPC: Implementation Issues client stub: build message send message await response unpack reply return result server stub: create threads loop await command unpack message call proc. w/thread build reply send reply

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 13 RPC Binding How does client know right port? Binding may be static (fixed at compile-time) Or dynamic (fixed at run-time) Most RPC systems: dynamic binding via name service Server exports interface, identifies itself to net Client asks name service for location of server, establishes connection

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 14 Example: Java RMI public static void bind(String name, Remote obj) Binds server to name public static Remote lookup(String name) Returns server object corresponding to name UnicastRemoteObject supports references to non-replicated objects using TCP Exports interface automatically when server object is constructed Tools: rmiregistry server-side name server rmic : given server interface, generates client & server stubs that create & interpret packets

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 15 Example: Server in Java Server Defines interface listing method signatures Implements each method in interface Main: Creates one or more server objects (subclasses of RemoteObject ) Registers objects with remote object registry Client Looks up server in remote object registry Uses normal method call syntax for remote methods Handles RemoteException

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 16 Example: Hello World Server (1/3)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 17 Example: Hello World Server (2/3)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 18 Example: Hello World Server (3/3)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 19 Example: Hello World Client

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 20 Example: Hello World Client

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 21 Summary Data, computation, job migration Client-server model Mechanism: RPC Common model for communication in distributed apps Effectively: language support for distribution Relies on stub compiler Used even on single nodes for communication across address spaces

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 22 Next Time Distributed File Systems