roabadi et al., 2021). For example, the placement of
services is an optimization problem in fog comput-
ing in which services should be placed in the fog in-
frastructure more efficiently. This problem is referred
to as the Service Placement Problem (SPP) (Khos-
roabadi et al., 2021).
This paper proposes a Dynamic Service Place-
ment algorithm (DSP) in a real-time fog infrastruc-
ture. Our algorithm aims to solve the problem of dy-
namic service placement for latency-critical IoT ap-
plications in hierarchical Fog infrastructure in order
to achieve high QoS for IoT users. The algorithm is
implemented in the iFogSim simulator (Gupta et al.,
2017) and compared with random and first-fit policies
together with the iFogSim built-in cloud-only policy.
The major contribution of this paper can be sum-
marized as follows.
• A framework for placing services dynamically
and in real-time in a hierarchical fog infrastruc-
ture is developed.
• An Integer Linear Programming (ILP) formula-
tion is presented for the SPP problem subject to
constraints such as application deadlines, require-
ments, and fog nodes characteristics.
• This paper proposes an efficient heuristic algo-
rithm that dynamically assigns a placement for a
service in real-time in the most suitable fog node.
The algorithm selects the best fog device that min-
imizes the response time and meets the deadline
of the processed application.
• The novelty of this work lies in the ability of the
framework to dynamically process tasks emitted
by applications one at a time and in real-time. The
algorithm proceeds to optimize the placement of
the services dynamically in the fog infrastructure
as and when a new task is emitted. The proposed
algorithm offers high performances even when the
complexity of the process increases with a large
number of delay-sensitive applications.
The remainder of the paper is organized as follows.
In Section 2, the related works are reviewed. Section
3 describes the system architecture. In Section 4, we
formulate the problem and describe our solution. We
evaluate the proposed solutions in Section 5 and con-
clude in Section 6.
2 RELATED WORK
In this section, we review and discuss some recent re-
lated works that have been proposed for solving the
problem of placing services (SPP) in the fog environ-
ment, focusing on their objective functions and solu-
tions to the SPP.
In (Khosroabadi et al., 2021), authors proposed a
heuristic algorithm, dubbed as ”a clustering of fog de-
vices and requirement-sensitive services first” (SCAT-
TER), based on fog node clustering to solve the SPP.
This algorithm, which has promising results, is based
on QoS metrics in terms of application response time,
network usage, average application loop delays, and
energy consumption. In (Farzin et al., 2022), au-
thors proposed a flexible and scalable platform called
FLEX for the SPP in multi-Fog and multi-Cloud en-
vironments. The service placement problem is for-
mulated as an optimization problem and solved by
the heuristic algorithm with the aim of delay and cost
minimization. In (Tran et al., 2019), Tran et al. pro-
posed a novel approach to task placement on fog com-
puting made efficient for IoT applications that can en-
hance the performance of IoT services in terms of
response time, cost, and energy. In (Tavousi et al.,
2022), authors developed a fuzzy approach to classify
IoT applications based on their characteristics. Fur-
thermore, they proposed a heuristic algorithm to place
applications on the virtualized computing resources.
Cost and resource usage are the performance metrics
for evaluating the proposed approach. The problem
is formulated using Mixed Integer Linear Programing
(MILP). In (Azizi et al., 2019), authors introduced
an efficient heuristic algorithm, called Most Delay-
sensitive Application First (MDAF), to solve the SPP
in fog-cloud computing environments. The proposed
algorithm placed the most delay-sensitive application
services closer to the IoT devices. This later work was
extended in (Hassan et al., 2020) where the authors
proposed a service placement policy, called MinRE,
to provide high QoS for IoT services and low energy
consumption for fog service providers. In addition,
they proposed two heuristic-based algorithms to solve
the problem efficiently. The first one tried to provide
high QoS for critical services in terms of response
time, while the second focused on the fog environ-
ment’s energy efficiency. In (Nezami et al., 2021),
authors studied two optimization objectives for IoT
service placement. They formulated a decentralized
global and local load-balancing problem to minimize
the cost of deadline violation, service deployment,
and unhosted services. In (Natesha and Guddeti,
2021), authors developed a docker and containers-
based two-level fog infrastructure to provide the re-
sources. Furthermore, they formulated the service
placement problem as a multiobjective optimization
problem for minimizing service time, cost, and energy
consumption. The multiobjective problem is solved
using the Elitism-based Genetic Algorithm (EGA). In
A Dynamic Service Placement in Fog Infrastructure
445