15
Communication

Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Embed Size (px)

Citation preview

Page 1: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Communication

Page 2: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Asynchronous RPC (1)

a) The interconnection between client and server in a traditional RPCb) The interaction using asynchronous RPC

2-12

Page 3: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Asynchronous RPC (2)

A client and server interacting through two asynchronous RPCs

2-13

Page 4: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 5: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 6: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Berkeley Sockets

Connection-oriented communication pattern using sockets.

Page 7: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Message-Passing Interface

• Multi-computers need low-overhead communication primitives

• Sockets are not suitable• Send/Receive primitives are too simple • Not optimized for proprietary protocols

• Provides transient asynchronous communication

• Local and remote buffers

• Identification by (groupID, processID)

Page 8: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

MPI Primitives

Page 9: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 10: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 11: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

Message-Queuing Model (1)

Four combinations for loosely-coupled communications using queues.

2-26

Page 12: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 13: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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 14: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

General Architecture of a Message-Queuing System (2)

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

2-29

Page 15: Communication. Asynchronous RPC (1) a)The interconnection between client and server in a traditional RPC b)The interaction using asynchronous RPC 2-12

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

destination application

2-30