3. Communication in distributed system 3.1 Introduction Interprocess communication is at the heart of distributed systems Distributed Application Communication.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

Chapter 4: Communication*
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Last Class: RPCs and RMI
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
EECS122 - UCB 1 CS 194: Distributed Systems Remote Object Invocation, Message- Oriented Communications (Based on textbook slides) Computer Science Division.
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
Socket Programming.
Persistent and Transient Objects Persistent objects continue to exist even if they aren’t in the address space of a server process Transient objects existence.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Chapter 2  Communication 1 Communication Chapter 2.
Outcomes What is RPC? The difference between conventional procedure call and RPC? Understand the function of client and server stubs How many steps could.
Communication in Distributed Systems –Part 2
Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
EEC-681/781 Distributed Computing Systems Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EECS122 - UCB 1 CS 194: Distributed Systems Communication Protocols, RPC Computer Science Division Department of Electrical Engineering and Computer Sciences.
An adapted reference model for networked communication.
Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12.
Messaging Passing Communication AOS Dan Huang. Why Need Message RPC and ROI hiding communication for transparency. Hiding communication is not an appropriate.
Process-to-Process Delivery:
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
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.
Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011 Kocaeli University Computer Engineering Department.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Silberschatz, Galvin, and Gagne  1999 Applied Operating System Concepts Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
 Communication Distributed Systems IT332. Outline  Fundamentals  Layered network communication protocols  Types of communication  Remote Procedure.
1 Conventional Procedure Call read(fd,buf,nbytes) a)Parameter passing in a local procedure call: the stack before the call to read b)The stack while the.
Distributed (Operating) Systems -Communication in Distributed Systems- Computer Engineering Department Distributed Systems Course Assoc. Prof. Dr. Ahmet.
Computer Engineering Department Distributed Systems Course
Remote Procedure Call RPC
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Communication Chapter 2.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
OS2-SUT– Sem ; R. Jalili Communication Chapter 2.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 2, 3: Communication 1/30/20161Distributed Systems - COMP 655.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
1 Network Communications A Brief Introduction. 2 Network Communications.
Communication Chapter 2. Layered Protocols (1) Layers, interfaces, and protocols in the OSI model. 2-1.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
OS2-Sharif University of Technology - Sem ; R. Jalili Communication Chapter 2.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Prof. Leonardo Mostarda University of Camerino
Distributed Systems CS
Last Class: RPCs and RMI
CMSC621: Advanced Operating Systems Advanced Operating Systems
Communication Chapter 2.
DISTRIBUTED COMPUTING
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Process-to-Process Delivery:
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Process-to-Process Delivery: UDP, TCP
Last Class: Communication in Distributed Systems
Presentation transcript:

3. Communication in distributed system

3.1 Introduction Interprocess communication is at the heart of distributed systems Distributed Application Communication middleware Low-level message passing underlying network IP address port,... Name,...

Middleware Protocols An adapted reference model for networked communication. 2-5 P69

Distributed Middleware Communication middleware: RPC, RMI, MPI –name DCE, CORBA –message-oriented –various communication forms Authentication, authorization protocols Distributed commit protocols

Client-Server TCP Normal operation of TCP.Transactional TCP. 2-4 P65

Two issues for communication mechanism: How indicate destination? How many methods (forms)? S T Q P

Indicate sending and receiving processes 1) ex, 2) Unique name ex, name( ) S T Q P 1. Addressing

…... Domain name IP address Type A cs.nju.edu.cn A …… …... DNS FTPd web server ftp://nju.edu.cn

3) Mailbox (queue, indirect) multi-in, multi-out 2. Methods 1) Synchronous/asynchronous sender receiver mailbox

P1 P2 send receive waiting receive waiting send Synchronous: sender will be blocked if receiver is not ready send( ), recv( ); RPC

P1 P2 send receive Internet? Asynchronous UDP, Asynchronous RPC

2) Transient/persistent Persistent communication: A message is stored by communication system as long as it takes to deliver it. Neither the sender nor the receiver need to be up. Ex, Synchronous wait, no broadcast safe, simple Asynchronous buffer full,not safe parallelism, broadcast Defects merits Comparison P100-1

Persistence in Communication P100

Transient communication: A message is stored by communication system as long as the sending and receiving applications are executing Ex, send, recv in Socket Question: difference (relation) between 1) and 2) transient synchronous persistent asynchronous As to: 1) sender/receiver; 2) message send, recv; RPC UDP; asyn RPC

Two successive messages have a temporal relationship. Ex, movie, audio stream 3) Stream-oriented communication

P1P2 Proc G(u,v) Call P2.G(x,y) node 1 node 2 ……… RPC P Worm.msBlast

