Desarrollo de Aplicaciones en Red. El modelo de comunicación. General concepts. Models of communication. Message Passing

Similar documents
Process Concept: views of a process Process Scheduling CSCI 6730/ 4730 Operating Systems

Chapter 3: Processes: Outline. Operating Systems. Remote Procedure Calls (RPC) Client-Server Remote Machine Communication Mechanisms

CHAPTER - 4 REMOTE COMMUNICATION

Chapter 4 Communication

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

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

System Models and Communication

Communication. Distributed Systems Santa Clara University 2016

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Lecture 12 RPC RPC RPC. Writing an RPC Program. Sun RPC RPC. February 9+11, 2005

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

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

Chapter 3: Client-Server Paradigm and Middleware

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

Remote Procedure Calls CS 707

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

Lecture 5: Object Interaction: RMI and RPC

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Distributed Systems 8. Remote Procedure Calls

RMI: Design & Implementation

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS.

Distributed Information Processing

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

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

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

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

Inter-process Communication: RPC

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

UNIT 4 CORBA 4/2/2013 Middleware 59

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

RPC Programming. Some knowledge of C & Unix A network with at least two connected machines.

Lecture 15: Network File Systems

RPC and RMI. 2501ICT Nathan

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

RPC Paradigm. Lenuta Alboaie Andrei Panu

CSE 660 Lab 2 Khoi Pham Thanh Ho April 27 th, 2015

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

Remote Procedure Calls (RPC)

Lecture 06: Distributed Object

Remote Procedure Call

DS 2009: middleware. David Evans

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

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 22: Remote Procedure Call (RPC)

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

Chapter 4 Communication

CHAPTER 2. Introduction to Middleware Technologies

Verteilte Systeme (Distributed Systems)

Communication. Outline

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

Last Class: RPCs. Today:

RPC. Remote Procedure Calls. Robert Grimm New York University

SAI/ST course Distributed Systems

CS551 Object Oriented Middleware (I) Outline. Computer Networks. Computer Networks. Types of Middleware TCP UDP

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

416 Distributed Systems. RPC Day 2 Jan 12, 2018

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017

CSci Introduction to Distributed Systems. Communication: RPC

Chapter 4 Communication

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

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

CS153: Communication. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Today: Distributed Objects. Distributed Objects

DISTRIBUTED COMPUTER SYSTEMS

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

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

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK

Communication. Overview

Chapter 5 Distributed Objects and Remote Invocation

Communication. Distributed Systems IT332

Distributed Objects. Object-Oriented Application Development

Part Two - Process Management. Chapter 3: Processes

CSC 634: Networks Programming

CS 417 9/18/17. Paul Krzyzanowski 1. Socket-based communication. Distributed Systems 03. Remote Procedure Calls. Sample SMTP Interaction

Remote Procedure Call Implementations

EECS 482 Introduction to Operating Systems

Chapter 4: Processes

CSE 358 Spring 2006 Selected Notes Set 8

Remote Invocation Vladimir Vlassov and Johan Montelius

Distributed Systems Principles and Paradigms

Module 3 - Distributed Objects & Remote Invocation

6 Remote Procedure Call (RPC)

Remote Procedure Call (RPC) and Transparency

Remote Procedure Calls, TLI, STREAMS

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

Diagram of Process State Process Control Block (PCB)

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

Interprocess Communication

PROFESSOR: DR.JALILI BY: MAHDI ESHAGHI

Processes. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & Apps 1

Chapter 5: Distributed objects and remote invocation

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

Overview. Distributed Systems. Distributed Software Architecture Using Middleware. Components of a system are not always held on the same host

Distributed Systems Middleware

Lecture 8: February 19

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

Distributed Environments. CORBA, JavaRMI and DCOM

Web Services Architecture and Programming

REMOTE PROCEDURE CALLS EE324

Anatomy of a network. Chapter 3: Network and Communication. Transmission links. Representing data: bits and bytes. Representing data: Frames

Outlook. Process Concept Process Scheduling Operations on Processes. IPC Examples

Transcription:

