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

Similar documents
Remote Invocation Vladimir Vlassov and Johan Montelius

Lecture 5: Object Interaction: RMI and RPC

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

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

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

RMI: Design & Implementation

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

Structured communication (Remote invocation)

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

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

REST Web Services Objektumorientált szoftvertervezés Object-oriented software design

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

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

Distributed Systems. Client-Server Communication: Exercises

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

CSCI-1680 RPC and Data Representation. Rodrigo Fonseca

Lecture 06: Distributed Object

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

A short introduction to Web Services

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

CHAPTER - 4 REMOTE COMMUNICATION

REST Easy with Infrared360

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

CSCI-1680 RPC and Data Representation. Rodrigo Fonseca

Introduction to Web Services & SOA

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

Distributed Systems. 5. Remote Method Invocation

CSCI-1680 RPC and Data Representation John Jannotti

416 Distributed Systems. RPC Day 2 Jan 12, 2018

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

RESTful Web service composition with BPEL for REST

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy

DS 2009: middleware. David Evans

INFOH-511 WEB SERVICES. LECTURE 1: Introduction

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

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

Remote Procedure Calls

Introduction to Web Services & SOA

HTTP Reading: Section and COS 461: Computer Networks Spring 2013

COMMUNICATION IN DISTRIBUTED SYSTEMS

3. Remote Procedure Call

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

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

MODELS OF DISTRIBUTED SYSTEMS

Slides for Chapter 5: Remote Invocation

416 Distributed Systems. RPC Day 2 Jan 11, 2017

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

CS631 - Advanced Programming in the UNIX Environment

CS 43: Computer Networks. Layering & HTTP September 7, 2018

Applications & Application-Layer Protocols: The Web & HTTP

ECE697AA Lecture 2. Today s lecture

REMOTE PROCEDURE CALLS EE324

Interprocess Communication

MODELS OF DISTRIBUTED SYSTEMS

CSci Introduction to Distributed Systems. Communication: RPC

Communication Paradigms

Web Services Architecture and Programming

Chapter 5: Distributed objects and remote invocation

Lecture 15: Frameworks for Application-layer Communications

Lecture 15: Frameworks for Application-layer Communications

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

Distributed Information Systems

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

HTTP and Web Content Delivery

Communication. Distributed Systems Santa Clara University 2016

1.264 Lecture 16. Legacy Middleware

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

DATA COMMUNICATOIN NETWORKING

Dr. Robert N. M. Watson

Last Class: RPCs. Today:

High performance and scalable architectures

Distributed Systems Middleware

Application Layer Introduction; HTTP; FTP

XML Web Service? A programmable component Provides a particular function for an application Can be published, located, and invoked across the Web

Today: Distributed Objects. Distributed Objects

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Trusteq Oy

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

World Wide Web, etc.

Kaazing Gateway: An Open Source

Chapter 2 Application Layer

HTTP TRAFFIC CONSISTS OF REQUESTS AND RESPONSES. All HTTP traffic can be

CS603: Distributed Systems

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

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

02 - Distributed Systems

Network concepts introduction & wireshark. workshop

02 - Distributed Systems

DISTRIBUTED COMPUTER SYSTEMS

REALIZATION CONCEPT Version: 1.02

RPC and RMI. 2501ICT Nathan

Chapter 5 Distributed Objects and Remote Invocation

Rudy: a small web server. Johan Montelius. October 2, 2016

Lecture Notes course Software Development of Web Services

Network concepts introduction & wireshark

CSE 124 Distributed programming and Remote Procedure Calls (RPC) February 23, 2016, UCSD Prof. George Porter

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

Chapter 4 Communication

02267: Software Development of Web Services

02267: Software Development of Web Services

Transcription:

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

Middleware Application layer Remote invocation / indirect communication Socket layer Network layer 2

Request / Reply find server encode send message receive reply client server receive message decode handle send reply identify and locate the server encode/decode the message send reply to the right client attach reply to request 3

Lost request find server encode send message client server What do we do if request is lost? 4

Resend request find server encode send message resend request client server need to detect that message is potentially lost wait for a timeout (how long) or error from underlying layer resend the request simple, problem solved 5

Lost reply find server encode send message client server receive message decode handle send reply client will wait for timeout and re-send request not a problem 6

Problem find server encode send message resend request receive reply client server receive message decode handle send reply receive message a problem server might need a history of all previous request might need 7

Idempotent operations add 100 euros to my account what is the status of my account Sweden scored yet another goal! The standing is now 2-1! 8

History If operations are not idempotent, the server must make sure that the same request is not executed twice. Keep a history of all request and the replies. If a request is resent the same reply can be sent without re-execution. For how long do you keep the history? 9

Request-Reply-Acknowledge client server client server Request-Reply (RR) Request-Reply-Acknowledge (RRA) 10

At-most-once or At-least-once How about this: If an operation succeeds, then.. at-most-once: the request has been executed once. Implemented using a history or simply not re-sending requests. at-least-once: the request has been executed at least once. No need for a history, simply resend requests until a reply is received. 11

