36
Univ. of Tehran Distributed Operating Systems 1 Advanced Advanced Operating Systems Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 9: Communication Communication in in distributed Systems distributed Systems

Advanced Operating Systems

  • Upload
    dore

  • View
    52

  • Download
    6

Embed Size (px)

DESCRIPTION

Advanced Operating Systems. Lecture 9: Communication in distributed Systems. University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani. Communication in Distributed systems. Goal: To study different form of communication among process in DS. References - PowerPoint PPT Presentation

Citation preview

Page 1: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 1

Advanced Advanced

Operating SystemsOperating Systems

University of TehranDept. of EE and Computer Engineering

By:Dr. Nasser Yazdani

Lecture 9: Communication in Communication in distributed Systemsdistributed Systems

Page 2: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 2

Communication in Distributed Communication in Distributed systemssystems

Goal: To study different form of communication among process in DS.

References Chapter 2 of the text book

Page 3: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 3

OutlineOutline Introduction Type of communications

Remote Object/Method Invocation (RMI) Message passing Stream base communication

Quality of Service in communication in DS.

Page 4: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 4

Communication ModelsCommunication Models Communication of processes in

distributed system environment. Communication is being done on the

higher levels. Remote procedure call (RPC) Remote Object Invocation. Message passing queues Support for continuous media or stream

Page 5: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 5

Distributed ObjectsDistributed Objects Common organization of a remote object with

client-side proxy.

2-16

Page 6: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 6

Binding a Client to an Binding a Client to an ObjectObject

a) An example with implicit binding using only global referencesb) An example with explicit binding using global and local references

Distr_object* obj_ref; //Declare a systemwide object referenceobj_ref = …; // Initialize the reference to a distributed objectobj_ref-> do_something(); // Implicitly bind and invoke a method

(a)

Distr_object objPref; //Declare a systemwide object referenceLocal_object* obj_ptr; //Declare a pointer to local objectsobj_ref = …; //Initialize the reference to a distributed objectobj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local proxyobj_ptr -> do_something(); //Invoke a method on the local proxy

(b)

Page 7: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 7

Remote Method Remote Method Invocation (RMI)Invocation (RMI)

• To have a Location server for binding to keep track of the machine where an object’s server is currently running.

•Static RMI: specify interface in an IDL or like JAVA to handle stub, proxy, generation

•Dynamic invocation: At runtime

Page 8: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 8

Parameter PassingParameter Passing The situation when passing an object by

reference or by value.

2-18

Page 9: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 9

DCE Distributed-Object DCE Distributed-Object ModelModel

a) Distributed dynamic objects in DCE.b) Distributed named objects

2-19

Page 10: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 10

Java RMIJava RMI Distributed objects have been integrated into

the language Aim: high degree of transparency, but not

always, in case inefficiency or implementation.

Object cloning: local or remote? In remote cloning, proxies are not cloned.

Objects are constructed as monitors: distributed synchronization is complex. Solution: block at the server

Page 11: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 11

Message Passing Message Passing Basic communication primitives:

Send message.

Receive message.

Modes of communication: Synchronous versus asynchronous.

Semantics: Reliable versus unreliable.

...Send

Sending Q

...

Receiving Q

Receive

Page 12: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 12

Persistence and Synchronicity in Persistence and Synchronicity in Communication (1)Communication (1)

General organization of a communication system in which hosts are connected through a network

2-20

Page 13: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 13

Persistence and Synchronicity in Persistence and Synchronicity in Communication (2)Communication (2)

Persistent communication of letters back in the days of the Pony Express.

The message is stored in the network until delivered.

Page 14: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 14

Persistence and Synchronicity in Persistence and Synchronicity in Communication (3)Communication (3)

a) Persistent asynchronous communication

b) Persistent synchronous communication

2-22.1

Page 15: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 15

Persistence and Synchronicity in Persistence and Synchronicity in Communication (4)Communication (4)

c) Transient asynchronous communicationd) Receipt-based transient synchronous communication

2-22.2

Page 16: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 16

Persistence and Synchronicity in Persistence and Synchronicity in Communication (5)Communication (5)

e) Delivery-based transient synchronous communication at message delivery

f) Response-based transient synchronous communication

Page 17: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 17

Berkeley Sockets (1)Berkeley Sockets (1) Socket primitives for TCP/IP.

