CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC

Slides:



Advertisements
Similar presentations
RPC Robert Grimm New York University Remote Procedure Calls.
Advertisements

Remote Procedure Call Design issues Implementation RPC programming
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
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.
INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 9 Prof. Crista Lopes.
G Robert Grimm New York University Lightweight RPC.
Distributed Systems Lecture #3: Remote Communication.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
490dp Prelude: Design Report Remote Invocation Robert Grimm (borrowing some from Hank Levy)
Remote Procedure CallCS-4513 D-term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,
Communication in Distributed Systems –Part 2
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.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
Remote Procedure Call Andrew Whitaker CSE451. Remote Procedure Call RPC exposes a programming interface across machines: interface PriceService { Price.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
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.
CS 153 Design of Operating Systems Spring 2015 Lecture 23: Inter-Process Communication (IPC) and Remote Procedure Call (RPC)
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
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.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Remote Procedure Call RPC
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Distributed objects and remote invocation Pages
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.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Java Distributed Computing
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
Dave Eckhardt RPC Dave Eckhardt
Programming Models for Distributed Application
Remote Procedure Call present by :Enas Alkhoshi
Distributed Systems CS
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
Sarah Diesburg Operating Systems COP 4610
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
Remote Procedure Call (RPC) RPC – RMI - Web Services.
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
EECE.4810/EECE.5730 Operating Systems
Remote Procedure Call Hank Levy 1.
CS-502, Operating Systems Fall 2009 (EMC)
Distributed Systems CS
Remote invocation (call)
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Winter Module 21 Web Servers / Services
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 6: RPC (exercises/questions)
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)
Distributed Systems CS
Presentation transcript:

CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC Hank Levy levy@cs.washington.edu Allen Center 596 1

What’s Interesting about RPC? RPC = Remote Procedure Call the most common means for remote communication used both by operating systems and applications NFS is implemented as a set of RPCs HTTP is essentially RPC DCOM, CORBA, Java RMI, etc., are just RPC systems Someday you, too, will likely have to write an application that uses remote communications you’ll likely model your remote communications on RPC RPC is really, really simple under the covers 11/30/2018 © 2003 Hank Levy

Client/Server Communication The prevalent model for structuring distributed computation is the client/server paradigm a server is a program (or collection of programs) that provides a service to other programs e.g., file server, name server, web server, … server may span multiple nodes (clusters) often, nodes are called servers too e,g., the web server runs on a Dell server computer a client is a program that uses the service the client first binds to the server locates it, establishes a network connection to it the client then sends requests (with data) to perform actions, and the server sends responses (with data) e.g., web browser sends a “GET” request, server responds with a web page 11/30/2018 © 2003 Hank Levy

Messages Initially, people hand-coded messages to send requests and responses but, this quickly gets tiresome need to worry about message format have to pack and unpack data from messages servers have to decode messages and dispatch to handlers messages are often asynchronous after sending one, what do you do until response comes back? messages aren’t a natural programming model maybe we could encapsulate messaging behind some abstraction that the OS provides… then, we could just invoke library routines the library routines would send messages for us, and wait for responses to come back. hmm…. 11/30/2018 © 2003 Hank Levy

Procedure Calls Procedure calls are a natural way to structure multiple modules inside a single program every language supports procedure calls semantics are well-defined and understood programmers are used to them Idea: have servers export a set of procedures that can be called by client programs similar to library API, class definitions, etc. Clients do a local procedure call, as though they were directly linked with the server under the covers, the procedure call is converted into a message exchange with the server 11/30/2018 © 2003 Hank Levy

Remote Procedure Calls So…now we know the main idea: use procedure calls as the model for distributed (remote) communication But, there are a bunch of hard issues: how do we make the “remote” part of RPC invisible to the programmer? and is that a good idea? what are the semantics of parameter passing? what if we try to pass by reference? how do we bind (locate/connect-to) servers? how do we handle heterogeneity? OS, language, architecture, … how do we make it go fast? 11/30/2018 © 2003 Hank Levy

RPC model A server defines the service interface using an interface definition language (IDL) the IDL specifies the names, parameters, and types for all client-callable server procedures example: ASN.1 in the OSI reference model example: Sun’s XDR (external data representation) A “stub compiler” reads the IDL declarations and produces two stub procedures for each server procedure the server programmer implements the service’s procedures and links them with the server-side stubs the client programmer implements the client program and links it with the client-side stubs the stubs manage all of the details of remote communication between client and server 11/30/2018 © 2003 Hank Levy

RPC Stubs A client-side stub is a procedure that looks to the client as if it were a callable server procedure it has the same API as the server’s implementation of the procedure a client-side stub is just called a “stub” in Java RMI A server-side stub looks like a caller to the server it looks like a hunk of code that invokes the server procedure a server-side stub is called a “skeleton” or “skel” in Java RMI The client program thinks it’s invoking the server but it’s calling into the client-side stub The server program thinks it’s called by the client but it’s really called by the server-side stub The stubs send messages to each other to make the RPC happen transparently 11/30/2018 © 2003 Hank Levy

RPC example Server API: int Add(int x, int y; Client Program: … sum = server->Add(3,4); Server Program: int Add(int x, int y) { return x + y; } If the server were just a library, then “Add” would just be a local procedure call 11/30/2018 © 2003 Hank Levy

RPC example invocation Client Program: … sum = server->Add(3,4); Server Program: int Add(int x, int y) { return x + y; } client-side stub: int Add(int x, int y) { alloc message buffer; mark as “add” call; store x,y in buffer; send message; receive response; unpack response; return response; } server-side stub: Message Add_Stub(Message m) { remove x,y from m; r = Add(x,y); allocate response buffer; store r in response; return response; } RPC runtime system: send message to server; receive response; RPC runtime system: receive message m; response = Add_Stub(m); send response to client; 11/30/2018 © 2003 Hank Levy

RPC Marshalling Marshalling is the packing of procedure parameters into a message packet the RPC stubs call type-specific procedure to marshal or unmarshal the parameters of an RPC the client stub marshals the parameters into a message the server stub unmarshals the parameters and uses them to invoke the service’s procedure on return: the server stub marshals the return value the client stub unmarshals the return value, and returns them to the client program 11/30/2018 © 2003 Hank Levy

RPC Binding Binding is the process of connecting the client to the server the server, when it starts up, exports its interface identifies itself to a network name server tells RPC runtime that it is alive and ready to accept calls the client, before issuing any calls, imports the server RPC runtime uses the name server to find the location of the server and establish a connection The import and export operations are explicit in the server and client programs a slight breakdown in transparency more to come… 11/30/2018 © 2003 Hank Levy

RPC Transparency One goal of RPC is to be as transparent as possible make remote procedure calls look like local procedure calls we’ve seen that binding breaks this transparency What else breaks transparency? failures: remote nodes/networks can fail in more ways than with local procedure calls network partition, server crash need extra support to handle failures server can fail independently from client “partial failure”: a big bugbear in distributed systems if an RPC fails, was it invoked on the server? performance: remote communication is inherently slower than local communication if you’re not aware you’re doing a remote procedure call, your program might slow down an awful lot… 11/30/2018 © 2003 Hank Levy

RPC and thread pools What happens if two client threads (or client programs) simultaneously invoke the same server procedure using RPC? ideally, two separate threads will run on the server so, the RPC run-time system on the server needs to spawn or dispatch threads into server-side stubs when messages arrive is there a limit on the number of threads? if so, does this change semantics? if not, what if 1,000,000 clients simultaneously RPC into the same server? 11/30/2018 © 2003 Hank Levy