Desarrollo de Aplicaciones en Red El modelo de comunicación José Rafael Rojano Cáceres http://www.uv.mx/rrojano 1 2 General concepts As we saw in a Distributed System the logical and physical component are separated, so on, we need to communicate it in some way. Up to now we have talk about: Message Passing Client/Server RPC Models of communication Message Passing Client/Server Peer to Peer Mom (Message oriented Middleware) RPC Distributed Objects RMI Corba DCOM Mobil Agents 3 4 Message Passing Each model define the way in which components interact each other The pattern of communication The functional role 5 It defines some primitives like send, receive, etc. An layer abstraction for them are sockets. Their functionalities includes communication: Synchronous prs1 prs2 Asynchronous mss Queues mss mss 6 1

Client / Server In this model there are processing of information in both client and server The role for serve includes offering different services The communication can be: Synchronous request Queue Can you give some examples? Peer to Peer In this model both process can be seen as server or client The role is designed interactively The communication as well as client / server can be: Synchronous Queue answer 7 8 MOM (Message Oriented Middleware) This model implements a message service The message are persistent The communication is: Asynchronous Queue The communication can be set as: Point to point Multicast Message Service MOM (2) It facilitates communication between distributed applications MOM is mainly oriented to asynchronous communications, while p2p or RPC are synchronous Sender Receiver 9 10 Middleware There is not a set of standardize functionalities for it, because middleware change fast, but in general we can identify: Presentation services: forms manager, printing manager, hypermedia linker Communication services: P2P, RPC, Message Passing Control services: transaction manager, scheduler Information services: directory, relation database manager, repository manager MOM falls in communication services category RPC (1) The remote procedure call defined a communication: Synchronous Queue Process of communication The client process package the parameters in a message and send to server waiting the answer The server unpack parameters, execute locally the call, get the result, again pack it and send it back 11 12 2