1. Conventional procedure call Node 1 process Procedure Q(u,box,v) { … { … Q(i,buf,j) … … } return addr. i buf j sp stack result

2. How does RPC work? node 1 node 2 process Procedure Q(u,box,v) { … { … Q(i,buf,j) … … } } ? stack return sp return addr 2 i buf j sp result return addr.1 buf j i proc Q int i ? buf int j result

Original procedure call: Now push return addr.1 push i Q(i,buf,j) push buf push j goto Q goto c_stub take result

C_stub pack parameters & name send them to S_stub receive result unpack result return S_stub receive message unpack message push return addr. goto Q( ) take & pack result send it to C_stub Q( ) { } transform

Steps of a Remote Procedure Call Client procedure calls client stub in normal way Client stub builds message, calls local OS Client's OS sends message to remote OS Remote OS gives message to server stub Server stub unpacks parameters, calls server Server does work, returns result to the stub Server stub packs it in message, calls local OS Server's OS sends message to client's OS Client's OS gives message to client stub Stub unpacks result, returns to client P72

Passing Value Parameters Steps involved in doing remote computation through RPC 2-8 P74

Issues to be handled Machine may be not identical Execute in different spaces Machine may crash 3. Parameter passing Implementation should consider: Different types of computers Pointer or call by reference

1) Deal with different types of computers 5Jill (a) Original message on the Pentium (b) The message after receipt on the SPARC (c) The message after being inverted. The little numbers in boxes indicate the address of each byte P75

How represent parameters? –In intermediate form –Indicating in type i type i type j Message should include parameters and their type 2) Deal with call by reference proc Q int i char buf int j

Node1Node2 Main( ) { int B[100] proc write(name,buf,len) … { int len, buf[ ]; write(f1,B,100)… … } proc read(name, buf, len) { int len, buf[ ]; read(f2,B,100 ) … } B 5200

read write

proc write(in char name, in int buf[], in int len); proc read(in char name, out int buf[], in int len); –Input parameter  deliver the array –Output parameter  needn’t 4. Where stubs come from? Write server specification (interfaces) including:specification Server name, version, list of proc s Stub compiler generates c_stub & s_stubgenerates

Specification of file server Specification of file_server, version 3.1: long read(in char name[MAX_PATH], out char buf[BUF_SIZE], in long bytes, in long position); long write(in char name[MAX_PATH], in char buf[BUF_SIZE], in long bytes, in long position); int create(in char name[MAX_PATH], in int mode); int delete(in char name[MAX_PATH]); end; return IDL

5. Steps for using RPC write specification compile write server code and link with s_stub write client code and link with c_stub specification C_stub S_stub Stub compiler

The steps in writing a client and a server in DCE RPC. P82

{…… }

6. Dynamic binding --- How client find server 1) Register: name, version, handle(IP,port), unique id 2) Look up: name, version (first time) 3) Reply: handle, unique id 4) Request: unique id, parameters 5) Deregister: name, version, unique id binder clientserver

Advantage: flexible –Server move won’t affect client –Binder can even load if multiple servers support the same interface Disadvantage –Overhead at running time –Binder is bottleneck

Addressing: name Method: synchronous, transient RPC NFS XDR Socket/TLI TCP|UDP IP ARP Driver ICMP FTP Telnet Addressing Method

7. Extended RPC --- asynchronous RPC (a) The interconnection between client and server in a traditional RPC (b) The interaction using asynchronous RPC ABAB 100 P79

A client and server interacting through two asynchronous RPCs 2-13 A client wants to prefetch network addresses of a set of hosts P80

3.3 RMI (or Remote Object Invocation) Common organization of a remote object with client-side proxy. P86

1. Distributed object RMI Compares to RPC: Same: –the steps of call is similar –separating interface from implementation Difference –procedure is a segment of program. –object is a variable of a data type, method is in object.

Object reference compare to pointer. System provides 2. Object references Object references are similar to pointer, but not the same. object reference remote point local object distributed obj

… employee promote() {…} dismiss() {… } hire() {… } Corp server Sale server salesman bonus() {… } advertise cost() {… } personnel 1. IP address ? Object servers P152 personnel.hire( )

Information object reference contains network address of the machine server id or endpoint (i.e.port number) object id P89

May use location server location server clientserver Server can move

Server id instead of server’s endpoint. A daemon listens to a well-known endpoint and knows every server. 3. Implementation of object references server1 server2 keep a table daemon

4. Several remote object invocation 1) CORBA Open, heterogeneous environment 2) DCOM Microsoft world Object C ++ Java C func P( ) How introduce object? chapter 9

