Fast Deterministic Broadcast and Gossiping Algorithms for Mobile Ad hoc Networks Koushik Sinhaa∗ , Suranjan Ghoseb , Pradip K. Srimanic a
Honeywell Technology Solutions, Bangalore 560226, India, email: sinha
[email protected] b
Department of Computer Science and Engineering, Jadavpur University, Calcutta 700032, India, email:
[email protected] c
Department of Computer Science, Clemson University, Clemson, SC 29634, USA, email:
[email protected] We present a mobility resilient deterministic broadcast algorithm with worst-case time complexity of O(n log n) for ad hoc networks where the nodes possess collision detection capabilities, n being the total number of nodes in the network. The algorithm is based on a breadth-first traversal of the network and allows multiple simultaneous transmissions by the nodes. The idea of this broadcast algorithm is then extended to develop a mobility resilient deterministic gossiping algorithm having O(Dn log n) worst case run time, where D is the diameter of the network graph, which is an improvement over the existing algorithms. Simulation results show that on an average, the time for completing the broadcast or gossiping is significantly lower than the theoretical worst-case time requirement. Keywords. Ad hoc networks; MANET; deterministic broadcast; breadth-first broadcast; gossiping; all-to-all broadcast. 1. Introduction Recent times have seen a surge in interest in wireless ad hoc networks. Such networks are increasingly beginning to play a bigger role in military communications and maneuvers, disaster relief and rescue operations. A fundamental operation in ad hoc wireless networks is broadcasting. It finds extensive usage in the route query process of several routing protocols, sending of error messages to erase invalid routes and raising of network-wide alarms [25,23], among others. Broadcasting protocols can be classified into deterministic and probabilistic algorithms. In the probabilistic approach, each node, upon receiving a broadcast packet, retransmits it with a probability p. In contrast to the deterministic algorithms, the probabilistic algorithms can not guarantee a full coverage of the network. ∗
Corresponding author. Fax: +91 80 2658 4750
1
2 A fundamental issue in any single channel wireless communication is interference, resulting from simultaneous transmissions. When two or more nodes transmit a message to a common neighbor at the same time, the common node will not receive any of the messages correctly and a collision is said to have occurred at the common node. Collisions lead to retransmissions which result in drain on battery power of the nodes and increase in message delivery latency. Most of the research works on designing protocols for broadcast in ad hoc networks focus on the scenario where the nodes do not possess collision detection capabilities. However, with the rapid advances in technology and reduction in cost of hardware, mobile terminals with collision detection capabilities may soon become common in the future. Some results on this are already reported in the literature [7,22]. Besides collision, the other important issues in wireless ad hoc networks are limited battery power of the wireless devices and mobility of the nodes. While in the broadcast problem one node distinguished as the source node has a message to send to all other nodes, in the gossiping problem, also known as the total information exchange problem or all-to-all broadcast problem, each node has a different message that has to be distributed to all other nodes. Gossiping finds application in routing, spreading updates in networked databases and multicasting [36]. Because of mobility and limited battery power of the nodes, it is important to have fast, energy efficient and deterministic broadcast and gossiping protocols for wireless ad hoc networks by resolving collisions very efficiently. Such protocols with efficient collision resolution mechanism would provide low end-to-end latency and low overhead for retransmission of the collided messages. Most existing broadcast and gossiping algorithms do not address all of these issues together. [23] presents broadcast algorithms which guarantee that all nodes in the network receive the broadcast messages without collision, while simultaneously guaranteeing low broadcast latency and low number of retransmissions. [27] presents an energy efficient broadcast protocol. In this paper, we present deterministic broadcast and gossiping algorithms for mobile ad hoc networks that have low broadcast latencies. The algorithms presented in this paper assume the presence of collision detection capabilities at the mobile terminals. The deterministic broadcast algorithm is based on breadth-first traversal of the nodes of the network. The algorithm allows simultaneous transmission by multiple nodes. Although this may result in collisions at the receiving nodes, the proposed algorithm can detect and take corrective measures to eventually avoid collisions. The idea of breadth-first broadcast was first proposed in [2,3], in which there were two different types of rounds of transmission - control round and message round, with four slots in a message round and eight slots in a control round. Implementation of two such rounds with unequal number of slots will give rise to a synchronization problem under certain situations as will be established in a later section, and thus the algorithm in [3] will fail to operate correctly in those situations. In this paper, we have avoided this problem by assuming only one type of round structure for transmission. The proposed algorithm also works for scenarios where network topologies change frequently due to high mobility of the nodes and takes O(n log n) time in the worst case. Disregarding even the failures under the situations indicated above, the broadcast algorithm in [3] takes (2n log n + D log n) rounds in contrast to (n − 2)dlog ne + n − 1 = O(n log n) rounds taken by the algorithm proposed here. No simulation results were reported in [2,3] regarding the performance of the algorithms proposed there. In this work, we have simulated the performance of our proposed algorithm and these simulation results show that on an average, the time complexity of the breadth-first algo-
3 rithm is upper bounded by 8D log n, which is significantly lower than the worst case execution time. The reported simulation results were obtained for networks of size from 64 nodes up to as large as 1024 nodes. It may be noted in this context that the asymptotic lower bound for deterministic broadcast in networks where spontaneous transmission by the nodes is not allowed is, on an average, Ω(D log n) [29]. Furthermore, comparison with other algorithms show a definite improvement in performance with the proposed algorithm over the existing ones. Also, from the simulation results, we find that the time to complete the broadcast is almost insensitive to the mobility speed, although it is dependent on the specific mobility model assumed for the nodes of the network. Next we propose a mobility resilient, deterministic gossiping algorithm, extending the above idea of breadth-first broadcast technique. This gossiping algorithm is also different from that presented in [2,3] in that a different round structure has been assumed altogether. Moreover, the gossiping algorithm in [3] suffers from the same kind of synchronization problem as faced by the broadcast algorithm in [3], since their gossiping algorithm was completely based on that broadcast algorithm, using different types of rounds with varying number of slots per round. Thus, the gossiping algorithm presented in [3] will not work properly under certain situations. On the other hand, the proposed gossiping algorithm in this paper avoids this type of synchronization problem by using only one type of round structure and it completes in O(Dn log n) time, which is better than the deterministic gossiping algorithms in the literature. Finally, no simulation results for their proposed gossiping algorithm were reported in [2, 3]. In this work, we have simulated the performance of our proposed gossiping algorithm for both static and mobile networks and studied the performance of the algorithm under different mobility models. From these results we find that the average execution time of our gossiping algorithm is significantly lower than the worst case execution time by orders of magnitude when n becomes very large. Moreover, just like our broadcast algorithm, the simulation results show that the execution time of the gossiping algorithm is almost insensitive to the mobility speed, although it is dependent on the specific mobility model assumed for the nodes of the network. The rest of the paper is organized as follows : section 2 outlines related works, and section 3 deals with the system model. The proposed breadth-first broadcast algorithm is presented in section 4, while section 5 describes the deterministic gossiping algorithm developed over the breadth-first broadcast protocol. Section 6 is conclusion. 2. Related Work The simplest broadcast procedure in an ad hoc network is round-robin, which works in O(nD) time steps, where D represents the diameter of the network [1]. A deterministic algorithm for broadcasting in ad hoc networks in O(n log2 n) time slots is presented in [10]. O(D∆ log2 n)-time deterministic algorithms for broadcasting are presented in [12,14], where ∆ represents the maximum node degree. Lower bounds for the broadcast problem are presented in [29]. For networks with large diameters, [15] presents a deterministic broadcast algorithm that requires O(D + log5 n) time, with D = Ω(log5 n). The broadcast protocol in [6] completes the broadcast of a message in O(D log2 n) steps. Basagni et al. presented two mobility transparent deterministic broadcast schemes with bounded latency for mobile multi-hop radio networks [1], that require O(D2h logh n) steps, where h is the minimum integer in the range 1 ≤ h ≤ log n,
4 satisfying the inequality ∆ ≤ 2h+1 − 1. [37] presents a mobility tolerant broadcast algorithm for ad hoc networks. A randomized broadcast protocol which works in O(D log n + log2 n) time slots is given in [4]. In [18], it has been proved that such an algorithm is optimal for networks with D ≤ n1−² , where ² is any constant, greater than zero. A reliable broadcast protocol in O(D log n) time for linear grid-based networks has been proposed in [28]. In [26], a smart antenna based broadcasting protocol is presented for wireless ad hoc networks. Korkmaz et al. have presented a multi-hop broadcast protocol [30] for inter-vehicle communication. Several results on deterministic and randomized gossiping algorithms are available in the literature [8,10–14,16,17]. In [10], the authors showed the existence of an O(n3/2 log2 n) time deterministic algorithm (without any actual construction of the algorithm) for gossiping in ad hoc networks. In [11], a randomized distributed algorithm was presented that performs radio gossiping in an expected time of O(n log4 n). In [12,13], deterministic gossiping algorithms have been presented for unknown ad hoc radio networks working in time O(D∆2 log3 n). Chlebus et al. have proposed several algorithms [7] that work for networks with and without collision detection capabilities. They have given a broadcasting algorithm working in O(n) time, assuming that nodes can transmit spontaneously, before getting the source message. On the other hand, if spontaneous transmissions are not allowed, in [29] a lower bound of Ω(D log n) on deterministic broadcasting was proved for a network of n nodes and diameter D. [21] presents an O(n log n log D)-time broadcast algorithm for arbitrary directed graphs. Kowalski and Pelc in [22] proposed another deterministic broadcast algorithm with time complexity O(n log n) for arbitrary ad hoc radio networks where the nodes possess collision detection capabilities. However, the authors in [22] are silent about the performance of the algorithm for mobile networks and how its performance varies with mobility pattern of the nodes. √ ˜ In [16], an O( Dn)-time gossiping algorithm has been presented whenever D = O(nα ), for ˜ (n)) stands for O(f (n) · logc n), for any constant c > 0. any constant α < 1. The notation O(f For large values of maximum eccentricity D, they proposed an alternative algorithm that works in time O(D∆3/2 log3 n). Indyk [17] has shown constructive solutions for the broadcast and ˜ ˜ 3/2 ). [36] talks of a gossip-base gossiping problem respectively with complexities O(n) and O(n routing protocol for ad hoc networks. Several upper and lower bounds on the time complexity of oblivious (equivalently, non-adaptive) gossiping algorithms in unknown ad hoc radio networks have been presented in [8]. In an oblivious multiple-communication algorithm, the fact that a processor transmits or not at a given time-step depends solely on the identification number of the processor, n and the number of time-step. For a survey of numerous earlier results on the related problems of broadcasting and gossiping in ad hoc radio networks, the reader is referred to [3,4,18,9,20,25,24,21,22,16,34,35,27]. 3. System Model We consider an ad hoc network consisting of n nodes. The nodes may be stationary or mobile. Initially the nodes do not possess any information about the network topology. All communication links are assumed to be bi-directional and all communication occurs over a single channel. The nodes are assumed to be synchronized in time and in a particular time slot, a station can transmit and/or listen to the channel. A node v is a neighbor of u, if they are within each other’s hearing zone. The network is assumed to be connected at all times. In the broadcast
5 11111001
11100011
10110110
u
Figure 1. Collision Resolution Example 1
problem, one node is distinguished as the source node (also termed as the root), which has a message M to be broadcast. It is assumed that the mobile terminals possess collision detection capabilities. In the rest of our discussions in this paper, we will use the terms node id and address interchangeably to identify a particular node. 4. Breadth-First Broadcast We now present in this section a mobility resilient broadcast algorithm that allows simultaneous transmission by nodes, by detecting and resolving collisions, if any. We use the concept of layers to help understand how the broadcast message propagates in the network and how collisions are resolved. The source node is the only node in layer 0, all nodes within the hearing zone of the source node forming layer 1, and in general, all nodes within the hearing zone of the nodes in layer i and which are not in layer (i − 1), form the layer (i + 1), for i ≥ 1. Our proposed broadcast protocol is based on the following basic ideas. 4.1. Preliminaries and the Basic Idea A transmission of M by the source node will be received by all nodes in layer 1. The nodes in layer 1 would then transmit the message to the nodes in layer 2. However, at this point, a node in layer 2 may receive a collided message due to simultaneous transmission from more than one node in layer 1. In general, such a situation can also arise from simultaneous transmissions by nodes in different layers in the same time slot. Our proposed protocol proceeds in the way that i) a receiving node experiencing such a collision sends some appropriate acknowledgement signals to the transmitting nodes, and then, ii) one or more of the transmitting neighboring nodes are selectively dropped out (dropped out nodes do not transmit the message) at each of the succeeding stages (what we term as rounds), so that eventually collision is resolved at each of the receiving nodes. Essentially, we drop out all but the node with the maximum id value among the transmitting nodes causing collision at a receiving node, and this is done by successively scanning the bits of id values of each such transmitting node from the most significant bit (msb) side. As an example, consider the scenario in figure 1 where a node u which has experienced a collision due to messages simultaneously transmitted from its three neighboring nodes having the id values 11111001, 11100011, 10110110. In the next round, the nodes whose msb is 0 will be dropped out. Since there is no such node, all of these nodes will again transmit in this second round. In the next round, the nodes whose (msb − 1)-th bit is 0 will be dropped out and those with this bit value equal to 1 will only be
6 allowed to transmit. Thus, the node 10110110 will be dropped out. But the node u will still experience a collision due to messages coming from the nodes 11111001 and 11100011. At this point, the (msb − 2)-th bit of id will be tested and those with this bit value equal to 1 will only be allowed to transmit in the next round. Since both the transmitting nodes have this bit value equal to 1, the node u will again experience a collision. In the next round, however, the node 11100011 will be dropped out since its (msb − 3)-th bit is equal to 0, and only the node 11111001 will be allowed to transmit so that u receives the clean message. However, the above mechanism of successively dropping out the nodes will give rise to a problem when all the transmitting nodes have the corresponding scanned bit value equal to 0 and thus all of them will be dropped out. We explain in a later subsection how this problem can also be tackled to resolve the collision. 4.1.1. Node States and Acknowledgement Signals At any instant of time, a node may be in any one of the four states described below. • receive : node is ready to receive data transmitted by any other node • collision : node has received a collided message • active : node has received the message correctly, but not transmitting it • transmit : node will transmit the message A round of message transmission consists of several control slots, a message slot for transmitting the actual message M , and three slots for receiving acknowledgement(s) from the neighboring nodes as explained below. The control slots are used to guarantee collision-free reception of the message by all receiving nodes and their usage is defined later in the section. The acknowledgement slots are as follows : • Slot S for receiving a single-bit acknowledgement from the nodes which received the message correctly without any collision. • Slot C for receiving a single-bit acknowledgement from the receiving node(s), if the corresponding receiving node(s) detected a collision during message slot. • Slot N for receiving a single-bit acknowledgement to indicate that it did not receive any message (clean or collided) in this round although it received a collided message in the previous round(s). If for a node u, the channel status is null during any of these three slots, we assume that none of the neighbors of u have responded in that slot. The presence of a clean or collided signal due to one or multiple nodes responding simultaneously in any of these S, C and N slots, is interpreted as the appropriate acknowledgement signal for that slot by the node u.
7 111110
101111
111011
100101
x
v
w
z
y
u
Figure 2. Collision Resolution Example 2
4.2. Collision Resolution Every transmitting node takes a decision depending only on the type of acknowledgements - clean or collided, received by it in the three slots S, C and N respectively, associated with the previous message transmission slot. If a transmitting node receives an acknowledgement (which may come from a number of nodes in receive state) in slot S, it implies that the corresponding nodes in receive state have received the message correctly without any collision. These receiving nodes would become active in the successive rounds. If an acknowledgement is received by the transmitting node in the C slot, it implies one or more of the receiving nodes have experienced a collision during the previous message slot. Collision is resolved by preventing (dropping out) some of the nodes from transmitting in the subsequent rounds. This is done by scanning the bit pattern (starting from the msb) of the id value of each of the transmitting nodes receiving a C ack signal and allowing only those nodes to transmit whose corresponding bit value is equal to 1. However, as we have indicated above in section 4.1, a receiving node which experienced a collision, may not be receiving the message in the immediate next round when all the neighboring transmitting nodes of a receiving node are dropped out. At this point, the corresponding receiving node sends an acknowledgement in N slot. The transmitting node(s) receiving an N ack, tries to transmit again in the succeeding rounds. However, there may be some complex situation at this stage if a transmitting node receives an N signal from some node(s) and also a C signal from some other node(s). As an example, consider the situation as shown in figure 2, where the node y has experienced a collision due to messages coming from the nodes v, w, x and z, and the node u has experienced a collision as a result of simultaneous transmissions from nodes v and z. Let the id values of the nodes v, w, x and z be 101111, 111011, 111110 and 100101, respectively. In the first round, nodes v, w, x and z all receive a C signal. Since all these nodes have their msb equal to 1, in the next (second) round as well, all of v, w, x and z will transmit the message and hence, each of them will receive a C signal. Nodes v and z will be dropped out in the third round as both have the (msb − 1)-th bit equal to 0. Hence, in this round, both v and z will receive an N ack from u and a C ack from the node y. But none of v and z can be allowed to resume transmission in the fourth round, as then, v and z each would have caused a collision at y, jeopardizing the collision resolution at y. Collision at y will be resolved in the fifth round as the (msb − 3)-th bit of w is 0 and hence, it will be dropped out in the fifth round leaving the only node x to transmit. At this point, nodes v and z will get no C ack in this (fifth) round, but only an N ack from the node u. Now, nodes v and z both can be allowed to resume transmission
8 active state
v
collision state
test signal
collision state
x
u
layer j
ack2
test signal
ack1
ack2
ack1
layer j+1
ack3
w receive state
Figure 3. Role of the Control Signals
in the next (sixth) round and this would cause a collision at u. In the next (seventh) round, v and z both will test their (msb − 2)-th bit (as they were dropped out based on the value of their (msb − 2)-th bit), and at this time only v will be allowed to transmit since its (msb − 2)-th bit is equal to 1, so that a clean message is eventually received by the node u. 4.3. Moving from active State to transmit State In general, it is possible that after a particular round, some nodes in a given layer, say j, will receive the message correctly and hence, will become active, while others in the same layer have experienced collision and so they are in collision state. Two possible scenarios may arise : 1. While an active node in layer j starts transmitting the message, its message can also reach some of the nodes of the same layer j which are still in collision state. Example of such a situation is shown in figure 3, where node v is in active state in layer j, and node x is in collision state in the same layer j and lies within the hearing zone of the node v. Under this situation, while the collision resolution process at x is going on (by the above process of selectively dropping out its transmitting nodes in layer j − 1), the transition of the node v from active to transmit state during this collision resolution period, would cause further collision at the node x due to the message transmitted from v which may not be resolved at all. This is illustrated by the following example. Example 1. Assume that the node x in figure 3 has two transmitting neighbors with the id values equal to 11110001 and 11011011 differing first in the third bit from the msb side, while the node v has the id value equal to 10110001. Thus, in the third round after experiencing the collision for the first time, node x could get a clean message from the node 11110001 as the other node 11011011 would have been dropped out based on the testing of the (msb − 2)-th bit. However, if in this same round, node v moved from active to transmit state, then x would instead experience a collision due to messages coming from both 11110001 and v (= 10110001). Note that the id value of v is identical to that of this node from the (msb − 2)-th bit onward (towards the least significant bit side). Also, v would try to scan the bits of its own id from its msb, while the node 11110001 will scan its bits from the (msb−3)-th bit, which will completely jeopardize the collision resolution process at the node x. To avoid such a situation and to simplify the collision resolution algorithm, an active node in layer j would first test through some additional control signals (described below),
9
test ack1 ack2 ack3
message
S C N
Figure 4. Structure of a round for algorithm bf broadcast
if it is a neighbor of any node in collision state. If so, then this active node does not immediately move to the transmit state. 2. Referring to figure 3, consider another situation in which there is a node u in collision state in layer j which is not in the hearing zone of node v, but there is a node w in layer j + 1 in receive state which is adjacent to both the nodes v and u in layer j. Suppose v starts transmitting the message to w even when u is in the collision state. It may so happen that w receives a collided message (due to transmission from some other active node(s) like v in layer j), and so some of these nodes in layer j will be dropped from transmitting, depending on the bit pattern of their ids. When this dropping out process continues, node u may receive the clean message from some node in layer j − 1 and changes its state from collision to active. Subsequently, node u (because of its independent decision to transmit) may cause collision at w. To prevent this situation, we keep the node v in active state until no node like w exists (which has some parent in collision state). To handle the above mentioned two scenarios, we utilize four additional control signals in a round to test if an active node v in layer j can move to transmit state after satisfying the following two conditions : 1. No collision is caused to any other node in the same receiving layer j. 2. If the message from v is received by a node w (in receive state) at layer j + 1, then w can not be in the hearing zone of some node, say u (in collision state) at layer j. Thus, we augment a round with four additional control slots as follows : • test : 1-bit test signal sent by an active node only • ack1 : 1-bit acknowledgement signal sent by a node in receive state which received the test signal above • ack2 : 1-bit acknowledgement signal sent by a node in collision state which received either the test signal or ack1 signal • ack3 : 1-bit signal sent by a node in receive state which got the test and ack2 signals The overall structure of a round with the control signals for avoiding collision, is shown in figure 4. The four control signals and the three acknowledgement signals S, C and N are each 1-bit long. The state transition diagram in figure 5 depicts the transitions between the four possible states based on the various signals. From the above discussions, we get the following properties to be satisfied by our proposed broadcast protocol.
10 collision test/ack1
collided M
collided M
receive
clean M ack2/ack3 clean M
ack2/ack3
active ack2/ack3
S & (~C & ~N) test/ack1
ack1 & (~ack2 & ~ack3) C/N
transmit
Figure 5. State transition diagram
Property 1. The above mechanism of changing an active state of a node to the transmit state guarantees that while a node u in collision state is resolving the collision arising out of a set T of its transmitting neighbors, no new transmitting node 6∈ T can join the nodes in T to send the message to u. Property 2. With the property 1 above being satisfied, the collision resolution mechanism as described in section 4.2, guarantees that a collision experienced by a node u, arising out of a set T of its transmitting neighbors, can always be resolved so that eventually a clean message is received by u. To minimize the overhead, we would like to use the four control slots to test if an active node can move to the transmit state only once every dlog ne rounds. However, this may cause a situation where the nodes in layer 1 get the message in round 1 and then wait for the next dlog ne − 1 rounds until they become eligible for transmitting the message to the next layers. To avoid this unnecessary waiting, we propose to use these control slots in two successive rounds in every dlog ne rounds. Additionally, for mobility resilience, the source node will repeat transmitting the message every dlog ne rounds. At this point we would like to mention that the basic idea of collision resolution and moving an active node to transmit state mentioned above are similar to those used in breadth-first broadcast algorithm presented in [3]. However, the algorithm in [3] is based on two types of rounds a control round with eight slots and a message round with four slots. A control round is issued by a node in active state every dlog ne rounds only, while the nodes in transmit state continue to transmit the message in successive message rounds until they are dropped. Now, consider a scenario where there is a node v in active state and a node u in collision state which are in the hearing zone of each other. From the collision resolution mechanism described in section 4.2, it follows that based on the bit pattern of the id values of the set T of u and the presence of other neighbors of the nodes of T in collision state, the collision resolution at u may take more than dlog ne rounds, and during all these rounds, u would expect to receive only message rounds from its transmitting neighbors. But, since v would initiate a control round (with test, ack1, ack2 and ack3 signals) of 8 slots every integral multiples of dlog ne, this control round may be wrongly interpreted at u along with the other message rounds, and hence may cause the algorithm to fail. Thus, the broadcast algorithm presented in [3] may not work correctly in
11 such situations. The problem gets aggravated all the more for mobile scenarios where a node may move into the neighborhood another node having a different view of the round structure. The broadcast algorithm presented in the next section does not suffer from this problem as all rounds have the same structure with equal (eight) number of slots per round. 4.4. Algorithm bf broadcast We use a local variable round count, initialized to 0, at each node to keep track of the round number of transmissions. Subsequently, each node would increment their respective round count variable at the start of successive rounds. The following steps are executed by all nodes in parallel for broadcasting a message M . Step 1 : (Initialization) The source node sets its state to transmit. All other nodes set their states to receive. The following steps are executed in each of the successive rounds. Step 2 : (Actions taken by the source node) If round count MOD dlog ne = 0, then the source node transmits M . Step 3 : (Test for eligibility of an active node to move to transmit state). If the state is active and round count MOD dlog ne ≤ 1, then execute steps 3.1, 3.2 and 3.3. Step 3.1 : Send a test signal (one of the four control signals) and wait for ack2 or ack3 signals. Step 3.2 : If neither ack2 nor ack3 signals were received in respective slots, then node state is changed to transmit. Also, set value of transmission count = 0, set scanned bit position = dlog ne − 1, increment round count by 1 and go to Step 4 for the next round. Step 3.3 : If either of ack2 or ack3 signal is received, then increment round count by 1 and go back to Step 3 for the next round. Step 4 : (Transmit state actions) : If node state is transmit, then execute steps 4.1 to 4.5. Step 4.1 : If transmission count = 0, then transmit the message, increment value of transmission count by 1, and wait for acknowledgement signals in the S, C and N slots. Increment round count by 1 and go back to Step 4 for the next round. Step 4.2 : If an ack was received in the C slot of the preceding round, then Step 4.2.1 : If the id bit value at the current scanned bit position is 1 and the node transmitted the message in the immediate previous round, then retransmit M , increment transmission count by 1, decrement scanned bit position by 1, and look for S, C and N signals again. Increment value of round count by 1 and go back to Step 4 for the next round. Step 4.3 : If an ack was received in the N slot of the previous round but not in C, then, /* there is some node in receive state having only the dropped out nodes (including this node) from which it received the message; hence we need to restart transmission from this node */
12 Step 4.3.1 : If the node’s id bit at the scanned bit position is 0, then transmit the message, increment transmission count by 1, decrement value of scanned bit position by 1, and look for S, C and N signals. Increment value of round count by 1 and go back to Step 4 for the next round. Step 4.4 : If an ack was received only in the slot S but not in C and N , then the state of the node is changed back to active, i.e., the transmission was successful. Increment round count by 1 and go back to Step 3 for the next round. Step 4.5 : If no ack heard in S, C and N slot, then state of the node is changed back to active. This implies that none of its neighbors are in receive or collision state (e.g., a leaf node). Increment round count by 1 and go back to Step 3 for the next round. Step 5 : (Receive state actions) : If node state is receive, then execute steps 5.1 to 5.3. Step 5.1 : If a signal is received in test slot, then send ack1 in this round. If signal received in ack2 slot, then send ack3 signal in this round. Increment round count by 1 and go back to Step 5 for the next round. Step 5.2 : If received clean M , then send an ack in S slot and change state to active. Increment round count by 1 and go back to Step 3 for the next round. Step 5.3 : If collision heard in message slot, then send ack in C slot and change state to collision. Increment round count by 1 and go to Step 6 for the next round. Step 6 : (Collision state actions) : If node state is collision, then execute steps 6.1 to 6.4. Step 6.1 : If a signal received in either test slot or ack1 slot, then send the ack2 signal in this round. Increment round count by 1 and go back to Step 6 for the next round. Step 6.2 : If collision encountered in the message slot, then send an ack in C slot. Increment round count by 1 and go back to Step 6 for the next round. Step 6.3 : If no signal received in the message slot, but a collided message was received in some previous round, then send an acknowledgement signal in the N slot. Increment round count by 1 and go back to Step 6 for the next round. Step 6.4 : If clean signal received in the message slot, then send an ack in S slot and change state to active. Increment round count by 1 and go back to Step 3 for the next round. 4.4.1. Illustrative Examples To illustrate the basic ideas of the above algorithm, we consider the following two examples. Example 2. Consider the network in figure 6, where the nodes 111111, 111110, 110110, 110010 and 110001 are the transmitting nodes, and the nodes a, b, c, d and e are the receiving nodes. Following step 4.1, all of the nodes 111111, 111110, 110110, 110010 and 110001 send the message simultaneously. Node d receives the clean message from the node 110110, but each of nodes a, b, c and e detects a collision. Following the step 4.2 of the algorithm, nodes 110110 and 110001 are dropped out as sender nodes, after the testing of the third bit from the most significant bit side. c then receives the clean message from the node 111110 in the next round.
13 111111
111110
a
110110
b
c
110010
110001
d
e
Figure 6. An Example for Collision Resolution by the Broadcast Algorithm 000011
a
000010
b
000001
c
Figure 7. Another Example for Collision Resolution by the Broadcast Algorithm
Subsequently, node 111110 is dropped out after the sixth bit is tested for a ’1’, so that nodes a and b get clean message from 111111 in the next round. Node 110010 receives an ack signal in slot N from node e corresponding to the third bit position so that, by virtue of step 4.3, node 110010 transmits in the next round. Thus, node e would receive the message from node 110010. Example 3. Consider the network in figure 7, where the nodes 000011, 000010 and 000001 are the transmitting nodes, and nodes a, b and c are the receiving nodes. Due to step 4.1, all these nodes transmit the message in the first round (i.e., in the round immediately after their state was changed to transmit). Due to collision, none of the nodes will transmit in the second round (as the second most significant bit of all these nodes is ’0’). But in the third round, due to step 4.3, all of them will start retransmitting the message. In this way, eventually node 000001 is dropped out after the fifth bit (from the msb side) testing, and node 000010 is dropped out after the sixth bit testing. Finally, nodes a, b and c receive the clean message from node 000011. 4.4.2. Correctness of the Algorithm Theorem 1. The algorithm bf broadcast correctly executes the one-to-all broadcast among all the n nodes of the network. Proof : After the steps 1 and 2 of the algorithm bf broadcast, the source node initially transmits the message to all nodes in receive state in layer 1, each of which then gets the clean message (by step 5.2) and moves to the active state. Step 3 ensures that property 1 is satisfied to move all these active nodes to transmit state in the next round, and this is done in two successive rounds corresponding to round count MOD dlog ne ≤ 1 (as discussed in section 4.3). Step 4.1 enables each of these nodes to transmit the message for the first time and wait for acknowledgements. Steps 4.2 and 4.3 in conjunction with steps 6.2 and 6.3 ensures that
14 collision resolution mechanism as described in section 4.2 has been properly followed. Thus, all nodes in layer 2 will eventually get the clean message. For nodes in any succeeding layer, we can similarly argue that both property 1 (due to step 3) and property 2 (due to steps 4.2, 4.3, 6.2 and 6.3) are satisfied. Hence the theorem. 2 4.4.3. Mobility Resilience The layer-by-layer transmission of the message as in [1] and periodic retransmission of the message by the source node after every dlog ne rounds ensures that even if a node moves from a layer j to a layer i before it has received the message M and after all nodes in layer i have finished transmitting M , where i < j (i.e., it is now at a smaller distance from the source node s), it will still be able to receive the broadcast message correctly at some point of time. In addition to this feature, because of the N ack signal generated by a node in collision state, even if a node in collision state moves from one layer to another, it will eventually be in the neighborhood of some node in transmit state and hence, it will receive the message correctly. The combination of these two features make bf broadcast highly mobility resilient. 4.4.4. Complexity Lemma 1. At least one node is guaranteed to have received the message correctly, after every 2dlog ne + 1 rounds of transmission. Proof : Because of the typical nature of dropping out successive transmitting nodes causing a collision, it is guaranteed that every 1 + 2dlog ne rounds, at least one node of the receiving layer j (assuming that transmitting layer is j − 1) gets the message correctly. The term ’1’ in the complexity accounts for the very first round and the factor of 2 is included to take care of the fact that if a bit tested for 1 causes a no signal to the receiving nodes, then this bit is tested for 0. Since there are a maximum of dlog ne such two rounds of message transmissions for each bit of the id, the claim is justified. 2 Lemma 2. At least two nodes are guaranteed to have received the message correctly, in every 2dlog ne + 2 rounds of transmission. Proof : After a node, say u, in receive state receives a collided message for the first time, it looks for a message to be received in successive rounds from its transmitting neighbors which are not yet dropped out. If during this process, the node u always receives a collided message in successive rounds, then this node u is bound to resolve the collision in a total of dlog ne + 1 rounds to get the clean message. However, if u does not receive the message in some round, then it sends an N ack in that round. Two distinct situations may now be possible as discussed below. In one situation, one of the transmitting neighbors, say v, of u receives only this N ack for the first time, and no C ack. Note that in this case, any other neighbor of v which might have experienced a collision and sent previously a C signal to v, has received the clean message when v was dropped out from transmission. Hence, in the next round, v sends the message to u which is correctly received there. In the worst case, v may receive such an N ack in a round corresponding to the testing of the least significant bit of its id (i.e., when the least significant of the id of v is 0). Hence, the total number of rounds in which u resolves the collision is dlog ne + 2. However, also note that there was one more node in collision state who also resolved its collision in these dlog ne + 2 rounds.
15 In the other situation, assume that the transmitting neighbor v of u receives an N ack from u for the first time, along with a C ack from some other neighbors. In this case, v may have to wait for several rounds before it transmits the message again, until it does not have a neighbor any more which sends a C ack, i.e., all neighbors of v other than u have got the message correctly by that time. By lemma 1, the collision at neighbor(s) of v other than u can always be resolved in 2dlog ne + 1 rounds. Hence, u can get the clean message in one additional round, i.e., in a total of 2dlog ne + 2 rounds. Note that at least one more neighbor of v has also got the clean message by this process. Hence the claim. 2 Theorem 2. The algorithm bf broadcast takes (n − 2)dlog ne + n − 1 = O(n log n) rounds to complete the broadcast in the worst case. Proof : All the nodes in layer 1 gets the message in the very first round. For the nodes in a layer j, 2 ≤ j ≤ D, D being the diameter of the network graph, we see that in view of lemma 2, two nodes are guaranteed to get the message in every 2dlog ne + 2 rounds. There can be a total of at most (n − 2) nodes in all layers other than the layers 0 and 1. So, the number of rounds ne+2) . Hence the theorem. 2 needed for broadcast is upper bounded by 1 + (n−2)(2dlog 2 Considering eight slots per round, the total number of required slots by bf broadcast is upper bounded by 8(n − 2)dlog ne + 8n − 8 in the worst case. 4.5. Simulation In order to evaluate the performance of our proposed algorithm bf broadcast we simulated the algorithm on both static and mobile scenarios. We used ns-2 [31] for the purpose of randomly generating connected graphs in our simulation studies. We modeled our round structure similar to that of the GSM TDMA frame, assuming eight consecutive slots each of duration 0.577ms for a total of 4.615ms frame duration. All message transmissions are assumed to be completed in a single time slot. For the static scenarios, the broadcast algorithm was simulated on 100 different randomly generated connected graphs for each graph size. For every such randomly generated graph, each node was considered as the source node that initiated the broadcast and the relevant performance data was collected. The average of all such runs is presented as the performance results of the bf broadcast algorithm in figures 8 to 10. For the results depicted in figures 8 and 9, the average and maximum node degrees (δavg and ∆) were fixed at 7 and 15 respectively. Figure 8 demonstrates the average case time and message complexity of the bf broadcast algorithm. Message complexity (figure 8(b)) refers to the number of transmissions of the broadcast message M , while time complexity (figure 8(a)) is the number of rounds required to complete the broadcast. It can be recalled that each round consists of 8 time slots. Figure 9(a) shows the number of retransmissions of the broadcast message M that occurred on an average. Retransmissions can occur due to two reasons : i) collision detected by the receiving nodes and, ii) a node in transmit state receives an N message. Our simulation results showed that the number of actual message collisions suffered is slightly less than the total number of retransmissions of M . Figure 9(b) depicts the total number of transmission attempts on an average, that includes the transmission of the control signals and the broadcast message. Figure 10 shows the variation of average case time and message complexity with graph diameter for graphs of sizes 256, 512 and 1024 nodes.
16
4
Variation of Rounds Count with Graph Size
8
1200
Variation of Message Transmission Count with Graph Size
x 10
δavg = 7, ∆ = 15
7
δavg = 7, ∆ = 15 1000
6
Number of messages
Number of rounds
800
600
400
5
4
3
2 200
1
0 100
200
300
400
500
600
700
800
900
0 100
1000
200
300
400
500
600
700
800
900
1000
900
1000
Number of nodes
Number of nodes
(a)
(b)
Figure 8. Execution time of algorithm bf broadcast
4
3
Variation of Number of Message Retransmissions with Graph Size
x 10
Total Number of Transmissions vs. Graph Size
5
2.5
x 10
δavg = 7, ∆ = 15
δavg = 7, ∆ = 15
2.5
Number of transmissions
Number of retransmissions
2
2
1.5
1
1.5
1
0.5
0.5
0 100
200
300
400
500
600
700
800
900
1000
0 100
200
300
400
(a)
Figure 9. Number of transmissions
500
600
Number of nodes
Number of nodes
(b)
700
800
17 Variation of Message Transmission Count with Diameter
Variation of Rounds Count with Graph Diameter 15000
300
n = 256 n = 512 n = 1024
n = 256 n = 512 n = 1024 250
Number of messages
Number of rounds
200
150
100
10000
5000
50
0 10
15
20
25
30
35
40
45
50
0 10
15
20
(a)
25
30
35
40
45
50
Diameter of Graph
Diameter of Graph
(b)
Figure 10. Variation of execution time with graph diameter
The graphs in figures 11 to 15 show the performance of our algorithm for mobile scenarios. We selected two mobility models - the widely used random waypoint model and the city section model, also known as the manhattan grid model for the purpose of studying the performance of the bf broadcast algorithm. [33] provides a survey of the different popular mobility models. The city section mobility model provides realistic movements for a section of a city as the mobile nodes must follow predefined paths and behavior guidelines such as traffic laws. The mobility trace files were generated using the bonnmotion tool [32] and then ns-2 was used to obtain the results. We considered graphs of 100, 200 and 300 nodes for the purpose of comparison of results. As in the case of the static scenario, each node was in turn considered as the source node and the average of 100 different simulation trials for each graph size is presented as the performance results. The simulation grid sizes chosen were 200 x 200, 500 x 500 and 700 x 700 square units for graph sizes of 100, 200 and 300 nodes respectively. Pauses between two displacements were used for both the mobility models. The pause time was chosen randomly from the interval [0, 60] seconds. Each simulation trial was run for 1200 seconds to ensure that the mobile graphs remain fully connected for sufficient amount of time to ensure that every node receives the broadcast message at some point of time. Figures 11 and 12 show the average case time and message complexity of our algorithm for the manhattan grid and the random waypoint mobility models respectively. We see from these simulation trials that the performance of our proposed algorithm does not vary significantly with the speed of the mobile terminals. It however, appears to be dependent on the mobility model. The increase in the average time and message complexity is small for an increase in maximum possible speed of the nodes from 10 m/s to 30 m/s, as can be seen from figures 11 and 12. Moreover, from figures 13, 14 and 15 we see that on an average, more number of time slots and messages are required to complete broadcast in the manhattan grid mobility model than in the random waypoint model, for the same maximum speed, grid dimensions and graph size.
18
ManhattanGrid Model : Message Count against Mobility
ManhattanGrid Model : Round Count against Mobility
1400
38
n = 100 n = 200 n = 300
36
1200
n = 100 n = 200
Number of Messages
Number of Rounds
34
n = 300 32
30
28
26
1000
800
600
400
24 10
12
14
16
18
20
22
24
26
28
30
200 10
Maximum Speed (m/s)
12
14
16
18
20
22
24
26
28
Maximum Speed (m/s)
(a)
(b)
Figure 11. Performance on the Manhattan grid mobility model
RandomWaypoint Model : Round Count against Mobility
RandomWaypoint Model : Message Count against Mobility
32
1000
n = 100 n = 200 n = 300
900
30
n = 100
Number of Messages
800
Number of Rounds
28
26
24
n = 200 n = 300
700 600 500 400 300
22
20 10
200 100 10 12
14
16
18
20
22
24
26
28
12
14
16
30
(a)
18
20
22
Maximum Speed (m/s)
Maximum Speed (m/s)
(b)
Figure 12. Performance on the RandomWaypoint mobility model
24
26
28
30
30
19
Comparison of Message Count (n = 100)
Comparison of Round Count (n = 100) 27
300
ManhattanGrid RandomWaypoint 26
280
Number of Messages
Number of Rounds
25
24
23
260
240
220
22
200
ManhattanGrid
21
20 10
RandomWaypoint 180 10 12
14
16
18
20
22
24
26
28
12
14
16
18
20
22
24
26
28
30
Maximum Speed (m/s)
30
Maximum Speed (m/s)
(a)
(b)
Figure 13. Performance Comparison for n = 100
Comparison of Round Count (n = 200)
Comparison of Message Count (n = 200)
32
260 ManhattanGrid RandomWaypoint
ManhattanGrid RandomWaypoint
31
250
30
Number of Messages
Number of Rounds
240 29
28
27
230
220
210 26
200
25
24 10
12
14
16
18
20
22
24
26
28
30
190 10
12
14
16
Maximum Speed (m/s)
(a)
Figure 14. Performance Comparison for n = 200
18
20
22
Maximum Speed (m/s)
(b)
24
26
28
30
20 Comparison of Round Count (n = 300)
Comparison of Message Count (n = 300)
37
1250
36
1200 ManhattanGrid
ManhattanGrid
RandomWaypoint
RandomWaypoint Number of Messages
Number of Rounds
35 34 33 32 31
1150
1100
1050
1000
30 950
29 28 10
12
14
16
18
20
22
24
26
28
30
900 10
12
14
16
Maximum Speed (m/s)
(a)
18
20
22
24
26
28
30
Maximum Speed (m/s)
(b)
Figure 15. Performance Comparison for n = 300
4.6. Performance Comparison Table 1 provides a comparison of the performances of bf broadcast with the polylog broadcast algorithm proposed in [1]. Table 2 shows the worst case required time slots for the deterministic broadcast algorithm presented in [37]. Henceforth, we shall refer to the broadcast algorithm in [37] as radix broadcast for the sake of convenience. radix broadcast requires (D − 1)τ m! time slots, where τ = rh (m−h)! , r is the radix chosen, n = rm , h = blog ∆c and (m − h) ≥ 0. For the purpose of our comparison, we computed the worst case slots requirements of the radix broadcast algorithm for r = 2 to 8. The required number of slots varies with r and the values presented in table 2 correspond to the radix for which we get the minimum of the worst case requirements for a given n, D and ∆. Table 3 shows another comparison between the performance of radix broadcast and bf broadcast for a different set of n, D and ∆. We note that for a given n, the performance of radix broadcast depends on the D and ∆ values. For example, in table 3, for n = 64, if we had D = 9 and ∆ = 13 instead of D = 7 and ∆ = 20, the worst case required number of time slots for radix broadcast would be 3072 (corresponding to r = 3) instead of 11664. Note that in such a scenario, radix broadcast would complete broadcast faster than ours in the worst case. Comparing the worst case time complexity of our algorithm with those in the literature, we see that it is better than the O(n log2 n)-time broadcast algorithm proposed by Chrobak et. al. in [10] and the O(n log n log D) algorithm given in [21] by Kowalski and Pelc. It is to be noted that the authors in [10] show only the existence of a deterministic broadcast algorithm that can work in O(n log2 n) time, without giving any actual construction. Kowalski and Pelc in [22] proposed another deterministic broadcast algorithm for arbitrary ad hoc radio networks where the nodes possess collision detection capabilities. This algorithm has a time complexity of O(n log n) like ours. However, nothing was mentioned there about the performance of their algorithm in the case of mobile networks. The same applies to the algorithms in [21] and [10]. An interesting observation in the context our proposed bf broadcast algorithm is that for the
21 Table 1 Slots requirement comparison of bf broadcast with polylog algorithm
n 128 256 512 1024
D 22 35 40 58
Algorithm Polylog 36969 940800 19353600 56125440
∆ 15 20 36 36
Algorithm bf broadcast Worst Case Average Case 15456 773 34880 1240 76464 1513 168320 2518
Table 2 Slots requirements of radix broadcast
n 128 256 512 1024
D 22 35 40 58
∆ 15 20 36 36
Algorithm radix broadcast min. r slots 6 27216 4 208896 4 4792320 4 7004160
simulation trials, the average execution time of our proposed broadcast algorithm is significantly lower than that in the worst case by orders of magnitude, and is upper bounded by 8D log n. It may be noted in this context that the asymptotic lower bound for deterministic broadcast in networks where spontaneous transmission by the nodes is not allowed, is given by Ω(D log n) [29]. 5. Gossiping Under the collision detection model, we now extend our idea of breadth-first broadcast to devise an algorithm for gossiping among the nodes of an ad hoc mobile network so that every node u has some message mu to be broadcast to all other nodes of the network.
Table 3 Comparison of radix broadcast with bf broadcast
n 64 128 256 512 1024
D 7 11 13 21 28
∆ 20 25 25 21 22
Algorithm radix broadcast min. r slots 3 11664 4 61440 4 73728 5 300000 4 829440
Algorithm bf broadcast worst case average case 3480 132 8072 186 18296 245 40808 287 89944 345
22 u
u1 1
u2 1
uk
Figure 16. Collision-free message transmission from node u to its neighbors
5.1. Basic Idea In the algorithm bf broadcast of the previous section, some of the nodes in transmit state at say, layer j − 1, are selectively dropped out so that eventually a receiving node in the layer j would have exactly one transmitting node as its neighbor. A node in layer j receiving the message without any collision sends an ack signal in the S slot. Let mu denote the message that node u wishes to broadcast. Each node maintains a message array of length n. The message from node i is stored in the ith location of this message array. Let Mu denote the message set of a node u, which consists of all messages that u has received cleanly so far. The source node s that initiates the gossip algorithm initially has only one message (ms ) in its message set. Each neighbor of s subsequently appends its own message mu and all other messages it has received from its neighbors to form its message set Mu . When u moves to the transmit state, it transmits Mu . The algorithm terminates when every node in the network has received the message of every other node in the network. Specifically, consider the situation in which the nodes u1 , u2 , · · · , uk all receive the message set Mu without any collision from only one single transmitting parent node u, as shown in figure 16. Subsequently u receives an ack signal in the S slot. Now, the node u, instead of immediately changing its state to active as in the bf broadcast algorithm, would first execute a procedure gather messages to collect the message sets to be broadcasted by each of the nodes u1 , u2 , · · · , uk , and then will change its state to active. Also, each of the nodes u1 , u2 , . . . , uk receiving a clean message will change its state to a new state back transmit, in which it would respond to all control signals generated by u for message gathering, instead of immediately going to active state as in the bf broadcast algorithm. Executing this modified algorithm, which we call as the algorithm bf gossip, all the messages that each of u1 , u2 , . . . , uk in layer j have heard so far, move one layer up, i.e., to the node u in layer j − 1. Hence, D (D being the diameter of the network) such calls to algorithm bf gossip, would cause the messages of all nodes to reach the root node s. One more call to the algorithm bf broadcast by s would complete the required message transfers for gossiping. The procedure gather messages called by a node u will successively select the neighboring node with the maximum id, that is yet to transmit its message list Mui to u, from the nodes u1 , u2 , · · · , uk , by using the function find next max id as described later. Node u collects all such messages. Note that when u will send a control message for this purpose, only those of its neighbors in back transmit state would respond. After a node ui sends its message set Mui to u, it changes its state to active. Finally, on return from the procedure gather messages, node u changes its state to active. To implement the above idea, we augment the round structure described in the bf broadcast
23 test ack1 ack2 ack3
M
S
C N query ack send recv fin
Figure 17. Structure of a round for algorithm bf gossip
algorithm (figure 4) with five additional slots : i) query, ii) ack, iii) send, iv) recv and, v) fin slot. In the query slot, a node in transmit state that has received an S signal only, will try to find its neighbor in back transmit state with next maximum id, by executing the find next max id procedure. Each node in back transmit state that hears a signal during the query slot, either sends a response by sending its own id, or remains silent during the ack slot, depending on the bit pattern of its address. The find next max id procedure can last for one or more rounds. A neighbor j selected thus by a node will change its state to active after transmitting its message set Mj and not respond to any further find next max id calls. A node u will send a command in the send slot to its neighbor j, selected by executing the find next max id procedure, to send its message set to u during the recv slot. During the recv slot, j will send its message set back to u. Node j indicates the end of transmission of its message set by sending a signal in the fin slot. When node u hears a signal in the fin slot, either clean or collided, it resumes execution of the find next max id in the subsequent round, until all neighbors in back transmit state have been touched. The purpose of the fin slot is to enable the use of multiple rounds of query and recv slots to execute the find next max id procedure and to receive the message set of chosen neighbor j. Figure 17 shows the structure of a round used for implementing the gossip algorithm. At this point we would like to mention that the gossiping algorithm in [3] suffers from a synchronization problem similar to the broadcast algorithm there as explained in section 4.3 above, due to the usage of two different types of rounds differing in the number of slots per round. Besides the problems mentioned for the bf broadcast algorithm, there can be additional synchronization problem due to the varying amount of time taken by different nodes in executing the gather messages protocol. While a node in transmit state may be executing gather messages, other nodes in its neighborhood may be trying to move from the active to transmit state or attempting to resolve collisions in their neighborhood. Like in the case of the bf broadcast algorithm, the problem gets aggravated all the more for mobile scenarios where a node may move into the neighborhood of another node having a different view of the round structure. The proposed gossiping algorithm, however, avoids this type of problems by using only one type of round structure. For the gossip algorithm, we introduce a fifth possible state of a node, called back transmit, in addition to the four states receive, collision, active and transmit as mentioned in the previous section. For the function find next max id, we use the following notations : Suppose the id of a node is j. Let m = dlog ne − 1. j will then be represented by dlog ne bits as j = jm jm−1 · · · j0 . We denote the portion of the bit string jm jm−1 · · · jk by the symbol [j]m,k . 5.2. Algorithm bf gossip We describe in this section the modifications required to the algorithm bf broadcast in order to convert it to the algorithm bf gossip. First, a node i gathers the messages received cleanly by
24
1: function FIND NEXT MAX ID(i) 2: m = dlog ne − 1; 3: jm ← 1; 4: f lag ← true; 5: k ← m; 6: while (f lag and k ≥ 0) do 7: [j]m,k ← jm jm−1 · · · jk+1 1; 8: Send command in the query slot 9: to all neighbors in back transmit state 10: whose [id]m,k = [j]m,k , to 11: send their id in the ack slot; 12: if no signal received in the ack slot then 13: jk ← 0; 14: end if 15: if clean signal received in the ack slot then 16: /* neighbor with highest id found */ 17: j ← id of the node from ack slot; 18: f lag ← false; 19: end if 20: k ← k − 1; 21: end while 22: /* no more neighbor of i in back transmit state */ 23: if f lag = true then 24: j ← −1; 25: end if 26: return j; 27: end function
. indicate invalid id . return node id
25 all its neighbors until now by executing the procedure GATHER MESSAGES. 1: procedure GATHER MESSAGES(round count) 2: /* send a query signal and */ 3: /* look for an acknowledgement */ 4: /* Acknowledgement will be sent only by */ 5: /* its children in back transmit state */ 6: repeat 7: /* Node i tries to find max id neighbor j */ 8: /* using the query and ack slots */ 9: j ← find next max id (i); 10: if j 6= −1 then 11: Ask j to transmit its message set Mj ; 12: repeat 13: receive Mj ; 14: look for a signal (clean or collided) in fin slot; 15: round count ← round count + 1; 16: until signal in fin slot; 17: end if 18: until j = −1; 19: end procedure
. increment round count
. no more neighbor present
Next, for a node in state transmit, Step 4.4 of algorithm bf broadcast is modified as follows : Step 4.4 : If an ack was received only in slot S but not in C and N , then execute procedure GATHER MESSAGES. If the node is the source node s, then change the state back to active, else to receive. Increment round count by 1 and return to Step 3 for the next round. Also, if the state of a node is receive, then step 5.2 for the case when clean signal is received in the message slot, will now be as follows : Step 5.2 : If a clean signal is received in message slot, then send an acknowledgement in S slot, and change the state of the node to back transmit. Increment round count by 1 and go back to Step 3 for the next round. Further, if the state of a node is collision, then step 6.4 will be changed as follows : Step 6.4 : If a clean signal is received in message slot, then send an acknowledgement in S slot, and change the state of the node to back transmit. Increment round count by 1 and go back to Step 3 for the next round. Finally, the procedure BACK TRANSMIT ACTIONS below depicts the actions corresponding to the back transmit state. In view of all the above discussions, we have the following result : Theorem 3. Algorithm bf gossip correctly executes gossiping among all nodes of the network.
26
1: procedure BACK TRANSMIT ACTIONS(i, round count) 2: if state = back transmit then 3: repeat 4: if signal received in test slot then 5: transmit in ack1 slot of this round; 6: end if 7: if signal received in ack1 slot then 8: transmit in ack2 slot of this round; 9: end if 10: if signal received in ack2 slot then 11: transmit in ack3 slot of this round; 12: end if 13: if signal received in query slot then 14: either transmit in ack slot or remain silent, 15: based on the bit pattern of the node id; 16: end if 17: if signal received in send slot then 18: repeat 19: send message set Mi in recv slot; 20: round count = round count + 1; 21: until Mi completely transmitted; 22: end if 23: if no signal in query phase then 24: send signal in fin slot; 25: if i 6= source then 26: state = receive; 27: else 28: state = active; . only source changes back to active state 29: end if 30: end if 31: until state = active; . end repeat loop 32: end if . end of state = backtransmit 33: end procedure
27 Round Count against Graph Size 220
200
Random Waypoint Mobility Model Manhattan Grid Mobility Model Static Graph
Number of rounds
180
160
140
120
100
80
60 50
100
150 Graph size (n)
200
250
Figure 18. bf gossip, plot of round count vs. graph size
5.3. Complexity It follows from the above discussions that the procedure GATHER MESSAGES will need at the most 2dlog ne∆ rounds, where ∆ is the maximum degree of a node. However, when we sum over all such nodes u during one complete pass of the algorithm bf gossip, the actual time needed to execute all the calls to procedure GATHER MESSAGES will be limited to 2dlog ne(n − 1) rounds. Hence, the overall worst-case time complexity of the algorithm for gossiping is equal to [13((n − 2)dlog ne + n − 1) +26dlog ne(n − 1)](D + 1) time slots = O(Dn log n). 5.4. Simulation In order to evaluate the performance of our proposed algorithm bf gossip we simulated the algorithm on both static and mobile scenarios. Similar to the simulation for bf broadcast, we used ns-2 for the purpose of graph generations to study the static scenarios and bonnmotion was used to generate the trace files for the two mobile scenarios - random waypoint and the manhattan grid model. The generated trace files were then used as input to the ns-2 simulation. Figures 18 and 19 show the performance of our proposed bf gossip algorithm for both the static and mobile scenarios. The reported results are an average of 100 runs for each graph size. For the static scenarios, D and δavg were fixed at 8 and 9 respectively. Figure 20 shows the variation of round count with D for static graphs. For the mobile scenarios in figure 18, the maximum speed of the nodes was set to 10 m/s. Random pause times chosen from the interval [0, 60] were used between two displacements for both the mobility models. Each simulation trial was run for 1200 secs, similar to the bf broadcast experiments. For different graph sizes, the grid dimensions were chosen so that the overall node density was 0.001 nodes per sq. unit. The grid area for the manhattan grid model was divided into 5 by 5 blocks. Figures 18 and 19 show that bf gossip and bf broadcast have similar performance patterns. For a given graph size and a given maximum speed of the nodes, like the bf broadcast algorithm, bf gossip takes more number of rounds to complete the all-to-all broadcast in the manhattan grid model than in the random waypoint model, for the same graph size, grid dimensions and
28 Round Count against Mobility 125 Random Waypoint Mobility Model Manhattan Grid Mobility Model 120
Number of rounds
115
110
105
100
95 10
15
20
25 Speed (m/s)
30
35
40
Figure 19. bf gossip, plot of round count vs. mobility for n = 50
maximum speed of the mobile terminals. Furthermore, from figure 19 we see that as in the case of bf broadcast, the performance of the bf gossip algorithm does not vary much with the mobility of the nodes. The increase in the average time complexity is small for an increase in maximum possible speed of the nodes from 10 m/s to 40 m/s, as can be seen from figure 19. 5.5. Performance Comparison 2 3/2 Our algorithm has a better worst case time complexity √ than the O(n log n)-time algorithm by Chrobak et. al. in [10] whenever D < Dmax = n log n). Like their broadcast algorithm in [10], their proposed gossip algorithm too is non-constructive. Comparing the performance of our proposed gossiping algorithm with the O(D∆3/2 log3 n)-time Collate&Broadcast deterministic distributed gossiping algorithm presented in [16], we see that bf gossip has a better ³ ´2/3 time complexity than Collate&Broadcast for all values of ∆ > ∆min = logn2 n . Table 4 shows the values of Dmax and ∆min for different values of n, and we see that Dmax is quite large and ∆min is very small in the range 50 ≤ n ≤ 1024, which imply that the performance of the bf gossip algorithm will be better than those in [10] and [16] for a large class of network graphs. Table 5 gives the worst case vs. the average case time slots requirement of the bf gossip algorithm. The average case values shown for our algorithm were obtained through simulation for each n, D and ∆ value, we took the mean of 100 runs. The results show that for any arbitrary graph, the average case performance of our proposed gossiping algorithm is significantly better than the worst case slots requirement. 6. Conclusion We have presented deterministic mobility-resilient algorithms for broadcast and gossiping in ad hoc networks with collision detection capabilities of the mobile terminals. The proposed broadcast algorithm is mobility resilient even for high mobility of the nodes, takes O(n log n)
29
Round Count against Diameter 180 n = 50 n = 100 n = 150
170
160
Number of rounds
150
140
130
120
110
100
90
5
5.5
6
6.5
7 7.5 8 Diameter of graph (D)
8.5
9
9.5
10
Figure 20. bf gossip, round count vs. D for static graphs
Table 4 Values of Dmax and ∆min n
Dmax =
50 64 100 128 150 200 250 256 512 1024
√
³ n log n
39.91 48.00 66.44 79.20 88.53 108.10 125.95 128.00 203.65 320.00
∆min =
n log2 n
´2/3
1.35 1.47 1.72 1.90 2.02 2.27 2.49 2.52 3.42 4.72
Table 5 Time slots requirement of bf gossip
n 50 100 150 200 250
D 7 11 11 14 14
∆ 12 17 16 18 20
Algorithm bf gossip Worst Case Average Case 65533 1248 226421 1804 389233 2530 644059 2708 805909 3057
30 time in the worst case, and its simulation results show an average case performance upper bounded by 8D log n. This average case behavior is quite encouraging in view of the Ω(D log n) bound given in [29]. Our bf gossip gossiping algorithm completes an all-to-all broascast in arbitrary mobile ad hoc networks in O(Dn log n) time. Simulation results for the bf gossip too show that it is mobility resilient and has a significantly better average case performance than the worst case time complexity. REFERENCES 1. S. Basagni, D. Bruschi and I. Chlamtac, A mobility transparent deterministic broadcast mechanism for ad hoc networks, IEEE Trans. Networking 7 (Dec. 1999) 799–807. 2. K. Sinha and P. K. Srimani, Broadcast and gossiping algorithms for mobile ad hoc networks based on breadth-first traversal, Proc. 6th International Workshop on Distributed Computing (IWDC) Lecture Notes in Computer Science (LNCS) 3326 Springer (Dec. 2004) 459–470. 3. K. Sinha and P. K. Srimani, Deterministic broadcast and gossiping algorithms for ad hoc networks, The Journal of Supercomputing 37 (Aug. 2006) 115–144. 4. R. Bar-Yehuda, O. Goldreich and A. Itai, On the time-complexity of broadcast in multi-hop radio networks : an exponential gap between determinism and randomization, J. computer and System Sci. 45 (Aug. 1992) 104–126. 5. S. K. Gupta and P. K. Srimani, Adaptive core selection and migration method for multi-cast routing in mobile ad hoc networks, IEEE Trans. Parallel and Distributed Systems (2003). 6. I. Chlamtac and O. Weinstein, The wave expansion approach to broadcasting in multihop radio networks, IEEE Trans. Communications 39 (Mar. 1999) 426–433. 7. B. Chlebus, L. Gasieniec, A. Gibbons, A. Pelc and W. Rytter, Deterministic broadcasting in unknown radio networks, Proc. of SODA 2000 (2000) 861–870. 8. B. Chlebus, L. Gasieniec, A. Lingas and A. Pagourtzis, Oblivious gossiping in ad hoc radio networks, Proc. 5th International Workshop on Discrete Algorithms and Methods for Mobile Computing and Communications (2001) 44–51. 9. B. Chlebus, Randomized communication in radio networks, P. M. Pardalos, S. Rajasekaran, J. H. Reif, J. D. P. Rolim (Eds), Handbook on Randomized Computing, Kluwer Academic Publishers (2001). 10. M. Chrobak, L. Gasieniec and W. Rytter, Fast broadcasting and gossiping in radio networks, Proc. 41st IEEE Symp. Found. of Computer Science (FOCS’2000) (2000) 575–581. 11. M. Chrobak, L. Gasieniec and W. Rytter, A randomized algorithm for gossiping in radio networks, Proc. 7th Annual International Computing and Combinatorics Conference (COCOON 2001) 11 (2001) 483–492. 12. A. E. F. Clementi, A. Monti and R. Silvestri, Distributed multi-broadcast in unknown radio networks, Proc. 20th ACM Symp. on Principles of Distributed Computing (PODC’2001) (2001) 255–263. 13. A. E. F. Clementi, A. Monti and R. Silvestri, Round robin is optimal for fault-tolerant broadcasting on wireless networks, Proc. 9th Annual European Symp. on Algorithms (ESA 2001) (2001) 452– 463. 14. A. E. F. Clementi, A. Monti and R. Silvestri, Selective families, superimposed codes, and broadcasting in unknown radio networks, Proc. 12th ACM-SIAM Symp. on Discrete Algorithms (SODA 2001) (2001) 709–718. 15. I. Gaber and Y. Mansour, Broadcast in radio networks, Proc. 6th Annual ACM-SIAM Symp. Discrete Algorithms (1995) 577–585. 16. L. Gasieniec and A. Lingas, On adaptive deterministic gossiping in ad hoc radio networks, Information Processing Letters 83 (2002) 89–93.
31 17. P. Indyk, Explicit constructions of selectors and related combinatorial structures, with applications, Proc. 13th ACM-SIAM Symp. on Discrete Algorithms (SODA 2002) (2002) 697–704. 18. E. Kushilevitz and Y. Mansour, An Ω(D log n/D) lower bound for broadcast in radio networks, SIAM J. Computing 27 (Jun. 1998) 707–712. 19. K. Nakano and S. Olariu, Randomized initialization protocols for ad-hoc networks, IEEE Trans. Parallel and Distributed Systems 11 (2000) 749–759. 20. A. Pelc, Broadcasting in radio networks, I. Stojmenovic (Ed.) Handbook of wireless Networks and Mobile Computing John Wiley New York (2002). 21. D. R. Kowalski and A. Pelc, Broadcasting in undirected ad hoc radio networks, Proc. PODC 2003 (2003) 73–82. 22. D. R. Kowalski and A. Pelc, Broadcasting in undirected ad hoc radio networks, Distributed Computing 18 (2005) 43–57. 23. R. Gandhi, S. Parthasarathy and A Mishra, Minimizing broadcast latency and redundancy in ad hoc networks, Proc. MobiHoc 2003 (2003) 222–232. 24. W. Lou and J. Wu, On reducing broadcast redundancy in ad hoc wireless networks, Proc. 36th Hawaii International Conf. on System Sciences (HICSS) (2003). 25. J. Wu and F. Dai, Efficient broadcasting with guaranteed coverage in mobile ad hoc networks, IEEE Trans. Mobile Computing 4 (3) (2005) 259–270. 26. H. Koubaa, Smart antenna based broadcasting in wireless ad hoc networks, Ad Hoc Networks 4 (1) (2006) 138–146. 27. M. Cagalj, J.-P. Hubaux and C. C. Enz, Energy-efficient broadcasting in al-wireless networks, Wireless Networks 11 (1/2) (2005) 177–188. 28. M. Mohsin, D. Cavin, Y. Sasson, R. Prakash and A. Schiper, Reliable Broadcast in Wireless Mobile Ad Hoc Networks, Proc. 39th Hawaii International Conf. on System Sciences (HICSS) 9 (Jan. 2006). 29. D. Bruschi and M. D. Pinto, Lower bounds for the broadcast problem in mobile radio networks, Distributed Computing 10 (3) (1997) 129–135. ¨ uner and U. Ozg¨ ¨ uner, Urban multi-hop broadcast protocol for inter30. G. Korkmaz, E. Ekici, F. Ozg¨ vehicle communication systems, Proc. 1st ACM workshop on Vehicular Ad Hoc Networks (VANET ’04) (2004) 76–85. 31. The network simulator, http://www.isi.edu/nsnam/ns (2007). 32. Bonn Mobility and Networking Suite, http://web.informatik.unibonn.de/IV/bomonet/BonnMotion.htm (2007). 33. T. Camp, J. Boleng and V. Davies, A survey of mobility models for ad hoc network research, Wireless Communications and Mobile Computing 2 (5) (2002) 483–502. 34. F. Dai and J. Wu, Performance comparison of broadcast protocols for ad hoc networks based on self-pruning, IEEE Trans. on Parallel and Distributed Systems 15 (11) (2004) 1027–1040. 35. J. Wu and F. Dai, Broadcasting in ad hoc networks based on self-pruning, Proc. IEEE Infocom (2003). 36. Z. J. Haas, J. Y. Halpern and L. Li, Gossip-based ad hoc routing, Proc. IEEE Infocom (2002). 37. P. K. Srimani and B. P. Sinha, Mobility tolerant broadcast in mobile ad hoc networks, Proc. Intl. Workshop on Distributed Computing LNCS 3326 (2004) 435–446.