## 4 Measurement Formation Process
### Maintenance of MLMS Measurement-Formation Path  
WSNs are always deployed in a harsh environment, where unreliable wireless links and failure of certain nodes are prevalent, which potentially leads to the failure of creating and maintaining the MLMS path. In fact, the failure of any intermediate node compromises the delivery of all data aggregated and sent by the previous nodes in the path. Hence, some improvements to the scheme should be implemented. We will discuss this problem from two aspects: the nodes failure and the packets loss. Because the failures of other nodes will not affect the current MLMS measurement formation process, we mainly deal with the node failure on the MLMS path. If a node has failed, a new routing path should be established in a timely fashion, and the information of this failed node should be reported to the sink node to guide the building of another MLMS path. Then, two kinds of node failures on a MLMS path will be discussed below, including the group head node failure and the ordinary node failure. If a group head node at the end of MLMS path has failed, a new head node needs to be selected to continue to transmit packets of nodes in the group. Through dividing the remaining nodes into several small groups, we can choose the node which has the second-highest number of neighbor nodes to act as a new group head. If a node on the path fails to operate, its upstream node will choose the next neighbor nodes, which is similar to the GPSR protocol [19], and continue to transmit the packet, since all routing information (heading to interested nodes) is encoded into the packet head. As shown in Figure 8, when node #5 has failed, and its upstream node #4 encounters this situation, according to the working nodes in the neighbors, it will automatically select a next-hop node (e.g., node #6). But at this time, the routing path is probably not the optimal path, and if necessary, the optimal MLMS path should be recalculated. For the node-failure message return, we need to respectively deal with node failures in different measurement-formation periods. In the distribution of the global seed, we can use the Piggyback method, which allowing the sender to add the ID of the failure node to the fixed position of seed-distribution packet. As node #4 sends packets to node #6, because node #3 can eavesdrop  
Figure 7: MLMS construction and the compressed packet format. on the packet, it writes the ID of failure node #8 into a corresponding fixed position of its next packet to be sent, and in turn, until the failure information of node #5 reversely backtracking to the Sink through the normal data channel. Therefore, without increasing any control packet, by adopting the eavesdropping property, information about failed nodes is quickly reported to the Sink, while for the information return of the failed nodes in the process of measurement-formation, we can directly write the ID of the failed node to the fixed position of the measurement-formation packet. With the return of measurement-formation packets, the sink node can directly obtain the information of failing nodes. For each measurement formation process, both in the global seed distribution period and the establishment of measurement result, it will inevitably experience packet losses, and if the packet losses occur without a recovery mechanism, failure of this measurement formation will be induced, definitely. If a node in MLMS path discoveries that several packets in a sequence are not received within an acceptable TTL time, it will ask the upstream node for these packets along the reverse path. If the upstream node does not keep these packets, this process will continue until reaching the interested nodes. As shown in Figure 8, if node #4 fails to receive the packet from #6, node #4 will request this packet from its upstream node #6; if node #6 does not keep it, node #6 will request its upstream node #8 for this packet, and such process will be repeated until the packet is found.