Lecture 4 Remote Procedure Calls (cont). EECE 411: Design of Distributed Software Applications [Last time] Building Distributed Applications: Two Paradigms.

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Remote Procedure Call Design issues Implementation RPC programming
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture XVIII: Concluding Remarks.
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.
Distributed Object & Remote Invocation Vidya Satyanarayanan.
Lecture 3: Sockets, Remote Procedure Calls. EECE 411: Design of Distributed Software Applications Last time: Pitfalls when developing distributed systems.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Network Operating Systems Users are aware of multiplicity of machines. Access to resources of various machines is done explicitly by: –Logging into the.
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.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
.NET Mobile Application Development Remote Procedure Call.
Lecture 8 Epidemic communication, Server implementation.
EECS122 - UCB 1 CS 194: Distributed Systems Communication Protocols, RPC Computer Science Division Department of Electrical Engineering and Computer Sciences.
1 DNS,NFS & RPC Rizwan Rehman, CCS, DU. Netprog: DNS and name lookups 2 Hostnames IP Addresses are great for computers –IP address includes information.
File Systems (2). Readings r Silbershatz et al: 11.8.
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
Distributed File Systems Sarah Diesburg Operating Systems CS 3430.
Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP.
Networked File System CS Introduction to Operating Systems.
Distributed File Systems
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Remote Procedure Call (RPC) and Transparency Brad Karp UCL Computer Science CS Z03 / th October, 2006.
Politecnico di Milano © 2001 William Fornaciari Operating Systems R P C Remote Procedure Call Lecturer: William Fornaciari Politecnico di Milano
NFS : Network File System SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate.
Lecture 4-5-6: Remote Procedure Calls. EECE 411: Design of Distributed Software Applications Academic honesty is essential to the continued functioning.
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.
Remote Procedure Call (RPC) and Transparency Brad Karp UCL Computer Science CS GZ03 / M th October, 2008.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Remote Procedure Call (RPC) and Transparency Brad Karp UCL Computer Science CS GZ03 / nd October, 2007.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Remote Procedure Call RPC
- Manvitha Potluri. Client-Server Communication It can be performed in two ways 1. Client-server communication using TCP 2. Client-server communication.
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.
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 File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
Fault Tolerance CSCI 4780/6780. RPC Semantics in Presence of Failures 5 types of exceptions Client cannot locate server Request to server is lost Server.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
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.
Remote Procedure Calls
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Distributed File Systems
Prof. Leonardo Mostarda University of Camerino
CMSC621: Advanced Operating Systems Advanced Operating Systems
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Reliable Client-Server Communication
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM
Chapter 15: File System Internals
Lecture 6: RPC (exercises/questions)
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
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)
Presentation transcript:

Lecture 4 Remote Procedure Calls (cont)

EECE 411: Design of Distributed Software Applications [Last time] Building Distributed Applications: Two Paradigms Communication-oriented design Start with communication protocol; Design message format and syntax of message exchanges Design components (clients, servers) by specifying how they react to incoming messages What’s hard Protocol design problems Specify components as finite state machines Focus on communication instead of on application RPC offers support here! [By attempting to provide transparency] Application-oriented design Start with application Design, build, test conventional (single-box) applications Partition the program across boxes What’s hard Preserving semantics when partitioning the program (using remote resources) Masking failures Concurrency

EECE 411: Design of Distributed Software Applications Remote Procedure Calls (RPC) Idea: local program calls procedures hosted remotely in a similar way to local procedures Information is passed in procedure arguments & results Main issue: Provide transparency Mask differences in data representation Handle failures Hide different address spaces Security (?)

EECE 411: Design of Distributed Software Applications Procedure Foo (integer x, integer y, integer z) { X = Y + 10 Y = Z + 20 Z = X + 90 } ……… Integer a=0 Integer b=10 Foo (a, b, a) Print (a,b) What is printed if parameters are passed  By value?  By reference?  By copy in/out Quiz sample question: Argument passing

EECE 411: Design of Distributed Software Applications Quiz sample question The C language has a construct called union in which a memory location can hold one of several alternative data types. For example the following piece of code declares a new union type union_def. Variables of this type can hold either one of an integer, a float or a character. union union_def { int a; float b; char c;} ; // define the type union union_def union_var;// define the variable union_var.b=99.99; or// initialize the variable union_var.a=34; The runtime system can not tell what datatype is stored in a variable declared as an union. You are to implement the RPC support for C. Does this language feature have any impact? Explain your answer.

EECE 411: Design of Distributed Software Applications Discussion: Did we achieve transparency? Yes: Hides wire formats and marshal / unmarshal. Hides details of send / receive APIs Hides details of transport protocol (TCP vs. UDP) Hides who the client is. No: Global variables / concurrency Failures

