• No se han encontrado resultados

An obvious advantage of this technique is that node mobility does not deteriorate the precision of the estimate, as regardless of the location of the nodes in the network, the sum of all the averages will always converge to unity, that is:

X

i∈V (G)

avgi= 1 (5.4)

from which it can be deduced that:

∀i ∈ V (G) : lim k→∞  1 avgi(k)  = ||V (G)|| (5.5)

where V (G) is the set of nodes in the connected component, avgiis the average at node i, and k is the

number of aggregation rounds. Because the number of rounds needed to find the exact network size can, in theory, be infinite, in practice algorithms are considered converged if the estimate reaches a certain precision level [148]. Since the protocol is applied to ad hoc networks, with much fewer nodes than

large peer-to-peer networks, the algorithm does converge towards the exact network size in a finite time regardless of the mobility pattern.

5.4.2

Evaluation

The gossip-based aggregation method is simulated on a number of random networks generated using the algorithm described in 5.2. Figure 5.5 shows simulation results for the number of rounds taken to find the network size estimate for different estimation precisions and under various assumptions of node mobility conditions. Here, nodes do not follow a particular mobility model, instead they move randomly and with varying speeds. Node mobility may partition or merge network components and nodes may change their roles to suit the connectivity characteristics of the proposed attachment scheme.

Figure 5.5: Gossip-based Aggregation Method - Rounds vs. Precision Comparison

The fist observation that can be made by looking at Figure 5.5 is that the quality of the estimate does not follow a linear trend with the number of rounds. This indicates that for very accurate estimates, the algorithm needs to run for a large number of rounds. Another observation is that curves exhibit fluctuations, which are due to the randomness of the underlying topologies. In well connected networks, the number of rounds taken to reach a given precision level is less than that of a dispersed network. This means that a major factor governing the convergence time (in terms of number of rounds) of the gossip-based network size estimation algorithm is the degree centrality of nodes. However, the technique proposed in this thesis requires far fewer rounds than the gossip-based aggregation method, proposed in [73] does. Table 5.2 shows a comparison between the original and the adapted algorithm for 100% precision level for different network sizes.

The significant difference shown in the table above, stems from the fact that in each round, the adapted method produces the average of all participating nodes in the piconet, whereas in the original

Network Size 20 60 100

Number of rounds (original algorithm) 2544 5035 7521

Number of rounds (proposed algorithm) 123 232 277

Table 5.2: Comparison Between Original and Adapted Gossip-based Aggregation Algorithms

approach the aggregation concerns only a single master-slave pair. However, because of the TDD trans- mission characteristics of PANs, a round in the adapted method is expected to be longer than that in the original method. This is because, in the adapted method, a master sequentially collects the average from each slave currently participating in the piconet then broadcasts the value; whereas in the original algorithm a round only represents a poll/response cycle. It would therefore be fairer to compare the time taken to reach a given precision level in both algorithms rather than comparing the number of rounds. This is given in Figure 5.6

10 20 30 40 50 60 0 0.05 0.1 0.15 0.2 0.25 0.3 Network Size Time (seconds) Proposed Algorithm Original Algorithm (a) 50% Precision 10 20 30 40 50 60 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Network Size Time (seconds) Proposed Algorithm Original Algorithm (b) 90% Precision 10 20 30 40 50 60 0 1 2 3 4 5 6 Network Size Time (seconds) Proposed Algorithm Original Algorithm (c) 100% Precision

Figure 5.6: Gossip-based Aggregation Method - Estimation Delays

In the simulations, nodes are static; however, mobility would have no effect on the behaviour of the algorithms since the aggregation process occurs between any communicating nodes, thus it is indepen-

dent of the location of the nodes. Figure 5.6 shows that the original gossip-based estimation method takes longer to reach the desired precision level than the proposed adaptation. This diffence stems from the fact that the original method proposed in [73] requires a master-slave-master exchange in each round,

i.e.,a poll-response cycle, whreas in the case of the method proposed herein, the exchange relies on

broadcast which does not necessitate polling each slave at a time in order to send the aggregate averages, thereby resulting in quicker convergence time. The time complexity given herein shows the same trend as the number of rounds given in Figure 5.5, where an increase in precision level does not follow a linear increase in time, which again confirms that for precise estimates, gossip-based aggregation algorithms require large runtimes.

5.5

Summary

This chapter has adapted two network size estimation methods to suit the master/slave architecture of personal area networks and has shown that both methods can accurately estimate the size of the network. The gossip-based aggregation method exhibits better accuracy than the random tour method but at the expense of longer convergence time. In the work presented in this thesis, the random walk estimation method is preferred as it allows the collection of other network statistics such as the number of masters, the number of PMPs and the average node degree, which are all essential to the leader election algorithm described in the next chapter. However, that being said, both methods cope with random topology changes, which makes them suitable for mobile personal area networks.

Cooperative Network Leader Election

6.1

Introduction

In distributed computing, a network leader is a node responsible for carrying out a particular task such as membership management, data collection, payment management or routing control. The leader election problem has been studied extensively, particularly in the field of distributed computing [151], and many algorithms have been devised to elect a unique coordinator in the network. The complexity of leader election in ad hoc networks, however, is augmented by the dynamic and unpredictable nature of the environment and can therefore, yield large convergence times, large overheads, and in some cases im- possibility of consensus. There are many approaches to the leader election problem in ad hoc networks; three of the predominant ones are tree-based [163, 100], routing-based [106, 43] and probabilistic al- gorithms [55, 4]. Regardless of which approach is taken, or the role of the leader, the leader election problem must satisfy two fundamental conditions:

1. There is only one leader in a connected component.

2. Every node in the connected component has knowledge of the identity of the leader.

The proposed leader election algorithm satisfies these two fundamental conditions. It falls within the category of gossip algorithms, in that a gossip (the identity of the leader) will be disseminated to the entire network through local exchange of information. Each master gathers information from its currently connected neighbours, compares this information with its own, and re-distributes the best found value via broadcast. A fundamental question that must be answered, however, is: “How many times must a master repeat the process of collecting, comparing and redistributing the information before a unique leader is known to every node?” The answer to this question is strictly linked to the underlying topology characteristics of the mobile network. For the algorithm to converge, nodes require knowledge of the connectivity characteristics of the underlying topology, namely the estimated number of PMP nodes in the network and their corresponding average degree. This is achieved via the random tour network size estimation method described in Chapter 5.