# Home Automation System Based on Intelligent Transducer Enablers
## 8 Results
### ITN Response Time  
The response time of a node is defined as the time that goes by since a request to access a sensor value is issued until it is finally performed and the response is sent by the ITN. In order to simulate this behavior, the time response was measured using a script in Python, which requests each node ID periodically for a number of times. This replicates the sequences of processes required to access a sensor value or to change a transducer state. The script issues a request to an ITN, and the ITN sends  
Figure 12: Self-configuration and self-registration times using Linksys WRT54G AP (**A**) and SMCWEB-N AP (**B**). back a response containing a JSON object with its ID (e.g., [\"NodeID\":\"7.1.1\"]). Using this method, the script was run 1000 times for each scenario using the Linksys WRT54G router. A wait time of 25 ms was included between requests to avoid overloading the ITN. At the same time, the Wi-Fi load of the router was captured using its web interface (as shown in Figure 13). Moreover, the script counts the number of successful and failed requests and measures the time required to perform each one. For all of the tests carried out during 1000 script executions, a 0% ratio of failed requests was obtained. In a longer test that executed the script 200,000 times, there were only four failed requests, meaning an error ratio of 0.002%. Table 3 shows different results obtained with the network analyzing tool Wireshark for Scenario A. The following parameters are included: frame number, time instant of the request, source and destination IP addresses (the ITN has IP 192.168.1.123, whilst the client has IP 192.168.1.119), the protocol and the length of each packet captured. Considering the length of all packets, we have obtained that the whole communication uses 712 bytes of data. The histogram corresponding to the response time for the four scenarios is depicted in Figure 14. As can be seen, in the selected scenarios, the response time is not directly related to the distance between \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Frame Number** & **Time (s)** & **Source** & **Destination** & **Protocol** & **Length (Bytes)** \\ \hline
96 & 5.329233000 & 192.168.1.119 & 192.168.1.123 & HTTP & 127 \\
97 & 5.37878000 & 192.168.1.123 & 192.168.119 & TCP & 123 \\
98 & 5.429015000 & 192.168.11.19 & 192.168.1.123 & TCP & 54 \\
99 & 5.436950000 & 192.168.1.123 & 192.168.1.119 & HTTP & 60 \\
100 & 5.437021000 & 192.168.1.119 & 192.168.1.123 & TCP & 54 \\
101 & 5.437990000 & 192.168.1.119 & 192.168.1.123 & TCP & 54 \\
102 & 5.444188000 & 192.168.1.123 & 192.168.1.119 & TCP & 60 \\
103 & 5.489354000 & 192.168.1.119 & 192.168.1.123 & TCP & 66 \\
104 & 5.493145000 & 192.168.1.123 & 192.168.1.119 & TCP & 60 \\
105 & 5.493232000 & 192.168.1.119 & 192.168.1.123 & TCP & 54 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Network packet analysis of an ID request to an ITN. Figure 13: Access point load evolution during the test. **(A)** Load over wired interface; **(B)** Load over Wireless interface. the node and the AP. In addition, for each scenario, the figure shows a curve that fits almost perfectly to the histogram: a Generalized Extreme Value (GEV) distribution with its corresponding parameters of location (\(\mu\)), scale (\(\sigma\)) and shape (\(k\)) [45]. It is important to note that such curves can be used to model the behavior of the nodes and then generate artificial samples from the fitted distributions to perform Monte Carlo simulations. The location and scale of the distributions show that the best results are obtained in Scenario D, while Scenario A yields larger times. This can be explained due to the fact that in Scenario A, the AP, the node and the laptop used to monitor the process were placed very close to each other (i.e., they were placed within a 1-m radius). In Scenario D, the AP and the ITN were placed further, but they had an almost direct line-of-sight, only obstructed by a plywood door that attenuates the signal slightly.