Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message...

30
Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Transcript of Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message...

Page 1: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Middleware Protocols

An adapted reference model for networked communication.

2-5

RPC, Message oriented Communication, etc.

Page 2: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Remote Procedure CallConventional Procedure Call i.e. read(fd,buf,bytes)

a) Parameter passing in a local procedure call: the stack before the call to readb) The stack while the called procedure is active

Page 3: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Client and Server StubsPrinciple of RPC between a client and server program.

Page 4: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Remote Procedure Call (1)

Steps in making a remote procedure call– the stubs are shaded gray

Page 5: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Steps of a Remote Procedure Call (RPC)

• 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

Page 6: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Remote Procedure Call (2)

Implementation Issues• Cannot pass pointers

– call by reference becomes copy-restore (but might fail)

• Weakly typed languages– client stub cannot determine size

• Not always possible to determine parameter types• Cannot use global variables

Page 7: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

RPC protocol definition

• Define message format

• Define data representation

• Define transport service type (i.e. TCP)

Page 8: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Asynchronous RPC (1)useful when there is no result to return

a) The interconnection between client and server in a traditional RPCb) The interaction using asynchronous RPC

2-12

Page 9: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Asynchronous RPC (2)

A client and server interacting through two asynchronous RPCs (deferred synchronous RPC)

2-13

Page 10: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Message oriented communicationMessage oriented communication

RPCs, i.e., enhance access transparency but they are RPCs, i.e., enhance access transparency but they are not always appropriate to distributed system.not always appropriate to distributed system.

Persistence and SynchronicityPersistence and SynchronicityDifferent types of communicationsDifferent types of communications

Page 11: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Persistent communication

General organization of a communication system in which hosts are connected through a networkExample : E-mail system. If the target server is unreachable, the local one continue to store

messages ( in contrast with a transient communication method).

2-20

Page 12: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Persistence and Synchronicity in Communication

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Page 13: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Persistence and Synchronicity in Communication

c) Transient asynchronous communication (one way RPC)d) Receipt-based transient synchronous communication

2-22.2

Page 14: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Persistence and Synchronicity in Communication

e) Delivery-based transient synchronous communication at message delivery(asynchronous RPCs)

f) Response-based transient synchronous communication (RPCs)

Page 15: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

The need for persistent communication services is clear The need for persistent communication services is clear in developing middleware for large-scale distributed in developing middleware for large-scale distributed

applications. applications.

Only transient or persistent communications, like only Only transient or persistent communications, like only synchronous or asynchronous communications, are not synchronous or asynchronous communications, are not

sufficient!sufficient!

Message passing communicationMessage passing communication

Page 16: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Message oriented transient communicationsBerkeley Sockets

Socket primitives for TCP/IP.

Primitive Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket

ListenAnnounce willingness to accept connections

AcceptBlock 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

With new high performance multicomputer systems standard With new high performance multicomputer systems standard socket primitives are insufficient.socket primitives are insufficient.

Primitives have to be at a good level of abstraction and suitable for newPrimitives have to be at a good level of abstraction and suitable for newhigh speed interconnection protocolshigh speed interconnection protocols

Page 17: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

The Message-Passing 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_irecv Check if there is an incoming message, but do not block

MPI MPI usesuses the underlying network and it assumes communication take place within a the underlying network and it assumes communication take place within a known group of processesknown group of processes

MPI supports all the previous transient communication diagrams except for (d)MPI supports all the previous transient communication diagrams except for (d)

Page 18: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Message oriented persistent communications Message-Queuing Model

basic idea: applications communicate by inserting messages in specific queues

Four combinations for loosely-coupled communications using queues.

2-26

Page 19: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Message-Queuing Model

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

Primitive Meaning

Put Append a message to a specified queue

GetBlock until the specified queue is nonempty, and remove the first message

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

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

Page 20: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

General Architecture of a Message-Queuing System (1)

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

The collection of queues is distributed across multiple machines queue names dbThe collection of queues is distributed across multiple machines queue names db

Page 21: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

General Architecture of a Message-Queuing System (2)

A message-queuing system with routers (or relays) can solve the problem of a static large scale system queue-to-location mapping

2-29

Page 22: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Message Brokersit converts incoming messages to a format compatible with the destination application

The general organization of a message broker in a message-queuing system.

It is generally not considered an integral part of the queuing system.

2-30

Page 23: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Data Stream (1)Sometime timing is crucial for communication…

asynchronous, synchronous and isochronous mode for data stream

Setting up a stream between two processes across a network.

Page 24: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Data Stream (2)

Setting up a stream directly between two devices.

2-35.2

Page 25: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Data Stream (3)

An example of multicasting a stream to several receivers.

Page 26: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Specifying QoS (1)Time dependent requirements are expressed as QoS

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 27: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Specifying QoS (2)

The principle of a token bucket algorithmA token is a fixed number of bytes that an application can pass to the network.

Tokens are buffered in buckets

Page 28: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Setting Up a StreamResources required for streaming: bandwidth, buffers, processing capacity

The basic organization of RSVP for resource reservation in a distributed system.Receiver-initiated protocol

Resource reSerVation Protocol

Page 29: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Synchronization Mechanisms (1)

The principle of explicit synchronization on the level data units. The application is responsible for synchro.

Page 30: Middleware Protocols An adapted reference model for networked communication. 2-5 RPC, Message oriented Communication, etc.

Synchronization Mechanisms (2)

The principle of synchronization as supported by high-level interfaces.

2-41