0% found this document useful (0 votes)
15 views44 pages

Communication

Uploaded by

Natanem Yimer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views44 pages

Communication

Uploaded by

Natanem Yimer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

DISTRIBUTED SYSTEMS

[COMP-412]

Communication

Session 4 and 5, November 2013


Anteneh Tesfaye
[email protected]
Communications are often handled by
layered protocols
Protocols are formal set of rules that
govern the format, contents, and meaning
of the messages sent and received
Agreements and specifications are needed
at each level

November 11, 2013 Department of Computer Science


Two general types of protocols:
 Connection oriented protocols
 Do some initial work to set up a “virtual circuit”.
 Connectionless protocols
 Do not set up a “virtual circuit”.
 Examples:
¿?
 Connection-oriented are usually more efficient.
 Connectionless are usually more efficient for one-off messages
November 11, 2013 Department of Computer Science
Basic Networking Model

 Focus on message-passing only


 Often unneeded or unwanted functionality
 Violates access transparency
November 11, 2013 Department of Computer Science
Low-Level Layers
 Physical Layer
 Contains the specification and implementation of bits, and
their transmission between sender and receiver.
 Data Link Layer
 Prescribes the transmission of a series of bits into a frame.
 As physical layers are unreliable, main job of this layer is to
detect and correct errors.
 Network Layer
 Describes how packets in a network of computers are to be
routed.
 For many distributed systems, the lowest level
interface is that of the network layer

November 11, 2013 Department of Computer Science


Transport Layer
 The transport layer provides the actual
communication facilities for most distributed
systems
 Standard Internet protocols:
 TCP: connection-oriented, reliable, stream-oriented
communication
 User Datagram Protocol (UDP): unreliable datagram
communication
 IP multicasting is generally considered a
standard available service

November 11, 2013 Department of Computer Science


Application Layer
 Session layer
 Dialog control, checkpoints for long transfers
 Presentation layer
 Meaning of bits, define records, etc.
 Application layer
 Protocols for things like mail, file transfer, communication
terminals.
 Examples:
 FTP (File Transfer Protocol)
 HTTP (HyperText Transfer Protocol)
 Session and presentation layers are not effectively
used and in practice only the application layer is ever
used

November 11, 2013 Department of Computer Science


 Middleware Layer
 Middleware is logically at application layer.
 But it provides common services and protocols that can
be used by many different applications.
 A rich set of communication protocols to allow different
applications to communicate.
 Marshaling/Unmarshaling of data necessary for integrated
systems
 Naming protocols so that different applications can easily share
resources
 Security protocols to allow different applications to
communicate in a secured way
 Scaling mechanisms such as support for replication and caching
 What remains are truly application-specific protocols
November 11, 2013 Department of Computer Science
An adapted reference model for networked communication
November 11, 2013 Department of Computer Science
Cooperating processes need to communicate
 For synchronization and control
 To share data
In a Non-Distributed System:
 Two approaches to communication:
 Shared memory
 Direct memory access (Threads)
 Mapped memory (Processes)
 Message passing
 OS’s IPC mechanisms
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
Communication in a Distributed System
 Previous slides assumed a uniprocessor or a
multiprocessor
 In a distributed system, things change:
 Shared Memory:
 There is no way to physically share memory
 Message Passing:
 Over the network
 Introduces latencies
 Introduces higher chances of failure
 Heterogeneity introduces possible incompatibilities
November 11, 2013 Department of Computer Science
Synchronous vs Asynchronous
communication
Transient vs Persistent communication

November 11, 2013 Department of Computer Science


Synchronous vs Asynchronous
Synchronous
 Sender blocks until message received
 Often sender blocked until message is processed
and a reply received
 Sender and receiver must be active at the
same time
 Receiver waits for requests, processes them
and returns reply
 Client-Server generally uses synchronous
communication
November 11, 2013 Department of Computer Science
Asynchronous
 Sender continues execution after sending
message
 Message may be queued if receiver not
active
 Message may be processed later at
receiver’s convenience

November 11, 2013 Department of Computer Science


November 11, 2013 Department of Computer Science


Transient vs Persistent
Transient
 Message discarded if cannot be delivered to
receiver immediately
 Example: HTTP request
Persistent
 Message stored (somewhere) until receiver
can accept it
 Example: email

November 11, 2013 Department of Computer Science


 Abstractions above simple message passing
make communication easier for the
programmer
 Provided by higher level APIs
1. Remote Procedure Call (RPC) & Remote
Method Invocation (RMI)
2. Message-Oriented Communication
3. Group Communication
4. Streams
November 11, 2013 Department of Computer Science
Remote Procedure Call (RPC)
Idea: Replace I/O oriented message passing
model by execution of a procedure call on a
remote node:
 Synchronous - based on blocking messages
 Message-passing details hidden from application
 Procedure call parameters used to transmit data
 Client calls local “stub” which does messaging
