Remote Procedure CallCS-4513 D-term 20081 Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,

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 Design issues Implementation RPC programming
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
RPC Remote Procedure Call Dave Hollinger Rensselaer Polytechnic Institute Troy, NY.
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.
Networks & Communications CS-4513, D-Term Networks & Communication (continued) CS-4513 Distributed Computing Systems (Slides include materials from.
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.
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.
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
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)
NetworksCS-4513, D-Term Introduction to Networks CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,
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.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
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 CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
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.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
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
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
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Networks & Communication (continued)
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-4513 D-term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin, & Gagne, Distributed Systems: Principles & Paradigms, 2 nd ed. By Tanenbaum and Van Steen, and Modern Operating Systems, 2 nd ed., by Tanenbaum)

Remote Procedure CallCS-4513 D-term Review Definition — Protocol Formal set of rules that govern the formats, contents, and meanings of messages from computer to computer, process to process, etc. Must be agreed to by all parties to a communication May be defined in terms of other protocols E.g., 7-layer OSI model

Remote Procedure CallCS-4513 D-term Message-oriented Protocols Many in widespread use Traditional TCP/IP and Internet protocols Difficult to design and implement Especially with more sophisticated applications Many difficult implementation issues for each new protocol and each platform Formatting Uniform representation of data Client-server relationships …

Remote Procedure CallCS-4513 D-term Alphabet Soup of many, many Protocols TCP, UDP, IP, NCP, SMTP, SNNP, NNTP, FTP, TFTP, POP, IMAP, HTTP, VMRL, … Appletalk, Netware, … Remote Procedure Call, NFS, … CORBA, GLOBE, JINI, … Network Streaming, … …

Remote Procedure CallCS-4513 D-term Message-oriented Protocols Many in widespread use Traditional TCP/IP and Internet protocols Difficult to design and implement Especially with more sophisticated applications Many difficult implementation issues for each new protocol and each platform Formatting Uniform representation of data Client-server relationships …

Remote Procedure CallCS-4513 D-term Problem How to make sense out of many different kinds of protocols How to design new protocols for new, more sophisticated applications How to automate the nitty-gritty of protocol design and testing

Remote Procedure CallCS-4513 D-term Solution — Remote Procedure Call (RPC) The most common framework for newer protocols and for middleware Used both by operating systems and by applications –NFS (Network File System) 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-4513 D-term 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, procedure/function call is converted into a message exchange with remote server process

Remote Procedure CallCS-4513 D-term Ordinary procedure/function call count = read(fd, buf, bytes)

Remote Procedure CallCS-4513 D-term Remote Procedure Call Would like to do the same if called procedure or function is on a remote server

Remote Procedure CallCS-4513 D-term Solution — a pair of Stubs A client-side stub is a function that looks to the client as if it were a callable function of the service –I.e., same API as the service’s implementation of the function A service-side stub looks like a client calling the service –I.e., like a hunk of code invoking the service function The client program thinks it’s invoking the service –but it’s calling into the client-side stub The service program thinks it’s called by the client –but it’s really called by the service-side stub The stubs send messages to each other to make the RPC happen transparently (almost!)

Remote Procedure CallCS-4513 D-term RPC Stubs Tanenbaum & Van Steen, Fig 4-7

Remote Procedure CallCS-4513 D-term RPC Stubs – Summary Client-side stub –Looks like local server function to the client –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-4513 D-term 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-4513 D-term RPC – Issues How to make the “remote” part of RPC invisible to the programmer? What are semantics of parameter passing? –E.g., pass by reference? How to bind (locate & connect) to servers? How to handle heterogeneity? –OS, language, architecture, … How to make it go fast?

Remote Procedure CallCS-4513 D-term 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 functions A stub compiler reads the IDL declarations and produces two stub functions for each server function –Server-side and client-side

Remote Procedure CallCS-4513 D-term RPC Model (continued) Linking:– –Server programmer implements the service’s functions and links with the server-side stubs –Client programmer implements the client program and links it with client-side stubs Operation:– –Stubs manage all of the details of remote communication between client and server

Remote Procedure CallCS-4513 D-term RPC Stubs Tanenbaum & Van Steen, Fig 4-7

Remote Procedure CallCS-4513 D-term Marshalling and Unmarshalling Arguments Marshalling –the packing of function parameters into a message Unmarshalling –the extraction of parameters from a message Function call:– –Client stub marshals the arguments into message –Server stub unmarshals the arguments and uses them to invoke the service function Function return:– –Server stub marshals return values into message –Client stub unmarshals return values and returns them as results to client program

Remote Procedure CallCS-4513 D-term Issue #1 — representation of data Big endian vs. little endian Sent by PentiumRec’d by SPARCAfter inversion

Remote Procedure CallCS-4513 D-term Representation of Data (continued) IDL must also define representation of data on network –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-4513 D-term 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-4513 D-term 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-4513 D-term 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-4513 D-term 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 Unreliable transmission 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-4513 D-term Asynchronous RPC Analogous to spawning a thread Caller must eventually wait for result –Analogous to join

Remote Procedure CallCS-4513 D-term 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-4513 D-term 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-4513 D-term 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-4513 D-term Questions?

Remote Procedure CallCS-4513 D-term 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-4513 D-term 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-4513 D-term Implementation Model for DCE

Remote Procedure CallCS-4513 D-term Implementation Model for ONC program & version # rpcgen XDR

Remote Procedure CallCS-4513 D-term 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-4513 D-term 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-4513 D-term 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-4513 D-term 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-4513 D-term 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-4513 D-term Questions?