Remote Procedure Calls Taiyang Chen 10/06/2009. Overview Remote Procedure Call (RPC): procedure call across the network Lightweight Remote Procedure Call.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
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.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
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.
CS533 Concepts of Operating Systems Class 8 Shared Memory Implementations of Remote Procedure Call.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr.
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.
Remote Procedure Calls (RPC) Presenter: Benyah Shaparenko CS 614, 2/24/2004.
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:
Remote Procedure Calls (RPC) - Swati Agarwal. RPC – an overview Request / reply mechanism Procedure call – disjoint address space clientserver computation.
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)
CS533 Concepts of Operating Systems Class 4 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)
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?
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Implementing Remote Procedure Calls ANDREW D. BIRRELL and BRUCE JAY NELSON Presented by Tony Bock.
Lightweight Remote Procedure Call (Bershad, et. al.) Andy Jost CS 533, Winter 2012.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
By Andrew D. Birrell and Bruce Jay Nelson Presented By: Abdussalam Alawini Reviewed By Prof. Jonathon Walpole.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
Remote Procedure Call An Effective Primitive for Distributed Computing Seth James Nielson.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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,
Processes Introduction to Operating Systems: Module 3.
By Andrew D. Birrell and Bruce Jay Nelson Adapted from an earlier presentation by Abdussalam Alawini.
Networking Implementations (part 1) CPS210 Spring 2006.
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.
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,
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
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.
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
DISTRIBUTED COMPUTING
CS533 Concepts of Operating Systems Class 10
Lecture 4- Threads, SMP, and Microkernels
Fast Communication and User Level Parallelism
Presented by Neha Agrawal
Remote Procedure Call Hank Levy 1.
Presented by: SHILPI AGARWAL
Remote Procedure Call Hank Levy 1.
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

Remote Procedure Calls Taiyang Chen 10/06/2009

Overview Remote Procedure Call (RPC): procedure call across the network Lightweight Remote Procedure Call (LPRC): procedure call across domains

RPC Outline Background History Environment Motivation and Goals Design Implementation Binding Packet Transport Optimizations Performance Conclusions

History Idea back in 1976 Courier by Xerox in 1981 First business use Sun RPC Sun Network File System in 1984 Now Open Network Computing RPC Implementation on Unix-like systems and Windows A. D. Birrell and B. J. Nelson in 1984 Nelson's doctoral thesis

Environment Dorado machines (your own IBM 370/168 workstation) 3/10Mbps Ethernet Standard PUP protocol: unreliable datagram, reliable byte streams Cedar: programming environment for building systems and programs Mesa: strongly typed programming language

Motivation and Goals Distributed computing Simple distributed applications using RPC Powerful interface Ease of building RPC, like a procedure call Efficient calls Secure communication Not yet, but possible

Design Decisions Same semantics to local procedure call Procedure call vs message passing Reliable and efficient transmission Arguments and results Network security Mesa No shared addresses Paging system High cost, even today

From Local Procedure Call...

To Remote Procedure Call

Components User/Server: caller/callee process Stub: packing and unpacking procedures and arguments, auto-generated by Lupine RPCRuntime: transport layer Network: PUP Interface: Mesa module defining procedure names, arguments and results Importer Exporter

Implementation Binding Packet Transport Optimizations

Binding Naming Type Instance Location Grapevine: distributed database for binding Key = RName Entry = Individual or Group Group = Set of RNames (Types) Individual = Connect-site (Instance)

Interface Server uses ExportInterface(type, instance, procedure) Client uses ImportInterface(type, [instance])

Look-up Table Unique binding identifier

Binding Overview

Binding: ExportInterface

Binding: ImportInterface

Binding

Packet Transport No specialized package-level protocol Unsatisfactory experiments Small packets Minimizing elapsed call time No large data transfers One call, one return (or exception)

Transport Types Simple call: all arguments fit in one packet Complicated call: need to split into multiple packets

Simple Call Two packets Retransmission and Acknowledgement

Call Details Call ID Activity: one outstanding remote call  Machine ID  Process ID Sequence Number: monotonic (global counter)

Look-up Table Unique binding identifier Call identifier

Complicated Call Probe packet Acknowledge all but the last packet

Exception Handling Signals Dynamically scanning Mesa runtime system Exception packet Handled by RPCRuntime

