Title: Communication
1Communication
Part II Message-Oriented Communication
2Giving credit where credit is due
CSCE455/855 Distributed Operating Systems
- Most of the lecture notes are based on slides by
Prof. Jalal Y. Kawash at Univ. of Calgary - I have modified them and added new slides
3RPC and Message Passing
- RPC enhances access transparency by hiding
communication - RPC is inherently synchronous and is not always
appropriate - What if the receiving side is not executing when
the request is sent? - Sometimes, we need to resort to message-passing
4Persistence and Synchronicity in Communication (1)
2-20
- General organization of a communication system in
which hosts are connected through a network
5Persistence and Synchronicity in Communication (2)
- Persistent communication of letters back in the
days of the Pony Express.
6Persistence in Communication
- Persistence A (sent) message is stored by the
communication system until it is delivered. - Transient A (sent) message is stored by the
communication system as long as both the sender
and receiver applications are executing
7Synchrony in Communication
- Asynchronous The sender does not block until the
message is delivered, blocks until stored in a
buffer at the sending host, or the first
communication server - Synchronous The sender blocks until the message
is stored in a buffer at the receiving host, or
delivered to the receiver
8Persistent Asynchronous Communication
2-22.1
9Persistent Synchronous Communication
2-22.1
10Transient Asynchronous Communication
2-22.2
11Transient Synchronous Communication (1)
2-22.2
12Transient Synchronous Communication (2)
- Delivery-based transient synchronous
communication at message delivery - Response-based transient synchronous communication
13Message-Oriented Transient Communication
- Berkley (UNIX) Sockets
- An abstraction of the actual communication
endpoints - Message Passing Interface (MPI)
- a standard for message passing
- Makes applications platform independent
- Short-term storage for messages
- Milliseconds to seconds transfer time
14Berkeley Sockets (1)
Java
- Socket primitives for
TCP/IP.
15Berkeley Sockets (2)
ServerSocket()
Socket()
- Connection-oriented communication pattern using
sockets.
16MPI (1)
- Processes are grouped (non-disjoint groups)
- A process is identified by (groupID, processID)
- Used instead of a transport-level address
- Offers communication primitives for all kinds
forms of communication
17MPI (2)
- Some of the most intuitive message-passing
primitives of MPI.
18Message-Oriented Persistent Communication
- Message Queuing systems
- Offers intermediate-term storage capacity for
messages - Without requiring any of the sender or receiver
to be active during transmission - Intermediate-term minutes of transfer time
19Message-Queuing Model (1)
- Applications communicate by inserting messages
into queues - Each application has a private queue
- Other applications send message to that queue
- The private queue can be read only by the
associated application - Applications can share a queue
- A queue has a system-wide name (address)
20Message-Queuing Model (2)
- A messages travels through communication servers
to get to its destination - It is popular to have direct connections between
each pair of communication servers - Persistence a message will eventually be
inserted into the recipients queue
21Loosely-Coupled Communication
- Receiver not necessarily executing when the
message is added to its queue - Sender not necessarily executing when message
is picked up by the receiver
Sender
Receiver
4 execution modes while transmitting messages
22Execution Modes
2-26
- Four combinations for loosely-coupled
communications using queues.
23Queuing System Interface
- Basic interface to a queue in a message-queuing
system.
24General Architecture of a Message-Queuing System
(1)
A
B
- Nearby the sender
- Messages can be put to this queue only
25General Architecture of a Message-Queuing System
(2)
- The collection of queues is distributed across
multiple machines - The system must maintain a (possibly distributed)
database of queues (queuing tables)
Queuing table entry
26General Architecture of a Message-Queuing System
(3)
- The relationship between queue-level addressing
and network-level addressing.
27General Architecture of a Message-Queuing System
(4)
- Queues are managed by queue managers
- A queue manager interacts directly with the
sending/receiving application - Some (special) queue managers act like routers or
relays
28General Architecture of a Message-Queuing System
(5)
2-29
- Routing is static
- Medium-level scalability (manually configure the
routing tables)
29Integrating Differing Message-Based Systems
A-specific message format
B-specific message format
30Message Brokers
2-30
- The general organization of a message broker in a
message-queuing system.
31In-Class Exercises
1. C has a construction called a union, in which
a field of a record (called a struct in C) can
hold any one of several alternatives. At run
time, there is no sure-fire way to tell which one
is in there. Does this feature of C have any
implications for remote procedure call? Explain
your answer. 2. One way to handle parameter
conversion in RPC systems is to have each machine
send parameters in its native representation,
with the other one doing the translation, if need
be. The native system could be indicated by a
code in the first byte. However, since locating
the first byte in the first word is precisely the
problem, can this actually work?
32In-Class Exercises
3. With persistent communication, a receiver
generally has its own local buffer where messages
can be stored when the receiver is not executing.
To create such a buffer, we may need to specify
its size. Give an argument why this is
preferable, as well as one against specification
of the size. 4. Explain why transient
synchronous communication has inherent
scalability problems.