Get - Institute of Computer Engineering - Technische Universität Wien
Get - Institute of Computer Engineering - Technische Universität Wien
Get - Institute of Computer Engineering - Technische Universität Wien
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Research Report 38/2004, TU <strong>Wien</strong>, Institut für <strong>Technische</strong> Informatik February 4, 2005<br />
Distributed Construction <strong>of</strong> Fault-Tolerant Overlay<br />
Networks: Propose Modules<br />
Bernd Thallner<br />
<strong>Technische</strong> <strong>Universität</strong> <strong>Wien</strong><br />
Embedded Computing Systems Group E182/2<br />
Treitlstrasse 3, A-1040 Vienna, Austria<br />
Email: thallner@ecs.tuwien.ac.at<br />
Tel: +43-1-58801-18203, FAX: +43-1-58801-18297<br />
February 4, 2005
Abstract<br />
In [TS04] we present a distributed algorithm for constructing a sparse overlay network that<br />
has fixed node-degree and facilitates efficient fault-tolerant multi-hop communication in<br />
large-scale distributed systems. This paper deals with different Propose Modules implementations<br />
and presents simulation results.<br />
3
Chapter 1<br />
Propose Modules<br />
This chapter discusses different propose modules, their implementations and their properties.<br />
A propose module is an independent and highly network-specific part <strong>of</strong> our topology<br />
construction. It can be adapted to various characteristics <strong>of</strong> the underlying wireless network,<br />
e.g. memory consumption, number <strong>of</strong> messages versus message size, size <strong>of</strong> neighborhood<br />
or the reaction time to network changes. Furthermore the propose modules define the quality<br />
(efficiency) <strong>of</strong> the generated overlay network and the complexity <strong>of</strong> construction.<br />
Typically, all propose module implementations use simple search strategies to explore<br />
the search space. The implementations are sometimes complicated since the search is done<br />
entirely message driven, in a distributed way and the required information (edge weights) is<br />
distributed among different nodes. In the following, we present some propose modules with<br />
different properties and analyze their complexity.<br />
Recall that from the description and analysis <strong>of</strong> our algorithm in [TS04], it is apparent<br />
that the propose module is crucial for liveness and performance albeit not for convergence,<br />
correctness and fault-tolerance. In this chapter we discuss some propose modules and their<br />
worst case performance. Propose modules can be classified according to (1) Search space<br />
exploration:<br />
• Perfect: We call a propose module perfect if it eventually infinitly <strong>of</strong>ten generates<br />
a proposal corresponding to a group in the final minimum admissible overlay graph<br />
arbitrary <strong>of</strong>ten. Hence in some scenarios it potentially searches the whole search space.<br />
If there is a perfect propose module on each node and leader we can guarante that<br />
each group <strong>of</strong> the minimal admissible overlay graph is proposed until all groups are<br />
constructed.<br />
• Non-perfect: Propose modules that have a restricted search space (e.g. to achieve low<br />
message complexity) are called non-perfect. Note that the construction <strong>of</strong> the minimal<br />
admissible overlay graph cannot be guaranteed if non-perfect propose modules are<br />
employed.<br />
(2) Distribution<br />
• Global: A propose module is called global if it uses any kind <strong>of</strong> central coordinator<br />
so that group proposals are proposed in a fully serialized order (i.e., with increasing<br />
5
6 CHAPTER 1. PROPOSE MODULES<br />
group weight) or such that former built groups cannot be destroyed through later group<br />
constructions.<br />
• Local: If the group construction is fully distributed, such that suboptimal groups may<br />
be built that have to be destroyed later again, the propose module is called local.<br />
• Locally agreed: A propose module is called locally agreed if the construction is as<br />
concurrent as possible in order to ensure that no group is ever destroyed by later group<br />
constructions.<br />
Note that local, global, and locally agreed propose modules can be either perfect or nonperfect.<br />
1.1 Introduction<br />
We assume that each node knows a subset <strong>of</strong> the edgeset Λ ID ⊂ Λ where its ID is an<br />
edge endpoint: (x, y, w) ∈ Λ ID ⇔ x =ID ∧ y ∈ Π. The edges are undirected, therefore<br />
if (x, y, w) ∈ Λ x → (y, x, w) ∈ Λ x . Note that the edgeset is time-variant. Furthermore,<br />
we assume that each node knows the minimal edge weight: w min = min w (x, y, w) ∈ Λ. A<br />
proposal is released to the topology construction algorithm (received by the topology construction)<br />
if the proposal is stored to the variable P [gid]. Recall, that a proposal P consists<br />
<strong>of</strong> the member set P.Members, the group connection set P.Connections, the terminal node<br />
set P.T erminals and a group weight P.W eight. The propose module implementations require<br />
a unique leader <strong>of</strong> a group, which is the terminal node with the smallest ID, such that<br />
the function leader <strong>of</strong>(gid) can be implemented as min(gid).<br />
In order to keep our code clear we intentionally left out all code for the handling <strong>of</strong> node<br />
crashes and recovery in our propose module implementations. In particular since the propose<br />
modules are not critical for correctness and convergence <strong>of</strong> the topology, a simple solution<br />
for handling node crashes could be to restart the proposal generation upon failure detection.<br />
1.2 Sub-functions<br />
In this section we introduce some basic sub-functions for all remaining propose module<br />
implementation. Our pseudo code notation uses sets (keyword: set) and arrays (keyword:<br />
array). An array a consists <strong>of</strong> elements a 1 , a 2 ,. . . , a i−1 , a i , a i+1 ,. . . , a n , where a[i] refers to<br />
the i-th element a i in a if 0 < i ≤ n. For adding elements at the end <strong>of</strong> the array a we use<br />
the notation a ← a ∪ a n+1 , and checking whether an element a i is in a is donated a i ∈ a. If<br />
the array index i is not an integer, then array is used as an associative array where i as the<br />
corresponding key.<br />
Our propose module algorithms require a communication subsystem without message loss<br />
that provides the primitives send(), if received() and wait for receive.<br />
The function unique id() returns an id, which is unique on the calling node (e.g. a global<br />
counter).<br />
The Figures 1.1 and 1.2 depict the pseudo code implementation <strong>of</strong> function calculate<br />
proposal(). This function calculates for a given set <strong>of</strong> members fix and an edgeset edges
1.2. SUB-FUNCTIONS 7<br />
the complete group information consisting <strong>of</strong> the group connections P.Connections, the terminal<br />
node set P.T erminals, and the group weight P.W eight. If fetch missing edges is<br />
enabled, required edges still missing in edges are fetched from the corresponding nodes via<br />
GET EDGES messages, whereas if disabled, missing edges are assumed to have minimum<br />
edge weight k (line 7-14). The function checks all possible combinations for connecting<br />
the group members via terminal nodes and returns the cheapest alternative. The functions<br />
source() and destination() assign the terminal nodes to the connection (line 46-55 and 58-<br />
67). If all connections are created (line 26), the terminal set is calculated (line 31-38). If<br />
the calculated weight is smaller than min weight it is adjusted according to Definition 1<br />
in [TS04] (line 18). The complexity <strong>of</strong> this function depends only on k.<br />
0 global P out ←⊥<br />
1<br />
2 function calculate proposal ( array fix, min weight,set edges, fetch missing edges)<br />
3<br />
4 P out .Connections←∅, P out .T erminals←∅, P out .W eight←∞<br />
5 set t = {∃x : x ′ ∈ fix : x ∈ x ′ }<br />
6<br />
7 for x ∈ t /∗ complete edge set ∗/<br />
8 if fetch missing edges = true ∧ t \ {y : (x, y, w) ∈ edges} ≠ ∅<br />
9 tag←unique id()<br />
10 send (GET EDGES, t \ {y : (x, y, w) ∈ edges}, tag) to x<br />
11 wait for reply (EDGES, edges in , tag in ) from x with tag in = tag<br />
̸<br />
12 edges←edges ∪ edges in<br />
13 else<br />
14 edges←edges ∪ {(x, y, w min ) : y ∈ t∧ ∃w : (x, y, w) ∈ edges}<br />
15<br />
16 source(1, 2, ∅, 0, fix, edges)<br />
17 if P out .W eight < min weight<br />
18 P out .W eight←min weight + ɛ<br />
19 return P out<br />
20<br />
21 if received request (GET EDGES, nodes, tag) from j<br />
22 reply (EDGES, {(x, y, w) ∈ Λ ID : x =ID, y ∈ nodes}, tag) to j<br />
Figure 1.1. First part <strong>of</strong> the pseudo code for function calculate proposal().<br />
Figure 1.3 depicts the function potential member set(). This function calculates a set pms<br />
consisting <strong>of</strong> nodes and groups <strong>of</strong> ps, which allow to build groups with the members in fix,<br />
and with less weight than bound. The value edges is the set <strong>of</strong> edges known to the function.<br />
First <strong>of</strong> all, if filter is true, nodes are removed with id lower than the id <strong>of</strong> the smallest<br />
node in fix. This is done to avoid multiple searches for the same proposal by different<br />
propose modules (line 72-75). Then, all nodes and groups are added to pms which allows to<br />
build groups with lower weights below bound (line 80-84). After that, nodes and groups are<br />
removed from pms set for which no group <strong>of</strong> k members from pms exists (line 86-89). The<br />
worst case complexity for this function is O(|ps| k ).<br />
Figures 1.4 shows the implementation <strong>of</strong> the function get group ids(). The function takes
8 CHAPTER 1. PROPOSE MODULES<br />
23 function source(a, b,set connections, weight,array fix,set edges) /∗ find connection source ∗/<br />
24 c with c.from, c.to<br />
25<br />
26 if a = |fix| − 1 ∧ b = |fix| /∗ all internal connections are built ∗/<br />
27 if P out .W eight > weight<br />
28 P out .W eight←weight<br />
29 P out .Connections←connections<br />
30 P out .T erminals←⊥<br />
31 for i ∈ fix /∗ calculate terminal nodes ∗/<br />
32 if i ∈ Π<br />
33 P out .T erminals←P out .T erminals ∪ i<br />
34 else<br />
35 set terminal←i<br />
36 for j ∈ connections<br />
37 terminal←terminal \ (j.from ∪ j.to)<br />
38 P out .T erminals←P out .T erminals ∪ terminal<br />
39 return<br />
40<br />
41 if b = |fix| /∗ next source/destination pair ∗/<br />
42 a←a + 1<br />
43 b←a<br />
44 b←b + 1<br />
45<br />
46 if fix[a] ∈ Π<br />
47 c.from←fix[a]<br />
48 destination (a, b, connections, weight, fix, edges, c)<br />
49 else<br />
50 set available terminals←fix[a] /∗ probe all source terminals ∗/<br />
51 for i ∈ connections<br />
52 available terminals←available terminals \ (i.from ∪ i.to)<br />
53 for i ∈ available terminals<br />
54 c.from←i<br />
55 destination (a, b, connections, weight, fix, edges, c)<br />
56<br />
57 function destination (a, b,set connections, weight,array fix,set edges, c) /∗ find destination ∗/<br />
58 if fix[b] ∈ Π<br />
59 c.to←fix[b]<br />
60 source(a, b, connections ∪ c, weight + w : (c.from, c.to, w) ∈ edges, fix, edges)<br />
61 else /∗ probe all destination terminals ∗/<br />
62 set available terminals←fix[b]<br />
63 for i ∈ connections<br />
64 available terminals←available terminals \ (i.from ∪ i.to)<br />
65 for i ∈ available terminals<br />
66 c.to←i<br />
67 source(a, b, connections ∪ c, weight + w : (c.from, c.to, w) ∈ edges, fix, edges)<br />
Figure 1.2. Second part <strong>of</strong> function calculate proposal().<br />
a set <strong>of</strong> nodes ps and returns a set which contains all group ids <strong>of</strong> higher level groups <strong>of</strong> the<br />
nodes in ps. The maximum number <strong>of</strong> nodes in the set ps is n and the maximum number <strong>of</strong><br />
groups in G ′ is ⌊ n−1<br />
k−1⌋<br />
= O(n) by Theorem 4 in [TS04] , therefore the function has a worst
1.3. LOCAL PERFECT PROPOSE MODULE 9<br />
68 function potential member set ( array fix,set ps,set edges, bound, filter)<br />
69 set pms←⊥<br />
70<br />
71 if filter<br />
72 if fix ∩ Π ≠ ∅ /∗ avoid duplicate solutions, from multiple nodes in the same proposal ∗/<br />
73 for i ∈ ps<br />
74 if (i ∈ Π) ∧ (i < min(fix ∩ Π))<br />
75 ps←ps \ i<br />
76<br />
77 ps←ps \ {x ∈ ps : x ′ ∈ x : y ∈ fix : y ′ ∈ y : x ′ = y ′ }<br />
78 /∗ remove members in ps already member or submember in fix ∗/<br />
79<br />
80 for i ∈ ps /∗ add potential candidates to pms for a group with | fix |+1 members<br />
81 and smaller group weight than bound ∗/<br />
82 P ′ ←calculate proposal(fix ∪ {i}, 0, edges, false)<br />
83 if P ′ .W eight ≤ bound<br />
84 pms←pms ∪ {i}<br />
85<br />
86 if k − |fix| > 1 /∗ remove candidates from pms for which no group with k members exist ∗/<br />
87 for i ∈ pms<br />
88 if |potential member set(fix ∪ {i}, pms \ {i}, edges, bound, false)| < k − |fix| − 1<br />
89 pms = pms \ {i}<br />
90<br />
91 return pms<br />
Figure 1.3. Pseudo code for function potential member set().<br />
case message complexity <strong>of</strong> O(n 2 ) and the worst case time complexity <strong>of</strong> 1 + ⌊ n−1<br />
k−1⌋<br />
+ 1,<br />
hence O(n).<br />
1.3 Local Perfect Propose Module<br />
In this section we present a local perfect propose module. We start with the following<br />
definitions:<br />
Definition 1. Let (G ′ ) e be an incomplete built overlay graph at time e. A local propose<br />
module on a node or on the leader <strong>of</strong> a group gid at time e generates a proposal consisting<br />
<strong>of</strong> gid and members in (G ′ ) e .<br />
This property reduces the search space since only proposals which include the initial<br />
node/group gid are built.<br />
Definition 2. A propose module is perfect, if it eventually generates infinitly <strong>of</strong>ten a proposal<br />
which corresponds to a group in the minimal admissible overlay graph.<br />
Note that, in some scenarios each perfect propose module eventually has to search the<br />
whole search space.
10 CHAPTER 1. PROPOSE MODULES<br />
92 function get group ids (ps)<br />
93 array tags<br />
94<br />
95 for x ∈ ps /∗ fetch all group ids <strong>of</strong> nodes in ps ∗/<br />
96 tags[x]←unique id()<br />
97 send (GET GROUP IDS, {x},ID, x, x, tags[x]) to x<br />
98<br />
99 while ps ≠ ∅<br />
100 wait for receive (GROUP IDS, group ids, x, tag) with x ∈ ps ∧ tag = tags[x]<br />
101 pms←pms ∪ group ids<br />
102 ps←ps \ {x}<br />
103<br />
104 return pms<br />
105<br />
106 if received (GET GROUP IDS, group ids, source, x, gid, tag)<br />
107<br />
108 if Group[gid].P arentID ≠⊥<br />
109 send (GET GROUP IDS, group ids ∪ {Group[gid].P arentID}, source, x, Group[gid].P arentID, tag) \\<br />
110 to leader <strong>of</strong> (Group[gid].P arentID)<br />
111 else<br />
112 send (GROUP IDS, group ids, x, tag) to leader <strong>of</strong>(source)<br />
Figure 1.4. Pseudo code for get group ids() function.<br />
Our implementation <strong>of</strong> a local perfect propose module is based upon the following idea:<br />
To make a proposal, the propose module <strong>of</strong> a node/group leader gid adds itself to a list<br />
<strong>of</strong> proposed members and calculates its potential member set pms gid . This set contains all<br />
nodes/groups that are candidates for forming a group with less weight than its current parent<br />
group. Then, gid sends a SEARCH message to all nodes/leaders in the potential member<br />
set. Every node/leader j receiving such a SEARCH message does the same as gid (except<br />
that it bases the calculation <strong>of</strong> its pms j upon pms gid instead <strong>of</strong> (G ′ ) e gid ). This process <strong>of</strong><br />
forwarding is repeated k −1 times or the potential member set becomes empty. In the former<br />
case, a RESULT message containing the proposed members set is sent back to the originator<br />
gid. Otherwise, an extinction notification for this particular forwarding “thread” is sent. The<br />
proposal comprising the members <strong>of</strong> the RESULT message with the lowest group weight is<br />
eventually proposed by gid.<br />
The pseudo code <strong>of</strong> the perfect local propose module is depicted in Figure 1.5. The global<br />
value reply set stores for each search step (fix) the nodes/groups to which a SEARCH message<br />
has been sent, and in best proposal the currently best received proposal for this search<br />
step is stored (line 113).<br />
The initiator initiates pms with its potential member set pms and their corresponding<br />
parent group ids and starts the search with a SEARCH messages to itself. If a node or<br />
leader receives a SEARCH messages, it sets the minimal weight according to Definition 1<br />
in [TS04] (line 128) and reduces the bound if its current group weight is lower than bound<br />
(line 130). If the number <strong>of</strong> group members (|fix|) is k, this search branch is completed<br />
and a RESULT message is sent back to the predecessor (line 134-138). If the proposal is not
1.3. LOCAL PERFECT PROPOSE MODULE 11<br />
113 set reply set,set best proposal<br />
114<br />
115 procedure local perfect proposal (gid)<br />
116 bound←∞<br />
117<br />
118 if Group[gid].P arentID ≠⊥<br />
119 bound←Group[Group[gid].P arentID].W eight<br />
120 set pms←potential member set({gid}, Π, Λ ID , bound, true)<br />
121 pms←get group ids(pms);<br />
122<br />
123 send (SEARCH, {gid}, pms, bound, 0, ∅, gid) to leader <strong>of</strong>(gid)<br />
124<br />
125 if received (SEARCH,array fix,set ps, bound, min weight,set relevant edges, gid)<br />
126 reply set[fix]←∅, best proposal[fix]←⊥<br />
127<br />
128 if min weight < Group[gid].W eight /∗ store minimal possible group weight ∗/<br />
129 min weight←Group[gid].W eight<br />
130 if Group[gid].P arentID ≠⊥ ∧ Group[Group[gid].P arentID].W eight < bound<br />
131 bound←Group[Group[gid].P arentID].W eight /∗ store maximum possible group weight ∗/<br />
132<br />
133 if min weight < bound<br />
134 if |fix| = k /∗ proposal is complete ∗/<br />
135 P ′ ←calculate proposal(fix, min weight, relevant edges ∪ Λ ID , true)<br />
136 if P ′ .W eight > bound<br />
137 P ′ ←⊥<br />
138 send (RESULT, P ′ , gid, ⋃ |fix|−1<br />
x=1<br />
fix[x]) to leader <strong>of</strong>(fix[|fix| − 1])<br />
139 return<br />
140 else /∗ calculate next member ∗/<br />
141 for x ∈ ps<br />
142 set pms←potential member set(fix ∪ {x}, ps \ {x}, relevant edges ∪ Λ ID , bound, true)<br />
143 if |pms| + |fix ∪ {x}| ≥ k<br />
144 send (SEARCH, fix ∪ {x}, pms, bound, relevant edges ∪ \\<br />
145 {(x, y, w) ∈ Λ ID : x ∈ID ∧ y ∈ {z : z ′ ∈ fix : z ∈ z ′ }}, x) to leader (x)<br />
146 reply set[fix]←reply set[fix] ∪ {x}<br />
147 if reply set[fix] = ∅ ∧ |fix| > 1<br />
148 send (RESULT, ⊥, gid, ⋃ |fix|−1<br />
x=1<br />
fix[x]) to leader <strong>of</strong>(fix[|fix| − 1])<br />
149<br />
150 if received (RESULT, P ′ , j,array fix)<br />
151 if P ′ ≠⊥ ∧ (best proposal(fix) =⊥ ∨ best proposal(fix).W eight > P ′ .W eight)<br />
/∗ store current best proposal ∗/<br />
152 best proposal(fix)←P ′<br />
153<br />
154 reply set[fix]←reply set[fix] \ {j}<br />
155 if reply set[fix] = ∅ /∗ if all RESULT messages received, send best proposal ∗/<br />
156 if |fix| = 1<br />
157 P [gid]←best proposal(fix) /∗ release proposal ∗/<br />
158 else /∗ send proposal to predecessor ∗/<br />
159 send (RESULT, best proposal(fix), fix[|fix|], ⋃ |fix|−1<br />
x=1<br />
fix[x]) to leader <strong>of</strong>(fix[|fix| − 1])<br />
Figure 1.5. Pseudo code for perfect local propose module.
12 CHAPTER 1. PROPOSE MODULES<br />
completed, node/leader gid calculates its potential member set pms based on the received ps<br />
set and sends a SEARCH message to all nodes/leaders in the new pms set. Thereby gid adds<br />
itself to fix and includes some edges to the relevant edge set, to improve future search (line<br />
140 to 145). Each node/group to which a SEARCH messages is sent is added to the reply set<br />
(line 146) in order to determine when all RESULT messages are received. If no SEARCH<br />
message is sent an empty RESULT message is immediately sent back to the predecessor (line<br />
147-148).<br />
If a node or leader receives a RESULT message, it checks whether this result is better than<br />
the currently best proposal and if so, stores it in best result (line 152). When all results are<br />
received either the best result is sent to the predecessor (line 159) or it is released as new<br />
proposal (line 157).<br />
Lemma 1. The worst case message complexity <strong>of</strong> the local perfect propose module<br />
generating a single proposal is O(n k−1 ).<br />
for<br />
Pro<strong>of</strong>. Let (G ′ ) e gid be the incompletely built overlay graph at time e as perceived by node<br />
gid. The worst case message complexity <strong>of</strong> the initialization (potential member set() and<br />
get group ids()) is O(n 2 ). Since the maximum number <strong>of</strong> nodes is n and the maximum<br />
number <strong>of</strong> groups is ⌊ n−1<br />
k−1⌋<br />
, the pms set in line 123 and therefore the maximum number <strong>of</strong><br />
recipients <strong>of</strong> a SEARCH message is n + ⌊ n−1<br />
k−1⌋<br />
. In the worst case the SEARCH and RESULT<br />
messages are sent to every node/leader so we obtain a message complexity <strong>of</strong> at most O(n 2 )+<br />
2 · ∑k−1<br />
i=0 (n + ⌊ n−1<br />
k−1⌋<br />
) i = O(n k−1 ).<br />
Lemma 2. The worst case time complexity <strong>of</strong> the local perfect propose module for generating<br />
a single proposal is O(n).<br />
Pro<strong>of</strong>. Analogous to the pro<strong>of</strong> <strong>of</strong> Lemma 1 the worst case time complexity for the initialization<br />
is O(n). In the search phase, in worst case, each SEARCH and RESULT message is<br />
forwarded k − 1 times, resulting in a time complexity <strong>of</strong> 2 · (k − 1) = O(1). Hence the<br />
claimed time complexity <strong>of</strong> O(n).<br />
Theorem 1. There are at most ∏⌊ n−k<br />
k−1<br />
i=0<br />
for a given graph G.<br />
⌋<br />
( n−i·(k−1)<br />
)<br />
k different admissible overlay graphs G<br />
′<br />
Pro<strong>of</strong>. For the first group there are ( n<br />
k)<br />
different combinations. A group removes k members<br />
and adds a new possibility, therefore for the second group there are ( )<br />
n−(k−1)<br />
k combinations,<br />
the third has ( )<br />
n−2·(k−1)<br />
k combinations and so on. Multiplying all possible combinations, we<br />
have a maximum <strong>of</strong> ∏⌊ ⌋<br />
n−k (<br />
k−1 n−i·(k−1)<br />
)<br />
i=0 k different admissible overlay graphs G ′ for a given<br />
graph G.<br />
Theorem 2. The worst case message and time complexity for generating a minimal admissible<br />
overlay network G ′ with the regular topology construction algorithm using local perfect<br />
propose modules is O(n k·n ).
1.4. LOCAL NON-PERFECT PROPOSE MODULE 13<br />
Pro<strong>of</strong>. Assume that the proposal from a local perfect propose module which correspond to a<br />
global minimal group is delayed and many other proposals are released. Furthermore assume<br />
that the edge weights are assigned so that there exists an order for building admissible graphs<br />
so that a bulk <strong>of</strong> the possible admissible graphs from Theorem 1 can be constructed if the<br />
proposals are generated according to this order. So until the first globally perfect and therefore<br />
final group is built not more than ∏⌊ ⌋<br />
n−k (<br />
k−1 n−i·(k−1)<br />
) ∏<br />
i=0 k = O( n−k<br />
( n<br />
) (<br />
i=0 k ) = O( n<br />
) n<br />
) =<br />
k<br />
O((n k ) n ) = O(n k·n ) admissible graphs can be constructed. The complexity for building<br />
a non minimal admissible graph ⌊ n−1<br />
k−1⌋<br />
= O(n), the complexity for generating a proposal<br />
(Lemma 1 or 2) and the complexity for building the missing groups <strong>of</strong> the minimal admissible<br />
graph ⌊ n−1<br />
k−1⌋<br />
= O(n) can be neglected.<br />
1.4 Local Non-Perfect Propose Module<br />
This section presents a deterministic implementation <strong>of</strong> a local non-perfect propose module.<br />
We use a depth first search for finding proposals. Rather than to all nodes/leaders in<br />
the potential member set, as in the local perfect propose module, a node/leader sends the<br />
SEARCH message only to the node/group corresponding to its lowest-weight edge.<br />
The pseudo code for the local non-perfect propose module is given in Figure 1.6. The<br />
node/leader that initiates the search, sends a SEARCH message to itself. The array fix contains<br />
the for each search step i an array <strong>of</strong> the current memebers fix[i], hence fix is a<br />
array <strong>of</strong> arrays. Each node/leader, which receives a SEARCH message, first <strong>of</strong> all calculates<br />
the weight <strong>of</strong> the group with the current members (fix, line 167) and checks if the current<br />
bound (bound2) is not exceeded (line 173).<br />
If the number <strong>of</strong> members (fix) is k, a RESULT message is sent back to the initial<br />
node/leader. If the number <strong>of</strong> members is lower, the potential member set pms—based on<br />
the last received potential set ps—is calculated. If pms is large enough to build a complete<br />
group, a SEARCH message is sent to the node corresponding to the lowest-weight edge (line<br />
177-185).<br />
If the bound is exceeded or the pms was too small, the SEARCH message is forwarded to<br />
either the parent group (line 189) if it exists, or to the previous entry in fix (line 195). Each<br />
time a search message is sent the excluded set is extended by the current node/group (gid),<br />
so that each node/group is tried only once.<br />
Lemma 3. The worst case message complexity <strong>of</strong> our local non-perfect propose module for<br />
generating a single proposal is O(n).<br />
Pro<strong>of</strong>. Let (G ′ ) e gid be the incompletely built overlay graph at time e as viewed by node gid.<br />
Due to DFS search, each <strong>of</strong> the at most n + ⌊ n−1<br />
k−1⌋<br />
nodes/leaders is asked only once for the<br />
participation in the member set <strong>of</strong> the new proposal and only generates a single SEARCH<br />
or RESULT message. Therefore the worst case message complexity for generating a single<br />
proposal is hence at most 2 · (n + ⌊ n−1<br />
k−1⌋<br />
) = O(n).<br />
Lemma 4. The worst case time complexity <strong>of</strong> the local non-perfect propose module for<br />
generating a single proposal is O(n).
14 CHAPTER 1. PROPOSE MODULES<br />
160 procedure local non-perfect proposal(gid)<br />
161 send (SEARCH, ∅, {Π}, {gid}, {∞}, {0}, ∅, gid) to leader <strong>of</strong>(gid)<br />
162<br />
163 if received (SEARCH,array fix,array ps,array excluded, \\<br />
164 array bound,array min weight,set relevant edges, gid)<br />
165<br />
166 P ′ ←calculate proposal(fix[|fix|] ∪ {gid}, max(min weight ∪ {Group[gid].W eight}), \\<br />
167 relevant edges ∪ Λ ID , true)<br />
168<br />
169 bound2←bound[|fix|]<br />
170 if Group[gid].P arendID ≠⊥<br />
171 bound2←min(bound2, Group[Group[gid].P arentID].W eight)<br />
172<br />
173 if P ′ .W eight < bound2<br />
174 if |P ′ .Members| = k /∗ send back final result ∗/<br />
175 send (RESULT, P ′ ) to leader <strong>of</strong>(fix[|fix|][1])<br />
176 exit<br />
177 else if |P ′ .Members| < k /∗ calculate next search step ∗/<br />
178 set pms←potential member set(fix ∪ {gid}, ps[|ps|] \ (excluded ∪ {gid}), \\<br />
179 relevant edges ∪ Λ ID , bound2)<br />
180 if |fix ∪ {gid} ∪ pms| ≥ k<br />
181 set j←y : min w (x, y, w) ∈ Λ ID : x ∈ID∧y ∈ {z : ∃z ′ ∈ pms : z ∈ z ′ }<br />
182 send (SEARCH, fix ∪ {fix[|fix|] ∪ {gid}}, ps ∪ {pms}, excluded ∪ {gid}, bound∪ \\<br />
183 {bound2}, min weight ∪ {Group[gid].W eight}, relevant edges∪ \\<br />
184 {(x, y, w) ∈ Λ ID : x =ID∧y ∈ {z : ∃z ′ ∈ fix : z ∈ z ′ }}, j) to leader <strong>of</strong>(j)<br />
185 exit<br />
186<br />
187 if Group[gid].P arentID ≠⊥ /∗ forward search to parent group ∗/<br />
188 send (SEARCH, fix, ps, excluded ∪ {gid}, bound, min weight, relevant edges, \\<br />
189 Group[gid].P arentID) to leader <strong>of</strong>(Group[gid].P arentID)<br />
190 else /∗ send back search ∗/<br />
191 if |fix| > 1<br />
192 fix2←fix[|fix|]<br />
193 send (SEARCH, ⋃ |fix|−1<br />
x=1<br />
fix[x], ⋃ |ps|−1<br />
x=1<br />
ps[x], excluded ∪ {gid}, \\<br />
⋃ |bound|−1<br />
194<br />
x=1<br />
bound[x], ⋃ |min weight|−1<br />
x=1<br />
min weight[x], relevant edges, fix2[|fix2|]) \\<br />
195 to leader <strong>of</strong> (fix2[|fix2|])<br />
196<br />
197 if received (RESULT, P ′ )<br />
198 P [gid]←P ′ Figure 1.6. Pseudo code for non-perfect local propose module.<br />
Pro<strong>of</strong>. Since by Lemma 3 in the worst case only O(n) messages are sent, the worst case<br />
time complexity cannot be larger than O(n).<br />
Theorem 3. The worst case message and time complexity for generating an admissible overlay<br />
network G ′ with the regular topology construction algorithm using local non-perfect<br />
propose modules is O(n k·n ).<br />
Pro<strong>of</strong>. The pro<strong>of</strong> is analogous to the pro<strong>of</strong> <strong>of</strong> Theorem 2.
1.5. GLOBAL PROPOSE MODULES 15<br />
A major disadvantage <strong>of</strong> the purely local propose modules is the unsatisfying worst case<br />
complexity for constructing the topology, caused by the fully distributed way <strong>of</strong> construction.<br />
In the next sections we introduce propose modules that avoid this problem.<br />
1.5 Global Propose Modules<br />
Definition 3. Let (G ′ ) e be an incompletely built overlay graph at time e, then a global propose<br />
module at time e returns the best proposal <strong>of</strong> all local propose modules and consisting<br />
<strong>of</strong> members in (G ′ ) e .<br />
A single node (in our case the one with the lowest id) is used to collect all proposals from<br />
the local propose modules. Only the minimal proposal is returned by the global propose<br />
module.<br />
The implementation <strong>of</strong> the global propose module in Figure 1.7 is straight forward and<br />
simply returns the minimum proposal <strong>of</strong> the received local perfect or non-perfect propose<br />
modules.<br />
199 define local proposal (gid) ← local perfect proposal (gid) or local non−perfect proposal(gid)<br />
200<br />
201 function global proposal (gid)<br />
202 set ps←Π, array tags, P ′ ←⊥<br />
203<br />
204 P ′ .W eight←∞<br />
205 if gid = min(Π)<br />
206 ps←get group ids(ps);<br />
207<br />
208 for x ∈ ps /∗ request all local proposals from nodes/leaders in ps ∗/<br />
209 tags[x]←unique id()<br />
210 send (REQUEST, gid, x, tags[x]) to leader <strong>of</strong>(x)<br />
211<br />
212 while ps ≠ ∅<br />
213 wait for receive (REPLY, P ∗ , x, tag) with x ∈ ps ∧ tag = tags[x]<br />
214 if P ∗ .W eight < P ′ .W eight<br />
215 P ′ ←P ∗<br />
216 ps←ps \ {x}<br />
217<br />
218 return P ′<br />
219<br />
220<br />
221 if received (REQUEST, source, gid, tag) /∗ return local proposal ∗/<br />
222<br />
223 P [gid]←⊥<br />
224 local proposal (gid)<br />
225 wait for P [gid] ≠⊥<br />
226 send (REPLY, P [gid], gid, tag) to leader <strong>of</strong>(source)<br />
Figure 1.7. Pseudo code for the global propose module.<br />
The node with the lowest id initiates ps with the nodeset and all group ids and then
16 CHAPTER 1. PROPOSE MODULES<br />
sends a REQUEST message to all nodes and leaders (line 210). If a node/leader receives<br />
a REQUEST message it returns a REPLY message with its local proposal (either local<br />
perfect proposal(gid) or local non perfect proposal(gid)) to the originator (line 221-<br />
226). When all local group proposals are received (REPLY messages), the minimal one is<br />
returned.<br />
Lemma 5. The worst case message complexity <strong>of</strong> our global propose module for generating<br />
a single non-perfect resp. perfect global proposal is O(n 2 ) resp. O(n k ).<br />
Pro<strong>of</strong>. In the worst case the initiation required O(n 2 ) messages from the get group ids()<br />
function. Each <strong>of</strong> the at most n+ ⌊ n−1<br />
k−1⌋<br />
= O(n) nodes/leaders generates a single non-perfect<br />
resp. perfect proposal, using at most O(n) resp. O(n k−1 ) messages each. Additionally the<br />
central coordinator node causes O(2 · (n + ⌊ n−1<br />
k−1⌋<br />
)) = O(n) REQUEST/REPLY messages.<br />
Hence the claimed overall message complexity follows: O(n 2 + n + n · n) = O(n 2 ) resp.<br />
O(n 2 + n + n · (n k−1 ) = O(n k ).<br />
Lemma 6. The worst case time complexity <strong>of</strong> the global propose module for generating a<br />
single non-perfect resp. perfect global proposal is O(n).<br />
Pro<strong>of</strong>. The GET GROUP IDS() function as well as the REQUEST/REPLY phase cause a worst<br />
case time complexity <strong>of</strong> O(n). Together with the time complexity <strong>of</strong> the local propose modules<br />
O(n) by Lemma 4 and 2 the worst case time complexity <strong>of</strong> O(3·n) = O(n) follows.<br />
In sharp contrast to local propose modules, we obtain only polynomial message complexity<br />
for constructing the topology here:<br />
Theorem 4. The worst case global message complexity for constructing the non-minimal<br />
resp. minimal admissible overlay network G ′ with the regular topology construction algorithm<br />
and the global propose module using non-perfect respectively perfect local propose<br />
module is O(n 3 ) respectively O(n k+1 ).<br />
Pro<strong>of</strong>. Obviously, the global propose module causes the topology tree to be constructed in<br />
the order <strong>of</strong> the minimum-weight groups. Hence, no existing group is ever destroyed later<br />
on, recall Definition 1 in [TS04] and Theorem 6 in [TS04] . By Theorem 4 in [TS04] , there<br />
are ⌊ n−1<br />
k−1⌋<br />
= O(n) groups to be built, and the worst case complexity for a global proposal is<br />
O(n 2 ) resp. O(n k ) by Lemma 5.<br />
Theorem 5. The worst case construction time for the non-minimal resp. minimal admissible<br />
overlay network G ′ with the regular topology construction algorithm and the global propose<br />
module using non-perfect resp. perfect local propose module is O(n 2 ).<br />
Pro<strong>of</strong>. By Theorem 4 in [TS04] , there are ⌊ n−1<br />
k−1⌋<br />
= O(n) groups to be built, and the worst<br />
time complexity for a global proposal is O(n) by Lemma 6. Hence the claimed time complexity<br />
follows.<br />
The obvious drawback <strong>of</strong> the global propose module is that the topology is constructed in<br />
a fully serialized way. Independent parts <strong>of</strong> the overlay network cannot be constructed in parallel.<br />
In the next section we introduce a locally agreed propose module, which circumvents<br />
this problem.
1.6. LOCALLY AGREED PROPOSE MODULE 17<br />
1.6 Locally Agreed Propose Module<br />
The locally agreed propose module permits concurrent group construction <strong>of</strong> parts where<br />
this is feasible without reconstructing groups and serializes the topology construction in parts<br />
where independent construction is not possible.<br />
Definition 4. Let (G ′ ) e be an incompletely built overlay graph at time e, then a group corresponding<br />
to a proposal generated by a locally agreed propose module is not destroyed<br />
through later group constructions if the incompletely built overlay graph (G ′ ) e and the communication<br />
graph G remain stable.<br />
The locally agreed propose module is based upon two sets: L and L ′ . Initially each<br />
node/leader gid generates its own local proposal P ∗ [gid] and the corresponding L[gid] and<br />
L ′ [gid] sets. In L[gid] all nodes/groups are stored, which allow building a group with a<br />
weight below P ∗ [gid].W eight, therefore all nodes/leaders in this set have to be asked if they<br />
have a proposal with less weight than P ∗ [gid].W eight. Set L ′ [gid] contains all nodes/leader<br />
from L that have confirmed that P ∗ has a lower weight than their current local proposal.<br />
Each node/leader gid forwards the PROPOSAL message, consisting <strong>of</strong> P ∗ [gid], L[gid] and<br />
L ′ [gid], to any node/leader in L[gid] \ L ′ [gid]. If a PROPOSAL message with a lower weight<br />
proposal is received, the variables P ∗ , L and L ′ are taken over and L is extended with all<br />
nodes/groups that have to be asked additionally. If L[gid] = L ′ [gid], all potential candidates<br />
for a group with lower weight than P ∗ confirmed that this P ∗ [gid] is the minimal one, thus<br />
the proposal is released.<br />
Figure 1.8 depicts the pseudo code for the locally agreed propose module. Each<br />
node/leader periodically calls the function locally agreed proposal() and initiates the search<br />
for a new proposal with an empty PROPOSAL message to itself (line 231).<br />
If a node or leader receives a PROPOSAL message and P ∗ [gid] is empty, it first generates<br />
its local perfect or non-perfect proposal P ∗ [gid] and the corresponding set L and L ′ (line<br />
235-238). If the received proposal Pin ∗ is equal to the local proposal, the sets <strong>of</strong> L and L′<br />
are merged (line 241-244). Whereas, if Pin ∗ has lower weight than the local proposal, it is<br />
taken over and set L is extended with nodes/leaders that have to be asked additionally (line<br />
244-249) and set L ′ with nodes/groups that have been asked already.<br />
If, after that, L[gid] is equal to L ′ [gid] all potential nodes/groups for a group with weight<br />
below P ∗ [gid] confirmed that P ∗ [gid] is minimal. The proposal P ∗ [gid] can be released and<br />
all nodes/groups in L ′ [gid] have to set P ∗ to ⊥ and start the search for the next proposal<br />
(initiated by an empty PROPOSAL message, line 251-261 and 267-269). If L[gid] ≠ L ′ [gid],<br />
the PROPOSAL message is sent to any node/leader in L[gid] which is not in L ′ [gid] (line<br />
263-265). If the received proposal has a higher weight nothing is done.<br />
Lemma 7. The worst case message complexity <strong>of</strong> the locally agreed propose module for<br />
generating a single non-perfect resp. perfect proposal is O(n 2 ) resp. O(n k ).<br />
Pro<strong>of</strong>. Let (G ′ ) e be the incompletely built overlay graph at time e. Each <strong>of</strong> the at most n +<br />
⌊ n−1<br />
k−1⌋<br />
= O(n) nodes/leaders generate a single local non-perfect resp. perfect proposal, using<br />
at most O(n) resp. O(n k−1 ) messages each. In the worst case L for the lowest local proposal
18 CHAPTER 1. PROPOSE MODULES<br />
227 define local proposal (gid) ← local perfect proposal (gid) or local non−perfect proposal(gid)<br />
228 P ∗ [gid]←⊥, set L[gid]←⊥, set L ′ [gid]←⊥<br />
229<br />
230 procedure locally agreed proposal (gid) /∗ periodically initiate search for new proposal ∗/<br />
231 send (PROPOSAL, ⊥, ∅, ∅, gid) to leader <strong>of</strong>(gid)<br />
232<br />
233 if receive (PROPOSAL, Pin ∗ in, set L ′ in , gid)<br />
234<br />
235 if P ∗ [gid] =⊥ /∗ generate local proposal for gid ∗/<br />
236 P ∗ [gid]←local proposal(gid)<br />
237 L[gid]←potential member set({gid}, Π, Λ ID , P ∗ [gid].W eight, false)∪{gid}<br />
238 L ′ [gid]←{gid}<br />
239<br />
240 if Pin ∗ =⊥ ∨ P in ∗ .W eight ≤ P ∗ [gid].W eight<br />
241 if Pin ∗ = P ∗ [gid] /∗ merge proposals ∗/<br />
242 L[gid]←L[gid] ∪ L in<br />
243 L ′ [gid]←L ′ [gid] ∪ L ′ in<br />
244 else if Pin ∗ ≠⊥ /∗ adopt proposal ∗/<br />
245 P ∗ [gid]←Pin<br />
∗<br />
246 L[gid]←L in ∪ potential member set({gid}, Π, Λ ID , P ∗ [gid].W eight, false)<br />
247 if Group[gid].P arentID ≠⊥<br />
248 L[gid]←L[gid] ∪ {Group[gid].P arentID}<br />
249 L ′ [gid]←L ′ in ∪ {gid}<br />
250<br />
251 if L[gid] = L ′ [gid] /∗ release proposal, all potential candidates confirmed minimality ∗/<br />
252 array tags<br />
253 for x ∈ L[gid]<br />
254 tags[x]←unique id()<br />
255 send (RESET, gid, x, tags[x]) to leader <strong>of</strong>(x)<br />
256 while L[gid] ≠ ∅<br />
257 wait for receive (RESET OK, x, tag) with x ∈ L[gid] ∧ tag = tags[x]<br />
258 L[gid]←L[gid] \ {x}<br />
259 P [gid]←P ∗ [gid] /∗ release proposal ∗/<br />
260 for x ∈ L ′ [gid] /∗ restart search for next proposal ∗/<br />
261 send (PROPOSAL, ⊥, ∅, ∅, x) to leader <strong>of</strong>(x)<br />
262<br />
263 else /∗ send to next node/leader in L and not in L ′ ∗/<br />
264 x← arbitrary element <strong>of</strong> (L[gid] \ L ′ [gid])<br />
265 send (PROPOSAL, P ∗ , L[gid], L ′ [gid], x) to leader <strong>of</strong>(x)<br />
266<br />
267 if received (RESET, source, gid, tag) /∗ reset local P ∗ [gid], L[gid] and L ′ [gid] set ∗/<br />
268 P ∗ [gid]←⊥, L[gid]←⊥, L ′ [gid]←⊥<br />
269 send (RESET OK, gid, tag) to leader <strong>of</strong>(source)<br />
Figure 1.8. Pseudo code for locally agreed proposal module.<br />
can include all nodes and groups so that the PROPOSAL message is forwarded n + ⌊ n−1<br />
k−1⌋<br />
− 1<br />
times. If the second lowest proposal is generated and forwarded to all nodes and groups<br />
except the one with the minimal local proposal before the lowest, it can cause n + ⌊ n−1<br />
k−1⌋<br />
− 2<br />
PROPOSAL messages, and so on. Summing up to O(n 2 ) PROPOSAL messages in the worst<br />
case. Obviously, the worst case number <strong>of</strong> messages for the reset and restart phase is 3·O(n).
1.6. LOCALLY AGREED PROPOSE MODULE 19<br />
Hence the worst case message complexity for a single locally agreed non-perfect proposal is<br />
O(n) · O(n) + O(n 2 ) + 3 · O(n) = O(n 2 ) and O(n) · O(n k−1 ) + O(n 2 ) + 3 · O(n) = O(n k )<br />
for a single locally agreed perfect proposal.<br />
Lemma 8. The worst case time complexity <strong>of</strong> the locally agreed propose module for generating<br />
a single proposal is O(n 2 ).<br />
Pro<strong>of</strong>. The set L can include at most n + ⌊ n−1<br />
k−1⌋<br />
= O(n) nodes and groups. Each<br />
node/leader in L generates a local non-perfect or perfect proposal with time complexity<br />
O(n) by Lemma 2 and 4 and forwards a PROPOSAL message to O(n) nodes/leaders in L.<br />
Hence the worst case time complexity <strong>of</strong> O(n 2 ) follows. The worst case time complexity for<br />
the reset and restart phase is O(3 · n) and can be neglected.<br />
Theorem 6. The worst case global message complexity for constructing the non-minimal<br />
resp. minimal admissible overlay network G ′ with the regular topology construction algorithm<br />
and the locally agreed propose module using non-perfect resp. perfect local propose<br />
module is O(n 3 ) resp. O(n k+1 ).<br />
Pro<strong>of</strong>. Pro<strong>of</strong> analogous to Theorem 4.<br />
Theorem 7. The worst case construction time <strong>of</strong> the non-minimal resp. minimal admissible<br />
overlay network G ′ with the regular topology construction algorithm resp. the locally agreed<br />
propose module using non-perfect resp. perfect local propose module is O(n 3 ).<br />
Pro<strong>of</strong>. By Theorem 4 in [TS04] , there are ⌊ n−1<br />
k−1⌋<br />
= O(n) groups to be built, and the worst<br />
time complexity for a single locally agreed proposal is O(n 2 ), the claimed time complexity<br />
follows.<br />
Note that the locally agreed proposal module significantly improves the average case for<br />
constructing the overlay network G ′ , since local proposals are only generated by potential<br />
members instead <strong>of</strong> all nodes/leaders in (G ′ ) e as in the global proposal module.<br />
Next, we show that the implementation in Figure 1.8 is a locally agreed propose module<br />
according to Definition 4.<br />
Lemma 9. If L[gid] = L ′ [gid], the set L[gid] includes all nodes/groups that allow constructing<br />
a group with a weight lower than P ∗ [gid].W eight and a member <strong>of</strong> L[gid].<br />
Pro<strong>of</strong>. Each node/leader initially calculates its local proposal P ∗ [gid], adds itself to<br />
L ′ [gid] and sets L[gid] to the potential member set() with fixed member gid and bound<br />
P ∗ [gid].W eight. The function potential member set() returns all nodes/groups which allows<br />
to build a group consisting <strong>of</strong> the fixed members without exceeding the bound. If a<br />
PROPOSAL message is received by a node/leader it either adopts P ∗ , L and L ′ and extends<br />
L[gid] with nodes/groups from its potential member set() including itself as fixed member<br />
and adds itself to L ′ [gid]. Or it leaves L ′ [gid] unchanged and thereby prevents L ′ [gid] from<br />
getting equal to L[gid] for this proposal. Therefore, each node/group which allows to constructed<br />
a group with weight below P ∗ [gid].W eight for any node/group in L[gid] must be<br />
in L[gid] if L[gid] = L ′ [gid].
20 CHAPTER 1. PROPOSE MODULES<br />
Lemma 10. If L[gid] = L ′ [gid], all nodes/leaders in L[gid] agreed upon the fact that P ∗ [gid]<br />
is the cheapest local proposal <strong>of</strong> all nodes/leaders in L[gid].<br />
Pro<strong>of</strong>. If a node/leader receives a PROPOSAL message and the weight <strong>of</strong> the received proposal<br />
Pin ∗ is lower than the local proposal P ∗ [gid] it adopts P ∗ , L and L ′ and adds itself to<br />
L ′ [gid] thereby agrees that the weight <strong>of</strong> Pin ∗ is lower than the weight <strong>of</strong> its current proposal<br />
P ∗ . If a node/leader receives a PROPOSAL message and the received Pin ∗ is equal to its local<br />
P ∗ [gid] the sets L and L ′ are merged. Whereas if a received Pin ∗ has higher weight than<br />
P ∗ [gid], the received set L ′ in is discarded and therefore L in can not become equal to L ′ in for<br />
this received proposal.<br />
Theorem 8. A group corresponding to a proposal generated by a locally agreed propose<br />
module is not destroyed through later group constructions if the groups in the incompletely<br />
built overlay graph (G ′ ) e and the communication graph G remain stable.<br />
Pro<strong>of</strong>. By contradiction. Let us assume that there exists an alternative proposal P alt that<br />
destroys a group corresponding to previous released proposal P ∗ [gid] <strong>of</strong> a locally agreed<br />
propose module. Then the weight <strong>of</strong> the P alt has to be lower than the weight <strong>of</strong> P ∗ [gid],<br />
and P alt and P ∗ [gid] must have a member in common, i.e. ∃j ∈ P alt .Members : j ∈<br />
P ∗ [gid].Members by the topology construction algorithm (Section 3 in [TS04] ). If P ∗ [gid]<br />
was released by a locally agreed propose module the sets L[gid] and L ′ [gid] were equal.<br />
Therefore L[gid] had to include all nodes/groups which allows to built a group that has<br />
lower than P ∗ [gid].W eight by Lemma 9. But if L[gid] = L ′ [gid], all nodes/leaders in L[gid]<br />
agreed upon the fact that P ∗ [gid] is the cheapest local proposal <strong>of</strong> all nodes/leaders in L[gid]<br />
by Lemma 10, which is a contradiction to the existence <strong>of</strong> a lower weight proposal P alt .<br />
1.7 Local Probabilistic Non-Perfect Propose Module<br />
In addition to the previous deterministic propose modules we now present a simple probabilistic<br />
local non-perfect propose module. The propose module operates in two phases:<br />
The first phase tries to build proposals consisting <strong>of</strong> nearby nodes and groups. If this phase<br />
fails, the second phase generates a proposal consisting <strong>of</strong> k nodes and groups currently in<br />
no groups. For the first phase a list L is used where all nodes and known groups are sorted<br />
according to their distance. Initially the first k entries in L are used for a new proposal.<br />
Nodes or groups which reject the proposal are randomly exchanged by their next entry in L.<br />
The new proposal is checked again until all members accept (all bounds are ok) or if they<br />
reject, phase two is started. In phase two the propose module uses a list L2 consisting <strong>of</strong><br />
nodes/groups without parent group. If this list is smaller than k, nodes and groups in L are<br />
checked to find new groups without parent group. If L2 is large enough, the first k entries<br />
are used for a proposal.<br />
First <strong>of</strong> all, if the current node/group gid is member in a group, any search for possibly<br />
better groups is immediately suspended (line 275 and 294). If the search for a proposal<br />
is initiated by calling procedure probabilistic proposal and there is currently no search in<br />
process (L[gid] =⊥) all global variables are initialized. For the first phase L[gid] is set to
1.7. LOCAL PROBABILISTIC NON-PERFECT PROPOSE MODULE 21<br />
270 array L[gid], array L2[gid], array L2 old [gid], array min weight[gid], array bound[gid]<br />
271 set reply set[gid], next[gid], phase[gid], P ∗ [gid]<br />
272<br />
273 procedure probabilistic proposal (gid)<br />
274<br />
275 if Group[gid].P arentID =⊥ ∧ L[gid] =⊥<br />
276 phase[gid]←1 /∗ initiate local data for search ∗/<br />
277 L[gid]←sort nodes in Π according to increasing w : (x, y, w) ∈ Λ ID : x = ID ∧ y ∈ Π<br />
278 L2[gid]←gid<br />
279 next[gid]←gid<br />
280 reply set[gid]← ⋃ k<br />
x=1 L[gid][x]<br />
281 min weight[gid]←⊥<br />
282 bound[gid]←⊥<br />
283 P ∗ [gid]←calculate proposal(reply set[gid], Group[gid].W eight, Λ ID , true)<br />
284 for i=reply set[gid]<br />
285 send (CHECK, gid, i) to leader <strong>of</strong>(i) /∗ query group weight, bound and ParentID ∗/<br />
286<br />
287 if received (CHECK, i, gid) /∗ return group weight, bound and ParentID ∗/<br />
288 if Group[gid].P arentID =⊥<br />
289 send (RETURN, Group[gid].W eight, ∞, ⊥, gid, i) to leader <strong>of</strong>(i)<br />
290 else<br />
291 send (RETURN, Group[gid].W eight, Group[Group[gid].P arentID].W eight, \\<br />
292 Group[gid].P arentID, gid, i) to leader <strong>of</strong>(i)<br />
Figure 1.9. First part <strong>of</strong> the local probabilistic propose module.<br />
the sorted list <strong>of</strong> nodes. The first proposal is generated consisting <strong>of</strong> the first k entries in L<br />
(line 276-285). After that, we send a CHECK message (line 285) to all members to query<br />
their current group weight and bound (weight <strong>of</strong> parent group).<br />
If such a (CHECK) is received a (RETURN) message including current group weight, parent<br />
group weight and parent group id is returned (line 287-292).<br />
If a (RETURN) message is received the min weight and bound is stored and the id and its<br />
parent id is inserted into L and L2 (line 295-302). If all (RETURN) messages are received,<br />
the weight <strong>of</strong> the proposal is adjusted according to Definition 1 in [TS04] . If the propose<br />
module is in phase one (line 307-320), we calculate the reject set consisting <strong>of</strong> all members<br />
which reject that proposal. If the reject set is empty the proposal is released. Whereas if<br />
the reject set is not empty, a random member is exchanged by its next element in L and the<br />
new member is checked again. If there is no next member, the propose module switches to<br />
phase two. In phase two (line 320-334) it is checked if the L2 set is larger than k. If this<br />
is not the case new nodes/groups without parent group are searched via CHECK messages to<br />
nodes and groups in L. If the set L2 is large enough, the first k entries are used for a new<br />
proposal. The proposal members are checked and if the L2 set does not change the proposal<br />
is released (line 334).<br />
It is not necessary to check the whole L set in phase one until we switch to phase two.<br />
In simulation we found that the total weight <strong>of</strong> the topology does not change significantly if<br />
we switch to phase two after phase one has searched 10% <strong>of</strong> L. This limitation <strong>of</strong> the L set<br />
reduces the average number <strong>of</strong> messages.
22 CHAPTER 1. PROPOSE MODULES<br />
293 if received (RETURN, weight, bound, P arentID, i, gid)<br />
294 if Group[gid].P arentID =⊥ /∗ only search if in no group ∗/<br />
295 if P arentID ≠⊥ /∗ enqueue P arentID and i ∗/<br />
296 L[gid]←add P arentID to L[gid] after first node x with x ∈ P arentID<br />
297 L2[gid]←L2[gid] \ {i}<br />
298 else<br />
299 L2[gid]←L2[gid] ∪ {i}<br />
300 reply set[gid]←reply set[gid] \ {i}<br />
301 min weight[gid][i]←weight<br />
302 bound[gid][i]←bound<br />
303<br />
304 if reply set = ∅ /∗ all returns received ∗/<br />
305 if P ∗ [gid].W eight < max(min weight[gid]) /∗ set minimum group weight ∗/<br />
306 P ∗ [gid].W eight←max(min weight[gid]) + ɛ<br />
307 if phase[gid] = 1<br />
308 set reject←x ∈ P ∗ [gid].Members : bound[gid][x] ≤ P ∗ [gid].W eight<br />
309 if reject = ∅<br />
310 P [gid]←P ∗ [gid] /∗ release proposal ∗/<br />
311 else<br />
312 i←randomly choose a node/group in reject<br />
313 P ∗ [gid].Members←exchange node/group i in P ∗ [gid].Members with next in L[gid]<br />
314 if there is no next element in L[gid]<br />
315 phase[gid]←2 /∗ change to phase 2 ∗/<br />
316 else<br />
317 P ∗ [gid]←calculate proposal(P ∗ [gid].Members, Group[gid].W eight, Λ ID , true)<br />
318 send (CHECK, gid, i) to leader <strong>of</strong>(i)<br />
319 reply set←{i}<br />
320 if phase[gid] = 2<br />
321 if |L2[gid]| < k /∗ search for nodes/groups in no group ∗/<br />
322 next←next node/group next in L[gid]<br />
323 send (CHECK, gid, next) to leader <strong>of</strong>(next)<br />
324 reply set←{next}<br />
325 else if L2[gid] = L2 old [gid] /∗ check if L2 has changed ∗/<br />
326 L2 old [gid]←L2[gid]<br />
327 for i= ⋃ k<br />
x=1 L2[gid][x]<br />
328 send (CHECK, gid, i) to leader <strong>of</strong>(i)<br />
329 reply set←reply set ∪ {i}<br />
330 min weight[gid]←⊥<br />
331 bound[gid]←⊥<br />
332 P ∗ [gid]←calculate proposal(reply set, Group[gid].W eight, Λ ID , true)<br />
333 else<br />
334 P [gid]←P ∗ [gid] /∗ release proposal ∗/<br />
Figure 1.10. Second part <strong>of</strong> the local probabilistic propose module.<br />
Lemma 11. The worst case message complexity <strong>of</strong> the local probabilistic propose module<br />
for generating a single proposal is O(n).<br />
Pro<strong>of</strong>. In the worst case the L set includes all nodes and groups (n + ⌊ n−1<br />
k−1⌋<br />
) and each initial<br />
proposal member is exchanged by all its successors in L. So no more than k · (n + ⌊ n−1<br />
k−1⌋<br />
) =<br />
O(n) (CHECK) and (RETURN) messages are caused by phase one. For phase two no more
1.8. GLOBAL PROBABILISTIC NON-PERFECT PROPOSE MODULE 23<br />
than |L| (CHECK) and (RETURN) messages are possible until the L2 set is large enough to<br />
build a proposal. Note that a proposal from phase two is always accepted by the construction<br />
algorithm (since their members have no parent group and hence no bounds). The claimed<br />
complexity follows if we add the message complexity <strong>of</strong> phase one and two.<br />
Lemma 12. The worst case time complexity <strong>of</strong> the local probabilistic propose module for<br />
generating a single proposal is O(n).<br />
Pro<strong>of</strong>. Since only O(n) messages are transmitted for a single proposal by Lemma 11, the<br />
worst case time complexity cannot be worse than O(n).<br />
Theorem 9. The worst case message and time complexity for generating an admissible overlay<br />
network G ′ with the regular topology construction algorithm using the local non-perfect<br />
probabilistic propose modules is O(n 2 ).<br />
Pro<strong>of</strong>. After O(n) messages each <strong>of</strong> the at most n + ⌊ n−1<br />
k−1⌋<br />
nodes/groups switches from<br />
phase one to phase two. In phase two the proposal consist only <strong>of</strong> members currently in no<br />
group, hence the proposal will always be constructed by the topology construction algorithm.<br />
Since there are not more than n + ⌊ n−1<br />
k−1⌋<br />
= O(n) nodes and groups the worst case messages<br />
complexity <strong>of</strong> O(n 2 ) follows. Obviously the claimed worst case time complexity follows by<br />
the same argument as for Lemma 12.<br />
1.8 Global Probabilistic Non-Perfect Propose Module<br />
In the next section we present a global probabilistic propose module with low worst case<br />
complexity. The propose module uses a list L containing all available nodes and groups<br />
(without parent group) and a second list L2 which is repeatedly forwarded, sorted and reduced<br />
until it has size k. If L2 consists <strong>of</strong> k nodes and groups a corresponding proposal is<br />
calculated.<br />
Figure 1.11 depicts the pseudo code for the global probabilistic propose module. The<br />
search is started with an INIT message to a random node containing a list L containing all<br />
nodes. Upon reception <strong>of</strong> the INIT message, a L2 list with the nearest INIT SIZE nodes/-<br />
groups is generated and forwarded randomly (PROB message) to any in L2. If a PROB is<br />
received the node/group corresponding to the most expensive edge is removed from L2. If<br />
L2 has size k a proposal is calculated, the proposal members are removed from L and the<br />
new group is added to L. Next, the search for a new proposal is initiated by a new INIT<br />
message. If L2 is larger than k L2 is randomly forwarded to any node/leader in L2.<br />
Lemma 13. The worst case message and time complexity for a single proposal from the<br />
global probabilistic propose module is O(1).<br />
Pro<strong>of</strong>. The set L2 is initiated with INIT SIZE elements from L and each PROB message<br />
reduces the size <strong>of</strong> L2 by one. After (init size − k) PROB messages a proposal is generated.<br />
List L2 contains only nodes/groups from L without parent group, hence the generated<br />
proposal is always accepted by all its members.
24 CHAPTER 1. PROPOSE MODULES<br />
335 function global probabilistic proposal () /∗ initially initiate search ∗/<br />
336 i← select id in Π<br />
337 send (INIT, Π) to leader <strong>of</strong>(i)<br />
338<br />
339 if received (INIT, L) /∗ generate L2 from L ∗/<br />
340 L←sort ids in L according to increasing w : (x, y, w) ∈ Λ ID : x = ID ∧ ∃z ∈ L : y ∈ z<br />
341 L2←trim(L, min(|L|−INIT SIZE, |L|)<br />
342 i← select random id in L2<br />
343 send (PROB, L, L2) to leader <strong>of</strong>(i)<br />
344<br />
345 if received (PROB, L, L2)<br />
346 if |L2| > k /∗ reduce L2 ∗/<br />
347 L2←sort ids in L2 according to increasing w : (x, y, w) ∈ Λ ID : x = ID ∧ ∃z ∈ L2 : y ∈ z<br />
348 L2←trim(L2, 1)<br />
349 if |L2| = k /∗ generate proposal from L2 ∗/<br />
350 P [gid]←calculate proposal(L2, Λ ID , true)<br />
351 L←L \ L2<br />
352 L←L ∪ {P [gid].T erminals}<br />
353 i← select random id in L<br />
354 send (INIT, L) to leader <strong>of</strong>(i)<br />
355 else if |L2| > k /∗ forward L2 to random node/group in L2 ∗/<br />
356 i← select random id in trim(L2,|L2|/2)<br />
357 send (PROB, L, L2) to leader <strong>of</strong>(i)<br />
Figure 1.11. Pseudo code for global probabilistic propose module.<br />
Theorem 10. The worst case message and time complexity for generating an admissible<br />
overlay network G ′ with the regular topology construction algorithm using the global probabilistic<br />
propose modules is O(n).<br />
Pro<strong>of</strong>. Obvious, since list L initially contains n nodes and each generated proposal reduces<br />
L by k − 1 nodes/groups.<br />
Note that this propose module maintains a list <strong>of</strong> nodes/groups without parent groups<br />
instead <strong>of</strong> exploring this information from the network. If there are concurrent group constructions<br />
or group destructions e.g. caused through crashing nodes or concurrently executed<br />
propose modules, it can not be guaranteed that the overlay graph is constructed completely<br />
by this propose module.<br />
1.9 Propose Module for the Extended Topology<br />
For constructing an admissible overlay graph G ′ with a topology construction algorithm<br />
that uses the extension <strong>of</strong> Section 6 in [TS04] (extended groups), new group proposals need<br />
not necessarily have lower group weight than the current group. Let (G ′ ) e be an incompletely<br />
built overlay graph at time e. Let i be a member <strong>of</strong> a regular or extended group<br />
g i : i ∈ members(g i ) in (G ′ ) e . Then, if a new group proposal g j with higher weight<br />
than g i is proposed to leader <strong>of</strong> group g i , an extended group gi ∗ is built instead <strong>of</strong> rejecting<br />
the proposal as with the regular topology construction algorithm. The new ′<br />
group
1.9. PROPOSE MODULE FOR THE EXTENDED TOPOLOGY 25<br />
gi ∗ consists <strong>of</strong> the members <strong>of</strong> g ′ i and <strong>of</strong> g j , so that the terminal nodes <strong>of</strong> T gi keep unchanged<br />
(T gi = T g ∗ ) and the new members <strong>of</strong> g i ′ j become internal members in group gi ∗ ′:<br />
I g ∗ = I<br />
i ′ gi ∪ {x : x ∈ members(g j ) ∧ x /∈ members(g i )}. Thus, even if groups with higher<br />
weight than the current group are proposed, the new members are added to the topology<br />
without destroying a group. Recall that extended groups with more than 2 · k − 2 members<br />
are split into two regular groups.<br />
A simple propose module that does not guarantee that a proposed group has lower weight<br />
for all group members is presented in Figure 1.12. The propose module simply proposes a<br />
group consisting <strong>of</strong> members corresponding to the k − 1 lowest-weight edges.<br />
358 procedure local non-perfect proposal for extended groups(gid)<br />
359<br />
360 if Group[gid].P arentID ≠⊥<br />
361 return /∗ if already in a group no new group is proposed ∗/<br />
362<br />
363 set fix←{gid}<br />
364 while |fix| < k<br />
365 set ps←Π \ {∃x ′ ∈ fix : x ∈ x ′ }<br />
366 fix←fix ∪ {y : min w (x, y, w) : x ∈ gid ∧ y ∈ ps}<br />
367 P [gid]←calculate proposal(fix, Λ ID , true)<br />
Figure 1.12. Pseudo code for the local non-perfect proposal module for a topology with<br />
extended groups.<br />
It is easy to see that the message complexity for such a proposal is O(1) and time complexity<br />
is O(k).<br />
Theorem 11. The worst case message and time complexity for constructing the non-minimal<br />
admissible overlay network G ′ with extended groups using the presented proposal module <strong>of</strong><br />
Figure 1.12 is O(n).<br />
Pro<strong>of</strong>. Each node and each group generates such a local non-perfect proposal at most once,<br />
since each proposed group causes their node/group to get member in a group. A new group<br />
is only proposed for nodes/groups without a parent group. Recall that in this constructing<br />
scheme no group is ever destroyed. Therefore at most n + ⌊ n−1<br />
k−1⌋<br />
= O(n) nodes/leaders<br />
generate a single proposal with O(k), hence the claimed complexity follows. Note that the<br />
reconstruction <strong>of</strong> groups with more than 2 · k − 2 members (cf. Section 6 in [TS04]) is<br />
independent <strong>of</strong> n, therefore does not cause additional complexity.<br />
Note that even if proposed groups with higher weight than the current group weight are<br />
accepted, this does not mean that no optimization takes place. The proposed groups are<br />
constructed to achieve low weight although they are not minimal, and there is a second<br />
optimization taking place if an extended group with more than 2 · k − 2 members is split into<br />
two regular groups. This is a kind <strong>of</strong> delayed optimization and it takes place in reverse order<br />
(top down), in contrast to the regular topology construction.
26 CHAPTER 1. PROPOSE MODULES<br />
1.10 Improvements<br />
In this section we present some optimizations for all propose modules that might significantly<br />
improve the average case albeit not the worst case.<br />
• A simple trick to avoid the global arrays with index gid is to include them into the<br />
Group[gid] data structure. So the allocated memory space is automatically freed if a<br />
group is destroyed.<br />
• If a node/group has no parent group, the bound for calculating a proposal can be set<br />
to a low value and incremental increases until the first proposal is found, instead <strong>of</strong><br />
setting the bound to ∞.<br />
• The size <strong>of</strong> the potential member set is critical for the performance <strong>of</strong> most propose<br />
module. It can be strongly shortened if the weight <strong>of</strong> unknown edges is estimated<br />
instead <strong>of</strong> using the lowest overall edge weight k for calculation.<br />
• The caching <strong>of</strong> edge weights <strong>of</strong> other nodes reduces the number <strong>of</strong> GET EDGES messages,<br />
shortens the potential member set if fetch missing edges = false and might<br />
reduce message size.<br />
• For larger k the complexity <strong>of</strong> the calculate proposal() function gets significant, even<br />
if independent from n. To improve performance a bound can be implemented (e.g.<br />
externally passed from potential member set() or internally from currently best calculated<br />
proposal) to prematurely prune useless search branches.<br />
• If function calculate proposal() is called from potential member set it is not necessary<br />
to calculate the terminal set.<br />
• In the local perfect proposal module it is not necessary to initially generate a complete<br />
pms set with function get group ids(), the necessary group ids can also be collected<br />
during the search.<br />
• The performance <strong>of</strong> the locally agreed propose module can be increased if each<br />
node/leader locally keeps a set <strong>of</strong> nodes/groups that were in P ∗ [gid].Member and<br />
Pin.Member ∗ when a node/leader took over the received proposal. If upon reset a<br />
node/leader rests all nodes/leaders in the new set, the number <strong>of</strong> proposed groups<br />
which will be rejected by the topology construction algorithm can be significantly<br />
reduced.<br />
• If one wants to allow some rare group reconstruction with the locally agreed propose<br />
module, the performance can be increased by exchanging line 249 with L ′ [gid]¡-L ′ in ∪<br />
(L[gid] ∩ L ′ [gid]).<br />
1.11 Summary<br />
Table 1.1 summarizes the worst case complexities for all presented propose modules.
1.11. SUMMARY 27<br />
Complexity Topology Topology Time Message Time Message<br />
regular/ perfect/ Proposal Proposal Topology Topology<br />
extended non-perf.<br />
Local Perfect regular perfect O(n k−1 ) O(n) O(n n·k ) O(n n·k )<br />
Local Non-Perfect regular non-perf. O(n) O(n) O(n n·k ) O(n n·k )<br />
Global Perfect regular perfect O(n k ) O(n) O(n k+1 ) O(n 2 )<br />
Global Non-Perfect regular non-perf. O(n 2 ) O(n) O(n 3 ) O(n 2 )<br />
Locally Agreed Perfect regular perfect O(n k ) O(n 2 ) O(n k+1 ) O(n 3 )<br />
Locally Agreed Non-Perf. regular non-perf. O(n 2 ) O(n 2 ) O(n 3 ) O(n 3 )<br />
Local Probabilistic regular non-perf. O(n) O(n) O(n 2 ) O(n 2 )<br />
Global Probabilistic regular non-perf. O(1) O(1) O(n) O(n)<br />
Prop. mod. for ext. groups extended non-perf. O(1) O(1) O(n) O(n)<br />
Table 1.1. Overview <strong>of</strong> the worst case complexities.
28 CHAPTER 1. PROPOSE MODULES
Chapter 2<br />
Simulation<br />
Analytical results, like our worst case results, are not sufficient to evaluate the practical<br />
use <strong>of</strong> our algorithm. Of similar interest are questions about the quality <strong>of</strong> the generated<br />
overlay graph, and the average case complexity <strong>of</strong> its construction. This section explains our<br />
MATLAB [MAT] simulation environment 1 and presents simulation results.<br />
2.1 Simulation Environment<br />
We developed a modular simulation environment based on MATLAB which allows to<br />
simulate our construction algorithm and different propose modules on various networks.<br />
The simulation environment provides:<br />
• Node: The main function allows to create, suspend and destroy nodes at any time. A<br />
node has a unique ID and a random position in the simulation area. It consists <strong>of</strong> a<br />
separate memory space and has access to different subsystem functions.<br />
• Message subsystem: The simulation provides a message subsystem with different message<br />
queuing strategies (unordered, FIFO) and consists <strong>of</strong> a send and receive interface<br />
for each node. To analyze the complexity <strong>of</strong> different propose modules, the message<br />
subsystem is able to protocol each message.<br />
• Node scheduler: Our simulation continuously executes the active nodes in a random<br />
and fair order.<br />
• Weight matrix: The communication weight matrix calculates the weight <strong>of</strong> each communication<br />
edge. Any function for assigning weight to edges can be used (e.g. for our<br />
simulation results we used the Euclidean distance). Each node knows the subset <strong>of</strong> the<br />
weight matrix where the node is endpoint <strong>of</strong> an edge.<br />
• Mobility: A node and the main function can change the position <strong>of</strong> a node. The weight<br />
matrix is automatically updated according to the new position <strong>of</strong> the node.<br />
1 The source code <strong>of</strong> the simulation environment can be downloaded from the web: http://www.ecs.<br />
tuwien.ac.at/W2F/.<br />
29
30 CHAPTER 2. SIMULATION<br />
• Connections: The simulation environment maintains a global connection matrix where<br />
each node can make and cancel connections to other nodes. Upon each change the<br />
maximum node degree <strong>of</strong> each node is checked and violations are reported. After the<br />
stabilization time, the simulation checks if each connection is bidirectional.<br />
• Stabilization: Since our algorithms continuously try to adapt to network changes and<br />
improve the topology, we can not define an exact termination point for our algorithms<br />
(e.g. no messages in transit). Therefore the simulation provides some support for determining<br />
the stabilization <strong>of</strong> the overlay graph like the monitoring <strong>of</strong> the timing behavior<br />
<strong>of</strong> the group constructions.<br />
On top <strong>of</strong> this simulation environment we implemented the construction algorithm from<br />
[TS04] with the atomic commit function and all propose modules <strong>of</strong> Section 1.<br />
With this simulation environment we are capable <strong>of</strong> analyzing the following system properties:<br />
• The number <strong>of</strong> joins and leaves, as well as the number <strong>of</strong> released proposals.<br />
• The number <strong>of</strong> sent messages, the number <strong>of</strong> messages in transit, the number <strong>of</strong> messages<br />
per node and the number <strong>of</strong> certain types <strong>of</strong> messages.<br />
• The total weight <strong>of</strong> the connection matrix and the spanning factor <strong>of</strong> specific paths.<br />
• With our visualization module we can monitor connection and group construction and<br />
termination, the moving <strong>of</strong> nodes and the final topology.<br />
• To analyze the effectivity <strong>of</strong> the locally agreed propose module we can visualize the<br />
size <strong>of</strong> the L list and highlight the nodes and groups in L.<br />
2.2 Results<br />
For the following simulations we randomly placed the indicated number <strong>of</strong> nodes on a<br />
100 × 100 square. The edge weight between two nodes is set to the square <strong>of</strong> their distrance.<br />
2.2.1 Example Overlay Graphs<br />
First <strong>of</strong> all, we depict some snapshots <strong>of</strong> our overlay graph with propose modules.<br />
Figure 2.1 shows four overlay graphs for the same example network with n = 50 and<br />
k = 3, where cycles are regular nodes and squares represent gateway nodes. For the overlay<br />
graph in Figure 2.1(a) we use perfect propose modules, overlay graph 2.1(b) uses non-perfect<br />
propose modules, overlay graph 2.1(c) uses local probabilistic propose modules and the overlay<br />
graph in Figure 2.1(d) was constructed using a global probabilistic propose module. A<br />
deeper look at the topology example yields the underlying group structure.<br />
2.2.2 Connectivity<br />
Figure 2.2(a) depicts the perfect overlay graph with k = 3 and in Figure 2.2(b) with k = 4<br />
for the same example network with n = 30.
2.2. RESULTS 31<br />
(a)<br />
(b)<br />
(c)<br />
(d)<br />
Figure 2.1. Different topologies for an example network.<br />
2.2.3 Total Weight<br />
Next we want to compare the minimality <strong>of</strong> our overlay graph with respect to the unique<br />
minimal k-connected and k-regular overlay graph. Since the problem <strong>of</strong> finding the minimum<br />
cost overlay graph proved to be NP-complete 2 , we used a specific and well studied<br />
subproblem. For k = 2 our overlay graph is comparable to the Traveling Salesman Problem<br />
(TSP) except that the TSP finds a closed path and our algorithm generates an open path.<br />
We hence add the weight for the connection between the two gateway nodes, which is not<br />
generated by our algorithm, to the total graph weight to compare the weight with the exact<br />
solution <strong>of</strong> the TSP problem. For small n (around 50 to 100) there exit tools [TSP] that<br />
are available to calculate the exact solution <strong>of</strong> the TSP in reasonable time. Table 2.1 shows<br />
the average total weight factors (total weight <strong>of</strong> the overlay graph plus the weight for the<br />
2 Since equivalent to TSP for k = 2.
32 CHAPTER 2. SIMULATION<br />
(a)<br />
(b)<br />
Figure 2.2. Overlay graph with k = 3 and k = 4.<br />
gateway interconnection divided by the weight <strong>of</strong> the exact TSP solution) from 20 random<br />
graphs with n = 50 and k = 2 using different propose modules.<br />
Propose Module perfect/non-perfect factor<br />
Perfect propose module perfect 1.11<br />
Non-Perfect propose module non-perfect 1.17<br />
Local Probabilistic propose module non-perfect 1.31<br />
Global Probabilistic propose module non-perfect 1.30<br />
Table 2.1. Overview <strong>of</strong> the average total weight factors.<br />
2.2.4 Message Complexity<br />
Figure 2.3 and 2.4 illustrate the relationship between number <strong>of</strong> nodes in the overlay graph<br />
and the average number <strong>of</strong> messages per node for construction. Figure 2.3 plots the average<br />
number <strong>of</strong> messages <strong>of</strong> all propose modules in a double-logarithmic scale and Figure 2.4<br />
depicts the number <strong>of</strong> messages for the probabilistic propose modules in linear scale. Note<br />
that the absolute number <strong>of</strong> messages is only a rough indication for the complexity, since<br />
the number <strong>of</strong> messages strongly depends on the propose module implementation (e.g. the<br />
use <strong>of</strong> caches or larger messages instead <strong>of</strong> multiple messages can decrease the absolute<br />
number <strong>of</strong> messages). For this results we used the same implementation as presented in<br />
Chapter 1. These results confirm that the average case is much better than the analytical<br />
worst case results. An interesting aspect is that in the average case the non-synchronized<br />
local propose modules perform better than their corresponding synchronized propose modules<br />
(locally agreed or global) even if their worst case complexity is much larger. Hence the<br />
additional synchronization complexity <strong>of</strong> the global and locally agreed propose module for
2.2. RESULTS 33<br />
generating the proposals in the perfect order is not necessary in the general case. For the<br />
local probabilistic propose module we discover a nearly linear average message complexity.<br />
10 3 Number <strong>of</strong> nodes<br />
Number <strong>of</strong> messages per node<br />
10 2<br />
10 1<br />
10 0<br />
local perfect<br />
local non−perfect<br />
global perfect<br />
global non−perfect<br />
locally agreed perfect<br />
locally agreed non−perfect<br />
local probabilistic non−perfect<br />
global probabilistic non−perfect<br />
10 −1<br />
10 0 10 1 10 2<br />
Figure 2.3. Average number <strong>of</strong> messages per node (double-logarithmic scale).<br />
2.2.5 Weight Distribution<br />
Besides the total weight <strong>of</strong> the overlay graph, the distribution <strong>of</strong> the edge weights among<br />
the nodes is an important issue. For example, an overlay graph that has minimal total weight<br />
but also contains connections with very high weight might not be feasible as network topology,<br />
since the corresponding nodes will prematurely run out <strong>of</strong> battery power. Figure 2.5<br />
shows the average distributions <strong>of</strong> the connection weights per node for 20 random networks<br />
with n = 50 and k = 3.<br />
2.2.6 Spanner Property<br />
In the following simulations we study the spanner property <strong>of</strong> our overlay graphs. We<br />
therefore calculate the stretch factors <strong>of</strong> random source and destination pairs. The stretch<br />
factor is the ratio between the weight <strong>of</strong> the shortest path in G ′ and the shortest path in G<br />
(hence the weight <strong>of</strong> the direct edge between source and destination). In Table 2.2 we show<br />
the average and maximum spanning factors for each node-disjoint path from 50 random<br />
source and destination pairs in 20 random networks with n = 50 and k = 3. Although our<br />
overlay graph is not a spanner (has a bounded stretch factor) the results depict a good spanner<br />
property.
34 CHAPTER 2. SIMULATION<br />
20<br />
18<br />
16<br />
Number <strong>of</strong> messages per node<br />
14<br />
12<br />
10<br />
8<br />
6<br />
4<br />
2<br />
local probabilistic non−perfect<br />
global probabilistic non−perfect<br />
0<br />
0 20 40 60 80 100<br />
Number <strong>of</strong> nodes<br />
Figure 2.4. Average number <strong>of</strong> messages per node (linear scale).<br />
Average number <strong>of</strong> nodes<br />
0 10 20 30 40 50 60 70 80 90 100<br />
Weight<br />
Figure 2.5. Weight distribution per node.<br />
2.2.7 Group Destructions<br />
If we use local propose modules it happens that a constructed group is destroyed through<br />
later proposed groups. In Figure 2.6 we plot the number <strong>of</strong> groups <strong>of</strong> the completely con-
2.2. RESULTS 35<br />
Stretch factor shortest path second shortest path longest path<br />
ave. max. ave. max. ave. max.<br />
Perfect propose module 2.0675 7.5739 3.2863 10.5328 6.1817 18.6312<br />
Non-Perfect propose module 2.0781 7.7823 3.3203 12.8245 6.3020 18.7564<br />
Local Probabilistic propose module 2.0026 6.3044 3.1066 14.0739 4.9470 19.3306<br />
Global Probabilistic propose module 2.446 9.1306 3.9401 18.7618 6.5578 23.1523<br />
Table 2.2. Average and maximum stretch factors.<br />
structed overlay graph and the average number <strong>of</strong> groups destroyed during the construction<br />
<strong>of</strong> G ′ for 20 random networks with k = 3. So the number <strong>of</strong> unnecessarily constructed<br />
groups grows linear with n, and does not necessitate the additional synchronization <strong>of</strong> the<br />
global and locally agreed propose module.<br />
25<br />
Number <strong>of</strong> group destructions<br />
20<br />
15<br />
10<br />
local perfect<br />
local non−perfect<br />
local probabilistic non−perfect<br />
number <strong>of</strong> groups<br />
5<br />
0<br />
5 10 15 20 25 30 35 40 45 50<br />
Number <strong>of</strong> nodes<br />
Figure 2.6. Average number <strong>of</strong> group destructions.<br />
2.2.8 Locally Agreed Propose Module<br />
The last simulation depicts the effectivity <strong>of</strong> the locally agreed propose module. Figure 2.7<br />
plots the group weight ω(g) and the size <strong>of</strong> the L list for each proposed group <strong>of</strong> the locally<br />
agreed propose module. We observed that the size <strong>of</strong> list L increases with increasing group<br />
weight and hence larger groups.
36 CHAPTER 2. SIMULATION<br />
Group weight<br />
Size <strong>of</strong> L<br />
0 2 4 6 8 10 12 14 16 18 20<br />
Group<br />
Figure 2.7. Group weight and size <strong>of</strong> L.
Bibliography<br />
[MAT] MathWorks MATLAB. http://www.mathworks.com/.<br />
[TS04] Bernd Thallner and Ulrich Schmid. Distributed construction <strong>of</strong> fault-tolerant<br />
overlay networks. Research Report 35/2004, <strong>Technische</strong> <strong>Universität</strong> <strong>Wien</strong>, Institut<br />
für <strong>Technische</strong> Informatik, Treitlstr. 1-3/182-2, 1040 Vienna, Austria, 2004.<br />
http://www.ecs.tuwien.ac.at/W2F/RR35-2004.pdf.<br />
[TSP] Collection <strong>of</strong> TSP s<strong>of</strong>tware to compute the optimal solution.<br />
http://www.or.deis.unibo.it/research pages/tsps<strong>of</strong>t.html.<br />
37