Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

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.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
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.
Remote Method Invocation
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
L-7 RPC 1. Last Lecture Important Lessons - Naming Naming is a powerful tool in system design  A layer of indirection can solve many problems Name+context.
EECS122 - UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message- Oriented Communications (Based on textbook slides) Computer Science Division.
Distributed Systems Lecture #3: Remote Communication.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
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.
CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.
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)
Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.
Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
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.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011 Kocaeli University Computer Engineering Department.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.
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,
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
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
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Communication Chapter 2.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Distributed objects and remote invocation Pages
RPC Model, Stubs and Skeletons Divya Nampalli
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems Lecture 8 RPC and marshalling 1.
Communication Chapter 2. Layered Protocols (1) Layers, interfaces, and protocols in the OSI model. 2-1.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Remote Procedure Call and Remote Object Invocation TANENBAUM-Chapter 2.
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.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Client-Server Communication
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
CS533 Concepts of Operating Systems
CSE 486/586 Distributed Systems Remote Procedure Call
CMSC621: Advanced Operating Systems Advanced Operating Systems
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
Outline Communication Primitives - continued Theoretical Foundations
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote Procedure Call (RPC) RPC – RMI - Web Services.
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter passing –Binding –Failure handling

Computer Science Lecture 4, page 2 CS677: Distributed OS Today: Case Study: Sun RPC Lightweight RPCs Remote Method Invocation (RMI) –Design issues

Computer Science Lecture 4, page 3 CS677: Distributed OS 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

Computer Science Lecture 4, page 4 CS677: Distributed OS 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

Computer Science Lecture 4, page 5 CS677: Distributed OS Rpcgen: generating stubs Q_xdr.c: do XDR conversion Detailed example: later in this course

Computer Science Lecture 4, page 6 CS677: Distributed OS 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

Computer Science Lecture 4, page 7 CS677: Distributed OS 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

Computer Science Lecture 4, page 8 CS677: Distributed OS Doors Which RPC to use? - run-time bit allows stub to choose between LRPC and RPC

Computer Science Lecture 4, page 9 CS677: Distributed OS 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).

Computer Science Lecture 4, page 10 CS677: Distributed OS Asynchronous RPC a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Computer Science Lecture 4, page 11 CS677: Distributed OS Deferred Synchronous RPC A client and server interacting through two asynchronous RPCs 2-13

Computer Science Lecture 4, page 12 CS677: Distributed OS 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

Computer Science Lecture 4, page 13 CS677: Distributed OS 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

Computer Science Lecture 4, page 14 CS677: Distributed OS 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

Computer Science Lecture 4, page 15 CS677: Distributed OS Binding a Client to an Object a)(a) Example with implicit binding using only global references b)(b) Example with explicit binding using global and local references Distr_object* obj_ref;//Declare a systemwide object reference obj_ref = …;// Initialize the reference to a distributed object obj_ref-> do_something();// Implicitly bind and invoke a method (a) Distr_object objPref;//Declare a systemwide object reference Local_object* obj_ptr;//Declare a pointer to local objects obj_ref = …;//Initialize the reference to a distributed object obj_ptr = bind(obj_ref);//Explicitly bind and obtain a pointer to the local proxy obj_ptr -> do_something();//Invoke a method on the local proxy (b)

Computer Science Lecture 4, page 16 CS677: Distributed OS Parameter Passing Less restrictive than RPCs. –Supports system-wide object references –[Java] pass local objects by value, pass remote objects by reference

Computer Science Lecture 4, page 17 CS677: Distributed OS DCE Distributed-Object Model a)Distributed dynamic objects in DCE. b)Distributed named objects

Computer Science Lecture 4, page 18 CS677: Distributed OS 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

Computer Science Lecture 4, page 19 CS677: Distributed OS 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