Communication: Distributed Systems Principles and Paradigms
Communication: Distributed Systems Principles and Paradigms
Chapter 4
Communication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Layered Protocols (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Middleware Protocols
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Synchronous vs. Asynchronous
Various combinations of persistence and synchronization occur in
practice. Popular ones are persistence in combination with
synchronization at request submission, which is a common scheme for
many message-queuing systems, which we discuss later in this chapter.
Likewise, transient communication with synchronization after the request
has been fully processed is also widely used.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Discrete vs. Streaming
We should also make a distinction between discrete and streaming
communication. The examples so far all fall in the category of discrete
communication: the parties communicate by messages, each message
forming a complete unit of information. In contrast, streaming involves
sending multiple messages, one after the other, where the messages are
related to each other by the order they are sent, or because there is a
temporal relationship. Remote Procedure Call can be considered as this
type of communication.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Conventional Procedure Call
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Remote Procedure Calls (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Passing Value Parameters (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Passing Value Parameters (3)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Passing Value Parameters (4)
Figure 4-8. (c) The message after being inverted. The little
numbers in boxes indicate the address of each byte.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Parameter Specification
and Stub Generation
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Asynchronous RPC (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Asynchronous RPC (3)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Binding a Client to a Server (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Binding a Client to a Server (2)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Berkeley Sockets
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
The Message-Passing Interface
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message-Oriented Persistent Communication
message-oriented middle ware services, generally known as message-
queuing systems, or just Message-Oriented Middleware (MOM).
Message-queuing systems provide extensive support for persistent
asynchronous communication.
The essence of these systems is that they offer intermediate-term storage
capacity for messages, without requiring either the sender or receiver to
be active during message transmission. An important difference with
Berkeley sockets and MPI is that message-queuing systems are typically
targeted to support message transfers that are allowed to take minutes
instead of seconds or milliseconds.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message Queue Models
Message-oriented middle ware services, generally known as message-
queuing systems, or just Message-Oriented Middleware (MOM).
Message-queuing systems provide extensive support for persistent
asynchronous communication.
The essence of these systems is that they offer intermediate storage
capacity for messages, without requiring either the sender or receiver to
be active during message transmission.
An important difference with Berkeley sockets and MPI is that
message-queuing systems are typically targeted to support message
transfers that are allowed to take minutes instead of seconds or
milliseconds.
A sender is generally given only the guarantees that its message will
eventually be inserted in the recipient's queue.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message-Queuing Model
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
General Architecture of a Message-Queuing System
One of the first restrictions that we make is that messages can be put
only into queues that are local to the sender, that is, queues on the same
machine, or no worse than on a machine nearby such as on the same
LAN that can be efficiently reached through an RPC. Such a queue is
called the source queue.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
General Architecture of a Message-Queuing System
It is important to realize that the collection of queues is distributed across
multiple machines. Consequently, for a message-queuing system to
transfer messages, it should maintain a mapping of queues to network
locations.
In practice, this means that it should maintain a (possibly distributed)
database of queue names to network locations, as shown in Fig. 4-19.
(Note that such a mapping is completely analogous to the use of the
Domain Name System (DNS) for e-mail in the Internet).
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
General Architecture of a Message-Queuing System
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
General Architecture of a Message-Queuing System
Queue-to-Location Mapping
In many message-queuing systems, there is no general naming service available
that can dynamically maintain queue-to-location mappings.
Instead, the topology of the queuing network is static, and each queue manager
needs a copy of the queue-to-location mapping. It is needless to say that in
large-scale queuing systems this approach can easily lead to network-
management problems.
One solution is to use a few routers that know about the network topology.
When a sender A puts a message for destination B in its local queue, that
message is first transferred to the nearest router, say Rl, as shown in Fig. 4-20.
At that point, the router knows what to do with the message and forwards it in
the direction of B. For example, Rl may derive from B's name that the message
should be forwarded to router R2. In this way, only the routers need to be
updated when queues are added or removed. while every other queue manager
has to know only where the nearest router is.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
General Architecture of a Message-Queuing System
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message Brokers
An important application area of message-queuing systems is
integrating existing and new applications into a single, coherent
distributed information system.
Integration requires that applications can understand the messages they
receive. In practice, this requires the sender to have its outgoing
messages in the same format as that of the receiver.
The problem with this approach is that each time an application is added
to the system that requires a separate message format, each potential
receiver will have to be adjusted in order to produce that format.
An alternative is to agree on a common message format, as is done with
traditional network protocols. Unfortunately, this approach will generally
not work for message-queuing systems.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message Brokers
general approach is to learn to live with different formats, and try
to provide the means to make conversions as simple as possible.
In message-queuing systems, conversions are handled by special
nodes in a queuing network, known as message brokers. A
message broker acts as an application-level gateway in a
message-queuing system. Its main purpose is to convert incoming
messages so that they can be understood by the destination
application. Note that to a message-queuing system, a message
broker is just another application as shown in Fig. 4-21.
In other words, a message broker is generally not considered to
be an integral part of the queuing system. A message broker can
be as simple as a reformatter for messages. For example,
assume an incoming message contains a table from a database,
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message Brokers
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
IBM’s WebSphere Message-Queuing
System
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message transfer
In most cases, routes are explicitly stored inside a queue manager in a
routing table.
An entry in a routing table is a pair (destQM, sendQ), where destQM is
the name of the destination queue manager, and sendQ is the name of the
local send queue to which a message for that queue manager should be
appended. (A routing table entry is called an alias in MQ.)
It is possible that a message needs to be transferred across multiple
queue managers before reaching its destination. Whenever such an
intermediate queue manager receives the message, it simply extracts the
name of the destination queue manager from the message header, and
does a routing-table look-up to find the local send queue to which the
message should be appended.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Message Transfer (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Enforcing QoS (1)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Enforcing QoS (2)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5
Information Dissemination Models (2)