# Data Collection Based on Opportunistic Node Connections in Wireless Sensor Networks
## 4 Data Collection Scheme Based on Opportunistic Node Connections
### Energy Efficient Probe Message Forwarding Mechanism  
For each node in the data collection scope, it needs to send its source information (including its whole working time, its status transition frequency and all its neighbors' IDs) included in the probe messages to the mobile sink. The format of the probe message is given in Table 2.  
The \"Message Source\" field is used to indicate the ID of the node sending this probe message. The \"Source Information\" field is used to store the whole working time, the status transition frequency, and the neighbors' IDs of the message source. The \"Sink ID\" field indicates the SID of the mobile sink launching this data collection task, and which is also the forwarded destination for the probe messages. The \"Forwarders ID\" field is used to store the IDs of nodes that have forwarded this probe message in sequence. In the process of forwarding a probe message, each time the message is relayed by a node (forwarder), it should add its ID in the \"Forwarders ID\" field in the probe message. The \"EOH\" field is used to store the value of EOH for the message source. Since a probe message can be generated from any node that received a tag message and the opportunistic node connections in the network decrease the efficiency of probe message forwarding, it is necessary to design an energy efficient probe message forwarding mechanism to minimize the overall energy consumption when forwarding them to the mobile sink. In the mechanism, only the nodes that have received this tag message can participate in the probe message forwarding. When an intermediate node \(v_{m}\) receives a probe message, it will check the IDs stored in \"Forwarders ID\" field in this probe message to learn whether it has forwarded it or not. Here if \(v_{m}\) has not forwarded this message, as shown in Figure 3a, it first updates the \"Forwarders ID\" field by adding its ID in it and calculates the Number of Forwarders (NF) based on it, by obtaining the value of EOH in this message it then can further calculate (EOH-NF), to find a neighbor whose EOH is closest to it as an optimal forwarder. However, if \(v_{m}\) has forwarded this message, as shown in Figure 3b, for sake of exposition, suppose that the IDs in the \"Forwarders ID\" field are denoted as {\(v_{s}\),..., \(v_{p}\), \(v_{m}\), \(v_{n}\)}, it first explores the neighbors that have not forwarded this probe message by checking \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Message Source** & **Source Information** & **Sink ID** & **Forwarders ID** & **EOH** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The format of the probe message. the IDs in this field, and then updates this field by deleting the IDs of \(v_{m}\), \(v_{n}\) from it and adds its ID in it. In the next, by calculating NF based on this field and obtaining the value of EOH in this message, \(v_{m}\) can further calculate (EOH-NF) to find a neighbor whose EOH is closest to it from the explored neighbors as an optimal forwarder. Considering the asynchronous working-sleeping cycle strategy for nodes, when \(v_{m}\) receives this probe message from \(v_{p}\), if only the neighbor \(v_{p}\) is in working status, as shown in Figure 3c, it forwards the message to \(v_{p}\). However, if \(v_{p}\) is also in sleeping status, as shown in Figure 3d, \(v_{m}\) stops forwarding it. Algorithm 1 gives the detailed energy efficient probe message forwarding mechanism. ```
1. When an intermediate node \(v_{m}\) receives a probe message:
2. if(\(v_{m}\) has not forwarded the probe message)
3. Add its ID in the \"Forwarders ID\" field included in the probe message;
4. Calculate NF based on the \"Forwarders ID\" field;
5. Calculate (EOH-NF); // the EOH is obtained from the \"EOH\" field
6. if(\(v_{m}\) has neighbors) //\(v_{p}\) is not included
7. Select the neighbor whose EOH is closest to (EOH-NF) as an optimal forwarder;
8. Forward the probe message to it;
9. end if
10. else
11.