Implementing Remote Procedure Calls

Slides:



Advertisements
Similar presentations
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed System Architectures.
Advertisements

RPC Robert Grimm New York University Remote Procedure Calls.
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.
Lightweight Remote Procedure Call BRIAN N. BERSHAD THOMAS E. ANDERSON EDWARD D. LAZOWSKA HENRY M. LEVY Presented by Wen Sun.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
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.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
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:
Remote Procedure Calls (RPC) Presenter: Benyah Shaparenko CS 614, 2/24/2004.
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)
Implementing Remote Procedure Calls an introduction to the fundamentals of RPCs, made during the advent of the technology. what is an RPC? what different.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
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.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
Implementing Remote Procedure Calls ANDREW D. BIRRELL and BRUCE JAY NELSON Presented by Tony Bock.
By Andrew D. Birrell and Bruce Jay Nelson Presented By: Abdussalam Alawini Reviewed By Prof. Jonathon Walpole.
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.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
Remote Procedure Call An Effective Primitive for Distributed Computing Seth James Nielson.
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
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
By Andrew D. Birrell and Bruce Jay Nelson Adapted from an earlier presentation by Abdussalam Alawini.
1 Developing Application in Distributed Computing Environment (DCE)
The Peregrine High-Performance RPC System David B. Johnson Willy Zwaenepoel Software—Practice & Experience February 1993.
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.
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.
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,
RPC Model, Stubs and Skeletons Divya Nampalli
Implementing Remote Procedure Call Landon Cox February 12, 2016.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Phil Howard.
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.
Client-Server Communication
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
CS533 Concepts of Operating Systems
Implementing RPC by Birrell & Nelson
CMSC621: Advanced Operating Systems Advanced Operating Systems
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Sarah Diesburg Operating Systems COP 4610
Process-to-Process Delivery:
CS533 Concepts of Operating Systems Class 10
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Distributed Systems CS
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Process-to-Process Delivery: UDP, TCP
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
Communication.
Distributed Systems CS
Presentation transcript:

Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Slide Set by Phil Howard and others

Why?

Consider #include <stdio.h> int main() { printf("hello world!\n"); return 0; }

What Happens main main printf glibc kernel IO kernel update_window X update_display kernel IO kernel

But what if Laptop Linux Box X Client X Server Console Window main

What Happens Laptop Linux Box X Client main main printf glibc update_display X kernel IO kernel kernel IO kernel update_window X update_display

How do you do this? Fork/Join? SendMessage/AwaitReply? Virtual Shared Memory? Remote Procedure Call?

Remote Procedure Call (RPC)

What's Involved in RPC Remote Procedure Call should look and feel like local call Remote Procedure Call should be independent of where it executes Remote Procedure Call should be "efficient"

Issues Finding the callee Passing data Implementation Exceptions Optimizations

Finding the Callee (Binding) Where - Either server has known static address - Or client broadcasts request - Or use central database of interfaces What - Servers export named interfaces - Clients request a particular interface - Need Globally Unique Identifiers for interfaces

Interfaces Type Instance - Like object oriented programming interfaces - Method names, parameter and result types - Underlying functionality is hidden Instance - Which specific provider of this type

Binding Callee exports an interface via a network accessible database. RPCRuntime Server Stub Server Database Export Interface Export Interface Update Database

Binding Caller binds by specifying the type of the interface in a database query Selects from a list of instances returned Caller User User Stub RPCRuntime Who’s available? Database Import Interface Import Interface Query Database Interface Info Interface Info Interface Info Available Interfaces

Issues Passing data Finding the callee Implementation Exceptions Optimizations

Passing Data Can't use the stack! Can't use shared memory! Generally use message passing

Passing Data #include <stdio.h> int main() { } union } my_var; unsigned long stuff1; unsigned char stuff2[4]; } my_var; my_var.stuff1 = 0x12345678; printf("%X %X %X %X\n", my_var.stuff2[0], my_var.stuff2[1], my_var.stuff2[2], my_var.stuff2[3]); return 0; }

Passing Data What's the output? 12 34 56 78 or 78 56 34 12

Passing data Build a message that includes: Who and what's being called Identity of the caller Data values in known byte order Using an intermediate data representation

Issues Implementation Finding the callee Passing data Exceptions Optimizations

Implementation foo(a,&b) foo(int a, int *b) return;

Implementation foo(int a; int *b) { build_msg(a,b); send_msg(); wait_for_reply(); get_from_msg(&b); } do_foo(msg_t msg) { int a,b; get_from_msg(&a,&b); foo(a,&b); build_msg(b); send_reply(); }

Implementation Function prototype is (almost) all that's needed to build the client stub Also need binding information Function prototype is (almost) all that's needed to build server stuff Also need method to wait for message

Implementation Network Network Caller Callee User User Stub RPCRuntime Procedure call Pack arguments Send packet Transmit packet(s) procedure return Unpack result(s) Receive packet(s) Receive packet Callee RPCRuntime Server Stub Server Network Receive packet Receive packet(s) Unpack arguments Procedure call Send packet Transmit packet(s) Pack result(s) Procedure return

Implementation Clients Threaded Servers Event Driven

Issues Exceptions Finding the callee Passing data Implementation Optimizations

Exceptions What can happen in "normal" procedures? Procedure generates an exception Procedure infinite loops Procedure generates wrong results

Exceptions What can happen in "remote" procedures? Client stub generates exception Transmission failure knowable failure unknowable failure Remote procedure generates an exception Remote procedure infinite loops Remote procedure generates wrong results

Issues Optimizations Finding the callee Passing data Implementation Exceptions Optimizations

Optimizations Servers maintain no state on clients No penalty for a large number of clients Messages must be ack'd for short calls, result serves as ack for frequent calls, next call ack's last result for long requests, only last request message gets ack'd for long results, only last result message gets ack'd Bound to "closest" server Minimum transmission delay

Protocol-Level Optimizations Caller Callee User RPCRuntime RPCRuntime Server Procedure call Transmit first packet Call[Ids, packet=0] Receive packet 0 Ack[Ids, packet=0] Receive ack Transmit ack Call[Ids, packet=1] Transmit next packet Receive packet 1 Procedure call Retransmit next packet Call[Ids, packet=1, needAck] Receive packet 1 Ack[Ids, packet=1] Receive ack Transmit ack procedure return Receive result Result[Ids] Transmit result procedure return Receive result Result[Ids, needAck] Transmit ack request Ack[Ids] Transmit ack Receive ack

Conclusion Remote Procedure Call should look and feel like local call Remote Procedure Call should be independent of where it executes Remote Procedure Call should be "efficient"