and marshalling
November 11, 2013 Department of Computer Science
Stubs
Client stub
 Piece of code responsible for proxying the
remote call as a local call, and packing the call
up as a message.
Server stub
 Piece of code responsible for unpacking the
message on the server, and invoking the actual
server-side application-level implementation.

November 11, 2013 Department of Computer Science


November 11, 2013 Department of Computer Science
1. Client procedure calls client stub in normal
way.
2. Client stub builds message, passes to
runtime, which calls local OS.
3. Client OS sends message to remote OS.
4. Remote OS gives message to runtime, which
does some initial processing, then passes it
to the server stub.
5. Server stub unpacks parameters, calls server.

November 11, 2013 Department of Computer Science


6. Server does work, returns result to the
stub.
7. Server stub packs it in message, passes
to runtime, which calls local OS.
8. Server OS sends message to client OS.
9. Client OS gives message to runtime,
which does some initial processing,
and then passes to client stub.
10. Stub unpacks result, returns to client.
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
Remote Method Invocation (RMI)
Your Assignment!!!

November 11, 2013 Department of Computer Science


Message - Oriented Communication
 Communication models based on message passing
 Traditional send()/receive() provides:
 Asynchronous and Synchronous communication
 Transient communication
 What more does it provide than send()/receive()?
 Persistent communication (Message queues)
 Hides implementation details
 Marshalling

November 11, 2013 Department of Computer Science


Message Queuing Systems
 Provides:
 Persistent communication
 Message Queues
 Transfer of messages between queues
 Model:
 Application-specific queues
 Messages addressed to specific queues
 Only guarantee delivery to queue. Not when.
 Message transfer can be in the order of minutes
 Very similar to email but more general purpose
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
Unicast Communication
 Unicast is a one-to-one connection between
the server and the client.
 Messages are sent to a single network
destination identified by a unique address.
 Not efficient for mass-distributed
applications since each network connection
requires its own separate network
bandwidth for transmission
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
Broadcast Communication
 Broadcast is a one-to-all connection in a given
address range.
 Same message is transmitted to all possible
destinations.

November 11, 2013 Department of Computer Science


Multicast Communication
 Multicast is a one-to-many connection in a given
address range.
 Each client that listens to the multicast adds no
additional overhead on the Server.

November 11, 2013 Department of Computer Science


Gossip-Based Communication
Technique that relies on epidemic behavior, e.g.
spreading diseases among people.
Variant: rumor spreading, or gossiping.
 When node P receives data item x, it tries to push it to
arbitrary node Q.
 If x is new to Q, then P keeps on spreading x to other
nodes.
 If node Q already has x, P stops spreading x with
certain probability.
Analogy from real life: Spreading rumors
among people
November 11, 2013 Department of Computer Science
November 11, 2013 Department of Computer Science
Support forContinuous Media
Between applications
Between devices

November 11, 2013 Department of Computer Science


Continuous Media:
 Data represented as single stream rather than
discrete chunks
 Temporal relationship between data (timing
has an effect on correctness)
 Minimum and maximum end-to-end time
delays
Contrast to Discrete Media:
 No temporal relationship between data
(timing does not have an effect on
correctness)
November 11, 2013 Department of Computer Science

November 11, 2013 Department of Computer Science


Different timing with respect to data
transfer results in different
transmission modes.
 Asynchronous- no restrictions with respect to
when data is to be delivered
 Synchronous- define a maximum end-to-end
delay for individual data packets
 Isochronous- define a maximum and
minimum end-to-end delay (jitter is bounded)
November 11, 2013 Department of Computer Science
Some common stream characteristics:
 Streams are unidirectional
 There is generally a single source, and one or
more sinks
 Often, either the sink and/or source is a wrapper
around hardware (e.g., camera, TV monitor,
dedicated storage)
Stream types:
 Simple: consists of a single flow of data, e.g.,
audio or video
 Complex: multiple data flows, e.g., stereo audio or
combination of audio/video
November 11, 2013 Department of Computer Science
Streams and Quality of Service
Streams are all about timely delivery of data.
Basics of Quality of Service (QoS):
 The required bit rate at which data should be
transported.
 The maximum delay until a session has been set up
(i.e., when an application can start sending data).
 The maximum end-to-end delay (i.e., how long will it
take until a data unit makes it to a recipient).
 The maximum delay variance, or jitter.
 The maximum round-trip delay.

November 11, 2013 Department of Computer Science


A general architecture for streaming stored multimedia data over a network:
November 11, 2013 Department of Computer Science
Enforcing Quality of Service
There are various network-level tools, such
as differentiated services by which certain
packets can be prioritized
Buffers can also be used reduce jitter

November 11, 2013 Department of Computer Science


How can the effects of packet loss be reduced
(when multiple samples are in a single packet)?

The effect of packet loss in a non-interleaved transmission

The effect of packet loss in an interleaved transmission


November 11, 2013 Department of Computer Science

You might also like