Lightweight Remote Procedure Call (Bershad, et. al.) Andy Jost CS 533, Winter 2012.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

The Spring System (and its trusty sidekick, Subcontract) Sun Microsystems.
Remote Procedure Call Design issues Implementation RPC programming
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM B. Bershad, S. Savage, P. Pardyak, E. G. Sirer, D. Becker, M. Fiuczynski, C. Chambers,
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Akbar.
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.
Microkernels How to build a dependable, modular and secure operating system?
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,
G Robert Grimm New York University Lightweight RPC.
Distributed Systems Lecture #3: Remote Communication.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Chris.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
CS533 Concepts of Operating Systems Class 8 Shared Memory Implementations of Remote Procedure Call.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
Dawson R. Engler, M. Frans Kaashoek, and James O'Tool Jr.
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
Improving IPC by Kernel Design Jochen Liedtke Presented by Ahmed Badran.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, Henry M. Levy ACM Transactions Vol. 8, No. 1, February 1990,
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
USER LEVEL INTERPROCESS COMMUNICATION FOR SHARED MEMORY MULTIPROCESSORS Presented by Elakkiya Pandian CS 533 OPERATING SYSTEMS – SPRING 2011 Brian N. Bershad.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
CS533 Concepts of Operating Systems Class 4 Remote Procedure Call.
.NET Mobile Application Development 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.
CS533 Concepts of OS Class 16 ExoKernel by Constantia Tryman.
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)
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CS533 Concepts of Operating Systems Jonathan Walpole.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
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.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
 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.
Lightweight Remote Procedure Call BRIAN N. BERSHAD, THOMAS E. ANDERSON, EDWARD D. LASOWSKA, AND HENRY M. LEVY UNIVERSTY OF WASHINGTON "Lightweight Remote.
Processes Introduction to Operating Systems: Module 3.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Networking Implementations (part 1) CPS210 Spring 2006.
LRPC Firefly RPC, Lightweight RPC, Winsock Direct and VIA.
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy. Presented by: Tim Fleck.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
The Mach System Silberschatz et al Presented By Anjana Venkat.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Brian Bershad, Thomas Anderson, Edward Lazowska, and Henry Levy Presented by: Byron Marohn Published: 1991.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Introduction to Operating Systems Concepts
Kernel Design & Implementation
CS533 Concepts of Operating Systems
OS Organization Continued
B. N. Bershad, T. E. Anderson, E. D. Lazowska and H. M
CS533 Concepts of Operating Systems Class 10
Chapter 1 Introduction to Operating System Part 5
By Brian N. Bershad, Thomas E. Anderson, Edward D
Fast Communication and User Level Parallelism
Presented by Neha Agrawal
Presented by: SHILPI AGARWAL
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M
Presentation transcript:

Lightweight Remote Procedure Call (Bershad, et. al.) Andy Jost CS 533, Winter 2012

Introduction Preliminary definitions – Monolithic kernels and microkernels – Capability systems – Remote procedure calls (RPC) Motivation – Analysis of the common case – Performance of RPC – Sources of overhead Lightweight RPC (LRPC) Performance

OS Kernel Paradigms Monolithic OS – All (or nearly all) services built into the kernel – One level of protection, but typically no internal firewalls – E.g., BSD UNIX (millions of LOC) – HW is exposed to a great deal of complex software – Hard to debug, extend Microkernel (or “small-kernel”) OS – The kernel provides only the minimum services necessary to support independent application programs (address space management, thread management, IPC) – Additional services are provided by user-space daemons – Certain daemons are imbued with special permission (e.g., HW access) by the kernel – Service requests utilize IPC

Separate address spaces are used to establish protection domains 1.No cross-domain read/write 2.The kernel mediates IPC 3.RPC can be used to give a procedural interface to IPC

Capability Systems A capability system is a security model – A security model specifies and enforces a security policy Provides a fine-grained protection model A capability is a communicable, unforgeable token of authority representing an access right In a capability system, the exchange of capabilities among mutually untrusting entities is used to manage privileged access throughout the system kernel ACL write(“/etc/passwd”) On whose authority do we write /etc/passwd? Need to consult an access control list One Possibility kernel fd = open(“/etc/passwd”, O_RDWR) write(fd) The open file descriptor proves write access was previously granted Capability System

