CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
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.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
The road to reliable, autonomous distributed systems
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Introduction to Remote Method Invocation (RMI)
Middleware Technologies compiled by: Thomas M. Cosley.
Communication in Distributed Systems –Part 2
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
Common Object Request Broker Architecture (CORBA) CS-328.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
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.
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.
SEMINOR. INTRODUCTION 1. Middleware is connectivity software that provides a mechanism for processes to interact with other processes running on multiple.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
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,
Presented By:- Sudipta Dhara Roll Table of Content Table of Content 1.Introduction 2.How it evolved 3.Need of Middleware 4.Middleware Basic 5.Categories.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
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.
Java Distributed Computing
Prof. Leonardo Mostarda University of Camerino
What is RMI? Remote Method Invocation
Remote Method Invocation
Ch > 28.4.
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
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.
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Java Remote Method Invocation
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals

CS 390- Unix Programming Environment Topics Distributed Systems Building Distributed Systems Remote Procedure Calls (RPC’s) Interface Definition Language

CS 390- Unix Programming Environment Introduction Since the early days of computers engineers have been able to dramatically improve the price/ performance of computer systems How: Advances in the hardware technology Software that takes advantage of, and requires powerful hardware support Can this continue? We are now starting to see the limits of the laws of physics effect the performance of microprocessor designs Not being able to access every part of the chip

CS 390- Unix Programming Environment Introduction Question: Where do we go from here? Answer: Add multiple processors to computer systems design that allow these processors to work together to improve the overall computing capacity of the computer How: Take advantage of advances in Hardware technology Make use of distributed systems architecture in an effective manner The future of distributed systems will have thousands of processors

CS 390- Unix Programming Environment Distributed Systems A Distributed System is a collection of independent computers that appears to the user as a single computer Fundamental aspects of the distributed systems definition Computers are autonomous Users think of the system as a single computer

CS 390- Unix Programming Environment Challenges The challenges for a distributed system are consistent with that of a centralized (non-distributed) system However, distributed systems are more complex than the centralized systems Coordination issues Synchronization issues Logical Clock Communication issues Desire to have a distributed system architecture with a distributed OS to handle and abstract these complex tasks

CS 390- Unix Programming Environment Desire of Distributed OS One of the primary desire of having an operating system is to shield programmers from the complexity of the hardware OS is a layer that sits on top on hardware OS provides an interface or virtual machine that is easy to understand and program In Similar ways a distributed system architecture must incorporate a Distributed System OS that would shield the client from complexities.

CS 390- Unix Programming Environment Building Distributed Systems To enable a distributed system, one processor must communicate with another processor We can do this by building out own communication programs using sockets With sockets we are responsible for: Encoding all data Having the client locate the server Byte Ordering Client and server processes must agree on the format on exchanged buffers Client and server processes must agree on handshaking for exchange of data

CS 390- Unix Programming Environment Building Distributed Systems contd… In the term project, we implemented a distributed application Client and Server communicated through sockets We implemented most of the socket features we discussed in the previous slide Summary: With sockets the programmer is intimately familiar with the details of communications programming We will now discuss about a technology that enables programmers to focus on building application code and lessen the burden of socket programming

CS 390- Unix Programming Environment Remote Procedure calls RPC’s look like traditional procedure (function) calls from the perspective of the programmer RPC’s abstract data communication issues and allow a process on one machine to invoke a procedure on another machine RPC’s are usually supported by tools that generate all of the communication code that is used by both the client and server programs

CS 390- Unix Programming Environment How a local procedure works int add(int a, int b) { return a+b; } void main() { printf(“%d \n”, add(5,4)); } How a local call works? Values put on stack A call is made Local procedure accepts parameters from the stack Local procedure performs its operation and returns value to the register Original calling procedure accepts this value

CS 390- Unix Programming Environment Parameter passing conventions Pass by value Pass by reference Pass by copy/restore Parameter value is passed from calling procedure to called procedure When the call finishes, the new parameter value overwrites the calling procedures original value This feature is not supported by C++ However, it holds

CS 390- Unix Programming Environment Remote Procedure Call Desire is to enable a RPC to support call by reference and call by value conventions Problem: traditional language syntax is not descriptive enough to describe if it is call by reference or call by value Also there are problems when we are trying to pass by reference How do we pass pointers? We need additional information such as storage space for pointers

CS 390- Unix Programming Environment RPC Architecture Client code Client Stub Operating System Server stub Server code Operating System Network

CS 390- Unix Programming Environment RPC Architecture contd… Client stub marshals the parameters that are passed from the client program to the server-based program Client stub implements communication code to send arguments to the server stub Server stub demarshals the client parameters Server stub calls the RPC Server stub passes the result back to the client via the client stub

CS 390- Unix Programming Environment Performing an RPC The key to performing a successful RPC is the marshaling and demarshaling code that is performed by the client and server stubs Marshaling handles Encoding and decoding of the procedure parameters User must be able to augment the basic marshaling facility to instruct the stubs on how to properly handle user-defined data types The marshaling code must properly handle pointers

CS 390- Unix Programming Environment IDL: The key to enabling RPC’s IDL is an Interface Definition Language Includes interface code only, no implementation code is included in the IDL file The IDL consists of special code that gives following details Procedures or the services that the server provides Parameters specifying their data type and also indicating whether they are in, out or in out type

CS 390- Unix Programming Environment Sample IDL interface test { int add(in int a, in int b); void add(in int a, in int b, out result); }

CS 390- Unix Programming Environment Building a RPC IDL IDL compiler Client stub Server skeleton Client code RPC Implementation Compiler and Linker Client ApplicationServer Application

CS 390- Unix Programming Environment Static or Dynamic Binding Static Binding Client specifies the location (IP address) of the server application during the IDL compilation phase At run time this address is used to establish connection with the server Dynamic Binding Server registers its name with a name server At run time the client contacts the name server for location of the server process The client builds and uses a binding handle to communicate with the server

CS 390- Unix Programming Environment Handling errors in RPC RPC’s are more error prone than the local procedures There are lots of issues: Client unable to locate the server Losing messages during communication Client/server crashes A programmer must handle these errors properly while coding

CS 390- Unix Programming Environment Handling errors using Exceptions Exceptions are error handling techniques An Exception has a try and catch block. A try block has the code and catch block catches an exception when an error occurs in the try block try {... Arrays[r] = new String(“Deal”);} catch (ArrayIndexOutOfBoundsException e) { out.close(); // don't do this; it duplicates code System.err.println("Caught ArrayIndexOutOfBoundsException: " + e.getMessage()); } catch (IOException e) { System.err.println("Caught IOException: " + e.getMessage()); }

CS 390- Unix Programming Environment RPC issues RPC’s may be quite slow because excessive copying of information is necessary Timer Management Synchronization issues Coordination issues Message Passing Communication issues Crashes

CS 390- Unix Programming Environment Some Architectures based on RPC’s Java RMI (Java Remote Method Invocation) CORBA (Component Object Request Broker Architecture) COM (Microsoft’s Component Object Model)