Message Based Communication TANENBAUMChapter 2 Message Oriented Communication

  • Slides: 35
Download presentation
Message Based Communication TANENBAUM-Chapter 2

Message Based Communication TANENBAUM-Chapter 2

Message Oriented Communication q RPC and RMI type firmware is not always desirable or

Message Oriented Communication q RPC and RMI type firmware is not always desirable or even practical Ø In such cases messaging is the way to go! q Subject of concern in communication Ø Persistence Ø Transient Ø Asynchronous Ø Synchronous

Persistence and Synchronicity in Communication (1) 2 -20 • General organization of a communication

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.

Example: Persistence and Synchronicity in Communication (2) • Persistent communication of letters back in

Example: Persistence and Synchronicity in Communication (2) • Persistent communication of letters back in the days of the Pony Express.

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

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

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

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

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

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

Message Based Transient Communication: Berkely Sockets q Messaging through transport level sockets Ø Sockets

Message Based Transient Communication: Berkely Sockets q 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…

Berkeley Sockets (1) Primitive Meaning Socket Create a new communication endpoint Bind Attach a

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 some data over the connection Receive some data over the connection Close Release the connection Socket primitives for TCP/IP.

Berkeley Sockets (2) Connection-oriented communication pattern using sockets.

Berkeley Sockets (2) Connection-oriented communication pattern using sockets.

Message-oriented Transient Communication: MPI q Message passing middleware standard Ø MPI is developed to

Message-oriented Transient Communication: MPI q 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

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 • Examples for some of the most intuitive message-passing primitives of MPI. There are over 100 MPI functions, used especially to improve communication efficiency

Message Queing Model Ø Targeted to support non time critical persistent asynchronous transmission Ø

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…

Message-Queuing Model (1) 2 -26 • Four combinations for loosely-coupled communications with respect to

Message-Queuing Model (1) 2 -26 • Four combinations for loosely-coupled communications with respect to queues.

Message-Queuing Model (2) Primitive Meaning Put Append a message to a specified queue Get

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.

General Architecture of a Message-Queuing System (1) • Mapping queue-level names to network locations,

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.

General Architecture of a Message-Queuing System (2) 2 -29 • The general organization of

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.

Message Brokers 2 -30 • The general organization of a message broker in a

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.

Message Brokers (cont. ) • General message queues are aimed to support persistent communication

Message Brokers (cont. ) • General message queues are aimed to support persistent communication for the end user. • Although e-mail systems behaves similarly they are not to guarantee message delivery, message priorities, logging facilitis, multicasting, load balancing, fault tolerance, etc.

Example: IBM MQSeries 2 -31 • General organization of IBM's MQSeries message-queuing system. a

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.

Properties of MCA in IBM MQseries Attribute Description Transport type Determines the transport protocol

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

Message Transfer in IBM MQSeries(1) • The general organization of an MQSeries queuing network

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

Message Transfer in MQSeries(2) Primitives available in an IBM MQSeries MQI Primitive Description MQopen

Message Transfer in MQSeries(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 • Message Queue Interface-MQI is a simple programming interface for the applications. • MQSeries provides these facilities to applications when the messages have arrived

Stream Oriented Communication(1) q In digital transmission of video and voice the timing is

Stream Oriented Communication(1) q 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. q So, which facilities should a distributed system provide for such CM streams transmission: q Temporal relationship between different items of CM is crucial for correct interpretation of such data

Stream Oriented Communication(2) q CM is supported by data streams, because of existence of

Stream Oriented Communication(2) q CM is supported by data streams, because of existence of temporal relationship between the data items. q 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… q Streams can be multicast between one source and a number of sinks and filtered if needed…

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

Data Stream (1) 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.

Stream Comm: Quality of service (Qo. S) q q Qo. S for CM tr

Stream Comm: Quality of service (Qo. S) q q Qo. S 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 Ø Ø q q loss sensitivity of data items Minimum delay noticed by the receiver Max delay variation Quality of guarantee Qo. S requires allocation of resources, usually, in terms of processing capacity, bandwidth, buffers… There is no best model for specifying Qo. S parameters Ø Resource re. Ser. Vation Protocol is a transports level for routers to tune to the Qo. S requirements, by the servers.

Specifying Qo. S (1) Characteristics of the Input • maximum data unit size (bytes)

Specifying Qo. S (1) Characteristics of the Input • maximum data unit size (bytes) • Token bucket rate (bytes/sec) • Token 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): Example method • The principle of a token bucket algorithm.

Specifying Qo. S (2): Example method • The principle of a token bucket algorithm. Irregular data stream is regulated at the bucket output.

Setting Up a Stream: RSVP-Resource re. Ser. Vation Protocol • The basic organization of

Setting Up a Stream: RSVP-Resource re. Ser. Vation Protocol • The basic organization of RSVP-Resource re. Ser. Vation Protocol- for resource reservation in a distributed system, to achieve the required Qo. S.

Synchronization Example (1) • In multimedia systems this is very important, as more than

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

Synchronization Example (2) • The principle of explicit synchronization on the level data unit:

Synchronization Example (2) • The principle of explicit synchronization on the level data unit: video and voice

Synchronization using Middleware (3) 2 -41 • The principle of synchronization as supported by

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.