# Fog Computing Architecture for Load Balancing in Parallel Production with a Distributed MES
## 1 Introduction  
For more than a decade, productive sectors have been gradually incorporating different technologies and innovative tools throughout the supply chain, enabling more efficient, flexible, and sustainable production that will benefit stakeholders such as manufacturing companies, production managers, engineers, maintenance operators, customers, suppliers, government authorities, society, and the environment. Technological solutions such as MESs and enterprise resource planning (ERP) systems offer several advanced tools such as the internet of things (IoTs), edge, fog computing (FC), cloud computing, artificial intelligence (AI), digital twin, digital shadows, databases, holograms, immersive-mixed virtual reality, etc., which can be integrated under an architectural reference framework for Industry 4.0, depending on the needs of the different business departments of manufacturing, communication, and data management--technological integration aimed at native smart factories or those in need of digital transformation. The scenario of digital migration in modern automation brings with it several benefits and challenges that must be resolved, so much so that [1] mentions that digitized factories themselves already generate a large flow of data and, when processed in the cloud, could cause delays in production execution times and conflicts in applications that operate with ultra-low latency. This procedure declines the quality of service (QoS) and quality of experience (QoE), basically due to the distance between end users and centralized servers in the cloud. In such unfavorable events, fog computing (FC) emerges as an innovative solution that, due to its operating characteristics, such as its reference architecture under the IEEE 1934 standard and its infrastructure for running industrial IoT services at the edge of a production plant, can solve these and other problems [2; 3; 4]. Following this solution context, ref. [5] mention that, according to the network density that FC can offer in response to the demand for large volumes of data generated by innovative environments such as cities, transportation, healthcare, industry, etc., the integration of this technology would reduce, for example, the response time of cyber-physical systems (CPS), improve the predictive maintenance of actuators, and better distribute tasks and product traceability; the latter being a crucial part of the valuable life of an asset and its value chain, which is a fundamental situation specified by the reference model for Industry 4.0 (RAMI 4.0). Likewise, ref. [6] indicates that applications running under IoT systems must be managed from an FC network to ensure the mobility of heterogeneous and wireless IoT devices that are geographically distributed. In analyzing the background of intelligent manufacturing, various studies highlight the integration of FC as an effective solution to address the aforementioned issues. However, implementing this in context results in various obstacles during the integration of advanced and emerging technologies as part of Industry 4.0. Some of these are limited by processing capacity, which is used to perform different tasks, reduce latency, improve energy consumption, and manage load and resource distribution. These situations present opportunities to leverage the potential of fog and cloud computing, particularly when dealing with expandable architectures that enable scalability, interoperability, flexibility, and modularity [7; 8; 9; 10; 11; 12]. For their part, in [13], they integrate a data gateway architecture into fog computing, consisting of two subordinate edge devices, which collect, filter, and send data to the cloud from two mobile robots of different owners using Docker and Kubernetes on a low-cost single-board computer (SBC). As for [14], they develop an Integer Linear Programming (ILP) model to optimize the location of key nodes (Edge Nodes, Fog Nodes, and Gateways) in an innovative factory environment with a five-layer architecture.