Ch04 Communication
Ch04 Communication
Observation
Middleware is invented to provide common services and protocols that can be Application protocol
used by many different applications Application
Note
Network
What remains are truly application-specific protocols... such as?
Server Time
Drawbacks synchronous communication
Client cannot do any other work while waiting for reply
Failures have to be handled immediately: the client is waiting
At request submission The model may simply not be appropriate (mail, news)
At request delivery
After request processing
7 / 26 8 / 26
Communication: Foundations Types of Communication Communication: Remote procedure call Basic RPC operation
Observations
Application developers are familiar with simple procedure model
Message-oriented middleware Well-engineered procedures operate in isolation (black box)
There is no fundamental reason not to execute procedures on separate
Aims at high-level persistent asynchronous communication: machine
Processes send each other messages, which are queued Wait for result
Sender need not wait for immediate reply, but can do other things Client
9 / 26 10 / 26
Communication: Remote procedure call Basic RPC operation Communication: Remote procedure call Parameter passing
Some assumptions
Copy in/copy out semantics: while procedure is executed, nothing can be Essence
assumed about parameter values. Try to get rid of the strict request-reply behavior, but let the client continue
All data that is to be operated on is passed by parameters. Excludes without waiting for an answer from the server.
passing references to (global) data.
Wait for Callback to client
Client
Conclusion acceptance
Remote reference offers unified access to remote data Server Call local procedure Time
Remote references can be passed as parameter in RPCs
Note: stubs can sometimes be used as such references
13 / 26 Asynchronous RPC 14 / 26
Communication: Remote procedure call Variations on RPC Communication: Remote procedure call Example: DCE RPC
Uuidgen
Essence Interface
definition file
Sending an RPC request to a group of servers.
IDL compiler
#include #include
Callbacks to client
C compiler C compiler C compiler C compiler
Client
Runtime Runtime
Linker Linker
library library
Server Call local procedure Time
Client Server
binary binary
Communication: Remote procedure call Example: DCE RPC Communication: Message-oriented communication Simple transient messaging with sockets
Making sockets easier to work with MPI: When lots of flexibility is needed
Sockets deemed insufficient
Observation
They were at wrong level of abstraction by supporting only simple send
Sockets are rather low level and programming mistakes are easily made.
and receive operations
However, the way that they are used is often the same (such as in a
client-server setting). They were not considered suitable for the proprietary protocols developed
for high-speed interconnection networks
Alternative: ZeroMQ
Message-Passing Interface (MPI)
Provides a higher level of expression by pairing sockets: one for sending
messages at process P and a corresponding one at process Q for receiving a standard for message passing that is hardware and platform
messages. All communication is asynchronous. independent
is designed for parallel applications and as such is tailored to transient
Three patterns communication
Request-reply
makes direct use of the underlying network
Publish-subscribe
Pipeline assumes that serious failures such as process crashes or network
partitions are fatal and do not require automatic recovery
Using messaging patterns: ZeroMQ 19 / 26 The Message-Passing Interface (MPI) 20 / 26
Communication: Message-oriented communication Message-oriented persistent communication Communication: Message-oriented communication Message-oriented persistent communication
Communication: Message-oriented communication Message-oriented persistent communication Communication: Message-oriented communication Message-oriented persistent communication
Observation
Source Message broker Destination
Message queuing systems assume a common messaging protocol: all
applications agree on message format (i.e., structure and data representation) Application Application
Multicasting as Broadcasting
Construct an overlay network per multicast group.
Essence Performance
Organize nodes of a distributed system into an overlay network and use that A node belonging to several groups, will, in principle, need to maintain a
network to disseminate data: separate list of its neighbors for each group of which it is a member.
Oftentimes a tree, leading to unique paths
Alternatively, also mesh networks, requiring a form of routing Essence
P simply sends a message m to each of its neighbors. Each neighbor will
forward that message, except to P, and only if it had not seen m before.
Performance
The more edges, the more expensive!
25 / 26 26 / 26