Spring 2006CS 3321 Remote Procedure Call Outline Protocol Stack Presentation Formatting.

Slides:



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

Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Spring 2002CS 4611 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
Spring Remote Procedure Call (5.3) Outline Protocol Stack Presentation Formatting.
RPC Remote Procedure Call Dave Hollinger Rensselaer Polytechnic Institute Troy, NY.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Computing Systems 15, 2015 Next up Client-server model RPC Mutual exclusion.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
1 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
Distributed Systems Lecture #3: Remote Communication.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
End-to-End Data Outline Presentation Formatting Data Compression.
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011 Kocaeli University Computer Engineering Department.
1Spring 2003, COM1337/3501 Lecture 5: End-to-End Protocols Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter.
Chapter 4: Interprocess Communication‏ Pages
Chapter 5 : End-to-End (Transport) Protocols Summary of underlying best-effort network capabilities (host-host) –drops packets or datagrams –re-orders.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
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.
Introduction to Computer Networks
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Remote Procedure Call RPC
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 22 – April 1, 2010.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
1 Remote Procedure Calls External Data Representation (Ch 19) RPC Concept (Ch 20)
Spring 2000CS 4611 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
1 COM Chapter 7 End-To-End Data 3 What Do We Do With The Data? From the network’s perspective, applications send messages to one another and these.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Topic 3: Remote Invocation Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Prof. Leonardo Mostarda University of Camerino
CSE 486/586 Distributed Systems Remote Procedure Call
Layered Architectures
CMSC621: Advanced Operating Systems Advanced Operating Systems
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
7. End-to-end data Rocky K. C. Chang Department of Computing
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Advanced Computer Networks
Remote Procedure Call (RPC) Neil Tang 11/26/2008
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
University of Houston Remote Procedure Call Datacom II Lecture 6
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
CS-502, Operating Systems Fall 2009 (EMC)
Distributed Systems CS
Remote invocation (call)
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
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Distributed Systems CS
Presentation transcript:

Spring 2006CS 3321 Remote Procedure Call Outline Protocol Stack Presentation Formatting

Spring 2006CS 3322 Why Not Use UDP or TCP? Request/reply paradigm well suited to UDP, but we need reliability TCP has too much overhead: going to the trouble of establishing connection, performing flow control, congestion control, etc, just too much for the exchange of a pair of messages.

Spring 2006CS 3323 RPC Timeline ClientServer Request Reply Computing Blocked From perspective of application, semantics should be identical to local procedure call

Spring 2006CS 3324 RCP Components Protocol Stack –May want layer for fragmenting and reassembling large messages –Definitely want layer for synchronizing request and reply messages –Definitely want layer for dispatching requests to the correct process Stubs Caller (client) Client stub RPC protocol Return value Arguments ReplyRequest Callee (server) Server stub RPC protocol Return value Arguments ReplyRequest