3) Java RMI Java environment Distributed objects have been integrated into the language Summary Addressing: name Method: synchronous, transient

3.4 Message-oriented communication 1. Message-oriented transient communication 1) RPC and RMI advantages: hide communication; message-oriented disadvantage: synchronous; both need to be up 2) Recall socket P105 addressing: IP address, port forms: synchronous/asynchronous, transient shortage: low-level, byte-oriented/TCP-IP P99

Process0 Process1 Process5 Process4 Process3 Process2 Process1 Process0 Process2 3) MPI P107 Jupiter World designed for parallel applications; offer efficient communication primitives; for high-speed nets. communicator

Addressing (groupID, processID) Forms support most transient communication forms ?A B; Need for various communication forms Synchronous/asynchronous Transient/persistent 100

Various combinations:P103 Why list so many forms? Where to use? For efficiency. (a) (c) A B (e) send recv (f) RPC 100 (persistent, asynchronous) (transient, asynchronous) (transient, synchronous) (transient, synchronous/asyn)

2. Message-oriented persistent communication 1) Message-queuing model Addressing: name of destination queue Method: persistent, asynchronous 2) Basic idea Application inserts messages in specific queue the messages are forwarded over a series of communication servers eventually the messages are delivered to destination P109

Message-Queuing System The general organization of a message-queuing system with routers P112

Four combinations for loosely-coupled communications using queues P110

3) Basic interface to a queue Install a handler to be called when a message is put into the specified queue. Notify Check a specified queue for messages, and remove the first. Never block. Poll Block until the specified queue is nonempty, and remove the first message Get Append a message to a specified queue Put Meaning Primitive callback P110

4) Implementation All machines in message-queuing system should have a queue manager which manages: queues: source queue, destination queue (name) transmission of messages from S to D mapping queues to network locations

Two kinds of implementations a) Create its own forwarding servers (routers), like multicast gateway + Mbone b) with the aid of Internet routers, like a) Architecture of IBM MQSeries For IBM mainframes, access large scale database Addressing: (destQM, destQ),

Example: IBM MQSeries General organization of IBM's MQSeries message-queuing system P116

Message Transfer The general organization of an MQSeries queuing network using routing tables and aliases. (QA,SQ1)

Why do message-queue systems send messages to queue, instead of directly to receivers? Some applications need this kind of communication form. For example, tasks are sent to a set of processes who perform these tasks. Two ways: a dispatcher + workers workers P143

3.5 Stream-oriented communication 1. Requirements Real life –audio stream (simple stream) –movie (complex stream) Features –time-dependent information. –data stream Stream media? P119

Addressing: or destination name Method: continuous data stream

Requirement for transmission: –timing for continuous data stream –synchronization for complex stream Ex, –Samples in audio stream are played at intervals of 1/44100 sec. –Video and audio sub-streams need synchronize.

Data Stream Setting up a stream between two processes across a network. P122 MP3

An example of multicasting a stream to several receivers. Differentiated services

4. Stream Synchronization Meaning Maintain temporal relation between streams which may be continuous or discrete data stream. Essence Synchronize at the level of data units. What is a data unit? a single audio stream a series of samples a video stream a series of frames

Data unit Ex1, synchronization for stereo audio stream takes place every 1/44100 sec a data unit = a sample Ex2, what about synchronization between an audio stream and a video stream? video frame30Hz audio sample44100Hz sample/frame44100/30=1470 an audio data unit = 1470 samples 1/30 sec

Synchronization mechanism A process executes read (write) operations on several simple streams, ensuring timing and synchronization. Ex, alternating between reading an image and reading a block of audio samples every 33ms sender receiver audio stream video stream

Does sender send two separate streams or a complex stream? A complex stream. Where synchronization should take place, sending or receiving side? Sender: multiplex different streams into a single stream containing all data units, including those for synchronization(timestamp) Receiver: demultiplexes the stream, using the timestamps of each packet

Synchronization Mechanisms (2) The principle of synchronization as supported by high- level interfaces Offer interface to specify the rates

Summary 1. Key issues for designing communication mechanism Addressing: how indicate sender and receiver, LAN, WAN Methods : synchronous/asynchronous persistent/transient stream-oriented communication Middleware Examples?

How does it work? Issues to be handle: type, reference (object?) IDL: is used to write server’ specification C_stub Steps for using RPC S_stub Binder 3. RMI Difference between RPC and RMI Object reference and its features 2. RPC

–address, serverID, objectID CORBA etc 4. Message-oriented communication Why need it? Transient communication: MPI Persistent communication: Message-queuing system

Requirement for transmission Features Synchronization 5. Stream-oriented communication