# Multi-Agent Dynamic Fog Service Placement Approach
## 5 Results
RSA and DSA do not seem to have any significant advantage over each other, allowing us to conclude that the usage of security add-on does not contribute to a higher response time, as is suggested in the Jade security guide. Moreover, the usage of other security configurations rather than default ones does not obviously contribute to a higher response time either. It is important to maximize the overall runtime of the system. Mobile fog nodes are known for scarce power supply and therefore resources have to be used in an optimal way. The best service distribution from the perspective of power is the one used when nodes are evenly loaded to keep the whole system available as long as possible. The following experiment is meant to measure the power in watts that is needed to obtain a service placement solution. For the method to be physically available, it has to be running in a fog node. Raspberry Pi 4 was used as a host for the JADE platform. Measurements were made solely with a running Pi 4, and with launched JADE working on its tasks in the Pi 4. Power needs were compared with a regular 40 W bulb for illustrative purposes. An official power supply adapter with the output of 5.1 V and 3.0 A was used. The USB tester UNI-T UT658B was used to measure the voltage and amperage, which served as a power input for Pi 4. Please see Figure 23 for more details. Figure 21: Response time dependency on message encryption. Figure 22: Response time dependency on an asymmetric key pair algorithm. A remote service redistribution scenario was used. In total, 5.1 V and 0.5 A were needed to keep Raspberry Pi 4 running. It is equal to 2.55 W of power. If JADE was launched and no optimization algorithms were running, power consumption settled to the same 2.55 W after a few seconds. However, once an optimization process begins, voltage stays more or less the same but the current increases to 0.62 A, which is equal to 3.162 W. More details are given in Table 3 below. A very tiny amount of energy is needed and the costs to maintain such a fog node are minimal as well. Even if the optimization process is running without any interruptions for the whole month, which is barely required in real-life conditions, self-cost will be around just 0.1 EUR, considering that the price for electricity is 0.214 EUR/kWh. However, power demands did not vary on the type of tasks that were running such as battery level sensing, service placement finding, or redistribution. This suggests that only the active time of the optimization should be considered as the whole instead of breaking it into different processes. The following experiment was conducted to analyze a service placement solution energy consumption based on task scalability. An optimization model was run 20 times with each parameter set using Raspberry Pi 4 as a fog node. Fog computing system complexity was gradually increased by increasing the number of fog nodes, services, particles, and epochs. An average value was used of each 20 attempts. Please see Figure 24 and Table 4 for more details. As is visible from Table 4, finding a service placement for 14 nodes and 42 services requires a very small amount of consumed energy, which is around just 23 mW/h. This is barely considerable, but what requires more attention is the time itself. A response time of over 20 s is unacceptable in field conditions. However, the calculation response time can be improved by using a more powerful fog node such as PC. With the current complexity configuration and low-resource fog node, it can be still beneficial to use it with up to 6 nodes and 18 services with a response time of a few seconds. A bigger problem to address in this case would be keeping a mobile fog node running on a battery for a while when its power supply is limited.