Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)

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 (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.
XML-RPC Remote Procedure Call (RPC) is a model that specifies how cooperating processes on different nodes in a heterogeneous computing environment can.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Implementing Remote Procedure Calls Authored by: Andrew D. Birrel and Bruce Jay Nelson Presented by: Terry, Jae, Denny.
G Robert Grimm New York University Lightweight RPC.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Distributed File Systems: RPC, NFS, and AFS
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
490dp Prelude: Design Report Remote Invocation Robert Grimm (borrowing some from Hank Levy)
Remote Procedure Calls. 2 Announcements Prelim II coming up in one week: –Thursday, April 26 th, 7:30—9:00pm, 1½ hour exam –101 Phillips –Closed book,
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
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
.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.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
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.
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)
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 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,
1 Developing Application in Distributed Computing Environment (DCE)
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
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.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
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.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
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.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Prof. Leonardo Mostarda University of Camerino
Implementing RPC by Birrell & Nelson
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
Sarah Diesburg Operating Systems COP 4610
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
Remote Procedure Call (invocation) RPC
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.
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Remote Procedure Calls

2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs) that –provides some service, e.g., file service, name service, … –may exist on one or more nodes. A client is a program that uses the service. –It first binds to the server, i.e., locates it in the network and establishes a connection. The client then sends requests to perform actions; –Using messages to indicate the desired service and params. –The server returns a response.

3 Why not use messages? Although messages are flexible, they have problems: –Requires that programmer worry about message formats –Messages must be packed and unpacked –Server needs to decode messages to figure out the request –Messages are often asynchronous –They may require special error handling functions Basically using messages is not a convenient paradigm for most programmers.

4 Procedure Call More natural way is to communicate using procedure calls: –every language supports it –semantics are well defined and understood –natural for programmers to use Basic idea: define server as a module that exports a set of procedures callable by client programs. To use the server, the client just does a procedure call, as if it were linked with the server call return ClientServer

5 (Remote) Procedure Call So, we would like to use procedure call as a model for distributed communication. Lots of issues: –how do we make this invisible to the programmer? –what are the semantics of parameter passing? –how is binding done (locating the server)? –how do we support heterogeneity (OS, arch., language) –etc.

6 Remote Procedure Call The basic model for Remote Procedure Call (RPC) was described by Birrell and Nelson in 1980, based on work done at Xerox PARC. Goal to make RPC as much like local PC as possible. Used computer/language support. There are 3 components on each side: –a user program (client or server) –a set of stub procedures –RPC runtime support

7 RPC Basic process for building a server: –Server program defines the server’s 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 and produces two stub procedures for each server procedure: a client-side stub and a server-side stub –The server writer writes the server and links it with the server- side stubs; the client writes her program and links it with the client-side stubs. –The stubs are responsible for managing all details of the remote communication between client and server.

8 RPC Stubs Client-side stub is a procedure that looks to the client as if it were a callable server procedure. Server-side stub looks like a calling client to the server The client program thinks it is calling the server; –in fact, it’s calling the client stub. The server program thinks it’s called by the client; –in fact, it’s called by the server stub. The stubs send messages to each other to make RPC happen.

9 RPC Call Structure call foo(x,y) proc foo(a,b)call foo(x,y) proc foo(a,b) begin foo... end foo client program client stub RPC runtime RPC runtime server stub server program Call client makes local call to stub proc. stub builds msg packet, inserts params runtime sends msg to remote node server is called by its stub stub unpacks params and makes call runtime receives msg and calls stub call foo send msg call foo msg received

10 RPC Return Structure call foo(x,y) proc foo(a,b)call foo(x,y) proc foo(a,b) begin foo... end foo client program client stub RPC runtime RPC runtime server stub server program return client continues stub unpacks msg, returns to caller runtime receives msg, calls stub server proc returns stub builds result msg with output args runtime responds to original msg return msg received return send msg

11 RPC Binding Binding is the process of connecting the client and server The server, when it starts up, exports its interface, –identifying itself to a network name server and –telling the local runtime its dispatcher address. The client, before issuing any calls, imports the server, –which causes the RPC runtime to lookup the server through the name service and –contact the requested server to setup a connection. The import and export are explicit calls in the code.

12 RPC Marshalling Marshalling is packing of procedure params into message packet. RPC stubs call type-specific procedures to marshall (or unmarshall) all of the parameters to the call. On client side, client stub marshalls parameters into call packet; –On the server side the server stub unmarshalls the parameters to call the server’s procedure. On return, server stub marshalls return parameters into return packet; –Client stub unmarshalls return params and returns to the client.

13 RPC Final RPC is most common model now for communications in distributed applications. –It is language support for distributed programming. RPC relies on a stub compiler to automatically produce client/server stubs from the IDL server description. RPC is commonly used, even on a single node, for communication between applications running in different address spaces. In fact, most RPCs are intra-node.