# Multi-Agent Dynamic Fog Service Placement Approach
## 5 Results
The optimization algorithm performance evaluation was completed using 4 simulated fog nodes, 12 services, and 200 epochs as a default setting. The number of particles ranges from 50 to 500. To perform a CPU stress test, a stress tool was installed. A CPU was stressed with 0 to 6 workers, which means that concurrent process threads that are launched in CPU overload it. The algorithm itself overloads Pi 4 CPU at around 30% once it is started. In total, 0 to 2 workers do not seem to pose any negative effect on a CPU. However, 4 to 6 workers that overload a CPU up to 100% are critical. Services would have to be redistributed before such a level is reached. The following experiment is meant to test the effect of RAM availability. The optimization algorithm performance evaluation was completed using 4 simulated fog nodes, 12 services, and 200 epochs as a default setting. The number of particles ranges from 50 to 500. Please see Figure 16 for more details. Figure 14: Algorithm optimization response time based on criteria number. Figure 15: Algorithm optimization response time based on CPU overloading. Raspberry Pi 4 background processes initially overload RAM with about 220 MB. Once the algorithm is launched, the level goes up to 250 MB. It suggests that the algorithm is not that dependent on RAM, as it is dependent on CPU. However, if there are some significant background processes or additional services, it can still slow down the algorithm and the fog node services need a redistribution. The following experiment is completed to test a low battery level. An external analog-to-digital module would be needed for this since Raspberry Pi 4 does not natively offer an ADC capability to detect a certain level of voltage. However, a low or high input was used for the test purposes. The class BattVolt.java was created to test a battery voltage level. The library P4J was used to read an input value by the BattVolt agent. The polling interval by default was 5000 ms. Using Raspberry Pi 4 as a low-resource fog node, it takes up to 1.5 s to complete the whole process of a service redistribution. Using a PC as a powerful fog node, it would require about 10 times lower duration. More details are available in the paper [54]. CPU overloading does not seem to affect battery level sensing or service redistribution. However, a two-stage IMOPSO and AHP algorithm is sensitive enough to overloading. Still, a few seconds to redistribute fog node services due to a low battery level might not be a problem in real-life conditions. Please see Figure 17 for graphical details and Table 2 for measurement details. The following five experiments are meant to test the security influence on a fog node response time using different security levels and two fog nodes with different hardware capabilities. JADE-S, a security add-on package, was used as a security option [64]. This add-on allows us to develop multi-agent applications with a certain degree of security, including guaranteed message integrity, confidentiality, and authorization checks. It allows for agents and containers in a platform to be owned by authenticated users, which are authorized by a platform administrator. Each agent has a public and a private key pair, which is used to sign and encrypt messages. The JADE security guide claims that the signing and encrypting of messages can slow down the agent communication performance and that this is the reason why it is not completed by default; it is important to check to what extent it can happen. An optimization algorithm performance evaluation was completed using 2 physical fog nodes and 12 services as a default setting. Services have to be moved from one fog node to another due to a low battery. The SecurityHeper() package is used with the methods setUseSignature() and setUseEncryption() to set a signature and encryption for a message. The methods getUseSignature() and getUseEncryption() of the same package are used to retrieve a signature and encryption.