Agreement Protocols, Distributed Resource Management: Issues in distributed File Systems, Mechanism for building distributed file systems, Design issues in Distributed Shared Memory, Algorithm for Implementation of Distributed Shared Memory.
Size: 2.04 MB
Language: en
Added: Oct 03, 2019
Slides: 91 pages
Slide Content
DISTRIBUTED SYSTEMS
ShikhaGautam
Assistant Professor
KIET, Ghaziabad
Problem which require Agreement
• Leader Election
• Distributed Transaction
• Mutual exclusion
• Any many more ….
System Model
AgreementProblemshavebeenstudiedunder
followingSystemModel:
1.‘n’processorsandatmost‘m’oftheprocessors
canbefaulty.
2.Processorscandirectlycommunicatewithother
processorsbymessagepassing.
3.Receiverknowstheidentityofthesender.
4.Communicationmediumisreliable.
Model of processor Failures
ProcessorCanFailinthreemodes:
1.CrashFailure:Processorstopsandneverresumesoperation.
2.Send/ReceiveOmission:ProcessorOmitstosend/receive
messagetosomeprocessors
3.MaliciousFailure:mostdangerousone
(i)AlsoknownasByzantineFailure.
(ii)Processormaysendfictitiousvalues/messagetootherprocessesto
confusethem.
(iii)Toughtodetect/correct.
Classification of Messages in DS
1.AuthenticatedMessages:Alsoknownassigned
Message.Processorcannotforge/changeareceived
message.Processorcanverifytheauthenticityofthe
message.Itiseasiertoreachonanagreementinthis
casebecausefaultyprocessorsarecapableofdoingless
damage.
2.Non-AuthenticatedMessages:Alsoknownas
OralMessage.Processorcanforge/changeareceived
messageandclaimstohavereceiveditfromothers.
Processorcannotverifytheauthenticityofthemessage
inthiscase.
We will find agreement solution in two mode
of communication under various failure
Agreement Problem Types
1.Byzantine Agreement problem.
The Byzantine Agreement problem is a primitive to
the other two problems. So, The other two
Agreement Problems are:
2.The Consensus Problem.
3.The Interactive Consistency Problem.
Problem
Who Initiates
Value
Final
Agreement
Byzantine
Agreement
One ProcessorSingle Value
ConsensusAll Processors Single Value
Interactive
ConsistencyAll Processors
A Vector of
Values
Byzantine General Problem
(Inspired from Byzantine Empire)
Therewasbyzantineempireinmiddleages….there
weresomearmygeneralswhowereprotectingthe
city.Nowallgeneralhavetomakeanagreementor
somenegotiationtoprotectthecity.Ifanygeneralis
foundtobetraitorstheywillnotbeabletoprotect
thecity.hencetheyhavetoagreeonsomecommon
termsandthenonlytheycanprotectthebyzantine
empire.
PresentpartofByzantineEmpireisknowns
Turkey(Istanbul).
1. Byzantine Problem in DS
Anarbitrarilychosenprocessor,calledthesource
processor,broadcastsitsinitialvaluetoallother
processors.
Agreement:Allnon-faultyprocessorsshould
agreeonthesamevalue.
Validity:Ifthesourceprocessorisnon-faulty,
thenthecommonagreeduponvaluebyallnon-
faultyprocessorsmustbesameastheinitialvalue
ofthesource.
Agreement algorithm for No-failure
•Agreement can easily achieved in constant no of
message exchange.
•Both synchronous and asynchronous mode will
always achieveagreement .Because when all
process are working fine then they are eventually
satisfying the property of Distributed system and
with constant no of message exchange we can
achieve i.e. all nodes in a distributed system are
working in a cooperation to achieve some
common goal.
Agreement Protocol in Crash
Failure Process
Solution for Byzantine Agreement
Problem
Lamportet.alproposedanalgorithmfor
byzantineagreementproblemwhichisknown
asLamport-Shostak-PeaseAlgorithm.
•SourceBroadcastsitsinitialvaluetoallotherprocessors.
•Processorssendtheirvaluestootherprocessorsandalso
receivedvaluesfromothers.
•DuringExecutionfaultyprocessorsmayconfusebysending
conflictingvalues.
•Howeveriffaultyprocessorsdominateinnumber,theycan
preventnon-faultyprocessorsfromreachinganagreement.
•So,thenooffaultyprocessorsshouldnotexceedcertain
limit.
Algorithm is Recursively defined as follows:
•Algorithm OM(0), i.e. (m=0)
Step 1: Source processor sends its values to every
processor.
Step 2: Each processor uses the value it receives from
source (If no value is received default value 0 is used).
• Algorithm OM(m), i.e. (m>0)
Step 1: The source processor sends its value to
every processor.
Step 2: If a processor does not receive value it uses
a default value of zero.
Step 3: For each processor Pi, let vi be the value
processor receives from source, then it behaves like
source processor.
Step 4: If for a processor Pi, Vj(j!=i) is the value
received from Pj, the Pi uses the majority value as
agreement value.
Byzantine Agreement can not have solution when
among three processors if one processor is faulty.
2. The Consensus Problem
Hereallprocesshavesomeinitialvaluethey
broadcasttheirinitialvaluestoallothersprocess
andsatisfythefollowingcondition:
Agreement:Allnon-faultyprocessesmustagreeon
samesinglevalues.
Validity:ifallnonfaultyprocesseshavethesame
initialvalue,thentheagreedvaluebyallthenon-
faultyprocessesmustbethatsamevalue.
Termination: Each non-faulty process must
eventually decide on a value.
•Two Important Points to be remember:
1.If initial value of non-faulty processors are
different then all non-faulty then processors
can agree on any common value.
2.Value agreed upon by faulty processors is
irrelevant.
3. The Interactive Consistency Problem
Every processor broadcasts its initial value to all other processors.
The initial values of the processors may be different . A protocol for
the interactive consistency problem should meet the following
conditions:
Agreement: All non-faulty processes must agree on the same array of
values A[v1 : : : vn].
Validity: If processor Pi is non-faulty and its initial value is vi , then all
non-faulty processes agree on vi as the ithelement of the array A. If
process j is faulty, then the non-faulty processes can agree on any
value for A[j].
Termination: Each non-faulty process must eventually decide on the
array A.
Metrics to measure performance of
Agreement Protocol
•Time: Time taken to reach an agreement under a
protocol. The time is usually expressed as the
number of rounds needed to reach an agreement.
•Message Traffic: Number of messages exchanged
to reach an agreement.
•Storage Overhead: Amount of information that
need to be stored at processors during execution
of the protocol.
• There are some solution that solve agreement problems by
satisfying all condition of agreement problem in case of
synchronous system.
• But in case of asynchronous models , agreement problem are
not solvable. However we can solve agreement problem in
asynchronous System after converting agreement problem in its
weaker version. That means agreement problem are reduce to
some weaker version :
Weaker version of agreement problem are:
1.k-set consensus
2.Approximate consensus
3.Renaming problem
4.Terminating reliable broadcast ( it is a kind of problem which
require consensus.)
Applications of AgreementProtocol
1.Clock Synchronization in Distributed Systems:
•Distributed Systems require physical clocks to synchronized
but physical clocks have drift problem. So, they must
periodically resynchronized.
•Such periodically synchronization becomes extremely difficult
if the Byzantine failures are allowed.
•This is due to the fact that faulty processors can report different
clock value to different processors.
•Agreement Protocols may help to reach a common clock value.
2.Atomic Commit in Distributed Database:
•DDBS sites must agree whether to commit or abort the
transaction.
•In first Phase, sites execute their part of a distributed
transaction and broadcast their decisions to all other
sites.
•In Second Phase, each site based on what is received
from other sites in the first phase, decides whether to
commit or abort.
Two-phase commit in Distributed
Systems
Motivation: sending money
Single-server: ACID
Distributed transactions?
Two-Phase Commit (2PC)
Safety versus liveness
A correct atomic commit protocol
A correct atomic commit protocol
A correct atomic commit protocol
A correct atomic commit protocol
Distributed Resource
Management
Issues in distributed File Systems,
Mechanism for building distributed file
systems, Design issues in Distributed Shared
Memory, Algorithm for Implementation of
Distributed Shared Memory.
Mechanism for building Distributed
File Systems
1.Mounting:
Amountmechanismallowsthebinding
togetherofdifferentfilenamespacestoform
asinglehierarchicallystructuredname
space.
•Somosttheimportantissuesare:
-Howtokeeptrackofthelocationofremote
data
-Howtominimizecommunicationoverhead
whenaccessingremotedata
-Howtoaccessconcurrentlyremotedataat
severalnodes
Algorithm for Implementation of
Distributed Shared Memory
1.TheCentralServerAlgorithm
2.TheMigrationAlgorithm
3.TheRead-ReplicationAlgorithm
4.TheFull–ReplicationAlgorithm
1. The Central Server Algorithm
•Centralservermaintainsallshareddata:
–Readrequest:returnsdataitem.
–Writerequest:updatesdataandreturnsacknowledgement
message.