CS 582 / CMPE 481 Distributed Systems Communications (cont.)

Slides:



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

RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Spring Remote Procedure Call (5.3) Outline Protocol Stack Presentation Formatting.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
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.
Implementing Remote Procedure Calls Authored by: Andrew D. Birrel and Bruce Jay Nelson Presented by: Terry, Jae, Denny.
L-7 RPC 1. Last Lecture Important Lessons - Naming Naming is a powerful tool in system design  A layer of indirection can solve many problems Name+context.
G Robert Grimm New York University Lightweight RPC.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
CS 582 / CMPE 481 Distributed Systems Communications (cont.)
Winter CMPE 155 Week 6. Winter Yet more servers… NFS and NIS.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
Jan 28, 2003CS475: Internetworking with UNIX TCP/IP1 XDR, RPC, NFS Internetworking with UNIX TCP/IP Winter
Copyright © Clifford Neuman - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE Administration Class web-page: suraj.lums.edu.pk/~cs582a03.
Netprog RPC Overview1 Distributed Program Design n Communication-Oriented Design –Design protocol first. –Build programs that adhere to the protocol.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
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.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Remote Procedure CallCS-502 Fall Remote Procedure Call CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System Concepts,
CSE 486/586 CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
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.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
Copyright © Clifford Neuman and Dongho Kim - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE Advanced Operating Systems Lecture.
Chapter 4: Interprocess Communication‏ Pages
RPC Design Issues Presented By Gayathri Vijay S-8,CSE.
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,
IS473 Distributed Systems CHAPTER 5 Distributed Objects & Remote Invocation.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Objects & Remote Invocation
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
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
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.
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 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
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.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
Implementing RPC by Birrell & Nelson
CMSC621: Advanced Operating Systems Advanced Operating Systems
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote Procedure Call Hank Levy 1.
CS-502, Operating Systems Fall 2009 (EMC)
Remote invocation (call)
Remote Procedure Call Hank Levy 1.
Remote Procedure Call Hank Levy 1.
Last Class: Communication in Distributed Systems
Presentation transcript:

CS 582 / CMPE 481 Distributed Systems Communications (cont.)

Remote Procedure Call (RPC)

Motivation Construction of distributed applications is a difficult task –Heterogeneity –Separation –Partial failure Leverage a local procedure call mechanism [Birrell & Nelson] –procedure calls are a well-known and well-understood mechanism for transfer of control and data within a program –Well engineered processes operate in isolation (black box) –the same principle can be extended to the client-server interaction clean and simple semantics Efficiency Generality –Communication between caller & callee can be hidden by using procedure call mechanism

Local Procedure Call before after E.g. read(int fd, char* buf, int bytes) 1.push parameter values of the procedure on a stack 2.call procedure 3.use stack for local variables 4.pop results (in parameters) “communication” with local procedure – copy data to/from stack

RPC Principle

LPC vs. RPC Client-server fails independently –extra exception handling –return value needs to be overloaded with failure codes from the server Global variables and pointers cannot be used across the interface

Design Consideration Abstraction of RPC semantics Heterogeneity Parameter passing Binding Failure Transparency Support for concurrency Orphan handling Performance

Level of Abstraction of RPC Semantics Integrate into the language –extend language to provide constructs for RPC semantics –examples: Cedar, Argus, Mercury Describe in a special purpose interface definition language –interface definition language supports language independence limited representation of parameter types –examples: Sun XDR, DCE IDL, Xerox Courier

Example: Argus Provides programming language constructs for remote operation invocation –Guardian a special kind of an object which implements a number of procedures that are run in response to remote requests interface is defined as a set of handlers –Action supports atomic transactions Ref –B. Liskov, “Distributed programming in Argus,” CACM 31(3), pp , March 1988.

Examples: Sun RPC Provides XDR language for interface definition –each procedure is numbered with a version number –the type of a result and an input parameter is either simple or complex (e.g. struct) –only one parameter is allowed (when -N option is not used) parameter is always input multiple parameters -> a single structure

Heterogeneity Marshalling policy –conversion to the common data type agreed by both a sender and a receiver: Sun RPC –a receiver makes it right (tagging): NCS RPC –sender negotiates with a receiver RPC mechanisms –define a veneer layer to encapsulate multiple RPC implementations [HRPC] control, data representation, and transport components Accommodate multiple transport protocols

Parameter Passing Considerations for parameter passing in RPC –direction of parameters input: client -> server output: server -> client input & output: client server –call-by-reference use call-by-value-result instead –pointer parameters no meaning to pass a pointer to memory location linearize before passing it –procedure parameter procedure should be accessible across the network

