Prof. Leonardo Mostarda University of Camerino

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
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.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
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.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
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.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
1 Developing Application in Distributed Computing Environment (DCE)
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
 Communication Distributed Systems IT332. Outline  Fundamentals  Layered network communication protocols  Types of communication  Remote Procedure.
1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the.
Distributed (Operating) Systems -Communication in Distributed Systems- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet.
Remote Procedure Call RPC
Remote Procedure Call and Serialization BY: AARON MCKAY.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
1 Prof. Leonardo Mostarda University of Camerino Distributed Systems – Remote Procedure Calls Prof. Leonardo Mostarda-- Camerino,
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.
Last Class: Introduction
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
CHAPTER 3 Architectures for Distributed Systems
Remote Procedure Call present by :Enas Alkhoshi
Distributed Systems CS
CMSC621: Advanced Operating Systems Advanced Operating Systems
Communication Chapter 2.
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 Autumn 2003 Lecture 16 RPC
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
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
Remote Procedure Call Hank Levy 1.
CS-502, Operating Systems Fall 2009 (EMC)
Lecture 6: RPC (exercises/questions)
Distributed Systems CS
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 6: RPC (exercises/questions)
Lecture 7: 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)
Communication.
Distributed Systems CS
Presentation transcript:

Prof. Leonardo Mostarda University of Camerino Distributed Systems – Remote Procedure Calls Prof. Leonardo Mostarda University of Camerino Prof. Leonardo Mostarda-- Camerino,

Last Lecture Client anatomy Server Anatomy Iterative and concurrent servers Stateful and stateless servers Server cluster organisation Distributed servers and IPv6

Outline OSI model Middleware definition Types of Communication Remote Procedure Calls

Learning outcomes Understand the OSI model Understand and discuss different types of communication Understand and discuss the RPC Understand and discuss the main challenges when we need to implement the RPC

Layered Protocols (1) Due to the absence of shared memory all communication in distributed systems is based on sending and receiving (low level) messages. Agreements are needed at a variety of levels on how information is to be expressed and processed. OSI provides a reference model to describe protocols

Layered Protocols (2) A typical message as it appears on the network.

Middleware Protocols Middleware is an application that logically lives (mostly) in the application layer, but which contains many general-purpose protocols. Middleware general services Authentication, authorisation distributed commit protocols, fault tollerance A middleware supports high-level communication services (transparency)

Types of Communication Various alternatives in communication can be offered by a middleware Persistent – the middleware stores the message until is delivered to the receiver (e.g., email) Transient – a message is stored by the communication system only as long as the sending and receiving application are executing (e.g., transport level communication) Besides being persistent or transient, communication can also be asynchronous or synchronous.

Conventional Procedure Call Send and receive do not conceal communication at all In 1984 Birrell and Nelson allowed programs to call procedures located on other machines Suppose that A calls a procedure on machine B The calling process on A is suspended Execution of the called procedure takes place on B No message passing at all is visible to the programmer. This is known as Remote Procedure Call (RPC). Some problems need to be faced The calling and called procedures run on different machines, They execute in different address spaces, Parameters and results must be passed (different hardware/software)

Conventional Procedure Call To understand RPC we need to fully understand how a conventional (i.e., single machine) procedure call works. E.g. count = read(fd,buf,nbytes) fd is an int (the file), buf is an array and nbytes an int (how many bytes to read) Parameters can be call-by-value or call-by-reference nbytes is by value while buf by reference

Client and Server Stubs In RPC the calling procedure should not be aware that the called procedure is executing on a different machine. When I read from the local file system the read routine is extracted from the library. It is a short procedure, which calls an equivalent read system call. In RPC a different version of read (client stub) is put into the library. This sends a message instead of getting data from the local OS. At the server side the message is passed to a server stub that transforms requests into local procedure calls The server stub will replay the result back to the client stub

Remote Procedure Calls (1) A remote procedure call occurs in the following steps: The client procedure calls the client stub in the normal way. The client stub builds a message and calls the local operating system. The client’s OS sends the message to the remote OS. The remote OS gives the message to the server stub. The server stub unpacks the parameters and calls the server. Continued …

Remote Procedure Calls (2) A remote procedure call occurs in the following steps (continued): The server does the work and returns the result to the stub. The server stub packs it in a message and calls its local OS. The server’s OS sends the message to the client’s OS. The client’s OS gives the message to the client stub. The stub unpacks the result and returns to the client.

Passing Value Parameters (1) The function of the client stub is to take the parameters, pack them into a message, and send them to the server stub (i.e., marshaling). Several problems need to be faced different data representation EBCDIC character code and ASCII code one's complement versus two's complement endianness

Passing Value Parameters (2) endianness: (a) The messages on the Pentium, i.e., 5 and Jill (b) The messages after receipt on the SPARC. (c) The messages after being inverted (the string did not need to be inverted).

Parameter Specification and Stub Generation How are pointers, or in general, references passed? A pointer is meaningful only within the address space of the process in which it is being used. What is the solution? If we have an array then the client stub must copy the values of the array and pass them to the server stub The server stub processes the array and sends back the modified array to the client stub. The reference can be related to a complicated data structure

Parameter Specification and Stub Generation Hiding a remote procedure call requires that the caller and the callee agree on the format of the messages they follow the same steps when it comes to exchange complex data structures In the example below a character is in the rightmost byte of a word a float as a whole word an array is preceded by a word giving the length,

Prof. Leonardo Mostarda-- Camerino, Question WHAT IS JSON? SOAP (xml)? Prof. Leonardo Mostarda-- Camerino,

Interfaces Once the RPC protocol has been fully defined, the client and server stubs need to be implemented. Stubs for the same protocol but different procedures normally differ only in their interface to the applications. An interface is a collection of procedures. Interfaces are often specified by means of an Interface Definition Language (IDL). An interface specified in such an IDL is then subsequently compiled into a client stub and a server stub

Corba interface module Calc{ interface Calculator{ //User-defined exception exception MyException{}; //synchronous method float calculate(in float val1, in float val2, in char operator) raises (MyException); //asynchronous method oneway void set_value(in long val); };

Asynchronous RPC (1) The interaction between client and server in a traditional RPC is synchronous. In some case there is not result to be returned transfer the balance, start a server

Asynchronous RPC (2) RPC systems may provide facilities for what are called asynchronous RPCs In asynchronous RPC a client immediately continues after issuing the RPC request. The server immediately sends a reply back to the client the moment the RPC request is received, after which the server calls the requested procedure.

Asynchronous RPC (3) Combining two asynchronous RPCs is some- times also referred to as a deferred synchronous RPC. For instance the client may not be ready to process the answer

Asynchronous RPC It should be noted that variants of asynchronous RPCs exist. In One-way RPC the client does not wait for the acknowledgment from the server. The problem with this approach is that when reliability is not guaranteed, the client cannot know for sure whether or not its request will be processed.

summary OSI model Middleware definition Types of Communication Remote Procedure Calls