Remote Procedure Call An IPC mechanism that allows a program to invoke a subroutine in another address space – The receiver might reside on the same physical system or over a network Provides a large-grained protection model The call semantics make it appear as though only a normal procedure call was performed – Stubs interface to a runtime environment, which handles data marshalling; the OS handles low-level IPC – Protection domain boundaries are hidden by stubs

Steps in a Traditional RPC Client Application Client Stub Client Runtime Library Client Kernel Server Application Server Stub Server Runtime Library Server Kernel sending path return path Potentially shared in a single-system RPC transport layer

The Use of RPC in Microkernel Systems Small-kernel systems can and do use RPC to borrow its large-grained protection model – Separate components are placed in disjoint address spaces (protection domains) – Communication between components is mediated by RPC, using messages – Advantages include: modularity, design simplification, failure isolation, and transparency (of network services) But this approach simultaneously borrows the control transfer facilities of RPC – Those are not optimized for same-machine control transfer – This leads to an unnecessary loss of efficiency

The Use of RPC Systems (I) Bershad argues that the common case for RPC: – is cross-domain (not cross-machine) – involves relatively simple parameters – can be optimized Frequency of Remote Activity Operation SystemPercentage of operations that cross machine boundaries V3.0 Taos5.3 Sun UNIX+NFS0.6 1.Frequency of Cross-Machine Activity

The Use of RPC Systems (II) 2.Parameter Size and Complexity – 1,487,105 cross-domain procedure RPCs observed during one four-day period – 95% were to 10 procedures; 75% were to 3 procedures – None of them involved complex arguments – Furthermore, most RPCs involve a relatively small amount of data transfer

The Use of RPC Systems (III) 3.The Performance of Cross-Domain RPC – The theoretical minimum time for a null cross- domain operation includes time for Two procedure calls Two traps Two virtual memory context switches – The cross-domain performance, measured across six systems using the Null RPC, varies from over 300% to over 800% of the theoretical minimum

Sources of Overhead in Cross-Domain RPC Stub Overhead: stubs are general enough for cross-machine RPC, but inefficient for the common case of local RPC calls Message Buffer Overhead: client/kernel, kernel/server, server/kernel, kernel/client Access Validation: the kernel must validate the message sender on call and again in return Message Transfer: messages are enqueued by the sender and dequeued by the receiver Scheduling: separate, concrete threads run in client and server domains Context Switch: in going from client to server Dispatch: the server must receive and interpret the message

Lightweight RPC (LRPC) LRPC aims to improve the performance of cross-domain communication relative to RPC The execution model is borrowed from a protected procedure call – Control transfer proceeds by way of a kernel trap; the kernel validates the call and establishes a linkage – The client provides an argument stack and its own concrete thread of execution The programming semantics and large-grained protection model are borrowed from RPC – Servers execute in private protection domains – Each one exports a specific set of interfaces to which clients may bind – By allowing a binding, the server authorizes a client to access its procedures

LRPC High-Level Design Physical Memory Virtual Memory A-stack E-stack Control Flow sending path return path Control Flow Kernel thread

Implementation Details Execution of the server procedure is made by way of a kernel trap The client provides the server with an argument stack and its own concrete thread of execution The argument stacks (A-stacks) are shared between client and server; the execution stacks (E-stacks) belong exclusively in the server domain – A-stacks and E-stacks are associated at call time – Each A-stack queue is guarded by a single lock The client must bind to an LRPC interface before using it; binding: – establishes shared segments between client and server – allocates bookkeeping structures in the kernel – returns a non-forgeable binding object to the client, which serves as the key for accessing the server (recall capability systems) On multiprocessors, domains are cached on idle processors (to reduce latency)

Performance The measurements below were taken across 100,000 cross-domain calls in a tight loop LRPC/MP uses the domain-caching optimization for multiprocessors LRPC performs a context switch on each call Table IV. LRPC Performance of Four Tests (in microseconds) TestDescriptionLRPC/MPLRPCTaos NullThe Null cross-domain call AddA procedure taking two 4-byte arguments and returning one 4-byte argument BigInA procedure taking one 200-byte argument BigInOutA procedure taking and returning one 200- byte argument

Discussion Items When the client thread is executing an LRPC, does the scheduler know it has changed context? Who is the parent of the server process? What is its main thread doing?