Last Class: RPCs. Today:

Similar documents
Last Class: RPCs. Today:

Communication. Outline

Communication. Overview

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

Last Class: RPCs and RMI. Today: Communication Issues

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

Communication. Layered Protocols. Topics to be covered. Layered Protocols. Introduction

Today CSCI Remote Method Invocation (RMI) Distributed Objects

IPC. Communication. Layered Protocols. Layered Protocols (1) Data Link Layer. Layered Protocols (2)

Verteilte Systeme (Distributed Systems)

Parallelism. Master 1 International. Andrea G. B. Tettamanzi. Université de Nice Sophia Antipolis Département Informatique

Distributed Systems. Communication (2) Schedule of Today. Distributed Objects. Distributed Objects and RMI. Corba IDL Example

Distributed Systems. Communication (2) Lecture Universität Karlsruhe, System Architecture Group

Distributed Object-Based Systems The WWW Architecture Web Services Handout 11 Part(a) EECS 591 Farnam Jahanian University of Michigan.

Communication. Distributed Systems Santa Clara University 2016

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

May Gerd Liefländer System Architecture Group Universität Karlsruhe (TH), System Architecture Group

Lightweight Remote Procedure Call. Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat

DISTRIBUTED COMPUTER SYSTEMS

Lecture 5: Object Interaction: RMI and RPC

CSci Introduction to Distributed Systems. Communication: RPC

Distributed Information Processing

Distributed Systems. The main method of distributed object communication is with remote method invocation

Distributed Systems Inter-Process Communication (IPC) in distributed systems

Module 3 - Distributed Objects & Remote Invocation

Remote Procedure Call

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

CHAPTER - 4 REMOTE COMMUNICATION

DISTRIBUTED COMPUTER SYSTEMS

Distributed Systems Course. a.o. Univ.-Prof. Dr. Harald Kosch

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

Today: Distributed Objects. Distributed Objects

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Lecture 06: Distributed Object

JAVA RMI. Remote Method Invocation

Distributed Objects SPL/ SPL 201 / 0 1

Verteilte Systeme (Distributed Systems)

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Lecture 5: RMI etc. Servant. Java Remote Method Invocation Invocation Semantics Distributed Events CDK: Chapter 5 TVS: Section 8.3

Operating System Support

Object-based distributed systems. INF 5040/9040 autumn Lecturer: Frank Eliassen

Chapter 4 Communication

CS533 Concepts of Operating Systems. Jonathan Walpole

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

CSC 634: Networks Programming

Chapter 4 Communication

COMP 6231: Distributed System Design

Middleware and Interprocess Communication

5 Distributed Objects: The Java Approach

Chapter 4 Communication

Course Snapshot. The Next Few Classes

Advanced Topics in Operating Systems

Distributed Systems. Lehrstuhl für Informatik 4. RWTH Aachen. Organization. Literature. Classification of the lecture

SAI/ST course Distributed Systems

Remote Method Invocation in Java

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Remote Invocation. Today. Next time. l Overlay networks and P2P. l Request-reply, RPC, RMI

Distributed Middleware. Distributed Objects

Last Class: Network Overview. Today: Distributed Systems

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Chapter 4: Processes. Process Concept. Process State

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory.

Networked Systems and Services, Fall 2018 Chapter 4. Jussi Kangasharju Markku Kojo Lea Kutvonen

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

Distributed Systems 8. Remote Procedure Calls

Chapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems

Distributed Systems Principles and Paradigms. Distributed Object-Based Systems. Remote distributed objects. Remote distributed objects

Distributed Information Processing

COS 318: Operating Systems. Message Passing. Kai Li and Andy Bavier Computer Science Department Princeton University

Lecture VI: Distributed Objects. Remote Method Invocation

Object-Oriented Distributed Technology

Lightweight RPC. Robert Grimm New York University

Chapter 4: Processes. Process Concept

Further MPI Programming. Paul Burton April 2015

Chapter 4: Processes

Lecture 2 Process Management

Point-to-Point Communication. Reference:

Parallel Programming

How do modules communicate? Enforcing modularity. Modularity: client-server organization. Tradeoffs of enforcing modularity

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

A Report on RMI and RPC Submitted by Sudharshan Reddy B

Chapter 10 DISTRIBUTED OBJECT-BASED SYSTEMS

Distributed Systems. Lehrstuhl für Informatik IV RWTH Aachen. Organisation. Classification of the lecture. Literature

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

MODELS OF DISTRIBUTED SYSTEMS

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 22: Remote Procedure Call (RPC)

5.4. Events and notifications

Remote Procedure Calls (RPC)

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

Distributed Systems Recitation 3. Tamim Jabban

EEC-682/782 Computer Networks I

Chapter 3: Processes. Operating System Concepts 8 th Edition,

RPC and RMI. 2501ICT Nathan

Diagram of Process State Process Control Block (PCB)

Advanced Distributed Systems

IBD Intergiciels et Bases de Données

Transcription:

Last Class: RPCs RPCs make distributed computations look like local computations Issues: Parameter passing Binding Failure handling Lecture 8, page 1 Today: Lightweight RPCs Remote Method Invocation (RMI) Design issues Lecture 8, page 2 1

