Professional Documents
Culture Documents
Introduction
interprocess communication is at the heart of all distributed
systems
communication in distributed systems is based on message
passing as offered by the underlying network as opposed to
using shared memory
modern distributed systems consist of thousands of
processes scattered across an unreliable network such as
the Internet
unless the primitive communication facilities of the network
are replaced by more advanced ones, development of large
scale Distributed Systems becomes extremely difficult
2
Objectives of the Chapter
review of how processes communicate in a network (the
rules or the protocols) and their structures
introduce the four widely used communication models for
distributed systems:
Remote Procedure Call (RPC)
Remote Method Invocation (RMI)
Message-Oriented Middleware (MOM)
Streams
3
2.1 Layered Protocols
two computers, possibly from different manufacturers, must
be able to talk to each other
for such a communication, there has to be a standard
The ISO OSI (Open Systems Interconnection) Reference
Model is one of such standards - 7 layers
TCP/IP protocol suite is the other; has 4 or 5 layers
OSI
Open – to connect open systems or systems that are open
for communication with other open systems using standard
rules that govern the format, contents, and meaning of the
messages sent and received
these rules are called protocols
two types of protocols: connection-oriented and
connectionless
4
layers, interfaces, and protocols in the OSI model
5
Media (lower) Layers
Physical: Physical characteristics of the media
Data Link: Reliable data delivery across the link
Network: Managing connections across the network
or routing
Transport: End-to-end connection and reliability
(handles
lost packets); TCP (connection-oriented),
UDP (connectionless), etc.
Session: Managing sessions between applications
(dialog control and synchronization); rarely
supported
Presentation: Data presentation to applications; concerned
with the syntax and semantics of the
information transmitted
Application: Network services to applications; contains
protocols that are commonly needed by
users;
Host (upper) FTP, HTTP, SMTP, ...
Layers
6
a typical message as it appears on the network
7
a conversation occurs between a sender and a receiver at
each layer
e.g., at the data link layer
Goal:
Provide process-to-process communication that
enables a process on one system to invoke a
function, or service, on a another system
Each network service is a collection of remote programs
What is procedure?
A procedure is a method for completing something
with steps and instructions for each aspect of the
task
A procedure is a set of coded instructions that tell a
computer how to run a program or calculation.
We can define a procedure with no parameters, one
parameter, or more than one.
A parameter represents a value that the procedure
expects
2.2.1 Client and Server Stubs
RPC is accomplished by generating stub functions:
Client stub also known as proxy
Its Job is to,
Take the parameters,
Marshal the parameters into a network message,
Send them to the server,
Received results from the server
Unmarshal the results and return them to the caller.
Server stub also known a skeleton
Its Job is to,
Unmarshals the message in the request,
Calls the local procedure and does the work
Marshals the results into a network message that is sent back to
the recipient/client
2.2.1 Client and Server Stubs…
16
Summary of a Remote Procedure Call
Steps
In the RPC model,
Step-1: The client makes a procedure call to send a
data packet to the server.
Step-2: When the packet arrives, the server uses the
local procedure and performs whatever service is
requested
Step-4: Sends a reply back to the client (i.e. result)
2.2.2 Parameter Passing
1. Passing Value Parameters
e.g., consider a remote procedure add(i, j), where i and j are
integer parameters
19
2.2.2 Parameter Passing….
e.g.,
Consider a procedure with two parameters, an integer and a four-
character string; each one 32-bit word (5, “JILL”)
the message after receipt on the SPARC; wrong integer, but correct string
20
2.2.3 Extended RPC Models
A. Doors
Called door is used for colocated client-server process
communication
21
2.2.3 Extended RPC Models…..
1. The server process registers a door before it can be called
(door_create) and a name is attached to it
2. A client calls a door by a system call (door_call) including
all parameters
3. Results are returned by the system call door_return
22
the principle of using doors as RPC mechanism
2.2.3 Extended RPC Models…..
23
B. Asynchronous RPC
If there is no need to block the client until it gets a reply
One cases:
1. If there is no result to be returned
e.g., adding entries in a database, ...
25
w1
2.3 Remote Object (Method) Invocation (RMI)...