Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.

Slides:



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

CSE 486/586 Distributed Systems Remote Procedure Call
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
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.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
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.
Distributed Systems Lecture #3: Remote Communication.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
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.
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
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.
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.
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.
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
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
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
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 Andy Wang Operating Systems COP 4610 / CGS 5765.
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.
Remote Procedure Call RPC
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
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.
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.
Reliable Client-Server Communication. Reliable Communication So far: Concentrated on process resilience (by means of process groups). What about reliable.
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
RPC Model, Stubs and Skeletons Divya Nampalli
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
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.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Topic 4: Distributed Objects 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.
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
CSE 486/586 Distributed Systems Remote Procedure Call
IPC and RPC.
Remote Procedure Call present by :Enas Alkhoshi
CMSC621: Advanced Operating Systems Advanced Operating Systems
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Sarah Diesburg Operating Systems COP 4610
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote Procedure Call (invocation) RPC
Lecture 6: RPC (exercises/questions)
Distributed Systems CS
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Distributed Systems CS
Presentation transcript:

Lecture 5: RPC (exercises/questions)

26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7

26-Jun-16COMP28112 Lecture 53 Remaining Steps 7: add executes and returns answer to server stub 8: server stub composes reply message containing this answer 9: message is sent across the network 10: client OS passes reply to client stub 11: client stub unpacks and returns result

26-Jun-16COMP28112 Lecture 54 Producing a Client and a Server TVS Figure 4-12

26-Jun-16 Passing Reference Parameters In a language, such as C, procedure call parameters can be call-by-value or call-by-reference. In the first case, modifications by the procedure are valid only within a procedure. In the second case, a pointer is passed and modifications affect the memory location. Pointers are meaningful only within the address space of the process that uses them! Call by copy/restore can be used in RPC to replace call-by-reference. E.g.: –Client stub copies contents of a pointer to an array of characters to a message (assumes knowledge of size of the array) –Message sent to the server. Server stub provides pointer to the server to this array of characters. Modifications take place to this array of characters. –When the server finishes, the original message can be sent back to the client stub that copies it to the client. (still cannot handle the general case of a pointer to an arbitrary data structure) (see Tanenbaum, Sections 4.2.1, 4.2.2)

26-Jun-16COMP28112 Lecture 56 An Exercise Given the following C code: void doIt1 (int *p) { *p += 1 ; return ; } void doIt2 (int *a, int *b) { *a += 1 ; *b += 2 ; return ; } int main (int n, char **args) { int i = 1 ; doIt1 (&i) ; printf ("%i\n, i) ; doIt2 (&i, &i) ; printf ("%i\n", i) ; } What values would you expect to be printed for i normally? What values would be printed if doIt1 and doIt2 were called using RPC instead of just being local functions? Assume that the RPC knew, from the IDL, that the parameters were just "inout" references to ints so copy/restore is used.

26-Jun-16COMP28112 Lecture 57 Questions (1) Where does the need for at-least-once and at- most-once semantics come from? Why can’t we have exactly-once semantics? Consider a client/server system based on RPC, and assume the server is replicated for performance. Sketch an RPC-based solution for hiding replication of the server from the client. Traditional RPC mechanisms cannot handle pointers. What is the problem and how can it be addressed?

26-Jun-16COMP28112 Lecture 58 Questions (2) Explain what is in the runtime library in the Figure of slide 4. Executing an RPC requires that a client can contact a server. How does it find the contact point for a server, and what does that contact point consist of? Explain the principal operation of a remote procedure call (RPC). An RPC to a replicated server can be made highly transparent to caller and callee with respect to access, replication, and failure transparency. How?

26-Jun-16COMP28112 Lecture 59 Questions (3) What is the major disadvantage of using RPCs in comparison to messaging as in message- queuing systems? Give two compelling arguments why an RPC can never provide the same semantics as a local procedure call. What is the main difference between a remote method invocation (RMI) and an RPC? Give a typical example of client-side software that is needed in a distributed system.

26-Jun-16COMP28112 Lecture 510 Answers An exercise: 2 and 5 on a single machine. Using copy/restore: 2 and either 3 or 4. The problem is how to deal with a suspected server crash. Exactly once is impossible because you don’t know if the server has crashed before or after executing the requested operation. Simply take a client stub that replicates the call to the respective servers and execute these calls in parallel. Pointers refer to a memory location that is a local to the caller and meaningless to the recipient. The runtime library contains calls to the underlying transport-level interface or routines for converting data structures to host-independent representations. Contact a name server; the contact point will consist of an IP address and port number. RPC: you need to explain the figure in slide 2. Place the replicated call inside the client-side stub from where it can simply be executed in parallel to the servers. The main disadvantage is the synchronous and nonpersistent nature of RPCs – when a fault occurs it has to be dealt immediately. Access transparency cannot be achieved as it is impossible to pass pointers to local data structures. Also, masking failures (as we operate across a network) is a major issue. RMI provides a system-wide object reference mechanism, hence objects can be referenced from a remote machine. Any answer related to client-side stubs for implementing RPC, handling replication, fault-tolerence…