G22.3250-001 Robert Grimm New York University Lightweight RPC.

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
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Akbar.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Lightweight Remote Procedure Call B. Bershad, T. Anderson, E. Lazowska and H. Levy U. Of Washington.
Fast Communication Firefly RPC Lightweight RPC  CS 614  Tuesday March 13, 2001  Jeff Hoy.
Lightweight Remote Procedure Call BRIAN N. BERSHAD THOMAS E. ANDERSON EDWARD D. LAZOWSKA HENRY M. LEVY Presented by Wen Sun.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
CS533 Concepts of Operating Systems Class 8 Shared Memory Implementations of Remote Procedure Call.
Implementing Remote Procedure Calls Authors: Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presenter: Jim Santmyer Thanks to:
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, Henry M. Levy ACM Transactions Vol. 8, No. 1, February 1990,
G Robert Grimm New York University Fine-grained Mobility (in Emerald)
G Robert Grimm New York University Fine-grained Mobility (in Emerald)
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,
Communication in Distributed Systems –Part 2
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
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)
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
Remote Procedure Calls Taiyang Chen 10/06/2009. Overview Remote Procedure Call (RPC): procedure call across the network Lightweight Remote Procedure Call.
1 Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska and Henry M. Levy Presented by: Karthika Kothapally.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
CS510 Concurrent Systems Jonathan Walpole. Lightweight Remote Procedure Call (LRPC)
Lightweight Remote Procedure Call (Bershad, et. al.) Andy Jost CS 533, Winter 2012.
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.
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 RPC Tanenbaum.
IT 344: Operating Systems Winter 2008 Module 19 Networking & Remote Procedure Call (RPC) Chia-Chi Teng CTB 265.
Lightweight Remote Procedure Call BRIAN N. BERSHAD, THOMAS E. ANDERSON, EDWARD D. LASOWSKA, AND HENRY M. LEVY UNIVERSTY OF WASHINGTON "Lightweight Remote.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
Networking Implementations (part 1) CPS210 Spring 2006.
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy. Presented by: Tim Fleck.
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?
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
CS533 Concepts of Operating Systems
Implementing RPC by Birrell & Nelson
B. N. Bershad, T. E. Anderson, E. D. Lazowska and H. M
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
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CS533 Concepts of Operating Systems Class 10
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
Fast Communication and User Level Parallelism
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
Presented by Neha Agrawal
Remote Procedure Call Hank Levy 1.
Presented by: SHILPI AGARWAL
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.
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

G Robert Grimm New York University Lightweight RPC

Altogether Now: The Three Questions  What is the problem?  What is new or different?  What are the contributions and limitations?

Structuring Systems  Monolithic kernels  Hard to modify, debug, validate  Fine-grained protection through capabilities  Relies on protected procedure calls  Is difficult to implement efficiently and program  Large-grained protection through machine boundaries  Relies on remote procedure calls  Small kernels (think Mach)  Rely on user-space servers for most functionality  Adopt programming models of distributed computing

Problem Statement and Approach  Small kernels use distributed programming models  Common case of communications is not across net but rather across domains on the same machine  Optimize for the common case  Simple control transfer  Simple data transfer  Simple stubs  Design for concurrency

RPC (by Hank Levy)

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.  Goals was to make RPC look 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

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.

RPC Stubs  Basically, a client-side stub is a procedure that looks to the client as if it were a callable server procedure.  A server-side stub looks to the server as if it’s a calling client.  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 the RPC happen.

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

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

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.

RPC Marshalling  Marshalling is the packing of procedure parameters into a message packet.  The RPC stubs call type-specific procedures to marshall (or unmarshall) all of the parameters to the call.  On the client side, the client stub marshalls the parameters into the call packet; on the server side the server stub unmarshalls the parameters in order to call the server’s procedure.  On the return, the server stub marshalls return parameters into the return packet; the client stub unmarshalls return parameters and returns to the client.

RPC Final  RPC is the most common model now for communications in distributed applications.  RPC is essentially 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.

Back (Well, Forward) to LRPC

Use of RPC  Most RPCs are cross domain  3.0% on V, 5.3% on Taos, 0.6% on Sun+NFS  Most RPCs transfer little data  On Taos, 3 procedures account for 75% of all RPCs  No complex marshalling, byte copy suffices

Overheads of RPC (When Compared to Null Proc)  Stub overhead  Message buffer overhead  Access validation  Message transfer  Scheduling  Context switch  Dispatch  What about SRC RPC?

Enter LRPC  Call to server made through kernel trap  Kernel validates caller, creates a linkage, dispatches concrete thread to server  Client provides argument stack and thread  Procedure returns through kernel

LRPC Binding  Model comparable to regular RPC  Server exports interface to name server  Clients import interface  Details differ  Procedure descriptor (PD)  Entry address, number of simultaneous calls, size of A-stack  Pair-wise shared memory for arguments and return values  Linkage record  Record of caller’s return address  Binding object  Capability for accessing server’s interface

LRPC Calls  Client stub sets up A-stack, calls kernel  Kernel  Verifies binding object, procedure identifier, locates PD  Verifies A-stack, locates linkage record  Ensures that A-stack/linkage record are unused  Records caller’s return address in linkage record  Pushes linkages record on per-thread stack  Locates execution stack (E-stack) in server’s domain  Updates stack pointer to use E-stack  Changes virtual memory registers  Performs upcall into server

LRPC Calls (cont.)  Return through kernel  No verification of rights, data structures  No explicit message passing  Call-by-reference requires local reference (why?)  E-stacks dynamically associated with A-stacks  Association performed on first call with given A-stack  E-stacks reclaimed when supply runs low  Why no static association?

More Details  Stubs blur boundaries of traditional RPC layers  Direct invocation of server stubs, no message dispatch  Simple LRPCs require one procedure call, two returns  LRPC designed for multi-processors  Each A-stack queue guarded by its own lock  Domains cached on idle processors  Processors changed on LRPC (in both directions)  Context switch only performed when domain not cached  Generalized technique (Amoeba, Taos cache blocked threads)

LRPC Argument Copying  Copying performed in stubs, not in kernel  4 times for RPC, once for LRPC in common case  Shared memory allows for asynchronous change  Extra copy for immutable parameters  Constraint check folded into copy operation

Performance of LRPC

Performance of LRPC (cont.)  Locking matters!

The Uncommon Cases  LRPC still supports cross-machine RPC  Detected in first instruction of client stub  A-stacks are either statically sized or size of ethernet packet  Stubs use out-of-band memory for larger arguments  Domain termination integrated with LRPC  Binding objects are revoked  Threads returned to client domain (with exception)  Linkage records of terminating domain invalidated  Threads can be recreated in client  Addresses server capturing a client’s thread

What Do You Think?