630 likes | 775 Views
Communication. Chapter 2. IPC. Inter-Process Communication is the heart of all DSs. Processes on different machines. Always based on low-level message passing. In this chapter: RPC RMI MOM (Message Oriented MiddleWare) Streams (due to the advent of Multimedia DSs). Layered Protocols (1).
E N D
Communication Chapter 2 OS2-Sem 831, Rasool Jalili
IPC • Inter-Process Communication is the heart of all DSs. • Processes on different machines. • Always based on low-level message passing. • In this chapter: • RPC • RMI • MOM (Message Oriented MiddleWare) • Streams (due to the advent of Multimedia DSs) OS2-Sem 831, Rasool Jalili
Layered Protocols (1) • Layers, interfaces, and protocols in the OSI model. 2-1 OS2-Sem 831, Rasool Jalili
Layered Protocols • Protocol • Connection Oriented • Connectionless • Protocol Stack • Description of the layers, Unit of exchange. OS2-Sem 831, Rasool Jalili
Layered Protocols (2) • A typical message as it appears on the network. 2-2 OS2-Sem 831, Rasool Jalili
Data Link Layer • Discussion between a receiver and a sender in the data link layer. 2-3 OS2-Sem 831, Rasool Jalili
Transport Protocols • Makes the underlying layers usable by the application layer. • Provide a reliable or unreliable connection for the upper layer. • UDP :: TCP • RTP for real-time systems. OS2-Sem 831, Rasool Jalili
Client-Server TCP • Normal operation of TCP. • Transactional TCP. OS2-Sem 831, Rasool Jalili
Middleware Protocols • An adapted reference model for networked communication. 2-5 OS2-Sem 831, Rasool Jalili
RPC • PC? • R…………….PC? • Simple idea • Complexity in provision OS2-Sem 831, Rasool Jalili
Conventional Procedure Call • Parameter passing in a local procedure call: the stack before the call to read Count = read (fd, buf, nbytes); • The stack while the called procedure is active OS2-Sem 831, Rasool Jalili
Issues • Calling Method? • Call by value • Call by reference • Call by Copy/Restore • Call by name OS2-Sem 831, Rasool Jalili
Client and Server Stubs • Principle of RPC between a client and server program. • The read stub is called on behalf of the real read procedure! OS2-Sem 831, Rasool Jalili
Steps of a Remote Procedure Call • 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 OS2-Sem 831, Rasool Jalili
Passing Value Parameters (1) • Steps involved in doing remote computation through RPC • It works fine, while the scenario is simple and straightforward; but …. 2-8 OS2-Sem 831, Rasool Jalili
Passing Value Parameters (2) • Different character set standards (ASCII vs EBCDIC) • Little-Endian vs Big-Endian Architecture. • Original message on the Pentium (L. E.) • The message after receipt on the SPARC (B. E.) • The message after being inverted. The little numbers in boxes indicate the address of each byte OS2-Sem 831, Rasool Jalili
Parameter Specification and Stub Generation • Both sides should agree on the content of passing data structures. • Example in the next slide. • The way a message including the parameters is interpreted is the main issue!! • Client and server should agree on the representation of simple data structures. • Agreement on the actual exchange of the messages (connection-oriented or connection-less) OS2-Sem 831, Rasool Jalili
Parameter Specification and Stub Generation • A procedure • The corresponding message. • Interface Definition Language compiling into client stub and server stub OS2-Sem 831, Rasool Jalili
Extended RPC Models • RPC becoming as de facto standard for comm. In DSs. • Popularity due to simplicity. • Two extensions • Doors • Async RPC. OS2-Sem 831, Rasool Jalili
Doors • Equivalent to RPC for processes located on the same machine. • A door is a name for a procedure in the address space of a server process, called by colocated processes with the server. • Idea was originally from the Spirit OS (1994) • Same as LightWeight RPC. • The server process must register a door before use (calling door-create) OS2-Sem 831, Rasool Jalili
Doors • The principle of using doors as IPC mechanism. OS2-Sem 831, Rasool Jalili
Asynchronous RPC (1) • The interconnection between client and server in a traditional RPC • The interaction using asynchronous RPC 2-12 OS2-Sem 831, Rasool Jalili
Asynchronous RPC (2) • A client and server interacting through two asynchronous RPCs 2-13 OS2-Sem 831, Rasool Jalili
Writing a Client and a Server • The steps in writing a client and a server in DCE RPC. 2-14 OS2-Sem 831, Rasool Jalili
Binding a Client to a Server • Client-to-server binding in DCE. 2-15 OS2-Sem 831, Rasool Jalili
Performing an RPC • The whole scenario! • Semantics • At-most-once operation • Idempotency OS2-Sem 831, Rasool Jalili
Remote Object Invocation • OO technology in centralized systems. • Promoting the idea if RPC to the OO technology. • Proxy as the server delegate == Client stub. • Skeleton == server stub • The object state is normally not distributed remote object instead of distributed object OS2-Sem 831, Rasool Jalili
Distributed Objects • Common organization of a remote object with client-side proxy. 2-16 OS2-Sem 831, Rasool Jalili
Binding a Client to an Object • (a) Example with implicit binding using only global references • (b) Example with explicit binding using global and local references Distr_object* obj_ref; //Declare a systemwide object referenceobj_ref = …; // Initialize the reference to a distributed objectobj_ref-> do_something(); // Implicitly bind and invoke a method (a) Distr_object objPref; //Declare a systemwide object referenceLocal_object* obj_ptr; //Declare a pointer to local objectsobj_ref = …; //Initialize the reference to a distributed objectobj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local proxyobj_ptr -> do_something(); //Invoke a method on the local proxy (b) OS2-Sem 831, Rasool Jalili
Object References • Endpoint and registration • Failure and object migration need to invalidate all bindings by clients. • Location Server • Static RMI and invocation :: Interfaces of an object is known to the client before compilation. • Dynamic invocation. OS2-Sem 831, Rasool Jalili
Parameter Passing • The situation when passing an object by reference or by value. 2-18 OS2-Sem 831, Rasool Jalili
The DCE Distributed-Object Model • Distributed dynamic objects in DCE. • Distributed named objects OS2-Sem 831, Rasool Jalili
Message-Oriented Communication • Sometimes both RPC and RMI is not appropriate • Synchronous nature of RPC and RMI! • Messaging. OS2-Sem 831, Rasool Jalili
Persistence and Synchronicity in Communication (1) • General organization of a communication system in which hosts are connected through a network 2-20 OS2-Sem 831, Rasool Jalili
Persistence and Synchronicity in Communication (2) • Persistent communication of letters back in the days of the Pony Express. OS2-Sem 831, Rasool Jalili
Persistence and Synchronicity in Communication (3) • Persistent asynchronous communication • Persistent synchronous communication 2-22.1 OS2-Sem 831, Rasool Jalili
Persistence and Synchronicity in Communication (4) • Transient asynchronous communication • Receipt-based transient synchronous communication 2-22.2 OS2-Sem 831, Rasool Jalili
Persistence and Synchronicity in Communication (5) • Delivery-based transient synchronous communication at message delivery • Response-based transient synchronous communication OS2-Sem 831, Rasool Jalili
Berkeley Sockets (1) • Socket primitives for TCP/IP. OS2-Sem 831, Rasool Jalili
Berkeley Sockets (2) • Connection-oriented communication pattern using sockets. OS2-Sem 831, Rasool Jalili
The Message-Passing Interface (MPI) • Some of the most intuitive message-passing primitives of MPI. OS2-Sem 831, Rasool Jalili
Message-Queuing Model (1) • Four combinations for loosely-coupled communications using queues. 2-26 OS2-Sem 831, Rasool Jalili
Message-Queuing Model (2) • Basic interface to a queue in a message-queuing system. OS2-Sem 831, Rasool Jalili
General Architecture of a Message-Queuing System (1) • Messages are put in local queues and got from local queues. • The relationship between queue-level addressing and network-level addressing. OS2-Sem 831, Rasool Jalili
General Architecture of a Message-Queuing System (2) • The general organization of a message-queuing system with routers. 2-29 OS2-Sem 831, Rasool Jalili
Message Brokers • The general organization of a message broker in a message-queuing system. • The broker acts as an application level gateway to convert the format of incoming msgs to be understood by the destination applications, eg. records • E-mail as a known messaging system OS2-Sem 831, Rasool Jalili
Example • General organization of IBM's MQSeries message-queuing system. • Used to access and manipulate large scale databases: finance • Queues are managed by queue managers; Each queue manager is responsible for removing msgs from its send queue and forward to other queue managers. • A queue manager (QM) is responsible to pick up incoming msgs from the underlying net and store in the appropriate input Q. • QMs are connected (pairwise) through msg channels. • A msg channel is a reliable uni-directional transport-level connection between a sending and a receiving QM. • Each end os a msg channel is managed by a MCA (msg chnl Agnt) OS2-Sem 831, Rasool Jalili
Example: IBM MQSeries-2 2-31 OS2-Sem 831, Rasool Jalili
Channels • Some attributes associated with message channel agents. OS2-Sem 831, Rasool Jalili
Message Transfer (1) • The general organization of an MQSeries queuing network using routing tables and aliases. OS2-Sem 831, Rasool Jalili