 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.

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.
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.
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.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Communication in Distributed Systems –Part 2
Implementing Remote Procedure Calls an introduction to the fundamentals of RPCs, made during the advent of the technology. what is an RPC? what different.
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.
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.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
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.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
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). The Programming Model.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
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.
Remote Procedure Call and Serialization BY: AARON MCKAY.
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.
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Implementing Remote Procedure Calls Andrew D. Birrell and Bruce Jay Nelson 1894 Xerox Palo Alto Research Center EECS 582 – W16.
Implementing Remote Procedure Calls Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Published: ACM Transactions on Computer Systems,
Remote Procedure Call (Introduction)
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
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.
Prof. Leonardo Mostarda University of Camerino
Implementing RPC by Birrell & Nelson
IPC and RPC.
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 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.
Lecture 6: RPC (exercises/questions)
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
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 Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building distributed systems.  Examples: File service, Authentication service.

Why we need Remote Procedure Call (RPC)? Why we need Remote Procedure Call (RPC)? –The client needs a easy way to call the procedures of the server to get some services. –RPC enables clients to communicate with servers by calling procedures in a similar way to the conventional use of procedure calls in high-level languages. –RPC is modeled on the local procedure call, but the called procedure is executed in a different process and usually a different computer.

 How to operate RPC? ◦ When a process on machine A calls a procedure on machine B, the calling process on A is suspended, and the execution of the called procedure takes place on B. ◦ Information can be transported from the caller to the callee in the parameters and can come back in the procedure result. ◦ No message passing or I/O at all is visible to the programmer.

The RPC model Blocking state client server request reply Executing state Call procedure and wait for reply Receive request and start process execution Send reply and wait for next execution Resume execution

 The called procedure is in another process which may reside in another machine.  The processes do not share address space. ◦ Passing of parameters by reference and passing pointer values are not allowed. ◦ Parameters are passed by values.  The called remote procedure executes within the environment of the server process. ◦ The called procedure does not have access to the calling procedure's environment.

 Simple call syntax  Familiar semantics  Well defined interface  Ease of use  Efficient  Can communicate between processes on the same machine or different machines

 Exception handling ◦ Necessary because of possibility of network and nodes failures; ◦ RPC uses return value to indicate errors;  Transparency ◦ Syntactic  achievable, exactly the same syntax as a local procedure call; ◦ Semantic  impossible because of RPC limitation: failure (similar but not exactly the same);

 Based on concepts of stubs  Stub is a code used for converting parameter used in procedure call  RPC involves Client & Server Process  Mechanism involves following five elements: ◦ The Client ◦ The Client Stub ◦ The RPCRuntime ◦ The Server Stub ◦ The Server

Return Call Call Return Unpack Pack Receive Send Client Stub RPC Runtime Server Stub Client Server Call Packet Result Packet Client Machine Server Machine

1. Client procedure calls client stub in normal way 2. Client stub builds message, calls local OS 3. Client's OS sends message to remote OS 4. Remote OS gives message to server stub 5. Server stub unpacks parameters, calls server 6. Server does work, returns result to the stub 7. Server stub packs it in message, calls local OS 8. Server's OS sends message to client's OS 9. Client's OS gives message to client stub 10. Stub unpacks result, returns to client

 Client: ◦ Initiates RPC ◦ Makes a local call that invokes a corresponding procedure in the client stub  Client Stub: ◦ Receiving a call request from client:  Packs the specification of the target procedure & the arguments into a message  Asks local RPCRuntime to send it to server stub ◦ Receiving result of procedure execution  Unpacks the result & passes it to the client

 RPCRuntime: ◦ Client Machine  Receive call request message from Client Stub & sends to server machine  Receives the message containing the result of procedure execution from the server machine & sends to client stub ◦ Server Machine  Receives the message containing the result of procedure execution from the server stub & sends it to client machine  Receive call request message from the client machine & sends it to server stub

 Server Stub: ◦ Receiving a call request from local RPCRuntime:  Unpacks & makes a normal call to invoke the appropriate procedure in Server ◦ Receiving result of procedure execution  Packs the result into a message  Asks local RPCRuntime to send it to client stub  Server: ◦ Receiving a call request from the server stub  Executes the appropriate procedure  Returns the result of execution to the server stub

 Manually ◦ The RPC implementor provides a set of translation functions from which a user can construct his/her own stubs ◦ It is simple to implement and can handle very complex parameter types  Automatically ◦ Uses Interface Definition Language(IDL)

 The transfer of message data between two computers requires encoding & decoding of the message data  This operation in RPCs is known as Marshaling ◦ Actions involved in Marshaling  Taking the arguments  Encoding the message data on sender’s computer  Decoding the message data on receiver’s computer

 Two issues in server management ◦ Server Implementation  Stateful Server  Stateless Server ◦ Server Creation  Instance-per-call server  Instance-per-session server  Persistent servers

 Based on the style of implementation, it is of two types  Stateful Servers ◦ Maintains clients’ state information ◦ For eg: Consider a server for byte stream files that allows the following operations on file:  Open(filename, mode)  Read(fid, n, buffer)  Write(fid, n, buffer)  Seek(fid, position)  Close(fid)

Open(filename,mode) Return(fid) Return(bytes 0 to 99) Return(bytes100 to199) Read (fid, 100, buf) fid Mode R/W ptr Client Process Server Process Stateful File Server

 Stateless Servers ◦ Does not maintain any client state information ◦ For eg: Consider a server for byte stream files that allows the following operations on files is stateless:  Read(filename, position, n,buffer)  write(filename, position, n,buffer)

Return(bytes 0 to 99) Return(bytes100 to199) Read (fid, 100, buf) Read (filename, 100, buf) Client Process Server Process Stateless File Server fid Mode R/W ptr

 Based on time duration for which RPC servers survive, it is classified into three  Instance-per-Call Servers ◦ Exist only for the duration of a single call ◦ Created by RPCRuntime -> when a call message arrives  Instance-per-Session Servers ◦ Exist for the entire session for which a client & a server intract  Persistent Servers ◦ Remains in existence indefinetely