# A Network Architecture and Routing Protocol for the MEDIcal WARNING System
## 7 Simulations  
The proposed network architecture was simulated using the OMNeT++ framework. The simulation model is based on the INET libraries, while the application scenario and the network layer models were implemented from scratch based on the MEDIWARN architecture. The scenario here addressed is the one presented for the experimental assessment described in Section 6.1 and shown in Figure 4. To quantify the impact on the delays experienced by the messages transmitted by the monitor when mobile nodes are active, simulations were also performed with two additional mobile nodes on the move between the routers. Such mobile nodes transmit/receive web traffic to the MEDIWARN virtual biosensor at exponentially distributed random intervals with a mean of 10 s.  
The assessed metrics are the maximum and average RTT and the PLR, calculated as in Equations (1) and (2), respectively. The simulation parameters are shown in Table 3. Each simulation was repeated eight times varying the seed for random number generators. The configured channel model was the log-normal shadowing. The channel model parameters were taken from the work in [41], where the channel was modeled based on experimental measures carried out in a hospital. The RTT simulation results are shown in Table 4. The average RTT was obtained from 8000 samples and the values are shown with the confidence interval calculated at 95%. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{**Without Mobile Nodes**} & \multicolumn{2}{c}{**With Mobile Nodes**} \\
**End Node** & **Max RTT (ms)** & **Avg RTT (ms)** & **Max RTT (ms)** & **Avg RTT (ms)** \\ \hline N1 & 7.16 & \(1.65\pm 0.01\) & 7.16 & \(1.65\pm 0.01\) \\ N2 & 4.59 & \(1.64\pm 0.01\) & 6.81 & \(1.66\pm 0.01\) \\ N3 & 5.26 & \(2.25\pm 0.01\) & 6.68 & \(2.34\pm 0.01\) \\ N4 & 377.68 & \(3.42\pm 0.18\) & 382.12 & \(3.21\pm 0.03\) \\ N5 & 263.21 & \(4.05\pm 0.06\) & 385.17 & \(4.21\pm 0.23\) \\ N6 & 292.51 & \(4.14\pm 0.12\) & 471.71 & \(4.16\pm 0.23\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Maximum and average RTT simulation values for each end node. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline
**Radio and MAC Protocol** & IEEE 802.11n (2.4 GHz) \\
**Payload Size** & 60 bytes \\
**Transmission Period** & 1s \\
**Seeds** & 0–7 (repeated 8 times) \\
**Channel Model** & Log-Normal Shadowing \\
**Ch. model Path-loss exponent (a)** & 4.5 \\
**Ch. model Standard deviation (c)** & 5.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation parameters. In the case with no mobile nodes, the maximum RTT values are always lower than 300 ms. Only a few of samples obtained an RTT higher than 100 ms and this was experienced by the three nodes at the highest hop-distance from the sink (i.e., N4-N6). Note that such values are of the same order of magnitude as the experimental results. Conversely, the average RTT increases with the hop-distance from the sink. In this case, the simulative results differ from the experimental results by few milliseconds (no more than 10 ms). Such a difference is due to the packet processing time, which is not considered in the simulations. In the case with mobile nodes, the maximum RTT values are very similar to the case without mobile nodes for the nodes that are closer to the sink, i.e., N1-N4. Conversely, the maximum RTT increases to 385 ms and 471 ms for N5 and N6, respectively, which is a very low increase. The average RTT values obtained in the case with mobile nodes are very close to the ones obtained in the case without mobile nodes, thus demonstrating that in the MEDIWARN system scenario mobile nodes do not significantly affect the network performance. As far as the PLR is concerned, in all the simulations all the transmitted packets were successfully delivered to the destination, despite a harsh channel was configured. Thanks to the redundant paths, the obtained PLR was zero for all the end nodes.