Structured communication (Remote invocation)

Similar documents
Slides for Chapter 5: Remote Invocation

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

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

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI

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

RMI: Design & Implementation

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

Interprocess Communication

Lecture 5: Object Interaction: RMI and RPC

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

Remote Invocation. 1. Introduction 2. Remote Method Invocation (RMI) 3. RMI Invocation Semantics

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Chapter 5: Distributed objects and remote invocation

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

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

Lecture 06: Distributed Object

Communication Paradigms

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

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

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

Distributed Information Processing

MODELS OF DISTRIBUTED SYSTEMS

Chapter 4: Inter-process Communications

CHAPTER - 4 REMOTE COMMUNICATION

MODELS OF DISTRIBUTED SYSTEMS

COMMUNICATION IN DISTRIBUTED SYSTEMS

Remote Procedure Calls CS 707

Architecture of distributed systems

Architecture of distributed systems

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

Distributed Systems. 5. Remote Method Invocation

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

Module 3 - Distributed Objects & Remote Invocation

Unit 7: RPC and Indirect Communication

Introduction to Distributed Systems. Fabienne Boyer, LIG,

Distributed Systems. Client-Server Communication: Exercises

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

Operating System Support

CSci Introduction to Distributed Systems. Communication: RPC

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

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

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

DISTRIBUTED COMPUTER SYSTEMS

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

02 - Distributed Systems

02 - Distributed Systems

SAI/ST course Distributed Systems

Remote Invocation Vladimir Vlassov and Johan Montelius

MTAT Enterprise System Integration. Lecture 2: Middleware & Web Services

Distributed Information Systems

3. Remote Procedure Call

Today: Distributed Objects. Distributed Objects

Java RMI Middleware Project

KTH ROYAL INSTITUTE OF TECHNOLOGY. Remote Invocation. Vladimir Vlassov and Johan Montelius

Peer-to-peer systems

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

Communication. Distributed Systems Santa Clara University 2016

Q.1. (a) [4 marks] List and briefly explain four reasons why resource sharing is beneficial.

Networked Systems and Services, Fall 2018 Chapter 4. Jussi Kangasharju Markku Kojo Lea Kutvonen

Chapter 5 Distributed Objects and Remote Invocation

Frequently asked questions from the previous class survey

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Middleware and Interprocess Communication

DS 2009: middleware. David Evans

Distributed Systems Course. a.o. Univ.-Prof. Dr. Harald Kosch

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

Architecture of Software Intensive Systems

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

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

Remote Procedure Calls

Remote Procedure Call

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

Chapter 4 Communication

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

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

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory.

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

System Models for Distributed Systems

Communication. Overview

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

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

Chapter 1: Distributed Systems: What is a distributed system? Fall 2013

5 Distributed Objects: The Java Approach

REMOTE PROCEDURE CALLS EE324

The Client Server Model and Software Design

CAS 703 Software Design

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Distributed Systems 8. Remote Procedure Calls

Remote Procedure Call (RPC) and Transparency

Communication. Communication. Distributed Systems. Networks and protocols Sockets Remote Invocation Messages Streams. Fall /10/2001 DoCS

Introduction to Distributed Systems

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

Module 1 - Distributed System Architectures & Models

Advanced Java Programming. Networking

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

Last Class: RPCs. Today:

DISTRIBUTED SYSTEMS [COMP9243] Distributed Object based: Lecture 7: Middleware. Slide 1. Slide 3. Message-oriented: MIDDLEWARE

Transcription:

Prof. Dr. Claudia Müller-Birn Institute for Computer Science, Networked Information Systems Structured communication (Remote invocation) Nov 8th, 2011 Netzprogrammierung (Algorithmen und Programmierung V)

Our topics last week Descriptive models for distributed system design Physical model Architectural model Architectural elements Interaction model Communicating entities Communication paradigm Roles and responsibilities Placement Interaction model Processes Objects Components Web Services Inter-process communication UDP sockets TCP sockets Indirect communication Multicast Remote invocation Architectural styles Client-server Peer-to-peer Multiple server Proxy/Cache Mobile code Failure model Architectural patterns Vertical distribution Multi-tier Thin/Fat Client Horizontal distribution Security model 2

Our topics today UDP Style request-reply protocols Failure model of UDP request-reply protocol Use of TCP streams to implement request-reply protocol HTTP: an example of a request-reply protocol Remote procedure call Remote Method invocation The distributed object model Implementation of RMI 3