Lightweight RPCs Many RPCs occur between client and server on same machine Need to optimize RPCs for this special case => use a lightweight RPC mechanism (LRPC) Server S exports interface to remote procedures Client C on same machine imports interface OS kernel creates data structures including an argument stack shared between S and C Lecture 8, page 3 Lightweight RPCs RPC execution Push arguments onto stack Trap to kernel Kernel changes mem map of client to server address space Client thread executes procedure (OS upcall) Thread traps to kernel upon completion Kernel changes the address space back and returns control to client Called doors in Solaris Lecture 8, page 4 2

Doors Which RPC to use? - run-time bit allows stub to choose between LRPC and RPC Lecture 8, page 5 Other RPC Models Asynchronous RPC Request-reply behavior often not needed Server can reply as soon as request is received and execute procedure later Deferred-synchronous RPC Use two asynchronous RPCs Client needs a reply but can t wait for it; server sends reply via another asynchronous RPC One-way RPC Client does not even wait for an ACK from the server Limitation: reliability not guaranteed (Client does not know if procedure was executed by the server). Lecture 8, page 6 3

Asynchronous RPC 2-12 a) The interconnection between client and server in a traditional RPC b) The interaction using asynchronous RPC Lecture 8, page 7 Deferred Synchronous RPC A client and server interacting through two asynchronous RPCs 2-13 Lecture 8, page 8 4

Remote Method Invocation (RMI) RPCs applied to objects, i.e., instances of a class Class: object-oriented abstraction; module with data and operations Separation between interface and implementation Interface resides on one machine, implementation on another RMIs support system-wide object references Parameters can be object references Lecture 8, page 9 Distributed Objects When a client binds to a distributed object, load the interface ( proxy ) into client address space Proxy analogous to stubs Server stub is referred to as a skeleton Lecture 8, page 10 5

Proxies and Skeletons Proxy: client stub Maintains server ID, endpoint, object ID Sets up and tears down connection with the server [Java:] does serialization of local object parameters In practice, can be downloaded/constructed on the fly (why can t this be done for RPCs in general?) Skeleton: server stub Does deserialization and passes parameters to server and sends result to proxy Lecture 8, page 11 Binding a Client to an Object Distr_object* obj_ref; obj_ref = ; obj_ref-> do_something(); Distr_object objpref; Local_object* obj_ptr; obj_ref = ; obj_ptr = bind(obj_ref); obj_ptr -> do_something(); (a) (b) //Declare a systemwide object reference // Initialize the reference to a distributed object // Implicitly bind and invoke a method //Declare a systemwide object reference //Declare a pointer to local objects //Initialize the reference to a distributed object //Explicitly bind and obtain a pointer to the local proxy //Invoke a method on the local proxy a) (a) Example with implicit binding using only global references b) (b) Example with explicit binding using global and local references Lecture 8, page 12 6

Parameter Passing Less restrictive than RPCs. Supports system-wide object references [Java] pass local objects by value, pass remote objects by reference Lecture 8, page 13 DCE Distributed-Object Model a) Distributed dynamic objects in DCE. b) Distributed named objects Lecture 8, page 14 7

Java RMI Server Defines interface and implements interface methods Server program Creates server object and registers object with remote object registry Client Looks up server in remote object registry Uses normal method call syntax for remote methods Java tools Rmiregistry: server-side name server Rmic: uses server interface to create client and server stubs Lecture 8, page 15 Java RMI and Synchronization Java supports Monitors: synchronized objects Serializes accesses to objects How does this work for remote objects? Options: block at the client or the server Block at server Can synchronize across multiple proxies Problem: what if the client crashes while blocked? Block at proxy Need to synchronize clients at different machines Explicit distributed locking necessary Java uses proxies for blocking No protection for simultaneous access from different clients Applications need to implement distributed locking Lecture 8, page 16 8

Message-oriented Transient Communication Many distributed systems built on top of simple message-oriented model Example: Berkeley sockets Lecture 8, page 17 Berkeley Socket Primitives Primitive Socket Bind Listen Accept Connect Send Receive Close Meaning Create a new communication endpoint Attach a local address to a socket Announce willingness to accept connections Block caller until a connection request arrives Actively attempt to establish a connection Send some data over the connection Receive some data over the connection Release the connection Lecture 8, page 18 9

Message-Passing Interface (MPI) Sockets designed for network communication (e.g., TCP/IP) Support simple send/receive primitives Abstraction not suitable for other protocols in clusters of workstations or massively parallel systems Need an interface with more advanced primitives Large number of incompatible proprietary libraries and protocols Need for a standard interface Message-passing interface (MPI) Hardware independent Designed for parallel applications (uses transient communication) Key idea: communication between groups of processes Each endpoint is a (groupid, processid) pair Lecture 8, page 19 MPI Primitives Primitive MPI_bsend MPI_send MPI_ssend MPI_sendrecv MPI_isend MPI_issend MPI_recv MPI_irecv Meaning Append outgoing message to a local send buffer Send a message and wait until copied to local or remote buffer Send a message and wait until receipt starts Send a message and wait for reply Pass reference to outgoing message, and continue Pass reference to outgoing message, and wait until receipt starts Receive a message; block if there are none Check if there is an incoming message, but do not block Lecture 8, page 20 10