Primitive

Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket

Listen Announce willingness to accept connections

Accept Block caller until a connection request arrives

Connect Actively attempt to establish a connection

Send Send some data over the connection

Receive Receive some data over the connection

Close Release the connection

Page 18: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 18

Berkeley Sockets (2)Berkeley Sockets (2)

Connection-oriented communication pattern using sockets.

Page 19: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 19

The Message-Passing The Message-Passing Interface (MPI)Interface (MPI)

Some of the most intuitive message-passing primitives of MPI.

Primitive Meaning

MPI_bsend Append outgoing message to a local send buffer

MPI_sendSend a message and wait until copied to local or remote buffer

MPI_ssend Send a message and wait until receipt starts

MPI_sendrecv Send a message and wait for reply

MPI_isend Pass reference to outgoing message, and continue

MPI_issendPass reference to outgoing message, and wait until receipt starts

MPI_recv Receive a message; block if there are none

MPI_irecvCheck if there is an incoming message, but do not block

Page 20: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 20

Message-Queuing Message-Queuing Model (1)Model (1)

Four combinations for loosely-coupled communications using queues.

2-26

Page 21: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 21

Message-Queuing Message-Queuing Model (2)Model (2)

Basic interface to a queue in a message-queuing system.

Primitive

Meaning

Put Append a message to a specified queue

Get Block until the specified queue is nonempty, and remove the first message

Poll Check a specified queue for messages, and remove the first. Never block.

Notify Install a handler to be called when a message is put into the specified queue.

Page 22: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 22

General Architecture of a Message-General Architecture of a Message-Queuing System (1)Queuing System (1)

The relationship between queue-level addressing and network-level addressing.

Page 23: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 23

General Architecture of a Message-General Architecture of a Message-Queuing System (2)Queuing System (2)

The general organization of a message-queuing system with routers.

2-29

Page 24: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 24

Message BrokersMessage Brokers An application level gateway in a message-

queuing system to convert message format.

2-30

Page 25: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 25

Example: IBM MQSeriesExample: IBM MQSeries MCA- Message Channel Agent.

2-31

Page 26: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 26

ChannelsChannels Message channel is associated with exactly one

send queue. Transfer along channel is possible if two end

point agents are up and running.

Attribute

Description

Transport type

Determines the transport protocol to be used

FIFO delivery Indicates that messages are to be delivered in the order they are sent

Message length

Maximum length of a single message

Setup retry count

Specifies maximum number of retries to start up the remote MCA

Delivery retries

Maximum times MCA will try to put received message into queue

Page 27: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 27

Message Transfer (1)Message Transfer (1) The general organization of an MQSeries

queuing network using routing tables and aliases.

Page 28: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 28

Message Transfer (2)Message Transfer (2)

Primitives available in an IBM MQSeries MQI

Primitive Description

MQopen Open a (possibly remote) queue

MQclose Close a queue

MQput Put a message into an opened queue

MQget Get a message from a (local) queue

Page 29: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 29

Data Stream (1)Data Stream (1) Setting up a stream between two processes

across a network.

Page 30: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 30

Data Stream (2)Data Stream (2) Setting up a stream directly between two

devices.

2-35.2

Page 31: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 31

Data Stream (3)Data Stream (3) An example of multicasting a stream to several

receivers.

Page 32: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 32

Specifying QoS (1)Specifying QoS (1)

A flow specification.

Characteristics of the Input

Service Required

maximum data unit size (bytes)Token bucket rate (bytes/sec)Toke bucket size (bytes)Maximum transmission rate (bytes/sec)

Loss sensitivity (bytes)Loss interval (sec)Burst loss sensitivity (data units)Minimum delay noticed (sec)Maximum delay variation (sec)Quality of guarantee

Page 33: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 33

Specifying QoS (2)Specifying QoS (2)

The principle of a token bucket algorithm.

Page 34: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 34

Setting Up a StreamSetting Up a Stream The basic organization of RSVP for

resource reservation in a distributed system.

Page 35: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 35

Synchronization Synchronization Mechanisms (1)Mechanisms (1)

An interface to control streams and devices. .

Page 36: Advanced  Operating Systems

Univ. of TehranDistributed Operating

Systems 36

Synchronization Synchronization Mechanisms (2)Mechanisms (2)

Higher level synchronization

2-41