## 5 Analysis of the Solution and Simulation
### Simulation Scenario  
To validate the effectiveness of the proposed network and to compare it with other well-accepted WSN solutions (e.g., ZigBee), a set of demonstrative simulations is conducted. For this purpose, it is mandatory to determine the AP and SP durations of the duty cycle. In order to reduce the number of packet losses in the SG environment, and following the same reasoning of the previous section, the AP is set to 33 ms (up to three sending attempts can be carried out by the sender). Besides, the SP is set to 1 s to reduce the delay and enable the deployment of bigger networks (up to 30 hops). This configuration will not jeopardize the long-standing feature of the network as shown in the following paragraphs. Various simulations are carried out to evaluate the response of the proposed network to each of the propagation environments introduced in the PRR analysis (Section 5.1). Asides from using the aforementioned log-distance path loss model, the TOSSIM simulator exploits the benefits of a very robust environment-aware noise model named Closest-fit Pattern Matching (CPM) [64]. CPM has proven to increase the packet simulation fidelity by up to a factor of 5 [68] in comparison with other simulation approaches (such as those used in ns-2 [69] or EmStar [70]). Furthermore, CPM noise model clearly achieves its best performance when fed with noise traces taken from the real environment to be simulated (this helps to characterize the different interfering phenomena of specific surroundings). Therefore, to enhance the accuracy of the simulation, a noise trace obtained in a power environment is included in our simulations. This way, unlike many other works ([8, 33, 71]), both propagation environments and noise patterns are considered in our simulations--this is especially important in the Smart Grid arena where the electromagnetic noise has as much impact on the final performance as the radio propagation environment itself. The TOSSIM simulator has been fed with the values of Table 1 so as to simulate the three desired scenarios. The _Path loss exponent_ models the rate at which signal decays when it propagates in a specific environment. The _Shadowing standard deviation_ represents the randomness of the received signal due to diverse phenomena (objects in the line of sight, multipath, _etc._). _Power decay_, models the power \begin{table}
\begin{tabular}{l l l l} \hline  & **Good Scenario** & **Mild Scenario** & **Harsh Scenario** \\ \hline Path loss exponent & 2.15 & 2.31 & 2.93 \\ Shadowing std. Deviation & 2.45 & 3.15 & 3.33 \\ Power decay & 33.0 & 54.0 & 54.0 \\ Noise floor & –97.0 & –93.0 & –85.0 \\ \hline \end{tabular}
\end{table} 
Table 1: Network expected lifetime. (in dBs) presence at 1 m distance from the transmitter. Finally _Noise floor_ represents the received power of other noise sources and other unwanted signals (expressed in dBs). Such values have been obtained by carefully reviewing academic literature ([9, 65, 68, 72]) together with a deep analysis of the simulator reference tutorial found in [73]. To the best of our knowledge, there is no WSN simulation for the Smart Grid that simultaneously integrates specific network-layer protocols, MAC and low-power listening mechanisms (authors tend to analyze separately each of the aspects of the WSN, neglecting the effects that one layer may cause to the other). Since SENSED-SG implements a protocol stack composed of the application, the network, the MAC and the physical layers; our simulations jointly evaluate all these elements. Furthermore, constant data-generating patterns are usually assumed in specialized literature [33, 35]. This fact causes that the very bursty nature of a WSN operating in a Smart Grid is neglected, obtaining results that greatly differ from those found in real deployments. To address this concern, in our simulations, bursts of data are randomly generated to emulate the presence of non-desirable conditions in power assets (which usually leads to an increase in data sending).