# DD-FoG: Intelligent Distributed Dynamic FoG Computing Framework
## 1 Introduction  
5G/IMT-2020 infrastructure based on several new architecture solutions can provide new technical opportunities for realizing new services with high data transfer speed and low latency such as tactile Internet, medical services, augmented reality applications and others [1, 2, 3]. However, as we know, tactile Internet applications require 1 ms RTT and thereby, modern approaches confront light speed limitations in the optical physical medium, which ultimately restrict the service distance. As result, researchers have introduced two solutions to tackle this issue. The first solution is based on changing the physical technology with quantum communication, network and computational resources decentralization. Whereas, the second solution is based on applying the compute allocation to improve Quality of Service levels through the integration of fog and MEC with the microservices support in which dynamicality of devices is considered. This paper focused on the second solution[4, 5].  
According to several International Telecommunication Union recommendations, such as the ITU-R M.2083-0 IMT vision--\"Framework and overall objectives of the future development of IMT-2020 and beyond\", IMT-2020 infrastructure will be based on softwaredefined networking (SDN) and network function virtualization (NFV), including computational technologies like a MEC and fog computing [6].  
Currently, few software architecture solutions have been proposed for developing IT solutions including IoT-based applications. One of the modern software architectures is the microservices approach. This architecture provides more opportunities than monolithically and difficult structures [7; 8]. Ideally, it's number of independent microservices in each can be worked with others via message broker, application programming interface gateway (api-gw). The comprehensive and difficult solution based on microservices generally has the special microservice/service for monitoring and controlling every other microservices in structure and message traffic between them [9].  
In a general view of the fog system, MEC and SDN with NFV infrastructure technologies can provide more positive synergy effect [10; 11; 12]. Taking into account the dynamics of user equipment, the new quality challenges, the new ICT infrastructure can ensure the necessary characteristics. An important part of service is the software (platforms, large servers, etc.) and as marked above, the new services with high load should be based on the microservices approach. In this way, microservices are more efficient architectural approaches for implementing fog computing. However, microservices development and deployment are currently challenging in fog and MEC architecture. Therefore, the deployment scheme must be carefully considered. Motivated by such considerations, we proposed a new framework for deploying services based on MEC, fog infrastructure in accordance with user dynamics. The main contributions of this paper are summarized as follows:  
* In this paper, we proposed a new framework for deploying services based on MEC, FoG infrastructure in accordance with user dynamics. The key feature of this framework (DD-fog) is the microservices migration on the necessary FoG-node for providing a stable quality level for each service.
* K means-based algorithm is developed and tested for peak loads center searching.
* Swarm-based algorithm is proposed and tested to define the fog-node with necessary resource allocation.
* Simulation results proved that the proposed framework could reduce the execution time of the microservice function due to the rational allocation of resources by up to 70%.  
The rest of the paper is presented in several sections: The related works and problem statement are detailed in Section 2. Section 3 introduces the proposed system. Afterward, Section 4 presents the proposed algorithms and Section 5 discusses the framework's algorithms realization. Finally, Section 6 concludes the paper.