Spring 2006CS 3325 RPC Complications Pointers –Different address spaces at caller and callee –How do you do call by reference? –Solution: Call by value-result (a.k.a. call by copy/restore) (as per Programming Language Concepts by Gezzi and Jazayeri “In call by value-result, local variables denoting formal parameters are both initialized at subprogram call (as in call by value) and delivered upon termination (as in call by result).” Problems of its own: two formal parameters become aliases (I.e. two different names denote same object) A formal parameter and a nonlocal variable which is visible both by the caller and the callee become aliases

Spring 2006CS 3326 RPC Complications (cont). –Example of first problem: a[i], a[j] two integer actual parameters corresponding to formal parameters x and y. Routine called at time that i = j, which make x and y aliases of same variable. At initiation of routine, assume a[i] (= a[j]) = 10. Execute: –If parameters passed as call-by-reference, then result should be that a[i]=a[j]=1 at end of routine. –If parameters passed as call by value-result, then either a[i]=a[j]=0 or a[i]=a[j]=11, depending on order in which values copied from stack into actual parameters

Spring 2006CS 3327 Why a Layer for Fragmenting and Reassembly of Large Messages? We’re not using TCP, so no guarantee of reliability If very large packet is lost, need to resend the whole thing Instead, might want to fragment large packets and use something like selective acknowledgements.

Spring 2006CS 3328 Why Request/Reply Synchronization? Synchronize client with server (mimic semantics of local procedure call) Supports at-most-once semantics Slow (long running) server or crashed server? –client periodically sends “are you alive” probe, or –server periodically sends “I’m alive” notice Want to support multiple outstanding calls –Need a way to distinguish calls Even perhaps mutliple calls to same procedure Machines crash and reboot

Spring 2006CS 3329 Synchronous vs Asynchronous Question: How much does sender know after call to send() returns? Synchronous: Application not only knows that message was received by peer, but also that peer has returned an answer Asynchronous: Nothing (not even whether message has successfully left local machine) There’s really a continuum between these

Spring 2006CS Dispatcher Dispatch to appropriate procedure Synchronous counterpart to UDP Caller SELECT CHAN xCall xDemuxxPush Callee SELECT CHAN xCallDemux xDemuxxPush ServerClient Address Space for Procedures –flat: unique id for each possible procedure –hierarchical: program + procedure number Selection (demux) Synchronization

Spring 2006CS Potential RPC Stack Frags ETH IP SELECT Synch.

Spring 2006CS SunRPC IP implements fragmentation and reassembly –except no selective retransmit SunRPC implements syncrhonization –except no at-most-once semantics UDP + SunRPC implement SELECT-equivalent –UDP dispatches to program (ports bound to programs) –SunRPC dispatches to procedure within program

Spring 2006CS SunRPC: Identifying Remote Procedures 32-bit program number (ex. NFS is 0x ) 32-bit procedure number ( read is 6, write is 8) Mapping program numbers to port numbers –Port Mapper (0x ) at well known UDP port 111, procedure number 3 Ex. NFS read(): –Client sends request to Port Mapper at UDP 111 asking that procedure 3 be invoked to map 0x to correct UDP port. Client then sends SunRPC request to returned port with procedure number 6. SunRPC module listening at this port calls read().

Spring 2006CS SunRPC Header Format XID (transaction id) Server does not remember last XID it serviced Problem if client retransmits request while reply is in transit (because of short term memory about XID, server will interpret request as a new request) XID memory also problem with long network delays (LANs OK) Data MsgType = CALL XID RPCVersion = 2 Program Version Procedure Credentials (variable) Verifier (variable) 031 Data MsgType = REPLY XID Status = ACCEPTED 031

Spring 2006CS Presentation Formatting Marshalling (encoding) application data into messages Unmarshalling (decoding) messages into application data Data types we consider –integers –floats –strings –arrays –structs Application data Presentation encoding Application data Presentation decoding Message … Types of data we do not consider –images –video –multimedia documents

Spring 2006CS Difficulties Representation of base types –floating point: IEEE 754 versus non-standard –char: ASCII or EBCDIC –integer: big-endian versus little-endian (e.g., 34,677,374) Compiler layout of structures (126)(34)(17)(2) Big-endian Little-endian (2)(17)(34)(126) High address Low address

Spring 2006CS Taxonomy Data types –base types (e.g., ints, floats); must convert –flat types (e.g., structures, arrays); must pack –complex types (e.g., pointers); must linearize

Spring 2006CS Conversion Strategy Canonical Intermediate Form –Settle on external representation for each data type –Lots of extra work if two system use same internal representations for data types Receiver-makes-right –Sender sends data in its own internal representation (but typically must flatten complex data structures) –Every host must be able to convert data from all other machine architectures An N  N solution (each of N machines must be able to handle N different architectures!) But N is typically small, and common case is machines with same architecture Third option: receiver-makes-right if machine knows it’s sending to a machine with the same architecture.

Spring 2006CS Taxonomy (cont.) Tagged versus untagged data Stubs –Compiled Faster, more common –Interpreted Flexible

Spring 2006CS eXternal Data Representation (XDR) Defined by Sun for use with SunRPC C type system (without function pointers) Canonical intermediate form Untagged (except array length) Compiled stubs

Spring 2006CS #define MAXNAME 256; #define MAXLIST 100; struct item { int count; char name[MAXNAME]; int list[MAXLIST]; }; bool_t xdr_item(XDR *xdrs, struct item *ptr) { return(xdr_int(xdrs, &ptr->count) && xdr_string(xdrs, &ptr->name, MAXNAME) && xdr_array(xdrs, &ptr->list, &ptr->count, MAXLIST, sizeof(int), xdr_int)); } CountName JO37HNSON List Example of rpcgen type stuff

Spring 2006CS Abstract Syntax Notation One (ASN-1) An ISO standard Essentially the C type system Canonical intermediate form Tagged Compiled or interpreted stubs BER: Basic Encoding Rules (tag, length, value) value type lengthvaluelengthtypevaluelength

Spring 2006CS Network Data Representation (NDR) Defined by DCE Essentially the C type system Receiver-makes-right (architecture tag) Individual data items untagged Compiled stubs from IDL –Interface Definition Language 4-byte architecture tag –IntegerRep 0 = big-endian 1 = little-endian –CharRep 0 = ASCII 1 = EBCDIC –FloatRep 0 = IEEE = VAX 2 = Cray 3 = IBM

Spring 2006CS DCE Distributed Computing Environment A set of standards and software for building distributed systems Defined by Open Software Foundation (OSF) –Consortium of companies that included IBM, Digital, HP –Today known as Open Group DCE-RPC is RPC protocol at core of DCE system –Serves as underlying RPC protocol for Common Object Request Broker Architecture (CORBA)

Spring 2006CS DCE-RPC Runs on UDP Defines two-level addressing scheme with port mapper (like SunRPC) Supports at-most-once semantics –Client sends pings, server replies with “working” message to indicate it’s still churning on problem. –Could also respond with “nocall” message indicating it has no idea what you’re talking about Client can send “quit” message –Server responds with “quack” (quit ACKed)