Middleware Protocols 2 5 RPC Message oriented Communication

  • Slides: 30
Download presentation
Middleware Protocols 2 -5 RPC, Message oriented Communication, etc. An adapted reference model for

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

Remote Procedure Call Conventional Procedure Call i. e. read(fd, buf, bytes) a) Parameter passing

Remote Procedure Call Conventional Procedure Call i. e. read(fd, buf, bytes) a) Parameter passing in a local procedure call: the stack before the call to read b) The stack while the called procedure is active

Client and Server Stubs Principle of RPC between a client and server program.

Client and Server Stubs Principle of RPC between a client and server program.

Remote Procedure Call (1) Steps in making a remote procedure call – the stubs

Remote Procedure Call (1) Steps in making a remote procedure call – the stubs are shaded gray

Steps of a Remote Procedure Call (RPC) • • • Client procedure calls client

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

Remote Procedure Call (2) Implementation Issues • Cannot pass pointers – call by reference

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

RPC protocol definition • Define message format • Define data representation • Define transport

RPC protocol definition • Define message format • Define data representation • Define transport service type (i. e. TCP)

Asynchronous RPC (1) useful when there is no result to return 2 -12 a)

Asynchronous RPC (1) useful when there is no result to return 2 -12 a) The interconnection between client and server in a traditional RPC b) The interaction using asynchronous RPC

Asynchronous RPC (2) 2 -13 A client and server interacting through two asynchronous RPCs

Asynchronous RPC (2) 2 -13 A client and server interacting through two asynchronous RPCs (deferred synchronous RPC)

Message oriented communication RPCs, i. e. , enhance access transparency but they are not

Message oriented communication RPCs, i. e. , enhance access transparency but they are not always appropriate to distributed system. Persistence and Synchronicity Different types of communications

Persistent communication 2 -20 General organization of a communication system in which hosts are

Persistent communication 2 -20 General organization of a communication system in which hosts are connected through a network Example : E-mail system. If the target server is unreachable, the local one continue to store messages ( in contrast with a transient communication method).

Persistence and Synchronicity in Communication 2 -22. 1 a) b) Persistent asynchronous communication Persistent

Persistence and Synchronicity in Communication 2 -22. 1 a) b) Persistent asynchronous communication Persistent synchronous communication

Persistence and Synchronicity in Communication 2 -22. 2 c) d) Transient asynchronous communication (one

Persistence and Synchronicity in Communication 2 -22. 2 c) d) Transient asynchronous communication (one way RPC) Receipt-based transient synchronous communication

Persistence and Synchronicity in Communication e) f) Delivery-based transient synchronous communication at message delivery(asynchronous

Persistence and Synchronicity in Communication e) f) Delivery-based transient synchronous communication at message delivery(asynchronous RPCs) Response-based transient synchronous communication (RPCs)

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

The need for persistent communication services is clear in developing middleware for large-scale distributed applications. Only transient or persistent communications, like only synchronous or asynchronous communications, are not sufficient! Message passing communication

Message oriented transient communications Berkeley Sockets Primitive Meaning Socket Create a new communication endpoint

Message oriented transient communications Berkeley Sockets 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 some data over the connection Receive some data over the connection Close Release the connection Socket primitives for TCP/IP. With new high performance multicomputer systems standard socket primitives are insufficient. Primitives have to be at a good level of abstraction and suitable for new high speed interconnection protocols

The Message-Passing Interface (MPI) Primitive Meaning MPI_bsend Append outgoing message to a local send

The Message-Passing Interface (MPI) Primitive Meaning MPI_bsend Append outgoing message to a local send buffer MPI_send Send 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_issend Pass 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 Some of the most intuitive message-passing primitives of MPI uses the underlying network and it assumes communication take place within a known group of processes MPI supports all the previous transient communication diagrams except for (d)

Message oriented persistent communications Message-Queuing Model basic idea: applications communicate by inserting messages in

Message oriented persistent communications Message-Queuing Model basic idea: applications communicate by inserting messages in specific queues 2 -26 Four combinations for loosely-coupled communications using queues.

Message-Queuing Model Primitive Meaning Put Append a message to a specified queue Get Block

Message-Queuing Model 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. Basic interface to a queue in a message-queuing system.

General Architecture of a Message-Queuing System (1) The collection of queues is distributed across

General Architecture of a Message-Queuing System (1) The collection of queues is distributed across multiple machines queue names db The relationship between queue-level addressing and network-level addressing.

General Architecture of a Message-Queuing System (2) 2 -29 A message-queuing system with routers

General Architecture of a Message-Queuing System (2) 2 -29 A message-queuing system with routers (or relays) can solve the problem of a static large scale system queue-to-location mapping

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

Message Brokers it converts incoming messages to a format compatible with the destination application 2 -30 The general organization of a message broker in a message-queuing system. It is generally not considered an integral part of the queuing system.

Data Stream (1) Sometime timing is crucial for communication… asynchronous, synchronous and isochronous mode

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.

Data Stream (2) 2 -35. 2 Setting up a stream directly between two devices.

Data Stream (2) 2 -35. 2 Setting up a stream directly between two devices.

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

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

Specifying Qo. S (1) Time dependent requirements are expressed as Qo. S Characteristics of

Specifying Qo. S (1) Time dependent requirements are expressed as Qo. S Characteristics of the Input • maximum data unit size (bytes) • Token bucket rate (bytes/sec) • Toke bucket size (bytes) • Maximum transmission rate (bytes/sec) Service Required • Loss sensitivity (bytes) • Loss interval ( sec) • Burst loss sensitivity (data units) • Minimum delay noticed ( sec) • Maximum delay variation ( sec) • Quality of guarantee A flow specification.

Specifying Qo. S (2) The principle of a token bucket algorithm A token is

Specifying Qo. S (2) The principle of a token bucket algorithm A token is a fixed number of bytes that an application can pass to the network. Tokens are buffered in buckets

Setting Up a Stream Resources required for streaming: bandwidth, buffers, processing capacity Resource re.

Setting Up a Stream Resources required for streaming: bandwidth, buffers, processing capacity Resource re. Ser. Vation Protocol The basic organization of RSVP for resource reservation in a distributed system. Receiver-initiated protocol

Synchronization Mechanisms (1) The principle of explicit synchronization on the level data units. The

Synchronization Mechanisms (1) The principle of explicit synchronization on the level data units. The application is responsible for synchro.

Synchronization Mechanisms (2) 2 -41 The principle of synchronization as supported by high-level interfaces.

Synchronization Mechanisms (2) 2 -41 The principle of synchronization as supported by high-level interfaces.