VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
DCS Unit-II COMMUNICATION AND COORDINATION.pdf
1.
2. Introduction
Layered protocol
Types of communication
Network virtualization
Network coordination
3. It is the communication amongst several
processes involved within a distributed system
scenario.
A process is a program in execution.
Process
1
Process
2
Data
Figure.1) Interprocess communication in distributed
system
4. Process 1
Process 2
Process 1
Process 2 Process 3 Process n
M
M
M
M
---
Fig.1.a) Unicast IPC Fig.1.b) Multicast IPC
5. I. Synchronous and asynchronous
communication
In the synchronous form, both send and
receive are blocking operations.
In the asynchronous form, the use of the send
operation is non-blocking and the receive
operation can have blocking and non-blocking
variants.
6. II. Message destinations
A local port is a message destination within a
computer, specified as an integer.
A port has an exactly one receiver but can have
many senders.
III. Reliability
A reliable communication is defined in terms of
validity and integrity.
A point-to-point message service is described as
reliable if messages are guaranteed to be
delivered despite a reasonable number of packets
being dropped or lost.
For integrity, messages must arrive uncorrupted
and without duplication
7. IV. Ordering
Some applications require that messages be
delivered in sender order.
V. Persistent and Transient Communication
An electronic mail system is a classic example
where communication is persistent.
8. The java API for inter-process communication in the
internet provides both datagram and stream
communication.
The two communication patterns that are most commonly
used in distributed programs:
I. Client-Server Communication.
II. Group Communication.
Protocols involved in interprocess communication are as
follows:
I. TCP(Transport Control Protocol).
II. UDP(User Datagram Protocol).
10. Message Passing:
The application program interface (API) to UDP
provides a message passing abstraction.
Message passing is the simplest form of inter-
process communication.
API enables a sending process to transmit a
single message to a receiving process.
The independent packets containing theses
messages are called datagrams.
In the Java and UNIX APIs, the sender
specifies the destination using a socket.
11. Request-reply protocols are designed to support
client-server communication in the form of either
RMI or RPC.
Group multicast protocols are designed to
support group communication.
12. The request and reply messages provide the basis for
remote method invocation (RMI) or remote procedure call
(RPC).
Remote Method Invocation (RMI)
It allows an object to invoke a method
in an object in a remote process.
E.g. CORBA and Java RMI
Remote Procedure Call (RPC)
It allows a client to call a procedure in
a remote server.
16. Characteristics:
End point for inter-process communication.
Message transmission between sockets.
A socket is associated with either UDP or TCP. Sockets
are bound to ports.
One process can use many ports .
Processes don’t share sockets (unless for IP multicast).
ƒ
Implementations :
originally BSD Unix, but available in Linux, Windows,…
APIs in programming languages (e.g., java.net)
17. Send
send a message to a socket associated to a
process .
can be blocking or non-blocking.
ƒ
Receive
receive a message on a socket .
can be blocking or non.
Blocking.
ƒ
Broadcast/Multicast
send to all processes/all processes in a group.
20. Marshalling and Unmarshalling
ƒ
Marshalling: Encode data items so that they
can be written onto a stream.
ƒ
Unmarshalling: Read an encoding from a
stream and reconstruct the original items.
Examples:
ƒ
CORBA: CDR(= Common Data
Representation) for primitive and structured
data types that occur in remote method
invocations.
ƒ
Java Serialization: Applicable to all classes
that implement the interface Serializable.
25. The client-server communication is designed to support
the roles and message exchanges in typical client-server
interactions.
In the normal case, request-reply communication is
synchronous because the client process blocks until the
reply arrives from the server.
Asynchronous request-reply communication is an
alternative that is useful where clients can afford to
retrieve replies later.
Avoidance of connection establishment overhead
No need for flow control due to small amounts of data
are transferred.
26. The pair wise exchange of messages is not the best
model for communication from one process to a
group of other processes.
A multicast operation is more appropriate.
Multicast operation is an operation that sends a
single message from one process to each of the
members of a group of processes.
Multicasting has the following characteristics:
Fault tolerance based on replicated services
o A replicated service consists of a group of
servers.
27. IP Multicast
IP multicast is built on top of the Internet
protocol, IP.
IP multicast allows the sender to transmit a
single IP packet to a multicast group.
A multicast group is specified by class D IP
address for which first 4 bits are 1110 in IPv4.
The membership of a multicast group is dynamic.
A computer belongs to a multicast group if one or
more processes have sockets that belong to the
multicast group.
28. The following details are specific to IPv4:
Multicast IP routers
IP packets can be multicast both on local network and on
the wider Internet.
Local multicast uses local network such as Ethernet.
To limit the distance of propagation of a multicast
datagram, the sender can specify the number of routers it
is allowed to pass- called the time to live, or TTL for short.
Multicast address allocation
Multicast addressing may be permanent or temporary.
Permanent groups exist even when there are no members.
Multicast addressing by temporary groups must be created
before use and cease to exit when all members have left.
29. Java API to IP Multicast:
The Java API provides a datagram interface to IP
multicast through the class Multicast Socket, which is a
subset of Datagram Socket with the additional
capability of being able to join multicast groups.
The class Multicast Socket provides two alternative
constructors , allowing socket to be creative to use
either a specified local port, or any free local port.
30. Multicast Transmission
A message sent to a specified group of recipients.
Examples
ƒ
Fault tolerance: Based on replicated services –
requests go to all servers
ƒ
Spontaneous networking: All nodes of the network
receive messages
ƒ
Better performance: Through replicated data –the
updated data goes to all storing the data.
ƒ
Event notification
47. Measuring Time :
Traditionally time measured astronomically .
1. Transit of the sun (highest point in the sky)
2. Solar day and solar second
Problem: Earth’s rotation is slowing down.
1. Days get longer and longer
2. 300 million years ago there were 400 days in the year
Modern way to measure time is atomic clock.
1. Based on transitions in Cesium-133 atom
2. Still need to correct for Earth’s rotation
Result: Universal Coordinated Time (UTC).
1. UTC available via radio signal, telephone line, satellite (GPS
53. Current time from a time server: UTC from
radio/satellite etc Problems:
time must never run backward
variable delays in message passing
Calculation:
Earliest time that S can have sent reply: t0 +
min
Latest time that S can have sent reply: t0 + T
round – min
Total time range for answer: T round - 2 *
min
Accuracy is ± (½Tround - min
55. Berkeley algorithm
No external synchronization, but one master
server
Master polls slaves periodically about their
clock readings
Estimate of local clock times using round
trip estimation
Averages the values obtained from a group
of processes - Cancels out individual clock’s
tendencies to run fast
Tells slave processes by which amount of
time to adjust local clock
Master failure: Master election algorithm
56. Goals
1. Ability to externally synchronize clients via
Internet to UTC
2. Provide reliable service tolerating lengthy
losses of connectivity
3. Enable clients to resynchronize sufficiently
frequently to offset typical HW drift rates
4. Provide protection against interference
57. NTP Basic Idea
Layered client-server architecture, based on
UDP message passing
Synchronization at clients with higher strata
number less accurate due to increased
latency to strata 1 time server
Failure robustness: if a strata 1 server fails, it
may become a strata 2 server that is being
synchronized though another strata 1 serve
58. Procedure-Call and Symmetric Modes
All messages carry timing history information.
Local timestamps of send and receive of the previous
NTP message.
Local timestamp of send of this message.
Figure 16. Procedure-Call and
Symmetric Modes
60. NTP Implementation
Statistical algorithms based on 8 most recent <oi, di>
pairs: à determine quality of estimates
The value of oi that corresponds to the minimum di is
chosen as an estimate for o
Time server communicates with multiple peers, eliminates
peers with unreliable data, favors peers with higher strata
number (e.g., for primary synchronization partner
selection)
NTP phase lock loop model: modify local clock in
accordance with observed drift rate
Experiments achieve synchronization accuracies of 10
msecs over Internet, and 1 msec on LAN using NTP
72. Group {Pi} ”fully connected”; election: ring
Pi notices: coordinator lost Send
ELECTION(Pi) to the next P
Pj receives ELECTION(Pi) Send ELECTION(Pi,
Pj) to successor
n. . .
Pi receives ELECTION(..., Pi, ...) active_list =
{collect from the message}
NC = max {active_list}
Send COORDINATOR(NC; active_list) to the
next P
A Ring Algorithm (2)
A Ring Algorithm (2)