Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not...

18
Distributed Computing Systems CSCI 6900/4900

Transcript of Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not...

Page 1: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Distributed Computing Systems

CSCI 6900/4900

Page 2: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message-Oriented Communication

• RPCs and RMIs are not always appropriate– Both assume that receiver is executing when a request

is issued– Inherently synchronous

• Buffer-based network model– Hosts are connected to communication servers– Message buffers at end hosts and communication

servers– Example: Email system

Page 3: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Buffer-based Network Model

General organization of a communication system in which hosts are connected through a network

2-20

Page 4: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Types of Communication

• Persistence – Persistent communication – Stores message until

communicated to user– Transient communication – Stored only when sending

and receiving processes are alive• Transport level protocols provide transient communication

• Synchronicity– Asynchronous – Sender continues after sending message– Synchronous – Sender blocks until message is stored at

receiver's local buffer, delivered to receiver or processed by receiver

Page 5: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Example of Persistent Asynchronous Comm.

Persistent communication of letters back in the days of the Pony Express.

Page 6: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Persistence and Synchronicity in Communication (3)

a) Persistent asynchronous communicationb) Persistent synchronous communication

2-22.1

Page 7: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Persistence and Synchronicity in Communication (4)

c) Transient asynchronous communicationd) Receipt-based transient synchronous communication

2-22.2

Page 8: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Persistence and Synchronicity in Communication (5)

e) Delivery-based transient synchronous communication at message deliveryf) Response-based transient synchronous communication

Page 9: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Which Communication Is Needed?

Appropriateness depends upon the semantics of the application

Underlying system should support all types

Page 10: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message Oriented Transient Communication -Berkeley Sockets

Socket primitives for TCP/IP.

Primitive Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket

ListenAnnounce willingness to accept connections

AcceptBlock 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

• Interface for transport layer• A communications end point

Page 11: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Berkeley Sockets (2)

Connection-oriented communication pattern using sockets.

Page 12: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message Oriented Persistent Comm.

• Message Queuing Systems or Message-Oriented Middleware (MoM)

• Incorporates support for persistent asynchronous communication

• Offers intermediate-term storage capacity– Neither sender or receiver need to be active for the entire

communication duration

Page 13: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message Queuing Model

• Applications communicate through messages stored in queues

• Each application has its own (local) queue

• Guarantees that the message will be inserted in recipient’s queue– No guarantee about time or whether receiver reads the

message

• Supports loosely coupled communication

Page 14: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message-Queuing Model (1)

Four combinations for loosely-coupled communications using queues.

2-26

Page 15: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message-Queuing Model (2)

Basic interface to a queue in a message-queuing system.

Primitive Meaning

Put Append a message to a specified queue

GetBlock until the specified queue is nonempty, and remove the first message

PollCheck a specified queue for messages, and remove the first. Never block.

NotifyInstall a handler to be called when a message is put into the specified queue.

Page 16: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

General Architecture of a Message-Queuing System (1)

• Source Queue/Destination Queue• Each queue has a unique name• Queuing system maps queue names to network address• Queue managers and relays

Page 17: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

General Architecture of a Message-Queuing System (2)

The general organization of a message-queuing system with routers.

2-29

Page 18: Distributed Computing Systems CSCI 6900/4900. Message-Oriented Communication RPCs and RMIs are not always appropriate –Both assume that receiver is executing.

Message Brokers• Message brokers convert messages to a format required by

destination application

2-30