Download presentation
Presentation is loading. Please wait.
1
Message Based Communication
TANENBAUM-Chapter 2
2
Message Oriented Communication
RPC and RMI type firmware is not always desirable or even practical. They need both senders and receivers to be invoked. In such cases messaging is the way to go! Subject of concern in communication Persistence Transient Asynchronous Synchronous
3
Persistence and Synchronicity in Communication (1)
2-20 General organization of a communication system in which hosts are connected through a network and messages are passed and queued in an asynchronous manner. Thus, persistence in comm is achieved.
4
Example: Persistence and Synchronicity in Communication (2)
Persistent communication of letters back in the days of the Pony Express.
5
Persistence and Synchronicity in Communication (3)
2-22.1 Persistent asynchronous communication Persistent synchronous communication
6
Persistence and Synchronicity in Communication (4)
2-22.2 Transient asynchronous communication Receipt-based transient synchronous communication
7
Persistence and Synchronicity in Communication (5)
Delivery-based transient synchronous communication at message delivery Response-based transient synchronous communication
8
Message Based Transient Communication: Berkely Sockets
Messaging through transport level sockets Sockets form an interface to transport layer Socket is an operating system abstraction over the end-to-end communication protocol UNIX derivative OSs are the first in providing socket interface to TCP of TCP/IP protocol suit So called, well-known port numbers together with IP numbers are used to bind to a socket…
9
Socket primitives for TCP/IP.
Berkeley Sockets (1) Primitive Meaning Socket Create a new communication endpoint Bind Attach a local address to a socket Listen Announce willingness to accept connections. By allocating enough memory 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 Socket primitives for TCP/IP.
10
Connection-oriented communication pattern using sockets.
Berkeley Sockets (2) Connection-oriented communication pattern using sockets.
11
Message-oriented Transient Communication: MPI
Message passing middleware standard MPI is developed to provide a transport layer independency or more transparency MPI provides mainly transient communication, could be synch or asynch MPI library can be tailored to high speed communication, usually provided as proprietary libraries MPI is developed for parallel application, where each group and a process with the group are assigned identifiers
12
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 Examples for some of the most intuitive message-passing primitives of MPI. There are over 100 MPI functions, used especially to improve communication efficiency
13
Message Queing Model Targeted to support non time critical persistent asynchronous transmission Each receiving application has its own private queue, to which messages are delivered, with no guarantee for when they will be processed The sender and receiver queues need to be globally identified Queues are managed by queue managers So called message brokers can be used to transfer a message into the format acceptable by the end receiver…
14
Message-Queuing Model (1)
2-26 Four combinations for loosely-coupled communications with respect to queues.
15
Message-Queuing Model (2)
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.
16
General Architecture of a Message-Queuing System (1)
Mapping queue-level names to network locations, same as in DNS . Normally queues are managed by queue managers. Static mapping is easier dynamic mapping is more complex.
17
General Architecture of a Message-Queuing System (2)
2-29 The general organization of a message-queuing system with routers, that know about network topology, where every queue manager needs to know the nearest router, malticasting can also be done.
18
Message Brokers 2-30 The general organization of a message broker in a message-queuing system, used to convert one message format to another. Message broker is an application level message converter. A database should be used to allow rule based format conversions.
19
Message Brokers (cont.)
General message queues are aimed to support persistent communication for the end user. Although systems behaves similarly they are not to guarantee message delivery, message priorities, logging facilitis, multicasting, load balancing, fault tolerance, etc.
20
Example: IBM MQSeries 2-31
General organization of IBM's MQSeries message-queuing system. a MCA-Message Channel Agent manages two ends of a message channel, This is primarily aimed at mainframe database applications Message channels between QM are implemented in TCP connection, and managed by Message Ch Agent-MCA.
21
Properties of MCA in IBM MQseries
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 Some attributes associated with message channel agents-MCA. Sending and receiving MCAs must be compatible in terms of rules of communication between them
22
Message Transfer in IBM MQSeries(1)
The general organization of an MQSeries queuing network using routing tables and aliases. A message header, in addition to the send queue address, has to have the address of the queue manager-QM and the destination queue under that QM
23
Message Transfer in MQSeries(2) Primitives available in an IBM MQSeries MQI
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 Message Queue Interface-MQI is a simple programming interface for the applications. MQSeries provides these facilities to applications when the messages have arrived
24
Stream Oriented Communication(1)
In digital transmission of video and voice the timing is important. This depend humans’ physical hearing and vision abilities… this is continuous media (CM) domain… The transmission has to be in streams rather than self contained messages. So, which facilities should a distributed system provide for such CM streams transmission: Temporal relationship between different items of CM is crucial for correct interpretation of such data
25
Stream Oriented Communication(2)
CM is supported by data streams, because of existence of temporal relationship between the data items. Temporal (time dependent) data transmission is generally provided by so called data streams. Asynchronous tr mode: no limits are defined Synch tr mode: max end-to-end delay is defined Isochronous tr mode: max and min end-to-end delay is defined Complex streams have more than one sub stream, e.g., stereo audio can have two audio streams… Streams can be multicast between one source and a number of sinks and filtered if needed…
26
Setting up a stream between two processes across a network.
Data Stream (1) Setting up a stream between two processes across a network.
27
Setting up a stream directly between two devices.
Data Stream (2) 2-35.2 Setting up a stream directly between two devices.
28
An example of multicasting a stream to several receivers.
Data Stream (3) An example of multicasting a stream to several receivers.
29
Stream Comm: Quality of service (QoS)
QoS for CM tr can be defined in terms of timeliness, volume, and reliability In addition to time requirements, in an application, using so called bucket algorithm, service requirements may include loss sensitivity of data items Minimum delay noticed by the receiver Max delay variation Quality of guarantee QoS requires allocation of resources, usually, in terms of processing capacity, bandwidth, buffers… There is no best model for specifying QoS parameters Resource reSerVation Protocol is a transports level for routers to tune to the QoS requirements, by the servers.
30
Characteristics of the Input
Specifying QoS (1) Characteristics of the Input Service Required maximum data unit size (bytes) Token bucket rate (bytes/sec) Token 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 A flow specification.
31
Specifying QoS (2): Example method
The principle of a token bucket algorithm. Irregular data stream is regulated at the bucket output.
32
Setting Up a Stream: RSVP-Resource reSerVation Protocol
The basic organization of RSVP-Resource reSerVation Protocol- for resource reservation in a distributed system, to achieve the required QoS.
33
Synchronization Example (1)
In multimedia systems this is very important, as more than one stream may come together to meet the application requirements For example Two voice streams for stereo voice applications Presentations slides with voice streams Video stream with voice stream: lip synchronization! Synchronization at the lowest level is conducted by the operating system, for example switching between video frames and voice frames, The low level communication channels must be able meet such requirements
34
Synchronization Example (2)
The principle of explicit synchronization on the level data unit: video and voice
35
Synchronization using Middleware (3)
2-41 The principle of synchronization as supported by high-level interfaces. Different streams are first converted into discrete stream packets, with synchronization information, which can then be multiplexed into one stream as in MPEG-2 standard.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.