# CONE: A Connected Dominating Set-Based Flooding Protocol for Wireless Sensor Networks
## 3 Design and Implementation of CONE
### Flooding Protocol
The state transitions are caused by events which can occur when a function is called or when a variable is set. The state _Maintenance_ is the starting state. The function “receives Trickle_message” handles messages received by Trickle. Figure 10: The Trickle protocol. The messages contain the nodes’ ID and sequence number \(seqno_{x}\). The current sender is colored in grey. The dashed lines indicate that two nodes are in transmission range of each other. The thick arrows indicate a transmission from one node to another one. (**a**) Node 1 broadcasts information with \(seqno_{i}\) to node 3. (**b**) Node 3 updates its local stored information after receiving the information from node 1 and rebroadcasts the message with \(seqno_{i}\) to node 1, 2, and 4. (**c**) Node 2 and 4 update their locally stored information after receiving the message from node 3 and broadcast the message with \(seqno_{i}\) to node 3. ```
1:while True do
2:if DS_is_connected is false then
3: proceed with CDS construction
4: set timer for construction
5: wait until (DS_is_connected is true) or (timer for construction expires)
6:else
7: set timer for maintenance
8:endif
9:if (I'm not the initiator) and (DS_is_connected is true) and (timer for maintenance expired) then
10: set DS_is_connected to false
11: broadcast maintenance_message
12: set timer for maintenance
13: wait until (DS_is_connected is true) or (timer for maintenance expires)
14:endif
15:endwhile
16:if receive maintenance_message then
17:if DS_is_connected is true then
18: broadcast is_connected_message
19:endif
20:endif
21:if receive is_connected_message then
22:if (DS_is_connected is false) and (sender is not dominator) then
23: set sender as dominator
24: set callback timer for election
25: pass election_callback as parameter
26:endif
27:endif
28:if receive Trickle_message then
29: DS_is_connected is true
30: restart timer for broadcasting maintenance message
31: handle received message
32:endif
```

**Algorithm 8** CDS maintenance. ## 4 Evaluation

In this section, we evaluate CONE based on results from simulations and from a real-world testbed. For this purpose, we compare the performance of CONE and our baseline protocol Trickle. Note, that we choose Trickle as the baseline because it is one of the most classic algorithms for propagating and maintaining code updates in WSNs and several IEEE 802.15.4 standards are based on Trickle, e.g., RPL [6]. However, CONE is flexible to adapt to other flooding protocols in Contiki. The difference between both protocols is that CONE additionally uses a CDS together with Trickle for network flooding. We use a Tmote Sky sensor platform in our simulations and testbed experiments, respectively. We first present our simulation results followed by our testbed results. ### Simulations

We simulate CONE and Trickle by using the Cooja network simulator [15] in Contiki OS [14]. Cooja is often used in the WSN community for debugging and performance evaluation of WSN projects [27]. To see how CONE affects RDCs and packet loss, we compare the average RDC and average packet loss of all nodes in our simulations. Furthermore, we compare the largest measured RDC of nodes in CONE and in Trickle, respectively. #### 4.1.1 Setup

For our simulations, we use a network that consists of 100 nodes in three scenarios: We simulate a network with various transmission ranges of 15 meters, 35 meters, and 45 meters, in order to evaluate the performance of CONE in different network densities. The nodes are arranged in a square in all scenarios. A larger transmission range results in a higher network density in our scenarios due to the larger number of neighbors of nodes. We expect that a higher network density leads to the occurrence of broadcast storms due to a larger number of simultaneous transmissions in a node's neighborhood. Furthermore, a larger transmission range of nodes results in a smaller maximal hop distance of the network.