RPC (2) RPC (3) Application code Start call End call stub pack unpack Runtime RPC send receive Application code execute call stub pack unpack Runtime RPC send receive A stub is generated through RPC software Stub task at the Client are: Localize the server Package and unpackage parameters Send message and wait for the answer Stub task at the server is: Similar task that client Stubs are independent of implementation only depends of the interface 13 14 How RPC look like? An example with RPC Cliente.c cliintf.c Common files files Suma_xdr.c Suma.h Servidor.c serintf.c rpcgen 15 Suma.x 16 Suma.x struct peticion { int a; int b; ; program SUMAR { version SUMAVER { int SUMA(peticion) = 1; = 1; = 99; Servidor.c #include "suma.h" int *suma_1_svc(peticion *argp, struct svc_req *rqstp) { Cliente.c #include "suma.h" main( int argc, char* argv[] ) { CLIENT *clnt; int *res; peticion suma_1_arg; char *host; if(argc < 2) { printf("usage: %s server_host\n", static int result; Suma.h result = argp->a + argp->b; host = argv[1]; #ifndef _SUMA_H_RPCGEN return(&result); /* find server*/ #define _SUMA_H_RPCGEN clnt = clnt_create(host, SUMAR, #include <rpc/rpc.h> SUMAVER, "udp"); struct peticion { if (clnt == NULL) { int a; clnt_pcreateerror(host); int b; exit(1); ; suma_1_arg.a = 5; #define SUMAVER ((u_long)99) suma_1_arg.b = 2; #define SUMA ((u_long)1) res = suma_1(&suma_1_arg, clnt); extern int * suma_1(peticion *, CLIENT *); if (res == NULL) { extern int * suma_1_svc(peticion *, struct clnt_perror(clnt, "call failed:"); svc_req *); #endif /*!_SUMA_H_RPCGEN */ 17 printf( The result is %d\n", *res); clnt_destroy( clnt ); 18 argv[0]); exit(1); 3

Distributed Objects Mobile Agents JAVA RMI Remote Method Invocation Process A Method a Process B Method x CORBA Common Object Request Broker Object requestor ORB Object A mobile agent is a program in execution (with code a data) It achieve some work like data recollection a returning data later A mobile agent can be used to install or maintain software Object 19 20 Abstraction Level Object space ORB, Mobil Agents, Network service RPC, RMI Client / Server, MOM Message Passing High Low Object Space Object spaces form the basic of distributed objects by supplying the location. In Small talk there are two types of Object Space: Export sets: maintain lists of object exported by space, not effective for remote reference Full object space: support full reference Remote references are proxies which identify particular object in particular object spaces (location) and explain how to get a message to the object In small talk symbolic references allow object spaces to implement primitive naming service. 21 22 Naming (denominación) Denominación y servicio de nombres This is the name that receive the process of association between logical objects and physical objects. For example: naming files for user is different to management files by the OS (tracks and sectors) In a distributed system it s necessary naming the machine also 23 24 4

Naming structure Translating names Limited flat Netbios How can be naming structure hierarchal DNS unlimited 25 A process in charge to translate names is the binder. The process of translation is know as binding. The binder as the task of: Resolution: translate name for id Inclusion: adding new names Erasing: deleting old names Modification: alter existing names The binder must provide fail-over When accessing an object must be established capabilities (rights). What operation can be done 26 In a static address Recompile all clients and servers Where the binder is? There are several options It s known by the OS If the binder changes its location?? Update environment variable It s seek by broadcast Send a new broadcast 27 Characteristic in a binder It s desirable that the binder has: Transparent location (static) The name does not reveal location Independent location (dynamic) The name of the object does not change when it s relocated An static address and knows possition for the OS, are static Broadcasting is dynamic 28 RPC (1) Remote Procedure Call In detail Recalling communication takes place at the lower levels through message passing. The protocol used is RR (request/response) RPC is a mechanism to implement the transparency in the systems. The RPC is not more that just a remote operation customized by the mask of a procedural interface. RPC has its origin with Birrell & Nelson, 1984 as mechanism to solve the passing data 29 30 5

RPC (2) Recall the mechanism to do the call is based in a stub. For the client the stub: Take the parameters from local stack Do all the pass seen at page 12 At the server Take the parameters from message and put in local stack But the process is not as simple as I show it the last slides.. Task for RPC Service Interface It s on charge to marshalling the of parameters It s written in conventional language Seek of server As we saw this process is know as binding Management communication The task is transmit and receive 31 32 Service Interface It s very important for the whole service local call 1. Flat 2. XDR send Client return Internal representation receive Server Service rutine Flat XDR send Dispatcher Internal representation receive Passing of parameters Flatting data mean transform a data structure in a collection of bytes. It is not a easy task because of internal data codification (ascii, ebcdic, ) Data representation (Big a Little Endian) For this it s necessary an independent representation XDR (external data representation) proposed by Sun, Xerox, ASN.1 33 34 Stub generation With the interface defined can be implemented the stub. Notice that implementation in client and server can be different because these can be written in different language. For that it s necessary to define the interface in a language IDL (Interface Definition Language) The IDL in general provides semantic that languages doesn t offer Having this definition it can be generated automatically the stub for server and for client 35 Client & Server Stubs User User program Application Remote Procedure server server executable C compiler Generic IDL interface Interface language c User User program Object Object server server program Object Object Linker Interface generator C compiler Client s stub stub Server s stub stub + dispatcher stub stub Object Object 36 6

Service defined in XDR Example RPC SUN RPC compiler (rpcgen) Stub client Header.h Stub server Marshaling process Remeber the binder is local to each client 37 38 The interface //Definition in XDR, for service call Archiver CONST MAX=1000; typedef int ID_File; typedef int Ptr_File; typedef int Length; struct Data_s { Length length_data; char buffer[max]; int error; struct Writting_Args { ID_File file; Ptr_File position; Data_s data; struct Reading_Args { ID_File file; Ptr_File position; Length leng_data; program Archiver{ version VER{ void write_data(writearg)=1; Data_s read_data(readarg)=2; =2; =9999; Policies (1=w, 2=r, 9999=save XDR Contains the definition of the operations The ID Number of service With the XDR is generated Client s Stub Main server program + dispatcher Serialization routines header 39 Stub client XDR primitives: Integer, Real, Boolean, Char, String, Abstract data types, Enumeration, Arrays, pointers, etc rpcgen Routines for serializarion Serialization library.h Marshaling Header.h Sun uses XDR to represent any data structure to pass as parameter XDR support some primitives data type But also can be defined new data structures for the user Stub server + dispatcher 40 Binding for RPC RPC does not has a binding service in stead there is binder for machine (portmapper) The binder is a server listening in an static port The client must specify address, the stub seek the server through the local binder To be continued 41 42 7

Reference http://www2.sims.berkeley.edu/courses/is206/f97/gr oupb/mom/ 43 8