Middleware layers Applications, services Remote invocation, indirect communication Underlying inter-process communication primitives: Sockets, message passing, multicast support Middleware layers UDP and TCP 4

Remote invocation UDP Style request-reply protocols 5

UDP style request-reply protocol Client Server dooperation (wait) (continuation) Request message Reply message getrequest select object execute method sendreply 6

Operations of the request-reply protocol (UDP) public byte[] dooperation (RemoteRef s, int operationid, byte[] arguments) sends a request message to the remote server and returns the reply. The arguments specify the remote server, the operation to be invoked and the arguments of that operation. public byte[] getrequest (); acquires a client request via the server port. public void sendreply (byte[] reply, InetAddress clienthost, int clientport); sends the reply message reply to the client at its Internet address and port. 7

Request-reply message structure messagetype requestid remotereference operationid arguments int (0=Request, 1= Reply) int RemoteRef int or Operation array of bytes 8

Message identifiers Unique message identifies is needed for any scheme that involves management of messages to provide additional properties such as reliable delivery request-reply communication Parts of a message identifier requestid, which is taken from an increasing sequence of integers by the sending process an identifier for the sender process, for example, its port and Internet address 9

UDP Style request-reply protocols Failure model of UDP request-reply protocol 10

Approaches to handle failures Repeatedly request message dooperation sends the request message repeatedly until either it gets a reply or it is reasonable sure the the delay is due to lack of response from the server, rather than lost messages Discarding duplicate request messages Server may receive more than one request message, e.g. server needs longer than the client s timeout to execute the command and return reply Problem: Operation is more than once executed to the same request Protocol is designed to recognize successive messages (from the same client) with the same request identifiers 11

Approaches to handle failures (cont.) Lost reply messages Problem: Server has already sent the reply when it receives a duplicate request it will need to execute the operation again to obtain the result Idempotent operation is an operation that can be performed repeatedly with the same effect as if it had been performed exactly once History Refer to a structure that contains a record of (reply) messages that have been transmitted Entry contains: request identifier, message, identifier of a client 12

Possible Exchange Protocols Name R Request Messages sent by Client Server Client RR Request Reply RRA Request Reply Acknowledge reply R = no response is needed and the client requires no confirmation RR = a server s reply message is regarded as an acknowledgement RRA = Server may discard entries from its history (Identified by Spector[1982]) 13

Request-reply protocols Use of TCP streams to implement requestreply protocol 14

HTTP: an example of a request-reply protocol HTTP specifies the messages involved in a request-reply exchange, the methods, arguments and results, and the rules for representing (marshalling) them in the messages Fixed set of resources are applicable to all of server s resources, e.g., GET, PUT, POST Additional functions Content negotiation: clients requests can include information as to what data presentation they can accept (e.g. language) Authentication: Credentials are used to support password-style authentication 15

Client/server interaction HTTP over TCP (original version) 1. The client requests and the server accepts a connection at the default server port or at the port specified in the URL. 2. The client sends a request message to the server. 3. The server sends a reply message to the client. 4. The connection is closed. 16

Client/server interaction HTTP 1.1 over TCP Usage of persistent connections Connections remain open over a series of request-reply exchanges between client and server Connection may be closed by client or server any time by sending an indication to the other participant RFC 2616, (Fielding et al. 1999) 17

HTTP methods GET Requests the resource whose URL is given as its argument HEAD Request is identical to GET but does not return any data Returns all the information about the data such as time of last modification PUT Requests that the data supplied in the request is stored with the given URL as its identifier either as a modification of an existing resource or as a new resource 18

HTTP methods (cont.) POST Is used to send data to the server to be processed in some way Designed to deal with Providing a block of data to a data-handling process such as a servlet Posting a message to a mailing list or updating member details Extending a database with an append operation Additional methods: DELETE, OPTIONS, TRACE 19

Message contents HTTP request message method URL or pathname HTTP version headers message body GET //www.dcs.qmw.ac.uk/index.html HTTP/ 1.1 HTTP reply message HTTP version status code reason headers message body HTTP/1.1 200 OK resource data Status code definitions and more: http://www.w3.org/protocols/rfc2616/rfc2616-sec10.html 20

Remote invocation Remote procedure call 21

