# An IoT-Based Solution for Intelligent Farming +
## 4 Experimental Evaluation
### Discussion  
As tackled in the previous section, the implemented gateway does not cause relevant traffic congestion considering the evaluation scenario defined. However, there are a few aspects that shall be analyzed in future works, namely:  
* The tests performed considered an Ethernet connection between the gateway and the CP. However, most of real scenarios shall be based in cellular connections (2G, 3G, 4G). Since some of these kinds of connections present bandwidth and latency constraints, we are expecting higher values on the time needed to upload the data to the broker. Thus, a deeper study shall be performed in order to assess the minimum bandwidth necessary to avoid congestion on the gateway;  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Task Duration vs. Number of Collars** & **100** & **200** & **500** & **1000** \\ \hline Duration Rx Beacons (ms) & 23.132 & 22.04 & 22.01 & 26.82 \\ Duration Rx Collars (ms) & 333.25 & 668.25 & 1658.69 & 3306.94 \\ Duration Process Beacons (ms) & 2.56 & 2.79 & 2.90 & 3.49 \\ Duration Process Collars (ms) & 15.78 & 26.56 & 66.05 & 130.31 \\ AMQP Library (ms) & 378.80 & 742.18 & 1342.81 & 2082.95 \\ \hline Cumulative time (ms) & 745.84 & 1430.63 & 3028.57 & 5534.48 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The worst case measurements (maximum duration measured).  
Figure 11: Cumulative processing duration.  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Task Duration vs. Number of Collars** & **100** & **200** & **500** & **1000** \\ \hline Duration Rx Beacons (ms) & 20.02 & 20.02 & 20.01 & 20.02 \\ Duration Rx Collars (ms) & 331.98 & 661.99 & 1651.97 & 3304.96 \\ Duration Process Beacons (ms) & 0.49 & 0.50 & 0.50 & 0.50 \\ Duration Process Collars (ms) & 2.51 & 4.92 & 12.15 & 24.15 \\ AMQP Library (ms) & 23.19 & 113.15 & 243.63 & 492.60 \\ \hline Cumulative time (ms) & 380.68 & 1483.66 & 1932.25 & 3859.17 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The Median Duration of the Most Important Tasks Running on the Gateway.  
* Receiving data from the serial port is the most predominant delay source, particularly when the number of devices increases. Possible solutions include increasing the baudrate or use other interfaces (e.g., SPI);
* This work did not consider the impact of additional modules that interact with the local database. For instance, the local alarm generator and the local web socket modules may increment the processing overhead. If it turns out to be a problem, it is possible to update the Gateway's computing microprocessor, without a significant impact in terms of price and energy consumption;
* The fluctuations observed may be a result of other concurrent tasks of the operating system. Consequently, future work shall consider the adoption of the real-time services provided by Linux;
* Evaluating the feasibility of the gateway's implementation is a step forward in the evaluation of the entire IoT-based stack proposed for intelligent farming solutions. Notwithstanding, there is still work to be done on such stack. Particularly, the network, routing and security modules shall be further developed and evaluated;
* There is also a critical requirement that still needs to be evaluated, particularly the collar's autonomy. On [22], a theoretical evaluation of such autonomy was presented considering a pre-prototype version of the solution, being expected 3224 h of autonomy with a battery of 2600 mAh. However, we believe that this may decrease under real conditions.