Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Similar documents
Chapter 5: Distributed objects and remote invocation

Interprocess Communication

Lecture 5: Object Interaction: RMI and RPC

Remote Invocation. Today. Next time. l Overlay networks and P2P. l Request-reply, RPC, RMI

Distributed Information Processing

RMI: Design & Implementation

COMMUNICATION IN DISTRIBUTED SYSTEMS

Chapter 5: Remote Invocation. Copyright 2015 Prof. Amr El-Kadi

Structured communication (Remote invocation)

Lecture 06: Distributed Object

MODELS OF DISTRIBUTED SYSTEMS

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CHAPTER - 4 REMOTE COMMUNICATION

Distributed Systems. Definitions. Why Build Distributed Systems? Operating Systems - Overview. Operating Systems - Overview

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

MODELS OF DISTRIBUTED SYSTEMS

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Chapter 4: Inter-process Communications

Lecture 5: RMI etc. Servant. Java Remote Method Invocation Invocation Semantics Distributed Events CDK: Chapter 5 TVS: Section 8.3

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

Unit 7: RPC and Indirect Communication

Chapter 5 Remote Invocation. Gandeva Bayu Satrya, ST., MT. Telematics Labz. Informatics Department Telkom

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Operating System Support

Distributed Systems. The main method of distributed object communication is with remote method invocation


Today: Distributed Objects. Distributed Objects

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

Module 3 - Distributed Objects & Remote Invocation

Slides for Chapter 5: Remote Invocation

CSci Introduction to Distributed Systems. Communication: RPC

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Distributed Systems. 5. Remote Method Invocation

Last Class: RPCs. Today:

Remote Invocation. Today. Next time. l Indirect communication. l Request-reply, RPC, RMI

Object-Oriented Distributed Technology

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

CS454/654 Midterm Exam Fall 2004

Object-based distributed systems. INF 5040/9040 autumn Lecturer: Frank Eliassen

Distributed Systems Recitation 3. Tamim Jabban

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Chapter 3: Client-Server Paradigm and Middleware

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

CORBA (Common Object Request Broker Architecture)

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Distributed Middleware. Distributed Objects

Java RMI Middleware Project

A Report on RMI and RPC Submitted by Sudharshan Reddy B

Advanced Topics in Distributed Systems. Dr. Ayman A. Abdel-Hamid. Computer Science Department Virginia Tech

Distributed Information Systems

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Chapter 5 Distributed Objects and Remote Invocation

Verteilte Systeme (Distributed Systems)

5.4. Events and notifications

Remote Procedure Calls CS 707

Figure 6.1 System layers

Chapter 4 Communication

CAS 703 Software Design

Lecture 8: February 19

Chapter 4 Interprocess Communication. Copyright 2015 Prof. Amr El-Kadi

DISTRIBUTED COMPUTER SYSTEMS

Networks and Operating Systems Chapter 3: Remote Procedure Call (RPC)

SAI/ST course Distributed Systems

Distributed Objects SPL/ SPL 201 / 0 1

Remote Invocation. To do. Request-reply, RPC, RMI. q Today q. q Next time: Indirect communication

Distributed Systems 8. Remote Procedure Calls

Communication. Distributed Systems Santa Clara University 2016

Programming with RMI Reminder

DS 2009: middleware. David Evans

Distributed Systems Principles and Paradigms. Distributed Object-Based Systems. Remote distributed objects. Remote distributed objects

Distributed Systems Inter-Process Communication (IPC) in distributed systems

Remote Procedure Call

Last Class: RPCs. Today:

Electronic Payment Systems (1) E-cash

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Today CSCI Remote Method Invocation (RMI) Distributed Objects

RPC and RMI. 2501ICT Nathan

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

Remote Procedure Calls

5 Distributed Objects: The Java Approach

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

Distributed object component middleware I - Java RMI

416 Distributed Systems. RPC Day 2 Jan 11, 2017

Remote Procedure Call (RPC) and Transparency

IBD Intergiciels et Bases de Données

Distributed object component middleware I - Java RMI

IPC. Communication. Layered Protocols. Layered Protocols (1) Data Link Layer. Layered Protocols (2)

Communication. Overview

Distributed Systems. Lehrstuhl für Informatik 4. RWTH Aachen. Organization. Literature. Classification of the lecture

Lecture 15: Network File Systems

Distributed Systems. Lehrstuhl für Informatik IV RWTH Aachen. Organisation. Classification of the lecture. Literature

Middleware and Interprocess Communication

Advanced Topics in Operating Systems

Transcription:

Distributed Systems Lecture 2 1 Today s Topics External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.4) Distributed Objects and Remote Invocations (5.1) Communication between Distributed Objects (5.2) Remote Procedure calls (5.3) Events and Notifications. (5.4) All figures are in the book Distributed Systems Concepts and Design by Couloris, Dollimore and Kindberg

Distributed Systems Lecture 2 2 Middleware Layers Applications, services RMI and RPC Request-reply protocol, marshaling and external data representation Network Middleware is the two layers in the middle.

Distributed Systems Lecture 2 3 External Data Representation and Marshaling Remember the problem in lecture one, Heterogeneity. (Everybody is different). Different operation systems. Different programming languages. Different hardware architectures. Problem when data structures must be sent in message in distribueted system.

Distributed Systems Lecture 2 4 Example, Big Endian/Little Endian Most numbers that you store are larger than a byte and there is some choice about how you lay out multibyte numbers in memory. Big Endian in big endian you store the most significant byte in the smallest memory address. (For example DECs) Little Endian in little endian you store the least significant byte in the smallest memory address. (For example Suns, Motorolas). For example to store the number 0x90AB Address Big Endin Value Little Endin Value 1000 90 AB 1001 AB 90

