Synchronous Flooding Broadcast Di Matteo Valerio 1379412 dimatteovalerio@hotmail.it ABSTRACT What is the relation between the cardinality of a network and the number of steps that it takes to complete a Synchronous Flooding Broadcast algorithm? Does the number of steps change dramatically if we increase the number of nodes? Is it tied to the number of edges? In this paper we will try to give an answer to these and other questions by presenting a case study of a simulation of such algorithm, going into details with the statistics that we collect.
Keywords Synchronous, Flooding, Broadcast, Netlogo, Networks, Models, Random, Erdos-Renyi.
1. INTRODUCTION In a network, a “broadcast” is a signal or message that is sent to all the components of the network. A “flooding” algorithm is an algorithm for which every component forwards the message to all of its neighbors upon receiving it. A “synchronous” model is a model in which the terminals act in synchronous rounds; in each round, each processor executes the following steps: 1. 2. 3.
Do some local computation (of reasonable complexity). Send messages to neighbors in graph (of reasonable size). Receive messages (that were sent by neighbors in step 2 of the same round).
Combining these three aspects we get a Synchronous Flooding Broadcast algorithm for which, given a random source, at each step the message is delivered to all of the neighbors of the nodes that received it in the steps before. The algorithm ends when all of the nodes have received the message. We implemented this model on the Netlogo agent-based modeling environment, and we counted the number of steps needed for completion changing the total number of nodes to observe how these two numbers were tied. The topology that we used is the Erdős-Rényi random network. In this type of network, two nodes are connected by an edge with a probability p that is fixed for all the nodes (but, as in our case, can depend on some global factor). This model is very important because it acts like a “benchmark” for many network properties. To compute the statistics we ran the algorithm 5 times for any number of nodes, without changing the network shape, with n going from 500 to 2000 with step=100. Then we computed the average number of steps for each n and we plotted it, comparing it with the expected results.
1.1 The Erdős-Rényi model The model that we use was introduced by Erdős and Rényi in [1] and [2]. They define a Random Network as a network where, given n nodes, an edge between two of them is created with a probability p that is equal for all edges. This leads to an expected number of links N that is: N = n * (n - 1) * p / 2 =
The expected “degree” of the graph is 2N/n, which is the average degree of any node. In fact, the average degree is: E(d) = (n - 1) * p = 2 * N / n
2. EXPERIMENTAL SETUP 2.1 Algorithm The algorithm we implemented is: 1.
Select a random source and give it the “message”.
2.
Each node v upon receiving the message the first time forwards the message to all “virgin” neighbors.
2.2 Implementation The Netlogo environment possesses many ready-to-use models, including the Erdos-Renyi random network. We selected it and applied some changes. First of all, we set the probability for an edge to be created. It is: 3 ln(n) / n Then, we went on to implement the actual broadcasting algorithm. The implementation doesn’t actually send messages, but simulates the diffusion that a broadcast signal would have. In particular, we start from a random node (in Netlogo, a “turtle”) and we give it a particular shape and color (a sky-blue circle). Then, the idea is that each node that has the “message” (i.e. is a circle) should forward it to its neighbors that still haven’t received it yet, so they turn to green circles, too, each time of a lighter green, while the isolated ones should stick to the original shape (triangles) and turn red in the end. So, at each of the following rounds, every node checks if it is a circle and, in case, asks all of the neighbors that are not circles to turn to (lighter) green circles, too. At this point we had to assure that a node that had already done the forwarding discarded the “message”, to save useless computations. We implemented this through the use of a boolean variable called “delivered”, which is set to true if that node has already done his “job”. So, when we ask all of the circle nodes to pass the message, we first check the value of the “delivered” variable. The algorithm ends when all of the nodes have received the message or when a round of forwarding didn’t change the state of