Issues that are important to understand the concept The style of programming promoted by RCP programming with interfaces The call semantics associated with RPC The key issue of transparency and how it relates to remote procedure calls 22

Programming with interfaces Modern programming languages provide a means of organizing a program as a set of modules that can communicate with one another. Communication between modules can be by means of procedure calls between modules or by direct access to the variables in another module In order to control possible interactions between modules, an interface is defined for each module which specifies the procedures and variables that can be assessed. 23

Advantages of using interfaces in distributed systems Modular programming allows programmers to be concerned only with the abstraction offered by the service interface and they need not be aware of implementation details. Extrapolating to (potentially heterogeneous) distributed systems, programmers also do not need to know the programming language or underlying platform used to implement the services. Approach provides the natural support for software evolution in that implementations can change as long as the interface (the external view) remains the same. 24

RPC call semantics Fault tolerance measures Call semantics Retransmit request message Duplicate filtering Re-execute procedure or retransmit reply No Not applicable Not applicable Maybe Yes No Re-execute procedure At-least-once Yes Yes Retransmit reply At-most-once 25

RPC call semantics (cont.) Maybe semantics RPC may be executed once or not at all, it means that faults are not tolerated Can suffer from omission and crash failures At-least-once semantics Invoker receives either a result, in which case the procedure was executed at least once, or an exception informing that no result was received Can suffer from crash failures and arbitrary failures At-most-once semantics Caller receives either a result, then the procedure was executed once, or an exception, that no results has been received 26

Implementation of RPC client process server process Request client program client stub procedure Communication module Reply server stub procedure Communication module dispatcher service procedure 27

Remote invocation Remote method invocation (RMI) 28

Commonalities of RMI and RPC Support of programming languages with interfaces Both are typically constructed on top of the request-reply protocol Offer semantics such as at-least-once and at-most-once Offer a similar level of transparency, means local and remote calls employ the same syntax but remote interfaces expose the distributed nature for example by supporting remote exceptions 29

Remote method invocation The distributed object model 30

Remote and local method invocation A remote invocation B local C invocation local E invocation local invocation D remote invocation F Remote object reference: Other objects can invoke the methods of a remote object if they have access to its remote object reference. Remote interface: Every remote object has a remote interface that specifies which of its methods can be invoked remotely. 31

A remote object and its remote interface remote object Data remote interface m1 { implementation m2 m3 of methods m4 m5 m6 32

Instantiation of remote objects C A L remote remote local C invocation invocation local E remote invocation instantiate instantiate invocation remote invocation invocation B M local N invocation D F K 33

Remote method invocation Implementation of RMI 34

Generic RMI Modules RMI software 35

The Communication Module Two cooperating communication modules carry out the request-reply protocol. Content of request and reply messages messagetype requestid remotereference Communication modules provide together a specified invocation semantics. The communication module in the server selects the dispatcher for the class of the object to be invoked, passing on the remote object s local reference. 36

The Remote Reference Module It is responsible for translating between local and remote object references and for creating remote object references. The remote reference module holds a table that records the correspondence between local object references in that process and remote object references (which are system wide). Table includes An entry for all remote objects held by the process An entry for each local proxy 37

Generic RMI Modules RMI software 38

Remote method invocation Summary 39

We have we learned? Basic communication primitives of UDP style request-reply protocols Basic message structure of the request-reply protocol Advantages of choosing TCP for request-reply protocols HTTP: an example of a request-reply protocol Issues that are important to understand the remote procedure calls HTTP methods and their properties Importance of interfaces for RPC RPC call semantics Commonalities and differences of RMI and RPC Generic RMI Modules 40

Our topics today Descriptive models for distributed system design Physical model Architectural model Architectural elements Interaction model Communicating entities Communication paradigm Roles and responsibilities Placement Interaction model Processes Objects Components Web Services Inter-process communication UDP sockets TCP sockets Indirect communication Multicast Remote invocation Architectural styles Client-server Peer-to-peer Multiple server Proxy/Cache Mobile code Failure model Architectural patterns Vertical distribution Multi-tier Thin/Fat Client Horizontal distribution Security model 41

Next class Distributed object component middleware I (Java RMI) 42

References Main resource for this lecture: George Coulouris, Jean Dollimore, Tim Kindberg: Distributed Systems: Concepts and Design. 5th edition, Addison Wesley, 2011 43