Distributed Systems Lecture 2 5 Example, Representing characters There are different set of codes to represent characters. ASCII: 1 byte Unicode: 2 byte

Distributed Systems Lecture 2 6 What to do? One of the two following methods can be used: The values can be converted to an agreed external format before transmission and converted to the local form on receipt. The values are transmitted in the sender s format together with an indication of the format used, and the recipient converts the values if necessary. An agreed standard for the representation of data structures and primitive values is called an external data representation.

Distributed Systems Lecture 2 7 Marshalling - Unmarshalling Marshalling is the process of taking a collection of data items and assembling them into a form suitable for transmission. Unmarshalling is the process of disassembling them on arrival to produce an equivalent collection of data items at the destination.

Distributed Systems Lecture 2 8 Two Examples We will briefly discuss two alternative approaches to external data representation and marshalling. CORBA s common data representation (CDR), an external representation of data. Java s object serialisation which flattens objects or tree of objects. Needs no involvement of the application programmer.

Distributed Systems Lecture 2 9 CORBA If middleware is supposed support many different systems and you have to convert the data then how do you get that to work? CORBA has a common external format CDR. CDR can represent all the data types that can be used as arguments and return values in remote invocations. Values transmitted in serders order (big-/little-endian).

Distributed Systems Lecture 2 10 CORBA Interface Definition Language The interface of objects are described in CORBA IDL. From a CORBA IDL specification the marshalling & unmarshalling operations are generated by the CORBA interface compiler. For each new platform a CORBA IDL compiler has to be provided.

Distributed Systems Lecture 2 11 Java Object Serialization In Java RMI, both objects and primitive data values may be passed as arguments and results of method invocations. If an object implements the interface Serializable then the system provides a default serialisation method. Serialization refers to the activity of flattening an object into a serial form.

Distributed Systems Lecture 2 12 Java Object Serialization (cont.) The contents of all the data members of the class is serialized. Serialization and deserialization of the arguments and results of remote invocations are generally carried out automatically by the middleware. A programmer declares a variable as transient when it should not be serialized.

Distributed Systems Lecture 2 13 Request Reply Protocol Communication designed for client-server. Common format for protocols. Send the request to the remote server/object and wait for the reply of acknowledgement. The primitives: dooperation - specify the remote object and which method to invoke. getrequest - acquire service requests. sendreply - send reply message to the client.

Distributed Systems Lecture 2 14

Distributed Systems Lecture 2 15 Failure in Request Reply Protocol If primitives implemented over UDP datagrams: lost; might not be received in the same order that they were sent. If client does not know if request has been executed by server. Messages can be lost. Server needs more time than clients timeout. Client can resend message until a reply is received or sure that server does not respond.

Distributed Systems Lecture 2 16 Distributed Objects and Remote Invocation Middleware layers: Applications, services RMI and RPC Request-reply protocol, marshaling and external data representation Network

Distributed Systems Lecture 2 17 Distributed Objects and Remote Invocation We will look at four things: The distributed object model. Remote method invocation (RMI). Remote procedure call (RPC). Distributed event-based systems.

Distributed Systems Lecture 2 18 The distributed object model Remote objects are objects that can receive remote invocations. Objects can invoce methods of a remote object if they have access to its remote object reference. Every remote object has a remote interface that specifies which of its methods can be invoked remotely. Remote interfaces: Remote interfaces do not have constructors. In CORBA user defines the remote interfaces in IDL. In Java RMI user extends interface Remote.

Distributed Systems Lecture 2 19 Middleware - Transparency Remember, one of the goals of middleware is to make things as invisible to the application. On of the design goals is location transparency. Remote invocations is vulnerable to failure. Remote invocations can throw exceptions which a client program handle.

Distributed Systems Lecture 2 20 Implementation of RMI Communication modul: One in the client and one in the servern. Perform the request-reply protocol. Remote reference module: Translates between local and remote object references and creates remote object references. For each process it maintains a remote object table - the mapping between local object references and remote object references. Proxy: Acts like a local object to the invocer, but instead of executing the invocation it forwards it in a message to a remote object. Does the marshalling and unmarshalling.

Distributed Systems Lecture 2 21 Implementation of RMI (cont.) Dispatcher: The dispatcher selects the method to invoce in the skeleton. Skeleton: A skeleton method unmarshals the arguments in the request messages and invoces the corresponding method in the object. An interface compiler generates proxies, dispatchers and skeletons automatiskt.

Distributed Systems Lecture 2 22

Distributed Systems Lecture 2 23 Remote Procedure Calls Client: Stub procedure: acts like a local procedure, marshals the request and unmarshals the reply. Similar to proxy in RMI. Server: Dispatcher: calls server s stub procedure. Stub procedure: Calls the real service procedure. Unmarshals the request and marshals the reply. Similar to skeleton in RMI. Like for RMI the software for RPC can be generated by an interface compiler.

Distributed Systems Lecture 2 24

Distributed Systems Lecture 2 25 Problems with local references If you pass a parameter which is a reference (pointer) to a local piece of data, then what do you do? Possible solutions include: Don t pass pointers! Copy the local data and send it over the network. Modify the server so that it requests the data on demand.

Distributed Systems Lecture 2 26 Events and Notifications The idea: one object can react to a change occuring in another object. Publish-subscribe paradigm. Objects publish a list of types of events that it might generate. Other object subscribe to certain events. When the objects generate events they notify the objects. Often used in GUI toolkits, for example a button on the screen generates an even that could be monitored by different objects.

Distributed Systems Lecture 2 27 Distributed event-based systems characteristics Heterogeneous: Components that were not designed to interoperate can be made to work together. Asynchronous: Notifications are sent asynchronously to all the objects that have subscribed to them.