Remote Procedure CallCS-4513, D-Term 20071 Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.

Slides:



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

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.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Distributed Systems Lecture #3: Remote Communication.
Networks & Communications CS-4513, D-Term Networks & Communication (continued) CS-4513 Distributed Computing Systems (Slides include materials from.
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.
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)
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)
.NET Mobile Application Development Remote Procedure Call.
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.
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.
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.
CS 153 Design of Operating Systems Spring 2015 Lecture 23: Inter-Process Communication (IPC) and Remote Procedure Call (RPC)
(a) Parameter passing in a local procedure call: the stack before the call (b) The stack while the called procedure is active. count =
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
RPC Model, Stubs and Skeletons Divya Nampalli
© 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.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
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.
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
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
Lecture 7: RPC (exercises/questions)
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, Modern Operating Systems, 2 nd ed., by Tanenbaum, and Distributed Systems: Principles & Paradigms, 2 nd ed. By Tanenbaum and Van Steen)

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

Remote Procedure CallCS-4513, D-Term 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

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, nbytes)

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 Client-side stub –Looks like local server function –Same interface as local function –Bundles arguments into 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 The hard work of building messages, formatting, uniform representation, etc., is buried in the stubs Where it can be automated! Client and server designers can concentrate on the 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 procedures 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 A client-side stub is a function that looks to the client as if it were a callable server function –I.e., same API as the server’s implementation of the function A server-side stub looks like a caller to the server –I.e., like a hunk of code invoking the server function The client program thinks it’s invoking the server –but it’s calling into the client-side stub The server program thinks it’s called by the client –but it’s really called by the server-side stub The stubs send messages to each other to make the RPC happen transparently (almost!)

Remote Procedure CallCS-4513, D-Term Marshalling Arguments Marshalling is the packing of function parameters into a message packet –the RPC stubs call type-specific functions to marshal or unmarshal the parameters of an RPC Client stub marshals the arguments into a message Server stub unmarshals the arguments and uses them to invoke the service function –on return: the server stub marshals return values the client stub unmarshals return values, and returns to the 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 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 Questions?

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)