Chapter 4-Communication (Autosaved)
Chapter 4-Communication (Autosaved)
1
Objectives of the Chapter
review of how processes communicate in a network (the rules or the
protocols) and their structures
Stream-Oriented Communication
Multicast Communication
2
Fundamentals
Inter-process communication is at the heart of all distributed
systems.
As such systems are made up of several processes running on
different machines
How processes on different machines can exchange
information?
Given, these processes do not have shared memory and clock
1.Traditional approach
Use low-level message-passing primitives offered by the transport
layer (send and receive).
However, these are difficult to use for large-scale distributed
Apps.
2.Use middleware systems that offer a higher level of abstraction
Easier to express communication between processes
3
4.1 Network Protocols and Standards
why communication in distributed systems? because there
is no shared memory
two communicating processes must agree on the syntax
and semantics of messages
a protocol is a set of rules that governs data
communications
a protocol defines what is communicated, how it is
communicated, and when it is communicated
the key elements of a protocol are syntax, semantics, and
timing
syntax: refers to the structure or format of the data
semantics: refers to the meaning of each section of bits
timing: refers to when data should be sent and how fast
they can be sent
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
TCP/IP protocol suite is the other.
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 transport layer protocols: connection-
oriented and connectionless
5
Layered Protocols (1)
6
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
7
Layered Protocols (2)
Every layer adds a header to the front of the message
But some put trailer either
8
Low level layers
Physical layer: contains the specification and
implementation of bits, and their transmission between
sender and receiver.
Deals with standardizing how two computers are connected and
how 0s and 1s are represented.
Data link layer: transmission of a series of bits into a
frame.
Provides the means to detect and possibly correct transmission
errors, as well as protocols to keep a sender and receiver in the
same pace.
Network layer: describes how packets in a network of
computers are to be routed.
Contains the protocols for routing a message through a computer network, as
well as protocols for handling congestion.
Note:
For many distributed systems, the lowest-level interface is that
of the network layer.
9
Transport Layer
The transport layer provides the actual communication facilities
for most distributed systems.
Turn the underlying network into something that a developer can
easily use.
Mainly contains protocols for directly supporting applications, such as
those that establish reliable communication, or support real-time
streaming of data.
Example transport layer protocols
TCP: connection-oriented protocol, reliable
communication
UDP: connectionless protocol,
Unreliable,
Application has to handle error
10
Higher-Level Protocols
OSI has three additional layers above transport layer
In TCP/IP suite, everything above transport layer is grouped together
Session layer is an enhanced version of transport layer
Provides dialog control, e.g., keeps track of who is talking and provide
synchronization
Presentation layer is mainly concerned with the meaning of the
bits.
Prescribes how data is represented in a way that is independent of
the hosts on which communicating applications are running.
Application layer : Protocols for things like mail, file transfer,
communication terminals.
Essentially, everything else: e-mail protocols, Web access protocols,
file-transfer protocols, and so on.
Examples:
FTP (File Transfer Protocol)
HTTP (Hypertext Transfer Protocol)
11
Transport Protocols: Client-Server TCP
12
much of the overhead in TCP is for managing the connection
combine connection setup with request
and closing connection with answer
such protocol is called TCP for
Transactions (T/TCP)
transactional TCP
13
Application Protocols
file transfer (FTP - File Transfer Protocol)
HTTP - Hypertext Transfer Protocol for accessing data on the
WWW
Middleware Protocols
a middleware is an application that contains general-purpose
protocols to provide services
example of middleware services
authentication and authorization services -
distributed transactions (commit protocols; locking
mechanisms) -
middleware communication protocols (calling a procedure
or invoking an object remotely, synchronizing streams for
real-time data, multicast services) -
14
4.2 Remote Procedure Call
the first distributed systems were based on explicit message
exchange between processes through the use of explicit
send and receive procedures; but do not allow access
transparency
in 1984, Birrel and Nelson introduced a different way of
handling communication: RPC
it allows a program to call a procedure located on another
machine
simple and elegant, but there are implementation problems
the calling and called procedures run in different
address spaces
parameters and results have to be exchanged; what if
the machines are not identical?
what happens if both machines crash?
15
Conventional Procedure Call, i.e., on a single machine
e.g. count = read (fd, buf, bytes); a C like statement, where
-fd is an integer indicating a file
-buf is an array of characters into which data are read
-bytes is the number of bytes to be read
Stack pointer
Stack pointer
16
Client and Server Stubs
RPC would like to make a remote procedure call look the
same as a local one; it should be transparent, i.e., the calling
procedure should not know that the called procedure is
executing on a different machine or vice versa
20
Asynchronous RPC
There are two cases in which no need to block the client until it gets a
reply
1. if there is no result to be returned
e.g., adding entries in a database, ...
the server immediately sends an ack promising that it will
carryout the request
the client can now proceed without blocking
23
4.3 Remote Object (Method) Invocation (RMI)
resulted from object-based technology that has proven its
value in developing non distributed applications
it is an expansion of the RPC mechanisms
it enhances distribution transparency as a consequence of
an object that hides its internal from the outside world by
means of a well-defined interface
Distributed Objects
an object encapsulates data called the state, and
the operations on those data called methods
methods are made available through interfaces
the state of an object can be manipulated only by
invoking methods
this allows an interface to be placed on one machine
while the object itself resides on another machine;
such an organization is referred to as a distributed
object
24
If the state of an object is not distributed, only the interfaces are distributed; such objects are also referred to as remote objects
the implementation of an object’s interface is called a proxy (analogous to a client stub in RPC systems)
it is loaded into the client’s address space when a client binds to a distributed object
25
common organization of a remote object with client-side proxy
26
Binding a Client to an Object
a process must first bind to an object before invoking its
methods, which results in a proxy being placed in the
process’s address space
binding can be implicit (directly invoke methods using
only a reference to an object) or explicit (by calling a
special function)
an object reference could contain
network address of the machine where the object
resides
endpoint of the server
an identification of which object
the protocol used
...
27
Parameter Passing
there are two situations when invoking a method with
object reference as a parameter: the object can be local or
remote to the client
local object: a copy of the object is passed; this means the
object is passed by value
remote object: copy and pass the reference of the object
as a value parameter; this means the object is passed by
reference
28
4.4 Message Oriented Communication
RPCs and RMIs are not adequate for all distributed system
applications
the provision of access transparency may be good but they
have semantics that is not adequate for all applications
example of problems
they assume that the receiving side is running at the
time of communication
a client is blocked until its request has been processed
29
Persistence and Synchronicity in Communication
assume the communication system is organized as a
computer network shown below
31
asynchronous: a sender continues immediately after it has submitted its message for
transmission
synchronous: the sender is blocked until its message is stored in a local buffer at the
receiving host or delivered to the receiver
the different types of communication can be combined
persistent asynchronous: e.g., email
transient asynchronous: e.g., UDP, asynchronous RPC
in general there are six possibilities
Persistent Transient
Asynchronous
33
transient asynchronous communication receipt-based transient synchronous communication
34
delivery-based transient synchronous
communication at message delivery
response-based transient
synchronous communication
35
4.5 Stream Oriented Communication
Multimedia
media
36
The Challenge
new applications
multimedia will be pervasive in few years (as graphics)
storage and transmission
e.g., 2 hours uncompressed HDTV (1920×1080) movie:
1.12 TB (1920×1080x3x25x60x60x2)
videos are extremely large, even after compressed
(actually encoded)
continuous delivery
e.g., 30 frames/s (NTSC), 25 frames/s (PAL) for video
guaranteed Quality of Service
admission control
37
Types of Media
two types
discrete media: text, executable code, graphics, images;
temporal relationships between data items are not
fundamental to correctly interpret the data
continuous media: video, audio, animation; temporal
relationships between data items are fundamental to
correctly interpret the data
a data stream is a sequence of data units and can be applied
to discrete as well as continuous media
stream-oriented communication provides facilities for the
exchange of time-dependent information (continuous media)
such as audio and video streams
38
timing in transmission modes
asynchronous transmission mode: data items are transmitted one
after the other, but no timing constraints; e.g. text transfer
synchronous transmission mode: a maximum end-to-end delay
defined for each data unit; it is possible that data can be
transmitted faster than the maximum delay, but not slower
isochronous transmission mode: maximum and minimum end-to-
end delay are defined; also called bounded delay jitter; applicable
for distributed multimedia systems
a continuous data stream can be simple or complex
simple stream: consists of a single sequence of data; e.g., mono
audio, video only (only visual frames)
complex stream: consists of several related simple streams that
must be synchronized; e.g., stereo audio, video consisting of audio
and video (may also contain subtitles, translation to other
languages, ...)
39
4.6 Multicast Communication
multicasting: delivery of data from one host to many destinations; for
instance for multimedia applications
a one-to-many relationship
1.Application-Level Multicasting
nodes are organized into an overlay network and information is
disseminated to its members
how to construct the overlay network
nodes organize themselves as a tree with a unique path between two pairs
of nodes or
nodes organize into a mesh network and there will be multiple paths
between two nodes; adv: robust
2. Gossip-Based Data Transmission
use epidemic protocols where information is propagated among a
collection of nodes without a coordinator
40
Thank you!
?