Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Chapter 4 Communication Part II

BIT3263 | Distributed System


Prepared by Noris Bt. Ismail
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Objectives
• Socket communication.
• Message Passing properties.

• Message Oriented System – as part of the middleware software.

• Data Streaming

• Multicasting - Gossiping

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Berkeley Sockets
Socket is a
communication end
point to which an
application can
write data that are
sent out over the
network.

Standardized
Interface of
transport layer to
allow programmers
to make use of the
entire suite.

Figure 4-14. The socket primitives for TCP/IP.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

The Message-Passing Interface (1)

For connection oriented


Protocol

Tell OS server rcv. mesg


Reserve OS ONLY through this PORT add.
resources for
send/recv.
Mesg.

Specifies the transport level add. to which a connection request to


be sent
Figure 4-15. Connection-oriented communication pattern using sockets.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

The Message-Passing Interface (2)


• The need to be hardware and platform independent led to the definition of standard for
message passing – Message Passing Interface.
• MPI – designed for parallel applications tailored to overcome transient communication.
E.g. serious failures such as process crashes/network partitions are fatal, and do not
require automatic recovery.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

The Message-Passing Interface (3)


• MPI assumes comm. takes place within a known group of processes. Each group is
assigned an identifier and each process within the group is also assigns a local
identifier.
• A(groupID, processID) uniquely identifies the source and destination of a mesg.
instead of a transport-level add.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

The Message-Passing Interface (2)

Sync.
Comm.

Figure 4-16. Some of the most intuitive message-passing primitives of MPI.noris

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message-Queuing Model

• Idea- Applications communicate by inserting message in specific queues.


• These message are forwarded over a series of comm. servers and are eventually
delivered to the destination, even if the application is down when the message is
being sent.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message-Queuing Model (1)

Diagram D- Sender and receiver are passive, the


system can be storing/transmitting mesg.

Figure 4-17. Four combinations for loosely-coupled communications using queues.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message-Queuing Model (4)

Figure 4-18. Basic interface to a queue in a message-queuing system.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

General Architecture of a Message-Queuing System (1)

Queue manager
– interact
directly with the
application that
is sending/
receiving a
message.

Local node
should maintain
a possibly
distributed db of
queue names to
network location.
Figure 4-19. The relationship between queue-level addressing and
network-level addressing.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

General Architecture of a Message-Queuing System (Relay)(2)

Figure 4-20. The general


organization of a message-queuing
system with routers.

- Routers. The message is first


transferred to the router.
- Instead of queue manager needs
to be updated frequently only the
router need to be updated.
- The queue manager has to know
the nearest router only.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Integration in MPI
• Integration of new and existing application into a single, coherent Distributed
Information System.
• In Mesg-queuing Sys. – Conversion is handled by special nodes in queuing network.

• Functions :- To convert incoming message. So that it can be understood by the


destination application.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message Brokers

Figure 4-21. The general organization of a message broker in a message-queuing system.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Mesg-Queuing System Implementation


• To enable persistent comm. between processes, regardless whether the process is
running a user application, handling access to a db, performing computations and etc.
• E-mail System – A mesg is transferred by setting up a direct TCP connection to the
destination mail server.
• Workflow, groupware and batch processing.

• A query expanding several db may need to be split into several sub queries that are
forwarded to individual databases.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

IBM’s WebSphere Message-Queuing System

Figure 4-22. General organization of IBM’s message-queuing system.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Channels

Figure 4-23. Some attributes associated with message channel agents.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message Transfer (1)


Application linked to queue
manager QMA can refer to
a remote queue manager
using the local alias LA1.

Alias table- Changing the


name of the queue manager
requires the only changes in
the in its alias table the
applications are not
affected.

Figure 4-24. The general organization of an MQ queuing


network using routing tables and aliases.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Automatic configuration of routing table


• Having a centralized component in which the topology of the queuing network is maintained. It
will simply calculates all best routes between pairs of queue managers using a known routing
algorithm, and subsequently generates routing tables for each queue manager.
• Decentralize the routing algorithm, by having each queue manager discover the network
topology, and calculate its own best routes to other managers.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Message Transfer (2)

Figure 4-25. Primitives available in the message-queuing interface.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Data Stream
• A sequence of data unit being transferred e.g. Playing an audio file requires setting
up a continuous data stream between the file and the audio device.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Data Stream

Figure 4-26. A general architecture for streaming stored multimedia data over a network .

• Important issues in this architecture:


- The multimedia data need to be compressed in order to reduce the required
storage and the network capacity.
- Timing(QoS) – Timeliness, volume and reliability.
- Quality of the transmission
- Synchronization issues between the stream decoder and encoder.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Streams and Quality of Service


Properties for Quality of Service:
• The required bit rate at which data should be transported.

• The maximum delay until a session has been set up (e.g. when application can start sending
data)
• The maximum end-to-end delay (how long will it take until a data unit reach the
destination).
• The maximum delay variance, or jitter(n voice over IP (VoIP), jitter is the variation in the
time between packets arriving, caused by network congestion, timing drift, or route
changes. A jitter buffer can be used to handle jitter. ).
• The maximum round-trip delay.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Enforcing QoS (1)

Assume Pkt # 8 took


11 sec to reach the
receiver at which the
buffer will have been
completely emptied. The
result is a gap in the
playback at the
application.

The size of the receiver’s


buffer = 9 sec of pkts to
pass to the applications

Figure 4-27. Using a buffer to reduce jitter.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Enforcing QoS (2)

A single packet
contains multiple
audio and video
frames as a
consequences
when a packet is lost,
the receiver
may actually
perceive a large
gap when playing the
frames

Figure 4-28. The effect of packet loss in (a) non interleaved


transmission and (b) interleaved transmission.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Burst error correction using Hamming code

Figure above shows when a burst error of size 4 corrupts the frame, only one bit from each
codeword is corrupted. The corrupted bit in each codeword can then easily be corrected at
the receiver.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Synchronization Mechanisms (1)

E.g.
Slide show on the web
enhanced with audio

Synchronization
between a discrete data
stream and a continuous
data stream
Ensuring - the specific
timing and
synchronization
constraints.

Figure 4-29. The principle of explicit synchronization on


the level data units.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Synchronization Mechanisms (2)

Figure 4-30. The principle of synchronization as supported by high-level interfaces.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Multicast Communication
• Sending data to multiple receivers.
• A major issue – Setting up the communication paths for information dissemination.

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

References
These slides are taken from Tanenbaum & Van Steen, Distributed Systems:
Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved.
0-13-239227-5

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

Sub Point #1
Socket Programming

Sub Point #4 KEY Sub Point #2


Message Passing
Multicasting
POINTS Interface

Sub Point #3
Data Streaming

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide
FACULTY OF INFORMATION & COMMUNICATION TECHNOLOGY

BIT3263 | Distributed System

End of Lecture

ALL RIGHTS RESERVED


No part of this document may be reproduced without written approval from Limkokwing University of Creative Technology Worldwide

You might also like