## 6 Simulation Evaluation  
We also evaluate the proposed approach with computer simulation. We use C++ based simulations to study the proposed protocol of localized discovery and recovery of query losses. We focused our  
Figure 8: Delivery success probability \(P_{\textit{succ}}\) with ideal MAC and PHY, as well as integrated model, for varying number of detector nodes \(n\). simulation study mainly on the network layer performance. We also adopted a simplified random access MAC with various contention windows. The evaluations examine the performance of the proposed approach validating the impact of the proposed approach on the successful query delivery, scalability of loss discovery, _etc_. In our simulations, we compare the proposed protocol with the conventional query dissemination, which is a query broadcast operation among sensor nodes and is widely applied in the information retrieval in sensor networks, such as directed diffusion, knowledge based sensor networks, _etc_. [2, 5]. The major purpose of our comparison is to validate the effect of the proposed approach on the improvement of successful query dissemination and its feasibility for sensor networks that have a large number of sensor nodes. To compare the query recovery operation, we also adopt sink-based recovery in the simulation, since it is a straightforward potential method in sensor networks and has been proposed by researchers [10]. In sink-based recovery, the sink node checks the received sensor data and retrieves the lost data from those nodes that have not successfully delivered their data to the sink. The sink-based approach requires the sink node to maintain the IDs of all sensors that should reply to each query. We evaluate the proposed and conventional approaches with the following metrics. 1. _The number of object nodes that have query packet losses_: The average total number of object nodes that suffer packet losses in a query among the sensor nodes that should reply to the query. This metric reflects the quality of the query dissemination process and has an impact on the success of sensor data collection from object nodes. 2. _The average route length in the recovery of query losses_: The average hop length of a route from the object node that fails to receive a query message to the detector node or sink node that recovers the query loss. 3. _The number of successful recoveries_: The total number of successful recoveries in the simulation with varying number of detectors. In the simulation, we try to examine the impact of the network size, the number of object nodes that should respond to a query, and the number of detectors per sensor node. We particularly study the scalability of the proposed approach and the related approaches. The scalability in performance is essential to sensor networks that have large network size and resource constraints. Unless otherwise stated, the simulations are set up as follows. The number of sensor nodes varies from 10 to 100. Each sensor is equipped with a radio module that has a transmission range of 10 m. The sensor nodes are distributed over rectangular areas: 100 m \(\times\) 10 m for 10 nodes, 100 m \(\times\) 20 m for 20 nodes, 100 m \(\times\) 30 m for 30 nodes, and 100 m \(\times\) 100 m for 100 nodes. The default number of detector nodes for each object node is 4. As for the broadcast in the simulation, each node randomly selects a start time to broadcast a received message within a time window of 0-5 time units. The probability of packet loss in recovery is set to 20 %. In the route selection, shortest path routing is utilized in the simulation. Figure 9 shows the average number of object nodes that failed to receive a query message in query dissemination in the sensor network with 100 nodes. As for using conventional query dissemination in general sensor networks, the sink node may not have all sensor information in the network, hence we do not assume that the sink node performs loss recovery here.