300 likes | 428 Views
Middleware Protocols. RPC, Message oriented Communication, etc. 2-5. An adapted reference model for networked communication. Remote Procedure Call Conventional Procedure Call i.e . read(fd,buf,bytes). a) Parameter passing in a local procedure call: the stack before the call to read
E N D
Middleware Protocols RPC, Message oriented Communication, etc. 2-5 • An adapted reference model for networked communication.
Remote Procedure CallConventional Procedure Call i.e. read(fd,buf,bytes) • a) Parameter passing in a local procedure call: the stack before the call to read • b) The stack while the called procedure is active
Client and Server Stubs • Principle of RPC between a client and server program.
Remote Procedure Call (1) • Steps in making a remote procedure call • the stubs are shaded gray
Steps of a Remote Procedure Call (RPC) • Client procedure calls client stub in normal way • Client stub builds message, calls local OS • Client's OS sends message to remote OS • Remote OS gives message to server stub • Server stub unpacks parameters, calls server • Server does work, returns result to the stub • Server stub packs it in message, calls local OS • Server's OS sends message to client's OS • Client's OS gives message to client stub • Stub unpacks result, returns to client
Remote Procedure Call (2) • Implementation Issues • Cannot pass pointers • call by reference becomes copy-restore (but might fail) • Weakly typed languages • client stub cannot determine size • Not always possible to determine parameter types • Cannot use global variables
RPC protocol definition • Define message format • Define data representation • Define transport service type (i.e. TCP)
Asynchronous RPC (1)useful when there is no result to return 2-12 • a) The interconnection between client and server in a traditional RPC • b) The interaction using asynchronous RPC
Asynchronous RPC (2) 2-13 • A client and server interacting through two asynchronous RPCs (deferred synchronous RPC)
Message oriented communication RPCs, i.e., enhance access transparency but they are not always appropriate to distributed system. Persistence and Synchronicity Different types of communications
Persistent communication 2-20 • General organization of a communication system in which hosts are connected through a network • Example : E-mail system. If the target server is unreachable, the local one continue to store messages ( in contrast with a transient communication method).
Persistence and Synchronicity in Communication 2-22.1 • Persistent asynchronous communication • Persistent synchronous communication
Persistence and Synchronicity in Communication 2-22.2 • Transient asynchronous communication (one way RPC) • Receipt-based transient synchronous communication
Persistence and Synchronicity in Communication • Delivery-based transient synchronous communication at message delivery(asynchronous RPCs) • Response-based transient synchronous communication (RPCs)
The need for persistent communication services is clear in developing middleware for large-scale distributed applications. Only transient or persistent communications, like only synchronous or asynchronous communications, are not sufficient! Message passing communication
Message oriented transient communicationsBerkeley Sockets With new high performance multicomputer systems standard socket primitives are insufficient. Primitives have to be at a good level of abstraction and suitable for new high speed interconnection protocols • Socket primitives for TCP/IP.
The Message-Passing Interface (MPI) MPI uses the underlying network and it assumes communication take place within a known group of processes MPI supports all the previous transient communication diagrams except for (d) • Some of the most intuitive message-passing primitives of MPI.
Message oriented persistent communicationsMessage-Queuing Model basic idea: applications communicate by inserting messages in specific queues 2-26 • Four combinations for loosely-coupled communications using queues.
Message-Queuing Model • Basic interface to a queue in a message-queuing system.
General Architecture of a Message-Queuing System (1) The collection of queues is distributed across multiple machines queue names db • The relationship between queue-level addressing and network-level addressing.
General Architecture of a Message-Queuing System (2) 2-29 • A message-queuing system with routers (or relays) can solve the problem of a static large scale system queue-to-location mapping
Message Brokersit converts incoming messages to a format compatible with the destination application 2-30 • The general organization of a message broker in a message-queuing system. • It is generally not considered an integral part of the queuing system.
Data Stream (1)Sometime timing is crucial for communication…asynchronous, synchronous and isochronous mode for data stream • Setting up a stream between two processes across a network.
Data Stream (2) 2-35.2 • Setting up a stream directly between two devices.
Data Stream (3) • An example of multicasting a stream to several receivers.
Specifying QoS (1)Time dependent requirements are expressed as QoS • A flow specification.
Specifying QoS (2) • The principle of a token bucket algorithm • A token is a fixed number of bytes that an application can pass to the network. • Tokens are buffered in buckets
Setting Up a StreamResources required for streaming: bandwidth, buffers, processing capacity Resource reSerVation Protocol • The basic organization of RSVP for resource reservation in a distributed system. • Receiver-initiated protocol
Synchronization Mechanisms (1) • The principle of explicit synchronization on the level data units. The application is responsible for synchro.
Synchronization Mechanisms (2) 2-41 • The principle of synchronization as supported by high-level interfaces.