Last Class: RPCs. Today:

Similar documents
Last Class: RPCs. Today:

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

Communication. Overview

Communication. Outline

Lecture 5: Object Interaction: RMI and RPC

Verteilte Systeme (Distributed Systems)

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

CSC 634: Networks Programming

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

CHAPTER - 4 REMOTE COMMUNICATION

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

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Communication. Distributed Systems Santa Clara University 2016

Distributed Systems 8. Remote Procedure Calls

Lecture 06: Distributed Object

Lecture 8: February 17

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

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

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

CSci Introduction to Distributed Systems. Communication: RPC

Remote Procedure Calls (RPC)

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

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

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

Remote Procedure Call (RPC) and Transparency

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

Today CSCI Remote Method Invocation (RMI) Distributed Objects

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

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

Module 3 - Distributed Objects & Remote Invocation

5 Distributed Objects: The Java Approach

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

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

CS533 Concepts of Operating Systems. Jonathan Walpole

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

Lecture 8: February 19

416 Distributed Systems. RPC Day 2 Jan 11, 2017

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

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

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

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

Today: Distributed Objects. Distributed Objects

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

Distributed Information Systems

Chapter 5 Remote Invocation. Gandeva Bayu Satrya, ST., MT. Telematics Labz. Informatics Department Telkom

RMI: Design & Implementation

Remote Procedure Call

RPC and RMI. 2501ICT Nathan

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

DISTRIBUTED COMPUTER SYSTEMS

Remote Procedure Call

Lecture 12 RPC RPC RPC. Writing an RPC Program. Sun RPC RPC. February 9+11, 2005

Remote Invocation. To do. Request-reply, RPC, RMI. q Today q. q Next time: Indirect communication

416 Distributed Systems. RPC Day 2 Jan 12, 2018

MODELS OF DISTRIBUTED SYSTEMS

Operating System Support

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

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

Lightweight RPC. Robert Grimm New York University

A Report on RMI and RPC Submitted by Sudharshan Reddy B

JAVA RMI. Remote Method Invocation

Remote Procedure Calls

RPC Paradigm. Lenuta Alboaie Andrei Panu

Distributed Objects SPL/ SPL 201 / 0 1

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

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

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

SAI/ST course Distributed Systems

Chapter 4 Communication

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

Chapter 3: Client-Server Paradigm and Middleware

MODELS OF DISTRIBUTED SYSTEMS

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

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

Communication in Distributed Systems

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

Distributed Information Processing

Q.1. (a) [4 marks] List and briefly explain four reasons why resource sharing is beneficial.

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University


Distributed Systems. 5. Remote Method Invocation

Course Snapshot. The Next Few Classes

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

xkcd.com End To End Protocols End to End Protocols This section is about Process to Process communications.

Remote Invocation. Today. Next time. l Indirect communication. l Request-reply, RPC, RMI

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017

EECS 482 Introduction to Operating Systems

Chapter 4: Processes. Process Concept. Process State

Last Class: Network Overview. Today: Distributed Systems

COMP 6231: Distributed System Design

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

REMOTE PROCEDURE CALLS EE324

Chapter 5: Remote Invocation. Copyright 2015 Prof. Amr El-Kadi

Web Services Architecture and Programming

Lecture 2 Process Management

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

Chapter 5 Distributed Objects and Remote Invocation

CSCI-1680 RPC and Data Representation. Rodrigo Fonseca

Networks and Operating Systems Chapter 3: Remote Procedure Call (RPC)

Transcription:

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

RPC Implementation Issues Choice of protocol [affects communication costs] Use existing protocol (UDP) or design from scratch Packet size restrictions Reliability in case of multiple packet messages Flow control Copying costs are dominant overheads Need at least 2 copies per message From client to NIC and from server NIC to server As many as 7 copies Stack in stub message buffer in stub kernel NIC medium NIC kernel stub server Scatter-gather operations can reduce overheads Lecture 4, page 3 Case Study: SUNRPC One of the most widely used RPC systems Developed for use with NFS Built on top of UDP or TCP TCP: stream is divided into records UDP: max packet size < 8912 bytes UDP: timeout plus limited number of retransmissions TCP: return error if connection is terminated by server Multiple arguments marshaled into a single structure At-least-once semantics if reply received, at-least-zero semantics if no reply. With UDP tries at-most-once Use SUN s external Data Representation (XDR) Big endian order for 32 bit integers, handle arbitrarily large data structures Lecture 4, page 4

Binder: Port Mapper Server start-up: create port Server stub calls svc_register to register prog. #, version # with local port mapper Port mapper stores prog #, version #, and port Client start-up: call clnt_create to locate server port Upon return, client can call procedures at the server Lecture 4, page 5 Rpcgen: generating stubs Q_xdr.c: do XDR conversion Detailed example: later in this course Lecture 4, page 6

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 4, page 7 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 4, page 8

Doors Which RPC to use? - run-time bit allows stub to choose between LRPC and RPC Lecture 4, page 9 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 4, page 10

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

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 4, page 13 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 4, page 14

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 4, page 15 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 4, page 16

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

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 registru Uses normal method call syntax for remote methos Java tools Rmiregistry: server-side name server Rmic: uses server interface to create client and server stubs Lecture 4, page 19 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 4, page 20