0% found this document useful (0 votes)
2 views

Formal Models - Copy

The document outlines the model of distributed computing, defining a distributed system as a network of nodes that communicate to achieve a common goal. It describes the state transition system (STS) used to model nodes, detailing how nodes process messages and perform computations through defined states and transition functions. Additionally, it explains the evolution of the system through events and configurations, illustrating the execution of distributed algorithms with examples.

Uploaded by

Nikita Kar
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)
2 views

Formal Models - Copy

The document outlines the model of distributed computing, defining a distributed system as a network of nodes that communicate to achieve a common goal. It describes the state transition system (STS) used to model nodes, detailing how nodes process messages and perform computations through defined states and transition functions. Additionally, it explains the evolution of the system through events and configurations, illustrating the execution of distributed algorithms with examples.

Uploaded by

Nikita Kar
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/ 6

Model of Distributed Computing

Q: What is a distributed system?


- Bunch of nodes/processes
- Sending messages over a network
- To solve a common goal (algorithm)

Modelling a Node
A single node has a bunch of neighbours
- Can send & receive messages
- Can do local computations

Model Node by State Transition System (STS)


- Like a finite state machine, except
o Need not be finite
o No input

State Transition System (informal)


A state transition system consists of
- A set of states
- Rule for which state to go from each state (transition function/binary
relation)
- The set of starting states (initial states)
State Transition System (Example)
Example Algorithm:
x: 0
while (x < 2) do
x = x + 1;
endwhile
x: 1

Formally:
- States {X0, X1, X2, X1’}
- Transition function {X0 -> X1, X1 -> X2, X2 -> X1}
- Initial States {X0}

Modelling a Node
State Machine of Node i
- Set of states Qi

Each state consists of


- 1 inbuffer (set)
- 1 outbuffer (set)
- Other data relevant to algorithm

Initial States
- inbuf is empty
State of one Node
Example States

Transition Functions
The state of a node, except outbuf, is called the accessible state of a
node.
Transition function f
• Takes accessible state and gives new state
• Removes at most one message from inbuf in new state
• Adds at zero, one, or more new msgs in outbuf of new state
• Possibly modifies local state
Transition Functions Formally
State of a node is triple <s, I, O>
- s is the local state
- I is inbuf
- O is outbuf
- f state transition function
- f(si, Ii, Oi) -> (si + 1, Ii + 1, Oi + 1)
- Removes at one message m from inbuf
o Ii + 1 = Ii / {m}
- Computes a function f’(si, m) -> (si + 1, {m1, …, mn})
- Adds {m1, …, mn} to outbuf
o Oi + 1 = Oi ∪ {m1, …, mn}

Single Node Perspective


This is how computers in a distributed system works:
- Wait for a message
- When received message, do some local computation, send some
messages
- Goto 1
Is this a correct model?
- Determinism
- Atomicity

Single Node to a Distributed System


A configuration is a snapshot of state of all nodes
- C = (q0, q1, ..., qn – 1) where qi is state of pi
An initial configuration is a configuration where qi is an initial state

The system evolves through events


- Computation event at node i, comp(i)
- Delivery event of msg m from i to j, del(i, j, m)

Computation Event comp(i)


- Apply transition function f on node i’s state

Delivery Event del(i, j, m)


- Move message m from outbuf of pi to inbuf of pi

Execution
An execution is an infinite sequence of
- config0, event1, config1, event2, config2 …
- config0 is an initial configuration

If eventk is comp(i)
- configk – 1 changes to configk by applying pi’s transition function on i’s
state in configk – 1

If eventk is del(i, j, m)
- configk – 1 changes to configk by applying moving m from i’s outbuf to j’s
inbuf

Example Execution

config0 config1 config2

x=1 x=1 x=1

outbuf={m1} outbuf={m1} P1 outbuf={m1}


P1 P1
inbuf={} inbuf={} inbuf={}

Event1 Event2
x=4 del(2,3,m7) x=4 Comp(3) x=1

P2 outbuf={m7}
P2
outbuf={} P2 outbuf={}

inbuf={} inbuf={} inbuf={}

x=11 x=1 x=11

outbuf={} outbuf={} outbuf={m7}


P3 P3 P3
inbuf={} inbuf={m7} inbuf={}

You might also like