At most or At least How about errors: Even if we do resend messages we will have to give up at some time. If an operation fails/is lost, then.. at-most-once: at-least-once: 12

At most or At least Pros and cons: at-most-once without re-sending requests: simple to implement, not fault-tolerant at-most-once with history: expensive to implement, fault-tolerant at-least-once: simple to implement, fault-tolerant Can you live with at-least-once semantics? 13

UDP or TCP Should we implement a request-reply protocol over UDP or TCP? 14

Synchronous or Asynchronous Asynchronous Synchronous 15

RR over Asynchronous send request continue to execute suspend if not arrived read reply 16

Hide the latency 17

HTTP A request reply protocol, described in RFC 2616. Request = Request-Line *(header CRLF) CRLF [ message-body ] Request-Line = Method SP Request-URI SP HTTP-Version CRLF GET /index.html HTTP/1.1\r\n foo 42 \r\n\r\nhello 18

HTTP methods GET: request a resource, should be idempotent HEAD: request only header information POST: upload information to a resource, included in body, status of server could change PUT: add or replace a resource, idempotent DELETE: add or replace content, idempotent 19

Wireshark 20

GET / HTTP/1.1 Host: www.kth.se HTTP GET User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept.Encoding: gzip, deflate Cookie:... Connection: keep-alive 21

HTTP Response HTTP/1.1 200 OK Date: Tue, 08 Sep 2015 10:37:49 GMT Server: Apache/2.2.15 (Red Hat) X-UA-Compatible: IE=edge Set-Cookie: JSESSIONID=CDC76A3;Path=/; Secure; HttpOnly Content-Language: sv-se Content-Length: 59507 Connection: close Content-Type: text/html;charset=utf-8 <!DOCTYPE html> <html lang="sv"> <title>kth Valkommen till KTH</title> 22

The web On the web the resource is often a HTML document that is presented in a browser. HTTP could be used as a general-purpose request-reply protocol. 23

REST and SOAP Request-reply protocols for Web-services: REST (Representational State Transfer) content described in XML, JSON,... light weight, SOAP (Simple Object Access Protocol) over HTTP, SMTP... content described in SOAP/XML standardized, heavy weight 24

HTTP over TCP HTTP over TCP - a good idea? 25

Masking a request-reply Could we use a regular program construct to hide the fact that we do a request-reply? 26

Masking a request-reply Could we use a regular program construct to hide the fact that we do a request-reply? RPC: Remote Procedure Call RMI: Remote Method Invocation 27

Procedure calls What is a procedure call: find the procedure give the procedure access to arguments pass control to the procedure collect the reply if any continue execution How do we turn this into a tool for distributed programming? 28

Operational semantics int x, n; n = 5; proc(n); x = n; int x, arr[3]; arr[0] = 5; proc(arr); x = arr[0]; 29

Call by value/reference Call by value A procedure is given a copy of the datum Call by reference A procedure is given a reference to the datum What if the datum is a reference and we pass a copy of the datum? Why is this important? 30

RPC: Remote Procedure Call.. inc();.. Client Server void inc() { g = g+1; } g: 13 31

RPC: Remote Procedure Call.. inc(x);.. Client 3 Server void inc(i) { g = g+i; } x: 3 g: 13 32

RPC: Remote Procedure Call.. inc(a);.. Client? Server void inc(int[] h) { g = g+h[2]; h[2] = g; } a: {1,2,3,4} g: 13 33

Open Network Computing (ONC) RPC (SunRPC) targeting intranet, file servers etc at-least-once call semantics procedures described in Interface Definition Language (IDL) XDR (external Data Representation) specifies message structure used UDP as transport protocol (TCP also available) 34

Java RMI (Remote Method Invocation) similar to RPC but: we now invoke methods of remote objects at-most-once semantics Objects can be passed as arguments, how should this be done? by value by reference 35

Java RMI We can do either: A remote object is passed as a reference (by reference) i.e. it remains as at the original place where it was created. A serializable object is passed as a copy (by value) i.e. the object is duplicated. 36

Finding the procedure/object How do we locate a remote procedure/object/process? Network address that specifies the location or.. a known binder process that keeps track of registered resources. 37

Remote invocation design decisions failure handling: maybe / at-most-once / at-least-once call-by-value / call-by-reference message specification and encoding specification of resource procedure binder 38

Examples SunRPC: call-by-value, at-least-once, IDL, XDR, binder JavaRMI: call-by-value/reference, at-most-once, interface, JRMP (Java Remote Method Protocol), rmiregistry Erlang: message passing, maybe, no, ETF (External Term Format), local registry only CORBA (Common Object Request Broker Architecture): call-by-reference, IDL, ORB (Object Request Broker), tnameserv Web Services: WSDL (Web Services Description Language), UDDI (Universal Description, Discovery, and Integration) 39

Summary Implementations of remote invocations: procedures, methods, messages to processes, have fundamental problems that needs to be solved. Try to see similarities between different implementations. When they differ, is it fundamentally different or just implementation details. 40