Implementing Remote Procedure Calls ANDREW D. BIRRELL and BRUCE JAY NELSON Presented by Tony Bock.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
CCNA – Network Fundamentals
IS333, Ch. 26: TCP Victor Norman Calvin College 1.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Fast Communication Firefly RPC Lightweight RPC  CS 614  Tuesday March 13, 2001  Jeff Hoy.
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.
Implementing Remote Procedure Calls Authored by: Andrew D. Birrel and Bruce Jay Nelson Presented by: Terry, Jae, Denny.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
G Robert Grimm New York University Lightweight RPC.
Distributed systems Programming with threads. Reviews on OS concepts Each process occupies a single address space.
CS533 Concepts of Operating Systems Class 8 Remote Procedure Call & LRPC.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
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.
Remote Procedure Calls (RPC) - Swati Agarwal. RPC – an overview Request / reply mechanism Procedure call – disjoint address space clientserver computation.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
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.
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)
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
.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.
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)
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Presentation on Osi & TCP/IP MODEL
Distributed File Systems
By Andrew D. Birrell and Bruce Jay Nelson Presented By: Abdussalam Alawini Reviewed By Prof. Jonathon Walpole.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
CS332, Ch. 26: TCP Victor Norman Calvin College 1.
3: Transport Layer 3a-1 8: Principles of Reliable Data Transfer Last Modified: 10/15/2015 7:04:07 PM Slides adapted from: J.F Kurose and K.W. Ross,
Remote Procedure Call An Effective Primitive for Distributed Computing Seth James Nielson.
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.
Transport Layer COM211 Communications and Networks CDA College Theodoros Christophides
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
By Andrew D. Birrell and Bruce Jay Nelson Adapted from an earlier presentation by Abdussalam Alawini.
Efficient Software-based Fault Isolation Robert Wahbe, Steven Lucco, Thomas E. Anderson & Susan L. Graham Presented By Tony Bock.
Remote Procedure Call and Serialization BY: AARON MCKAY.
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.
5. The Transport Layer 5.1 Role of Transport Layer It bridge the gab between applications and the network layer. Provides reliable cost-effective data.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
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,
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Phil Howard.
Distributed Systems Lecture 8 RPC and marshalling 1.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Prof. Leonardo Mostarda University of Camerino
CS533 Concepts of Operating Systems
Implementing Remote Procedure Calls
Implementing RPC by Birrell & Nelson
Sarah Diesburg Operating Systems COP 4610
Remote Procedure Call Hank Levy 1.
Remote Procedure Call Hank Levy 1.
Computer Networks Protocols
Remote Procedure Call Hank Levy 1.
Transport Layer 9/22/2019.
Presentation transcript:

Implementing Remote Procedure Calls ANDREW D. BIRRELL and BRUCE JAY NELSON Presented by Tony Bock

Remote Procedure Calls Bring Threaded Model to IPC Individual processes have their own address spaces providing a natural protection boundary relative to other processes Individual processes have their own address spaces providing a natural protection boundary relative to other processes Previously, coordination between address spaces required message passing and event-oriented style Previously, coordination between address spaces required message passing and event-oriented style RPC allows process-oriented, thread driven programming model for IPC whether local or remote RPC allows process-oriented, thread driven programming model for IPC whether local or remote

Advantages of RPC Simple – Straightforward semantics make it easier to build and maintain correct distributed programs Simple – Straightforward semantics make it easier to build and maintain correct distributed programs Efficient – Procedure call mechanism appears simple enough to enable rapid communication Efficient – Procedure call mechanism appears simple enough to enable rapid communication General – Procedures are the common way to communicate between portions of a program General – Procedures are the common way to communicate between portions of a program

Challenges Linking functions in a separate address space Linking functions in a separate address space Discovering/specifying RPC target Discovering/specifying RPC target Calling/returning across processes Calling/returning across processes Passing arguments by reference Passing arguments by reference Unreliability of networks Unreliability of networks Retransmits must not lead to multiple callsRetransmits must not lead to multiple calls Crashes can occur at either end at any timeCrashes can occur at either end at any time Deliver High Performance Deliver High Performance

Linking: Use Stubs to Import/Export Interfaces Application is linking against functions that reside in a different address space Application is linking against functions that reside in a different address space Server is returning results to separate address space Server is returning results to separate address space Server and client link to programmatically generated stubs of a common interface module at compile time Server and client link to programmatically generated stubs of a common interface module at compile time RPC runtime manages communication between machines/processes RPC runtime manages communication between machines/processes User writes interface, client, and server code but doesn’t need to write any code for communication mechanism User writes interface, client, and server code but doesn’t need to write any code for communication mechanism Client Stubs (Import) Server Stubs (Export) Interface Module bool Foo(int) int Bar(char) int Baz(int) Application Function Library RPC Runtime RPC Runtime NETWORK

Binding – Matching Callers to Callees Stubs are only place holders, client still needs to find the server Stubs are only place holders, client still needs to find the server Servers register their exported interfaces with secure database servers Servers register their exported interfaces with secure database servers Register time-based unique server IDRegister time-based unique server ID Clients can specify or select server from available list or bind statically by network address Clients can specify or select server from available list or bind statically by network address Get server’s ID and network addressGet server’s ID and network address Clients include server’s ID and unique sequence number with each call Clients include server’s ID and unique sequence number with each call Name Address Interface Server ID Interface? Name Address Server ID Interface Function Offset Server ID Sequence Number ServerClient Database

