Remote Procedure CallCS-502 Fall 20071 Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.

Slides:



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

CSE 486/586 Distributed Systems Remote Procedure Call
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
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.
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.
Remote Procedure Call Chin-Chih Chang. Remote Procedure Call Remote Procedure Call (RPC) is a protocol that allows programs to call procedures located.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Remote Procedure CallCS-4513 D-term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
Netprog RPC Overview1 Distributed Program Design n Communication-Oriented Design –Design protocol first. –Build programs that adhere to the protocol.
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Remote Procedure Call Andrew Whitaker CSE451. Remote Procedure Call RPC exposes a programming interface across machines: interface PriceService { Price.
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.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
IT 344: Operating Systems Winter 2008 Module 19 Networking & Remote Procedure Call (RPC) Chia-Chi Teng CTB 265.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
09/14/05 1 Implementing Remote Procedure Calls* Birrell, A. D. and Nelson, B. J. Presented by Emil Constantinescu *ACM Trans. Comput. Syst. 2, 1 (Feb.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Systems 11. RPC and Java RMI Simon Razniewski Faculty of Computer Science Free University of Bozen-Bolzano A.Y. 2014/2015.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Assignment 2 Multithreading/Synchronization UDP – How to maintain connections Testing: Mentioning test cases Plagiarism.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
What is RMI? Remote Method Invocation
Remote Procedure Call present by :Enas Alkhoshi
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
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
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
Distributed Program Design
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote Procedure Call Hank Levy 1.
CS-502, Operating Systems Fall 2009 (EMC)
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin, & Gagne, Modern Operating Systems, 2 nd ed., by Tanenbaum, and Distributed Systems: Principles & Paradigms, 2 nd ed. By Tanenbaum and Van Steen)

Remote Procedure CallCS-502 Fall Remote Procedure Call (RPC) The most common framework for newer protocols and for middleware Used both by operating systems and by applications –NFS is implemented as a set of RPCs –DCOM, CORBA, Java RMI, etc., are just RPC systems Reference –Birrell, Andrew D., and Nelson, Bruce, “Implementing Remote Procedure Calls,” ACM Transactions on Computer Systems, vol. 2, #1, February 1984, pp (.pdf).pdf

Remote Procedure CallCS-502 Fall Remote Procedure Call (RPC) Fundamental idea: – –Server process exports an interface of procedures or functions that can be called by client programs similar to library API, class definitions, etc. –Clients make local procedure/function calls As if directly linked with the server process Under the covers, call is converted into a message exchange with remote server process All messaging details handled automatically by stub compiler

Remote Procedure CallCS-502 Fall RPC Stubs – Summary Client-side stub –Looks like local server function –Same interface as local function –Bundles arguments into a message, sends to server- side stub –Waits for reply, un- bundles results –returns Server-side stub –Looks like local client function to server –Listens on a socket for message from client stub –Un-bundles arguments to local variables –Makes a local function call to server –Bundles result into reply message to client stub

Remote Procedure CallCS-502 Fall Result – a very useful Abstraction The hard work of building messages, formatting, uniform representation, etc., is buried in the stubs Where it can be automated! Designers of client and server can concentrate on semantics of application Programs behave in familiar way

Remote Procedure CallCS-502 Fall RPC Model A server defines the service interface using an interface definition language (IDL) –the IDL specifies the names, parameters, and types for all client-callable server procedures A stub compiler reads the IDL declarations and produces two stub functions for each server function –Server-side and client-side Marshalling arguments –Done completely within stubs –Little-endian vs. Big-endian handled by stubs

Remote Procedure CallCS-502 Fall Representation of Data IDL must also define representation of data on network –Big-endian vs. Little-endian –Multi-byte integers –Strings, character codes –Floating point, complex, … Example: Sun’s XDR (external data representation) Each stub converts machine representation to/from network representation Clients and servers must not try to cast data!

Remote Procedure CallCS-502 Fall Issue #2 — Pointers and References read(int fd, char* buf, int nbytes) Pointers are only valid within one address space Cannot be interpreted by another process Even on same machine! Pointers and references are ubiquitous in C, C++ Even in Java implementations!

Remote Procedure CallCS-502 Fall Pointers and References — Restricted Semantics Option: call by value –Sending stub dereferences pointer, copies result to message –Receiving stub conjures up a new pointer Option: call by result –Sending stub provides buffer, called function puts data into it –Receiving stub copies data to caller’s buffer as specified by pointer

Remote Procedure CallCS-502 Fall Pointers and References — Restricted Semantics (continued) Option: call by value-result –Caller’s stub copies data to message, then copies result back to client buffer –Server stub keeps data in own buffer, server updates it; server sends data back in reply Not allowed:– –Call by reference –Aliased arguments

Remote Procedure CallCS-502 Fall Transport of Remote Procedure Call Option — TCP Connection-based, reliable transmission Useful but heavyweight, less efficient Necessary if repeating a call produces different result Alternative — UDP If message fails to arrive within a reasonable time, caller’s stub simply sends it again Okay if repeating a call produces same result

Remote Procedure CallCS-502 Fall Asynchronous RPC Analogous to spawning a thread Caller must eventually wait for result –Analogous to join

Remote Procedure CallCS-502 Fall Asynchronous RPC (continued) Analogous to spawning a thread Caller must eventually wait for result –Analogous to join –Or be interrupted (software interrupt)

Remote Procedure CallCS-502 Fall RPC Binding Binding is the process of connecting the client to the server –the server, when it starts up, exports its interface identifies itself to a network name server tells RPC runtime that it is alive and ready to accept calls –the client, before issuing any calls, imports the server RPC runtime uses the name server to find the location of the server and establish a connection The import and export operations are explicit in the server and client programs

Remote Procedure CallCS-502 Fall Remote Procedure Call is used … Between processes on different machines –E.g., client-server model Between processes on the same machine –More structured than simple message passing Between subsystems of an operating system –Windows XP (called Local Procedure Call)

Remote Procedure CallCS-502 Fall Questions?

Remote Procedure CallCS-502 Fall Practical RPC Systems DCE (Distributed Computing Environment) Open Software Foundation Basis for Microsoft DCOM Tanenbaum & Van Steen, §4.2.4 Sun’s ONC (Open Network Computing) Very similar to DCE Widely used rpcgen ON/HTML/AA-Q0R5B-TET1_html/TITLE.htmlhttp://h30097.www3.hp.com/docs/base_doc/DOCUMENTATI ON/HTML/AA-Q0R5B-TET1_html/TITLE.html

Remote Procedure CallCS-502 Fall Practical RPC Systems (continued) Java RMI (Remote Method Invocation) java.rmi standard package Java-oriented approach — objects and methods CORBA (Common Object Request Broker Architecture) Standard, multi-language, multi-platform middleware Object-oriented Heavyweight …

Remote Procedure CallCS-502 Fall Implementation Model for DCE

Remote Procedure CallCS-502 Fall Validating a Remote Service Purpose Avoid binding to wrong service or wrong version DCE Globally unique ID –Generated in template of IDL file Sun ONC Program numbers registered with Sun Version # and procedure # administered locally

Remote Procedure CallCS-502 Fall RPC Binding — Sun ONC Service registers with portmapper service on server OS Program # and version # Optional static port # Client Must know host name or IP address clnt_create(host, prog, vers, proto) –I.e., RPC to portmapper of host requesting to bind to prog, vers using protocol proto ( tcp or udp ) (Additional functions for authentication, etc.) Invokes remote functions by name

Remote Procedure CallCS-502 Fall Implementation Model for ONC program & version # rpcgen XDR

Remote Procedure CallCS-502 Fall Sun ONC (continued) #include Header file for client and server rpcgen The stub compiler –Compiles interface.x –Produces.h files for client and service; also stubs See also rpcinfo RPC Programming Guide

Remote Procedure CallCS-502 Fall Note on XDR (the Interface Definition Language for ONC) Much like C header file Exceptions –string type – maps to char * –bool type – maps to bool_t

Remote Procedure CallCS-502 Fall Sun ONC Online tutorial ON/HTML/AA-Q0R5B-TET1_html/TITLE.htmlhttp://h30097.www3.hp.com/docs/base_doc/DOCUMENTATI ON/HTML/AA-Q0R5B-TET1_html/TITLE.html Code samples Any other resources you can find

Remote Procedure CallCS-502 Fall Questions?