# DD-FoG: Intelligent Distributed Dynamic FoG Computing Framework
## 3 Proposed System
### Entities and Interconnection Model in Framework  
Figure 1 in this article showed a generalized architecture of the proposed framework. Within the framework of the architecture under consideration, a number of elements are identified that implement certain computational functions. The structure of the MES implies a hierarchy of elements, with the subordination of the underlying computational layers of the clouds. At the same time, in the structure of fog calculations, as such, there is no strict hierarchy. At the same time, if you correctly organize fog structures, taking into account the technical characteristics and computing capabilities of each of the fog-nodes, their dynamic distribution in space, as well as device-to-device communication (D2D) technologies, it is possible to achieve a greater synergistic effect. In this article, in order to highlight the \"communication gateway\" with the Internet, it is proposed to use the lower-level server of the fog structure--MicroCloud. Thus, taking into account the above, it is proposed to highlight the following functional elements of the framework (Figure 4), taking into account the network component of the infrastructure. The main functional elements are highlighted in blue. Figure 4 also shows possible interactions. For example, device-to-device interaction between fog-nodes, fog-node and micro cloud interaction serving as a fog zone server. It is worth recalling that within this structure, a dynamic allocation of fog-nodes occurs, as a result of which the resource intensity of each of the fog zones changes. At the same time, on top of this dynamic computing infrastructure, the microservices of the application of a particular service migrate. Figure 4: Functional diagram of the elements. Within the framework of this framework, the following logic of interaction of functional elements is implemented when a new fog-node is connected. The interaction logic is displayed in the form of message diagrams (Figure 5). Figure 5: Diagrams of interaction of functional elements. * Code of active wireless technology (for example: 802.11 ac, 5G etc); This code is used for defining the theoretical throughput of the device channel. In this case, the database has a table with relations between wireless codes and theoretical channel throughput. * Allowed speed for external microservices. * System of virtualization. * Supported format of microservices. * Battery time: battery discharge time to critical value. In addition, fog-node transmits personal data about the owner to fog-server in order to be identified by the operator. The transfer of information about the owner (structure, obligation, etc.) is not specified in this article and is not a key issue. After that, the main server of the fog-zone determines the possibility of connecting this fog-node with the specified parameters. In case of a positive decision, fog-server (MicroCloud) sends a confirmation message to the pending fog-node connection. In this message, the fog-server also transmits a unique generated ISC (Internal System Code). This code is required for the subsequent processes of interaction of fog-node with the static cloud MEC infrastructure. Including for the application microservices migration management system, in order to uniquely identify each of the fog-nodes in fog-zones, in conditions of physical movement. Table 2 provides a comparison on the pros and cons of systems from related works with our proposed system. After this message, fog-server transmits connection parameters. As a result, the pluggable fog-node sends a confirmation message to the fog-server about readiness. After