A Time-Predictable Fog-Integrated Cloud Framework: One Step Forward in the Deployment of a Smart Factory Hamid Reza Faragardi , Saeid Dehnavi , Mehdi Kargahi , Alessandro V. Papadopoulos , Thomas Nolte MRTC / M¨ alardalen University, V¨ aster˚ as, Sweden {hamid.faragardi,alessandro.papadopoulos, thomas.nolte}@mdh.se School of ECE, College of Eng., University of Tehran, Iran {sdehnavi,kargahi}@ut.ac.ir Abstract—This paper highlights cloud computing as one of the principal building blocks of a smart factory, providing a huge data storage space and a highly scalable computational capacity. The cloud computing system used in a smart factory should be time-predictable to be able to satisfy hard real-time requirements of various applications existing in manufacturing systems. Interleaving an intermediate computing layer –called fog– between the factory and the cloud data center is a promising solution to deal with latency requirements of hard real-time applications. In this paper, a time-predictable cloud framework is proposed which is able to satisfy end-to-end latency requirements in a smart factory. To propose such an industrial cloud framework, we not only use existing real-time technologies such as Industrial Ethernet and the Real-time XEN hypervisor, but we also discuss unaddressed challenges. Among the unaddressed challenges, the partitioning of a given workload between the fog and the cloud is targeted. Addressing the partitioning problem not only provides a resource provisioning mechanism, but it also gives us a prominent design decision specifying how much computing resource is required to develop the fog platform, and how large should the minimum communication bandwidth be between the fog and the cloud data center. Keywords-Smart factory; cloud computing; fog computing; edge computing; resource allocation, real-time applications. I. I NTRODUCTION In order to make modern production cost-efficient, future production lines need to be smarter and more flexible [1], that is the principal notion of Industry 4.0 [2]. Industry 4.0 creates what has been called a Smart Factory. To achieve this goal, all the manufacturing processes are supposed to be configurable, and connected to the Internet. The idea can be fulfilled through connecting and integrating traditional industries, by providing communication between producers and consumers. This idea in near future will revolutionize the whole industrial panorama, as pointed out by the Fraunhofer Institute [3]. The integration of three main elements, including Cyber- Physical Systems (CPS), the Internet of Things (IoT) and cloud computing, builds the foundation of a smart factory. In a smart factory, we encounter with an exponential increase of data size and computational complexity in comparison to traditional manufacturing factories. This is due to (i) participation of a higher number of nodes, each of which continuously generates a stream of data that needs to be stored and processed, and (ii) machine to machine interactions which relies on multiple modern technologies such as big data analysis [4] and cognitive computing [5] which both demand a huge amount of data storage and processing. A promising solution to address the huge data size and extensive computations is cloud computing. If the required computing resources are supplied only by local resources within the factory, then both the cost of purchasing and the maintenance cost dramatically increase the Total Cost of Ownership (TCO). A considerable increase of TCO hinders the development of a smart factory in terms of finances. Hence, cloud computing is adopted as one of the main components of a smart factory to provide highly scalable computing and storage capacity. Most of the manufacturing applications contain multiple hard real-time requirements. However, today’s cloud providers neither provide a guarantee for hard real-time applications, nor provide a possibility for users to specify the deadline of their applications. Nevertheless, recently multiple solid solutions are proposed to provide a real-time cloud data center [6], [7]. They have made a foundation for developing a time-predictable cloud framework by this paper. Even if we provide a time predictable cloud data center, which is able to guarantee the real-time requirements of cloud services, a sub set of real-time applications with tight latency requirements (we call such applications, hard applications) can still not run in the cloud. The reason is inherent in the bandwidth limitation of the communication lines between the cloud data center and the factory. Here, a considerable time is spent over the network for exchanging the data, introducing a noticeable delay in response time of the applications running in the cloud. Therefore, we need to extend the cloud framework to cope with such hard applications having tight latency requirements. Along with real-time requirements, there are other principal challenges such as availability and security in outsourcing workload (data and computations) from local servers to a cloud data center in a smart factory. An effective solution to deal with all the above mentioned challenges (hard real-time applications, security, availability) is to retain a portion of a given workload on local resources, a notion which is referred to as Fog Computing– while the rest of the workload is outsourced to a cloud data center. This vertical extension of the cloud scheme is called fog, because a fog is a cloud that is closer to the ground. Similarly, in a smart factory, a fog platform which is located in the factory and connected with a local network is physically closer to the factory in comparison to a cloud data center which is 2018 Real-Time and Embedded Systems and Technologies (RTEST) 978-1-5386-1475-4/18/$31.00 ©2018 IEEE 54