Communication
Chapter 2
Communication Chapter 2 IPC Inter-Process Communication is the - - PowerPoint PPT Presentation
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
Communication
Chapter 2
IPC
DSs.
– RPC – RMI – MOM (Message Oriented MiddleWare) – Streams (due to the advent of Multimedia DSs)
Layered Protocols (1)
2-1
Layered Protocols
– Connection Oriented – Connectionless
Layered Protocols (2)
2-2
Data Link Layer
2-3
Transport Protocols
application layer.
the upper layer.
Client-Server TCP
a) Normal operation of TCP. b) Transactional TCP. 2-4
Middleware Protocols
2-5
RPC
Conventional Procedure Call
a) Parameter passing in a local procedure call: the stack before the call to read
Count = read (fd, buf, nbytes);
b) The stack while the called procedure is active
Issues
– Call by value – Call by reference – Call by Copy/Restore – Call by name
Client and Server Stubs
Steps of a Remote Procedure Call
1. Client procedure calls client stub in normal way 2. Client stub builds message, calls local OS 3. Client's OS sends message to remote OS 4. Remote OS gives message to server stub 5. Server stub unpacks parameters, calls server 6. Server does work, returns result to the stub 7. Server stub packs it in message, calls local OS 8. Server's OS sends message to client's OS 9. Client's OS gives message to client stub
Passing Value Parameters (1)
2-8
Passing Value Parameters (2)
a) Original message on the Pentium (L. E.) b) The message after receipt on the SPARC (B. E.) c) The message after being inverted. The little numbers in boxes indicate the address of each byte
Call by Reference Parameter Passing
Parameter Specification and Stub Generation
data structures.
interpreted is the main issue!!
representation of simple data structures.
(connection-oriented or connection-less)
Parameter Specification and Stub Generation
a) A procedure b) The corresponding message. c) Interface Definition Language compiling into client stub and server stub
Extended RPC Models
DSs.
– Doors – Async RPC.
Doors
same machine.
space of a server process, called by collocated processes within the server.
use (calling door-create)
Doors
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)
asynchronous RPCs
2-13
Writing a Client and a Server
2-14
Binding a Client to a Server
2-15
Performing an RPC
– At-most-once operation
Remote Object Invocation
Distributed Objects
client-side proxy.
2-16
Message-Oriented Communication
Messaging.
Berkeley Sockets (2)
The Message-Passing Interface (MPI)
primitives of MPI.
Primitive Meaning MPI_bsend Append outgoing message to a local send bufger MPI_send Send a message and wait until copied to local or remote bufger MPI_ssend Send a message and wait until receipt starts MPI_sendrecv Send a message and wait for reply MPI_isend Pass reference to outgoing message, and continue MPI_issend Pass reference to outgoing message, and wait until receipt starts MPI_recv Receive a message; block if there are none MPI_irecv Check if there is an incoming message, but do not blockStream-Oriented Communication
independent and complete units of info.
is also required the original sound has been sampled at 44100 Hz a sample in each 1/44100 Sec is required to re-produce the
required :: Temporal relationship between data items are crucial.
Data Stream (1)
Transmission Modes
delay for each unit: Sensor info!
transferred on time:: A max and min end-to-end delay (bounded jitter).
Data Stream (2)
2-35.2
Data Stream (3)
QoS
constant rate.
allowed to pass to the network.
Specifying QoS (2)
Setting Up a Stream
for resource reservation in a distributed system.
End of Chapter 2