Sei sulla pagina 1di 10

LESSON 3: Synchronization in

Distributed Systems
1. Distributed computing
1.1 Definition
Collection of autonomous computers, connected through a network and distribution software called
middleware which enables computers to coordinate their activities and to share system resources:

The users perceive the system as a single, integrated computing facility


The components are autonomous
Scheduling and other resource management and security policies are implemented by
each system
There are multiple points of control and multiple points of failure
The resources may not be accessible at all times.
Can be scaled by adding additional resources.
Can be designed to maintain availability even at low levels of hardware/software/network
reliability.

1.2 Properties

Access transparency: local and remote information objects are accessed using identical
operations
Location transparency: information objects are accessed without knowledge of
their location
Concurrency transparency: several processes run concurrently using shared information
objects without interference among them
Replication transparency: multiple instances of information objects increase reliability
without the knowledge of users or applications
Failure transparency: the concealment of faults
Migration transparency: the information objects in the system are moved without affecting
the operation performed on them
Performance transparency: the system can be reconfigured based on the load and quality of
service requirements
Scaling transparency: the system and the applications can scale without a change in the
system structure and without affecting the applications

2. Modeling

2.1 Problems
1. Communication among processes depends on dynamic parameters, such as both the
state of the network (traffic load) and the state of the nodes (computing load):
a. Causality
b. Global state (scalability-aware)
2. Common time reference
a. Physical clocks
b. Logical clocks

3. Physical clocks
Reference Time, t: Coordinated Universal Time(CUT). It is based on atomic time, but a leap
second is inserted or deleted to be synchronized with astronomical time.

3.1 Synchronizing clocks

External synchronization
CUT time references are periodically sent trough
Terrestial stations: 10 ms
GPS: 0,1 s
Geostationary satellites: 0,1 ms
Useful only for giving an accurate time service
Internal synchronization
Centralized algorithms (Cristians method, 1989)
Distributed algorithms (The Berckeley algorithm, 1989)

3.2 NTP (Network Time Protocol)


Multicast mode: high-speed. One/several servers periodically multicast the time.
Procedure-call mode: similar to the Cristians method.
Symmetric mode: by higher levels.

4. Logical time

4.1 Logical Clocks (LC)

4.2 Vector Clocks

4.3 FIFO delivery VS Causal delivery

FIFO delivery:

Causal delivery:

5. Global state
5.1 Cuts

5.2 Runs

5.3 Causal history

5.4 Global state


Monitor: process responsible for constructing the global state of the distributed system
The monitor sends messages requesting information about the local state of every process
and gathers the replies to construct the global state: Direct task if and only if {Global clock,
local state at the same time}

5.5 The snapshot algorithm

Goal: record a set of process and channel states (a snapshot) for a set of processes ( = 1,
2, , ) such that, even though the combination of recorded states may never have
occurred at the same time, the recorded global state is consistent
Assumptions:
Communication is reliable
Unidirectional channels (FIFO delivery)
Processes strongly connected
Any process may initiate a global snapshot at any time
The algorithm execution does not interfere in the normal execution of the processes

Process builds:

Each execution state:

State of the communication channels: {

}, = 0, 1, ,

Number of messages sent by but not yet received by

Marker (snapshot message) sending rule for process


After having recorded its state, sends one marker over each outgoing channel
before sending any other message over the channels
Marker receiving rule for process (over channel )
If ( has not yet recorded its state) it
Records its execution state.
Records the state of channel as the empty set Records messages arriving
over other incoming channels.
Send a marker message over any other outgoing channel.
else
It records the state of as the set of messages it has received over the
channel since it recorded its state
Process finishes when it has received the marker messages from any other process in the
distributed system.

Potrebbero piacerti anche