# SpaceSheep: Satellite Communications for Ovine Smart Grazing
## 4 Discussion  
The results of the first test showed an increase in the amount of data generated with an increase in the number of collars and a decrease in the period (Figure 2), with a daily volume of 1.89 GB for 1000 collars and a period of 30 s. Although this volume of information can be transferred by technology, which can transfer up to 2.99 GB daily, it is quite expensive, with daily values between EUR 345 and 690. These considerably expensive values would be even greater for larger herds, as they are directly proportional to the values of the generated data, as shown in Figure 2. As such, an increase in the data transfer period is not a viable solution, since the volume of data produced continues to represent a great expense for the system; therefore, message encoding optimization is required.  
The results of the connection latency test evidence a higher value for the satellite case, which was associated with the increase in the size of the messages. When smaller messages are considered, the latency is also affected by the different data paths being used by the two technologies. Thus, when larger messages are used, the overall latency reached one and a half seconds, which is a much higher latency than that measured on the WiFi connection, especially due to the low bandwidth available on the satellite connection. In fact, the satellite connection presented a greater latency than the WiFi because of two major factors. Firstly, the path taken by the messages was not the same for each technology. The information sent via the satellite link travels to the destination via a greater number of hops; 23 hops were verified for the satellite connection and 9 when using the WiFi connection. Finally, the data rate available for the satellite connection was limited, and thus, the same information took more time to be uploaded in the case of this connection. Nevertheless, the satellite communications latencies cannot be considered a limiting factor for the system.  
The encoding performance comparison results shown in Figure 3 consistently demonstrate the higher efficiency of the MessagePack API in carrying the alarm messages. AVRO encoding performed second in the tests, and Protocol Buffers had the worst performance in the tests. The difference between MessagePack and Avro was systematically small, while that between MessagePack and Protocol Buffers was slightly larger, with an approximately 8% difference.  
The signaling traffic volume generated by the system, before and after message encoding optimization, decreased considerably and allowed a significant reduction in the amount of information exchanged daily, with approximately 10 times less data from 100 collars upwards. Considering a tariff based on the information volume, the optimization has a considerable impact on both the costs and system latency. The modification of encoding the messages created a significant reduction in the amount of information exchanged daily, with approximately 10 times less data from 100 collars upwards. In terms of latency, it reached 4 s when the maximum number of collars was tested, while for 100 collars, it decreased by approximately 2.9 times.  
In terms of transmission costs and considering tariffs based on the volume of data transmitted, the savings were significant, albeit insufficient. Considering a herd of 100 elements, the expected monthly cost of transmission would decrease from approximately EUR 14,000 per month to EUR 1680, which remains financially unaffordable.  
The analysis of the computational requirements of the alarm system showed that for small and medium-sized herds, the hardware currently running at the gateway (Raspberry PI) responds to the set of requests imposed by system events; however, for larger herds, with more than 100 animals, the response times grow too large to allow for timely alarms to be sent. Unsurprisingly, in the case of the gateway implemented via a PC, the times grew much slower, which made it possible to create a gateway solution with better performance for larger herds.