Binding Naming –mapping from a name to a particular service static linking: most RPCs dynamic linking: Apollo NCS RPC procedure variable: Argus, Mercury –exportation and importation server exports its service interface client imports exported service –interface consists of name: uniquely identifiable –version info and location info can be included signature: parameter name & type

Binding How to determine where server is? Which procedure to call? –“Resource discovery” problem Broadcast requests –broadcast request & process incoming replies Name service: advertises servers and services. –Example: Birrel et al. uses Grapevine. Early versus late binding. –Early: server address and procedure name hard-coded in client. –Late: go to name service.

Binding (cont.) Locating a server –via a binder (like a directory service) well-know address run-time notification broadcasting (recruiting)

Failure Transparency Ordered delivery –request and reply delivered in order (e.g. Argus) RPC Execution semantics –How many times will a remote procedure be executed by the callee per call? –Semantics at-least-once at-most-once exactly-once

Execution Semantics At-least-once –when a caller receives the expected result, it implies that the requested call has been executed one or more (at least once) at a callee –the callee does not remember multiple executions due to call duplication or retry after failure –acceptable if operations are idempotent –example: Sun RPC - NFS

Execution Semantics (cont.) At-most-once –when a caller receives the expected result, it implies that the requested call has been executed exactly once. If not completed, executed zero or one time –the callee can detect duplicated requests at the absence of failure but persist through the abnormal termination (failure amnesia) –example: NCS RPC

Execution Semantics (cont.) Exactly-once –when a caller receives the expected result, it implies that the requested call has been executed exactly once. If not completed, executed zero times –the callee is failure-resilient: logging and two-phase commit –example: Argus

Support for Concurrency RPC behaves differently from LPC –the client does not need to be blocked while the server executes the requested call –the client may not need the result Approaches –Synchronous RPC a process/thread per call (at a client or a server) –Asynchronous RPC two types –no result –delayed result: delayed synchronous Examples: Argus, Mercury(Promises), X11 RPC

Synchronous & Asynchronous RPC Synchronous Asynchronous Client Server

Orphan Handling A server becomes an orphan when its results are no longer needed due to –duplicate call messages –client crashes or aborts in the middle of a call Orphans are bad because –resource waste –Interference –Inconsistency Orphan termination –server detects a duplicate message and aborts an orphan if exists –client keeps a list of servers and issues abort requests to them as part of the crash recovery procedure

Performance Performance consideration points –marshalling and unmarshalling –message transmission –request execution semantics –execution time Approaches –Leverage highly tuned transport protocols –Allow an application to make a right choice based on its needs request-n-reply: high throughput -> RPC large data transfer: low latency -> byte streams

RPC Implementation work CallerCallee Call packet Result User Client stub RPC runtime RPC runtime Server stub Server call pck args xmit rcv unpk call return pck result xmit rcv unpk result return

RPC Implementation RPC runtime mechanism responsible for retransmissions, acknowledgments. Stubs responsible for data packaging and un- packaging; –AKA marshalling and un-marshalling: putting data in form suitable for transmission. Example: Sun’s XDR.

Case Study : Sun RPC Defines format for messages, arguments, and results. –Uses UDP or TCP. over UDP message length ≤ 64 kbytes ~ 8-9 kbytes –broadcast RPC is an option –Uses XDR (eXternal Data Representation) to represent procedure arguments and header data. –Compiler system to automatically generate distributed programs. –Remote execution environment: remote program mutually exclusive execution of procedure in remote program

Identifying Remote Programs and Procedures Conceptually, each procedure on a computer is identified by pair : –(prog, proc) prog: 32-bit integer identifying remote program proc: integer identifying procedure –Set of program numbers partitioned into 8 sets. 0x x1fffffff assigned by SUN 0x x3fffffff assigned by local system manager 0x x5fffffff temporary 0x xffffffff reserved –Multiple remote program versions can be identified: (prog, version, proc)

Example RPC Program Numbers nameassigned nodescription portmap100000port mapper rstatd100001rstat, rup, perfmeter rusersd100002remote users nfs100003file system ypserv100004yp (NIS) mountd100005mount, showmount dbxd100006DBXprog (debug) ypbind100007NIS binder walld100008rwall, shutdown yppasswdd100009yppasswd

Communication Semantics TCP or UDP ? Sun RPC semantics defined as function of underlying transport protocol. RPC on UDP: calls can be lost or duplicated. at-least-once semantics if caller receives reply. zero-or-more semantics if caller does not receive reply. Programming with zero-or-more semantics: idempotent procedure calls. Sun RPC retransmission mechanism: –non-adaptive timeouts –fixed number of retransmissions

Remote Programs & protocols Ports