EECE 411: Design of Distributed Software Applications Dealing with failures (1/4) Failures: crash, omission, timing, arbitrary – some hidden by underlying network layers (e.g., TCP) What can go wrong with RPC: 1. Client cannot locate server 2. Client request is lost 3. Server crashes 4. Server response is lost 5. Client crashes [1:] Client cannot locate server. Relatively simple  just report back to client application (but transparency is lost!) [2:] Client request lost. Just resend message (and use message ID to uniquely identify messages)

EECE 411: Design of Distributed Software Applications Dealing with failures RPC (2/4) [3] Server crashes  harder as you don't know what the server has already done: Problem: decide on what to expect from the server At-least-once-semantics: The server guarantees it will carry out an operation at least once, no matter what. At-most-once-semantics: The server guarantees it will carry out an operation at most once.

EECE 411: Design of Distributed Software Applications Dealing with failures RPC (3/4) [4:] Lost replies  Detection hard: because it can also be that the server is just slow. You don't know whether the server has carried out the operation Solution: None that is general! (works sometimes) [At the application level] make your operations idempotent: repeatable without any harm done if it happened to be carried out before. Sequence numbers But: now one has to deal with state at the server. Main question here: for how long to maintain this state

EECE 411: Design of Distributed Software Applications Dealing with failures RPC (4/4) [5:] Client crashes  The server is doing work and holding resources for nothing (called doing an orphan computation). Possible solutions: [orphan extermination] Orphan is killed by client when it reboots But expensive to log all calls, …. and it may never work (grand-orphans, partitions) [reincarnation] Broadcast new epoch number when recovering  servers kill orphans [expiration] Require computations to complete in a T time units. Old ones are simply removed.

EECE 411: Design of Distributed Software Applications RPC Outline Mechanics. How does it actually work … … and limitations RPC in practice. Discussion: Techniques to deal with failures - Reliable RPC Case study: The Network File System Did we actually achieve transparency?

EECE 411: Design of Distributed Software Applications Case study: Network File System (NFS) What does the RPC split up in this case? App calls, syscalls, kernel file system, local disk In kernel, just below syscall interface. "vnode" layer. Is transparency preserved? Syntactic level: yes Semantic level: not really Not enough to preserve just the API. System calls must mean the same thing. Otherwise existing programs may compile and run but not be correct.

EECE 411: Design of Distributed Software Applications Does NFS preserve semantics of file system operations? New semantics: Open() system call: Originally, open() only failed if file didn't exist. Now open (and all others) can fail if server has died. Apps have to know to retry or fail gracefully. *even worse* open() could hang forever, which was never the case before. Apps have to know to set their own timeouts if they don't want to hang. This is fundamental, not an NFS quirk.

EECE 411: Design of Distributed Software Applications NSF: New Semantics … (II) New semantics: close() system call Originally client only waits in close(). close() never returned an error for local file system. Now: might fail if server disk out of space. So apps have to check close() for out-of-space, as well as write(). This is caused by NFS trying to hide latency by batching. Side effect of async write RPCs in client, for efficiency. They could have made write() synchronous (and much slower!).

EECE 411: Design of Distributed Software Applications NSF: New Semantics … (III) New semantics: deletion of open files I open a file for reading. Some other client deletes it while I have it open. Old behavior: my reads still work. New behavior: my reads fail. Side-effect of NFS's statelessness. How would one fix this?

EECE 411: Design of Distributed Software Applications NSF: New Semantics examples … (IV) Scenario: rename("a", "b") on an NFS file. Suppose server performs rename, crashes before sending reply. NFS client re-sends rename(). But now "a" doesn't exist, so produces an error. This never used to happen. Another side-effect of NFS's statelessness. NFS server never remembers all operations it has performed. Hard to fix: hard to keep that state consistent across crashes. Update state first? Or perform operation first?

EECE 411: Design of Distributed Software Applications NFS: security Security is totally different On local system: UNIX enforces read/write protections: Can't read my files w/o my password On NFS: Server believes whatever UID appears in NFS request Anyone on the Internet can put whatever they like in the request (Or you (on your workstation) can su to root, then su to me[2nd su requires no password] Why aren't NFS servers ridiculously vulnerable? Hard to guess correct file handles. This is fixable (SFS, AFS, even some NFS variants do it) Require clients to authenticate themselves cryptographically. Hard to reconcile with statelessness.

EECE 411: Design of Distributed Software Applications RPC: Summary Areas of RPC non-transparency 1. Partial failure, network failure 2. Latency 3. Efficiency/semantics tradeoff 4. Security. You can rarely deal with it transparently. 5. Pointers. Write-sharing. 6. Concurrency (if multiple clients) However, it turns out none of these issues prevented NFS from being useful. People fix their programs to handle new semantics. … install firewalls for security. And get most advantages of transparent client/server.

EECE 411: Design of Distributed Software Applications Concepts to remember Design choices RPC call semantics At-most-once / at-least-once semantics Idempotent calls Statefull/Stateless servers