Optimizations Idle server processes Process identifier swap Bypassing software layers Modified network driver to treat RPC packets RPC = Dominant CHEATING

Performance

RPC Summary Advantages Simple distributed interface for programmers Portable (different stub generators) Secure (future work) Disadvantages Error handling: special network cases Performance: two orders of magnitude slower than local procedure calls

ONC RPC (RFC 1831) Binding independent Language interfaces Transport independent Network protocols Authentication Asynchronous batching

RPC Conclusions Small code base (~2,200 lines) Distributed computing Bulk data transfer Security Grapevine authentication Packet data encryption

LRPC Outline Background History Environment Motivation and Goals Design RPC problems RPC optimizations LPRC design Implementation Binding Calling Interfaces and stubs Multiprocessing Other considerations Performance Conclusions

History B. N. Bershad, T. E. Anderson, E. D. Lazowska and H. M. Levy in 1990 Exokernel in 1995 LPRC in ExOS based on Aegis's protected control transfer More efficient than the Fastest RPC (259 μs vs 340 μs) Tornado in 2003 Protected Procedure Call (PPC)  Clustered Object call: client and server clustered objects  Stub Generator  Remote PPC: remote interrupts

Environment DEC SRC Firefly multiprocessor workstation 5 MicroVAX II CPUs (1 MIPs each) 16MB memory SRC Firefly RPC Inferior performance to LRPC (464 μs vs 157μs for the simplest cross-domain call) Modula2+: strongly typed programming language, influenced by Mesa

Firefly RPC Close to Cedar RPC Grapevine is now a global call table Transport: UDP/IP Improvements Direct thread wakeup from the Ethernet interrupt Retaining packet buffer instead of UID Same address space for packet buffer, Ethernet driver and interrupt handlers, sacrificing security Special Ethernet operations in assembly language

LRPC Motivation RPC performance across domains is disappointing Most communication traffic are... Cross-domain on the same machine  Cross-machine activity is very low on most systems Simple, small values  Most procedure calls incur fewer than 50 bytes of parameters Independent threads exchanging large messages

LRPC Goals Performance, safety and transparency Simple control transfer: execution within server domain Simple data transfer: shared argument stack Simple stubs: optimized Concurrency: no locking

LRPC Design Problems in Cross-Domain RPC RPC Optimizations (for the above) LRPC = PPC + RPC

Problems in Cross-Domain RPC Stub overhead Message buffer overhead Access validation Message transfer Scheduling Context switch Dispatch

RPC Optimizations Shared buffer region Handoff scheduling Direct context switch Passing arguments in register

LRPC = PPC + RPC PPC Call to server procedure is a kernel trap Kernel does validation and dispatches client thread to the server domain RPC Similarity  Binding  Interfaces and stubs Improvement  Calling

Binding Kernel Validation: Grapevine Linkage record: RPC's look-up table Clerk Argument passing: RPCRuntime Procedure descriptor list (PDL) Argument stack (A-stack): mapped read-write and shared by both domains Binding Object: unique identifier

Interfaces and Stubs Interfaces written in Modula2+ Stub generation in simple assembly language Portability

Calling Kernel Server Stub User Stub Client Domain Server Domain Binding Object A-stack E-stack Verification Linkage Record Thread Control Block Domain Transfer

Calling Details User stub Traps a new A-stack, Binding Object and procedure ID into kernel Verification Binding and procedure ID, finds Procedure Descriptor (PD) A-stack, finds linkage record No other thread is using current A-stack/linkage record Linkage Record Caller return address and current stack point Stored in caller's thread control block Domain Transfer User stack pointer to run server's E-stack Load virtual memory registers of the server domain Call into server's stub based on PD

Multiprocessing Caching domain contexts on idle processors (similar idea to RPC) Reduces TLB misses Process tag

Other Considerations Checking cross-machine calls Dynamic A-stack resizing Exception handling Termination any time Revoking Binding Object Asynchronous termination

Performance

LRPC Summary Advantages Efficient cross-domain RPC Safety using protection calls Disadvantages Exception handling is more complicated than RPC (revoking Binding Object) Heavy dependence on kernel verification (end-to- end)

LRPC Conclusions and Comparison LRPC improves performance over RPC on same-machine, cross-domain calls Sufficient evidence that most calls are same- machine in practice LRPC has better security RPC is still the general protocol for NFS and distributed applications

Thank you!