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.

Slides:



Advertisements
Similar presentations
RPC Robert Grimm New York University Remote Procedure Calls.
Advertisements

Remote Procedure Call (RPC)
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.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
L-7 RPC 1. Last Lecture Important Lessons - Naming Naming is a powerful tool in system design  A layer of indirection can solve many problems Name+context.
Distributed Systems Lecture #3: Remote Communication.
Remote Procedure Call in SR Programming Language By Tze-Kin Tsang 3/20/2000.
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.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
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.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
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.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
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.
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.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
Review Questions on Chapter IV—IPC COSC 4330/6310 Summer 2013.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
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.
Remote Procedure Call RPC
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.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
RPC Model, Stubs and Skeletons Divya Nampalli
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.
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.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
IPC and RPC.
Distributed Systems CS
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
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
Distribution Infrastructures
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Distributed Systems CS
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)
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)
Distributed Systems CS
Presentation transcript:

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 receive) -- error prone Solution –use procedure calls -- familiar model

Remote Procedure Call (RPC) Allow procedure calls to other machines –servicing of procedure remote –caller blocks until procedure finished, as usual –simpler than explicit message passing Complications –caller and receiver in different address spaces –parameter passing –where is the server? –what about crashes?

Programming Client/Server Applications with RPC Outline of Client code while (1) { build request reply = foo(params) do something } Note: Server can be written as collection of several procedures Outline of Server code foo(params) { …. return reply; } bar (params) { …. return reply; }

Basics of RPC Implementation Goal: provide complete transparency –For RPC, replace a normal procedure call with: pack arguments (including func) into a message via “stub function” –may need to worry about byte ordering, linked list, etc send message to server; block waiting for reply –On receipt at server: unpack and push args, call func. (create new thread) Implemented by forking a “stub” (sometimes called “skeleton” function) –On receipt of reply at client: put result where it belongs, unblock client

RPC Implementation Issues Weakly typed languages –E.g., C --- what to do if unbounded array passed to RPC? Communication via global variables impossible Binding –How does client know where server is? One solution: use a database Failures? –What if function is partially executed, or executed twice, or executed never?

RPC Parameter Passing Client machine may be different than server –ignore this issue -- someone has to convert data Parameter issues –what to provide? –can be important performance issue –not as easy as it seems at first glance

Call by Value Simple semantics Just package up the args, and sent them Server uses these args –doesn’t need to send them back

Call by Reference What do pointers mean across machines? –remember, they mean nothing across address spaces Could do the following: –pass pointer –send back message to client on each reference SLOW!

Call by Copy/Restore Similar to call by reference –parameter copied in, same as call by value –but when procedure finished, copy back to caller –not quite same as call by reference, but: can be problematic if pointer parameter points to a complex data type, e.g. graph or list –method of choice for “reference parameters” when using RPC

(Contrived) example of how call by reference and call by copy- restore can differ int a; unsafe(int x) { x= 2; a= 0; } int main( ) { a= 1; unsafe(a); print (a) } Call by reference outputs 0; call by copy-restore outputs 2

Rendezvous Similar to RPC –Key difference: no new process created on the server (but unlike RPC, there is synchronization) –Caller side is the same as with RPC –Server looks roughly as follows: in op1(…) execute code for op1 [] op2(…) execute code for op2 ni –Server blocks until >= 1 pending invocation on any op (can be implemented via UNIX select)

Bank Account with RPC module Customer deposit(amt) or withdraw(amt) module Bank void deposit(int) void withdraw(int) int balance = initbalance, cond try deposit(int amt) balance += amt broadcast(try) withdraw(int amt) while (amt > balance) wait(try) balance -= amt Note: deposit and withdraw need to be monitor functions

Bank Account with Rendezvous module Customer deposit(amt) or withdraw(amt) module Bank void deposit(int) void withdraw(int) int balance = initbalance process Teller { while (true) in deposit(amt) balance += amt [] withdraw(amt) and balance >= amt balance -= amt ni }