FING 1-ModelBroadcast
FING 1-ModelBroadcast
FING 1-ModelBroadcast
Chapter 1 and 2
The Model
Broadcast
Traversal
Wake-up
Paola Flocchini
Distributed Environment
Multiplicity
Autonomy
clock
memory
1+2 =3
computing capabilities
Interaction
typically by
Paola Flocchini exchange of messages
The Model
communication
link entity, node, site ...
(processor, process,
message-passing object ….)
Paola Flocchini
Entity x
registers
In memory:
state(x) value(x)
Possible operations:
- transmission of messages
Paola Flocchini
Entity x
state(x)
Always defined
At any time an entity is in one of these states
Paola Flocchini
External Events
Paola Flocchini
clock ring
Paola Flocchini
message arrival
Paola Flocchini
spontaneous impulse
Paola Flocchini
The reaction of an entity
depends on the event and on its state
Paola Flocchini
Actions
an action is atomic
the activities cannot be interrupted
an action is terminating
the activities must terminate within finite time
Paola Flocchini
Entity Behavior
Rule
State x Event Action
COMPLETE
( (state, event) an action)
Paola Flocchini
System Behavior
B = { B(x) : x E}
Paola Flocchini
Very different rules, states ….
Workstation
Workstation
Workstation
Server
Workstation
role =(workstation/server )
Communication Network:
Paola Flocchini
Communication
Point-to-point Model y
x w
No(x) = out-neighbors of entity x
Ni(x) = in-neighbors of entity x
N(x) = No(x) Ni(x)
z
G = (V, A) V: Entities
A: Arcs defined by N
Paola Flocchini
An entity x can send a message only to its
out-neighbors No(x)
Paola Flocchini
Axioms
x y
Local orientation
Paola Flocchini
Local orientation: more precisely
1
2
3
Send Message to 3
distinct labels
=
(out) port numbers
Paola Flocchini
Local orientation: more precisely
a
2
5
b distinct labels
=
(in) port numbers
Paola Flocchini
Local orientation: more precisely
x y
a 31
x(x,y) y(x,y)
Communication Restrictions
queue
Message Ordering
Paola Flocchini
Restrictions of the model: examples
Communication Restrictions
Bidirectional Links
x, Ni(x) = No(x) =N(x) and
y N(x): x(x,y) = x(y,x)
a d
x a d y a d
b b b b b b
c a
c c a
z a
Paola Flocchini
Restrictions of the model: examples
Reliability Restrictions:
1. Guaranteed delivery:
Any message that is sent will be received uncorrupted
2. Partial Reliability:
There will be no failures
3. Total Reliability:
No failures have occurred nor will occur
…..
Paola Flocchini
Restrictions of the model: examples
Topological restriction:
…..
Knowledge Restrictions
Time restriction:
Synchronized clocks:
All local clocks are incremented by one unit simultaneously
and interval are constant
…..
Paola Flocchini
Complexity measures - Performance
1. Amount of communication
2. Time
Ideal time:
1 unit
Paolaof time to transmit 1 message
Flocchini
Example - Broadcast
Assumptions = Restrictions
By definition of problem
Unique Initiator
Total reliability
Simplifying assumptions
Bidirectional links
G is connected
Otherwise unsolvable
Paola Flocchini
Algorithm FLOOD
The idea: If an entity knows something, it sends the
info to its neighbours
One entity is INITIATOR, the others are SLEEPING
INITIATOR
spontaneously
send(I) to N(x)
SLEEPING
receiving(I)
send(I) to N(x)
Paola Flocchini
The idea: If an entity knows something, it sends
it to its neighbours except the sender
INITIATOR
spontaneously
send(I) to N(x)
SLEEPING
receiving(I)
send(I) to N(x) - {sender}
INITIATOR
spontaneously
send(I) to N(x)
become(DONE)
SLEEPING
receiving(I)
send(I) to N(x) – {sender}
become(DONE)
Paola Flocchini
Algorithm FLOOD
SLEEPING
receiving(I)
send(I) to N(x) – {sender}
become(DONE)
DONE
Paola Flocchini
Algorithm FLOOD
Algorithm for node x:
State If INITIATOR
spontaneously
send(I) to N(x)
become(DONE)
If SLEEPING
receiving(I)
send(I) to N(x) – {sender}
become(DONE)
If DONE
do-nothing
Paola Flocchini
Algorithm for node x:
Event
If INITIATOR
spontaneously
send(I) to N(x)
become(DONE)
If SLEEPING
receiving(I)
send(I) to N(x) – {sender}
become(DONE)
If DONE
do-nothing
Paola Flocchini
Algorithm for node x:
If INITIATOR
spontaneously
send(I) to N(x)
become(DONE) Action
If SLEEPING
receiving(I)
send(I) to N(x) – {sender}
become(DONE)
If DONE
do-nothing
Paola Flocchini
Example
Paola Flocchini
Correctness
Termination
Local Termination: when DONE
Paola Flocchini
Message complexity Worst Case
2m
O(m)
More precisely:
= |N(x)| - 1
|N(x)| = 2m x x s
x
=
Paola Flocchini 2m - (n-1)
Time Complexity - Ideal Time Worst Case
Max{d(x,s)}
x
= eccentricity of s O(n)
Diameter(G) n-1
Paola Flocchini
Time and Events
External events:
spontaneously
receiving
when (clock)
Paola Flocchini
Different delays ---> different executions
Paola Flocchini
Time x Event diagram
Spontaneous event
receiving event
time
x
as seen by an observer
Paola Flocchini
Example: Time x Event diagram of Flooding
x y
Paola Flocchini
z
Example: Time x Event diagram of Flooding
Another execution
x y
Paola Flocchini
z
Knowledge
• Local knowledge LK
P LK(x). x P
• Implicit knowledge IK
P IK(S) if x S: P LK(x). S
x P
• Explicit knowledge EK
P EK(S) if x S: P LK(x).
P P S
P P
Paola Flocchini P P
•Common knowledge CK
P CK(S) if
x S, P LK(x)
x S (x S, P LK(x)) LK(x)
x S ((x S, P LK(x)) LK(x)) LK(x) ...
Paola Flocchini
Examples
Implicit knowledge
I am in a ring
Explicit knowledge
I am in a ring
I am in a ring
I am in a ring I am in a ring
Paola Flocchini
Common knowledge
Paola Flocchini
How to reach common knowledge in FINITE TIME ?
P CK(S) if
x S, P LK(x)
x S (x S, P LK(x)) LK(x)
x S ((x S, P LK(x)) LK(x)) LK(x) ...
muddy forehead
t=3
t=4
Paola Flocchini
Paola Flocchini
??
Paola Flocchini
I see everybody else is clean
Paola Flocchini
t=1
Paola Flocchini
? ?
?
t=1
? ? ?
? ?
? ?
? ? ?
Paola Flocchini
The other didn’t go forward … I must be dirty too !!!!
? ?
t=2
? ? ?
? ?
? ?
? ?
Paola Flocchini
t=2
Paola Flocchini
In general ….
Paola Flocchini
Some types of knowledge
Topological knowledge
Graph type (“G is a ring”...), adjacency matrix of G ...
Metric knowlege
Number of nodes, diameter, eccentricity...
Sense of direction
Information on link labels
Information on node labels
Paola Flocchini
Example: impact of knowledge
Paola Flocchini
Example: The labeled hypercube
1 1 1 1
00 01 0 1
2 2
1 1
2 2 2 100 101
1 1
10 11 2 3 2 3
110 111 2
1 1
3 3
3 3
1 1
2 000 001
3 3 2
2
010 011 2
1 1
Each link between two nodes is labeled
Paola Flocchini by the dimension of the bit
by which the nodes‘ name differ.
1 1
2 100 101
2 3 2 3
110 111 2
1 1
3 3
3 3
1 1
2 000 001
3 3 2
2
010 011 2
1 1
Paola Flocchini
0000 1 1 0001
2
2 34 2 3 4
0010 1 1 0011 2
3 4 3
3 3
1 1 0101
2 0100
3 3 2 4
2
0110 0111 2
1 1
4 4
4
1000 1 1
2 1001
4
2 3 2 3
1010 1 1 1011 2
3 3
4 3 4 3
1 1 1101
2 1100
3 3 2
4 2 4 1111
1110 2
1 1
Paola Flocchini
A hypercube of dimension k has n = 2k nodes
Paola Flocchini
HyperFlood - Efficient Broadcast
Paola Flocchini
Correctness
Paola Flocchini
Correctness
Paola Flocchini
Example: 5 4
8 x
3 8
X= 100010100 5
Y= 110001000 4
3
x
100010100
y
110010100
100000100
100001100
100001000 y
Paola Flocchini
---> the messages create a spanning tree ….
and every node is touched
1 1
2
2 34 2 3 4
1 1 2
3 4 3
3 3
1 1
2
3 3 2 4
2
2
1 1
4 4
4
1 1
2
4
2 3 2 3
1 1 2
3 3
4 3 4 3
1 1
2
3 3 2
4 2 4
2
1 1
Paola Flocchini
Complexity: n-1 (OPTIMAL)
Paola Flocchini
In Special Topologies
Paola Flocchini
Important Facts
Paola Flocchini
E1, E2: different environments
a
a
1 = 2
E1 E2
x y
(x) = (y)
Paola Flocchini
An example
Back to Broadcast …
Paola Flocchini
Lower Bounds for Broadcast
Proof.
m(G) = n. of edges in G
By contradiction.
Let A be an algorithm that broadcasts exchanging
less than m(G) messages (in all executions, and
for any graph G) under those assumption.
Paola Flocchini
G=(V,E)
Let e = (x,y) be such a link.
G
y
x
E1
E2
G G'
y y
x x
G G'
y y
x x
2. Execute flooding