Crossing Process Boundaries Caller and Callee have separate address spaces Caller and Callee have separate address spaces Can’t dereference pointers directlyCan’t dereference pointers directly Caller needs to call functions in separate processCaller needs to call functions in separate process Callee needs to return to separate processCallee needs to return to separate process RPC runtime layers on server & client coordinate communication across network RPC runtime layers on server & client coordinate communication across network Client calls result in messages sent by RPC to server with index of desired function from client stubsClient calls result in messages sent by RPC to server with index of desired function from client stubs Server RPC uses index to find desired function in server stubs and switches to serverServer RPC uses index to find desired function in server stubs and switches to server Server “calls home” to ask client for values when dereferencingServer “calls home” to ask client for values when dereferencing Client Stubs (Import) Server Stubs (Export) Interface Module bool Foo(int) int Bar(char) int Baz(int) Application Function Library RPC Runtime RPC Runtime Foo() Index of Foo() Foo() Index of Foo() *value? CallerCallee

Reliability RPC must overcome network’s inherent unreliability RPC must overcome network’s inherent unreliability Network can drop any packetNetwork can drop any packet Either machine can crash at any timeEither machine can crash at any time Mustn’t crash others by so doing Mustn’t crash others by so doing Need to discern crash vs. running slowly Need to discern crash vs. running slowly Each application issues at most one RPC to a particular server/interface at time Each application issues at most one RPC to a particular server/interface at time Each request includes a monotonically increasing sequence number & the server IDEach request includes a monotonically increasing sequence number & the server ID Sequence ID includes “conversation ID”, a unique time-based client identifierSequence ID includes “conversation ID”, a unique time-based client identifier

Reliability Server checks ID’s when receiving calls and keeps track of current (highest) sequence number Server checks ID’s when receiving calls and keeps track of current (highest) sequence number If server ID doesn’t match, server has crashed since client connected: dropIf server ID doesn’t match, server has crashed since client connected: drop Keeps track of current (highest) sequence numberKeeps track of current (highest) sequence number < current, this is a retransmit of old request: drop < current, this is a retransmit of old request: drop = current, retransmit of current request: issue ACK if requested, then drop = current, retransmit of current request: issue ACK if requested, then drop > current, new request: client acknowledges receipt of RPC result > current, new request: client acknowledges receipt of RPC result Conversation IDs ensure sequence numbers don’t repeat if client restartsConversation IDs ensure sequence numbers don’t repeat if client restarts

Packet Protocol – Simple Case Existing protocols focused on one-way bulk data transfers Existing protocols focused on one-way bulk data transfers Even substantial per-connection overhead is insignificant to data transmit timeEven substantial per-connection overhead is insignificant to data transmit time RPC generates many small packets in each direction so it uses a minimal protocol RPC generates many small packets in each direction so it uses a minimal protocol RPC result implies acknowledgment of request – function has run exactly onceRPC result implies acknowledgment of request – function has run exactly once Each RPC request implies acknowledgment of previous result – Each application has at most one outstanding requestEach RPC request implies acknowledgment of previous result – Each application has at most one outstanding request Sender must resend until acknowledged, retransmits include request for ACKSender must resend until acknowledged, retransmits include request for ACK Advantages of RPC protocol Advantages of RPC protocol Minimal per-connection setup and teardown costsMinimal per-connection setup and teardown costs Minimal state when connection is idleMinimal state when connection is idle Server just keeps last sequence number Server just keeps last sequence number Client has a list of server addresses & IDs Client has a list of server addresses & IDs Minimize delay between RPC request and response – no handshaking phaseMinimize delay between RPC request and response – no handshaking phase No idle time communication, i.e.: keep-alive packetsNo idle time communication, i.e.: keep-alive packets Request Result

Multi-Packet Requests Need to make sure all packets arrive in order Need to make sure all packets arrive in order Ask for explicit ACK with each transmit except the lastAsk for explicit ACK with each transmit except the last Retransmits still ask for explicit ACKRetransmits still ask for explicit ACK Return result still implies receipt of last packetReturn result still implies receipt of last packet

Crashed or Slow? If server crashes, caller needs to move on otherwise wait for slow server If server crashes, caller needs to move on otherwise wait for slow server While waiting for response caller periodically pings server While waiting for response caller periodically pings server If responses keep coming, server is just slow: wait forever (just like local procedure call)If responses keep coming, server is just slow: wait forever (just like local procedure call) If responses stop coming, server is crashed: throw exceptionIf responses stop coming, server is crashed: throw exception You There? Yes. Exception: Comm_Failed

Performance Both machines maintain multiple idle server processes ready to handle RPCs Both machines maintain multiple idle server processes ready to handle RPCs Reduces cost of process creationReduces cost of process creation Process may be created/destroyed to adapt to trafficProcess may be created/destroyed to adapt to traffic Each packet includes source and destination process ID Each packet includes source and destination process ID When expecting a packet, a process registers with the Ethernet handlerWhen expecting a packet, a process registers with the Ethernet handler When the handler receives an expected packet, it passes it directly to the waiting process with only one context switchWhen the handler receives an expected packet, it passes it directly to the waiting process with only one context switch If no one’s waiting, packet passes to idle server process for decision makingIf no one’s waiting, packet passes to idle server process for decision making

Summary RPCs allow for procedure oriented programming across process boundaries RPCs allow for procedure oriented programming across process boundaries Programmatically generated stubs abstract transition between processesProgrammatically generated stubs abstract transition between processes RPC runtime translates calls to networkRPC runtime translates calls to network User only writes application and server codeUser only writes application and server code Lightweight protocol minimizes per-client server load, handshaking, and idle state maintenance Lightweight protocol minimizes per-client server load, handshaking, and idle state maintenance System of time-based ID’s along with active state pinging enhances reliability and aids in securing network System of time-based ID’s along with active state pinging enhances reliability and aids in securing network