Resource allocation for fog computing based on software-defined networks

ABSTRACT


INTRODUCTION
Internet of thing (IoT) comprises many smart devices that are connected via wired or wireless connections and are also connected to a cloud data center.The deployment of a cloud computing data center at the core of the IoT network has advantages such as ubiquitous access, unlimited scalability, and elasticity [1].However, due to the centralization caused by deploying a central cloud data center in IoT and the geographical distance of cloud data centers from IoT devices, the links connecting the IoT de-vices and cloud data centers may become performance bottlenecks.Such performance bottlenecks can increase the execution latency of computation-al tasks submitted by IoT devices to the cloud data center, making it challenging to host delay-sensitive applications in such an IoT network.To mitigate these challenges, a new paradigm called "fog computing" [2] has been proposed in recent years.The idea behind fog computing is to reduce the average execution latency of tasks by placing a set of fog computing servers between IoT devices and cloud data centers.If an IoT-based fog computing model is implemented using traditional networking paradigms, the convergence to a new desirable configuration will be time-consuming, making it challenging to quickly adapt the platform to host new services with a short lifespan.As such, it is crucial to adjust the networking paradigm to make it agile enough to update its configuration to handle such services.According to the software-defined networking (SDN) paradigm, to address these challenges and leverage the features of SDNs, it seems to be a promising solution to implement the network of IoT-based fog computing models.
The concept of SDN has been proposed in [3] and has garnered significant attention from both industry and academia [4].So, using the SDN idea to implement the network IoT-based fog computing model has been considered in several types of research.Therefore, the implementation of an IoT-based fog computing model using the SDN paradigm has been considered in various research studies.Sood et al. [3] examined current efforts to merge SDN and IoT.Gupta et al. [5] proposed a middleware based on SDN-cloud fog computing.Hakiri et al. [6] proposed a novel architecture for controlling wireless fog-based SDN, in order to reduce delay.In [7] studied a software-defined fog computing in IoT architecture for resource management.Misra and Saha [8] studied a greedy heuristic scheme for multi-hop task offloading in IoT-based fog computing via softwaredefined methods.Misra and Bera [9] proposed mobility-aware task offloading in software-defined vehicular networks to optimize the computational offloading and network latency in vehicular networks.This scheme is based on SDN and has a node selection and task computation phase.
Therefore, due to the advantages of SDN and following the aforementioned research works, in this paper, we consider the platform of software-defined IoT-based fog computing to address the problem of processing delay-sensitive applications on this platform.− Analyzing the network between fog servers to find all possible paths between every pair of fog servers and indexing them as a hypergraph to facilitate the assigning process.− Selecting a mapping between the task graph and the constructed hypergraph, leading to the task's lowest execution latency.A set of simulations have been conducted to evaluate the effectiveness of the proposed method, and the proposed method's performance is compared to the exhaustive optimal search method.
The main contribution of this paper is to extend the previously proposed task processing latency models proposed in [6]- [9] to consider the latency of processing tasks with multi-node weighted directed graphs.The necessity of considering such tasks arises from the fact that there may be situations in which a single network fog server cannot handle the submitted task, and the task must be partitioned into dependent sub-tasks.The directed graph of the task would model the dependency between sub-tasks, and the graph nodes would denote each sub-task.Therefore, this graph should be assigned to a connected set of fog servers so that the processing latency of the task falls within an acceptable range according to the timing constraints of the submitted real-time task.In light of this, the proposed task offloading method in this paper is composed of two parts.The first part is similar to previously proposed methods for offloading tasks from IoT devices to fog servers.The second part deals with assigning the task graph to a suitable subset of fog servers.
The problem of assigning the multi-node task graph to the cluster of fog servers can be modeled as a variation of the well-known sub-graph isomorphism problem, which is NP-hard [10].Thus, the second part of the proposed method is designed based on a greedy approach that achieves optimal solutions with lower execution time than exhaustive optimal search.To this end, the second part of the proposed method takes the following actions: i) finding the critical path in the task graph, ii) analyzing the network between fog servers to find all possible paths between every pair of fog servers and indexing them as a hypergraph to facilitate the assigning process, and iii) selecting a mapping between the task graph and the constructed hypergraph, leading to the task's lowest execution latency.

RELATED WORK
This section provides an overview of related literature on the task offloading problem in IoT-based fog computing and software-defined fog computing.Specifically, with regard to the main contribution of this paper, which pertains to the mapping of undirected multi-node task graphs to fog servers, a brief review of related works in the field of task graph mapping is also presented.Subsection 2.1 primarily examines research conducted on task offloading in IoT-based fog computing, while subsection 2.2 examines literature addressing task offloading in software-defined fog computing.Finally, subsection 2.3 offers a succinct overview of the concept of task graph mapping.

Task offloading in IoT based fog computing
To address task offloading in the fog computing environment, Sood and Singh in [11], proposed a priority-based resource allocation scheme.Liu et al. [12] studied offloading processes in a fog computing system with mobile devices by utilizing queuing theory to form a theoretical foundation for formulating a multi-objective optimization problem to minimize energy consumption, execution delay, and payment cost.They proposed a task offloading method based on finding the optimal offloading probability and transmitting power for each mobile device.Wang et al. [13] proposed a resource management framework equipped with mechanisms for provisioning and auto-scaling edge node resources.Shojafar et al. [14] considered the resource scheduling challenges as a part of task offloading in IoT-based fog computing in vehicular networks.Zeng et al. [15] proposed an innovative algorithm for scheduling tasks and resource management with minimized task completion time in fog computing based on software-defined embedded systems.Gu et al. [16] considered the integration of fog computing and medical cyber-physical devices, and have proposed an algorithm for jointly optimize base station association, task distribution, and virtual machine placement to minimize the cost of this network.Pham-Nguyen and Tran-Minh [17] considered the service deployment problem as a multi-objective optimization that minimizes the overall response time of an application.Huang et al. [18] have proposed the task offloading problem in IoT-based fog computing with deep reinforcement learning in single -nodes task graphs.

Software-defined fog platform and task assignment
To address the issue of task offloading in the fog SDN, Bu and Wang [4] proposed a novel networking for edge computing patterns using the idea of software defined networking.Huang et al. [18] considered a SDN-based mobile edge computing framework to provide a higher level of data-plane flexibility and programmability.The network deployment and conditions of the proposed framework.In [19] studied a offloading model cooperative software-defined for device-to-device communication in advanced long-term evolution (LTE) networks.Misra and Saha [8] proposed an integer linear programming formulation for the task offloading problem in IoT-based fog computing with a software-defined access network.In addition, Misra and Bera in [9] considered optimizing the computational offloading and network latency in vehicular networks with SDN access networks.

Task graph mapping
Mirza et al. [20] proposed a systematic review in the scope of mapping and scheduling data flow graphs in streaming applications.Sugiarto et al. [21] presented an efficient mapping strategy for a task graph on a machine based on spiking neural network (SNN) architecture.Simon et al. [22] proposed a directed cycling graph scheduling algorithm over multiprocessor system-on-chips intending to minimize energy consumption.Taura and Chien [23] have presented a graph-theoretic formulation of task scheduling problems and have proposed a heuristic algorithm based on their proposed model.

THE PROPOSED SOFTWARE-DEFINED PLATFORM
We propose a software-defined fog platform as shown in Figure 1, the requests of each IoT device would be submitted to the fog-cloud network through base stations in the form of a multi-nodes weighted directed task graph.The base stations and the fog domains are SDN-enabled and can be monitored and managed by the SDN controller through its southbound Application programming interface (APIs).This module aims to reduce task execution latency by forwarding tasks to proper base stations and fog domains.The problem is formulated as integer programming and is presented below.
The physical network is shown as a  =< , ,  > where I is the set of IoT devices, V denotes a set of nodes including base stations and fog servers and, L denotes the set of communication links between the nodes is proposed in [21].The computational capacity of network nodes is denoted by  = {  1 , … ,   } where   is the processing capacity of  ℎ node of the network and  = ||.Furthermore, a bandwidth of network links is presented by  = { 1 , . .,   } where   is the bandwidth of  ℎ link of network and  = ||.Following this notation, it is implicitly assumed that the base station nodes are seen the same as the fog servers while they have no processing capacity by default.
Let  = {   The multi-node task graph processing delay is the total time taken by the fog domain to compute a task.Let    be the mapping parameter indicating the hosting the  ℎ node of the    task by the  ℎ node of the G. Furthermore let  , be the set of all paths between nodes ,  ∈  .Besides let    be the parameter indicating the mapping of the  ℎ link of the    task to the path  ∈  , .So, the multi-node task graph processing delay for processing the task    can be computed as: task by the  ℎ node of the G, and  ,  is transmission delay over  ℎ link of the G and is member of  ∈  , hosting the  ℎ of the    the task with starting ending nodes hosted by  ∈ .Therefore, the optimization objective function can be defined as ( 4)- (10).
x i f = { 1 hosting the f th node of the t s o task by the i th node of the G 0 otherwisw y p q = { 1 mapping of the q th link of the t s o task to the path p ∈ PH u,v 0 otherwise Constraints ( 5), ( 7) means,    either gets a value of zero or a value of 1.If its value is 1, it means that the  ℎ node of the task    is mapped to the  ℎ node of the G. Constraints ( 6), ( 8), means,    either gets a value of zero or a value of If its value is 1, it means that the  ℎ link of the task    is mapped to the path  ∈  , , in which p passes through the  ℎ link of the G. Constraint ( 9) stand for the processing capacity limitation of the  ℎ node of the .Constraint (10) stands for bandwidth capacity limitation of the  ℎ of the G.

THE PROPOSED ALGORITHM
We introduce a heuristic greedy algorithm called SDN BSA.The proposed algorithm is an adaptation of the BSA algorithm presented in [24].This algorithm starts by scheduling all the nodes to one node in a virtual way.It then improves the schedule by migrating the nodes to other fog nodes.
It should be noted that each link of the task graph may be mapped to a path on the fog domain.To make it possible to use the mapping technique of BSA in our presented problem a preprocessing step should be done on the fog domain topology.This preprocessing step indexes all possible paths between each pair of fog servers in the fog domain.By doing so, a hypergraph of the fog domain topology will be constructed in which each node is a fog server and each link represents a physical path over the fog domain.The paths represented by hypergraph links do not include any duplicate fog servers or physical links.The paths between each pair of fog servers can be found by depth first search (DFS).
Upon receiving a task by a base station, it will be forwarded to the SDN controller for making decisions about its mapping.Benefiting this it can make a central decision about the task mapping.To do this the controller designates a fog server as the "Admin node" of the mapping.
To minimize the overall task execution time, it is required to minimize the execution time of the longest path of the task graph.To do so, a function will scan the task graph and find its longest path.All fog servers will be checked for their available computational resources to host accumulated computational demands of the nodes in the longest path.If there is such a fog server it will be determined as the admin node and all of the longest path nodes will be mapped to this node.If there is not enough room over none of the fog servers to host all of the longest path nodes, a part of the longest path will be mapped to neighbor fog servers regarding their available resource and the delay constraint of the task.
After determining the admin node, the mapping of each task node will be done according to its data dependency on its previous nodes in the task graph and availability of the resources on the fog servers and their connections.While implementing the algorithm, we have a large data-producing parent that the volume of data they send to their child node is the maximum, here it is better to put the child next to these parents to minimize latency.Each fog node also has its computation capacity and bandwidth (communication capacity).Now, based on the selected admin node and capacity of the fog node, the node in the task graph maps to the fog node, after mapping the resources, the mapped value is reduced from the fog node capacity, and then the management module updates the fog node capacity.The mapping algorithm 1 is described as a pseudo-code as:

RESULT AND PERFORMANCE OF THE METHOD
In this section, a series of simulations have been carried out, and the results of the simulations are presented.These simulations are coded using Python 3.8.A random topology generator is implemented to create the fog node networks and SDN controllers.Additionally, a random task graph generator has been developed for sequential generation of task graphs.All coding runs on a system with 8 GB of RAM and a Core i7 CPU.For each node in the fog network, node frequencies of [0.2, 1.5 GHz] and bandwidths of [250 kbps, 54 Mbps] are considered.The transmission rate between the fog nodes is expected to be higher, approximately 100 Mbps, the average packet size [0, 1 KB, 80 KB].For each task, computation node frequencies of [0.1, 0.5 GHz] and bandwidths of [150 kbps, 10 Mbps] are considered, as per reference [25].The simulation parameters, such as the fog network size, the values of task node and fog node capacity, and the size of the task graph, are also reported for each experiment.
Simulation 1: the first experiment presents the results of the analysis of the working time of the SDN-BSA algorithm.The effect of the estimation on the algorithm's total working time is explained in the subsequent section.The reported results are then evaluated.The average mapping time plays an important role in the application of SDN-BSA.In this part, the average time of the proposed SDN-BSA algorithm is compared to the comprehensive execution time of the mapping algorithm.As shown in Figure 2, in experiment 1, to the exponential growth of the average execution time of the comprehensive implementation for the size of the task graph, the two algorithms are implemented in a network of size 3.The parameters used in the fog network and task diagram are shown in Table 1.A series of sequences consisting of 3 tasks each is applied to both algorithms, and the average working time of each algorithm is measured.The size of applied tasks varies from 1 to 3. The fog networks and task graphs are randomly generated.Simulation 3: to confirm the SDN-BSA, the overall delay obtained by this algorithm is compared to the delay of the exhaustive.Figure 4 shows the results of this simulation using the benchmarks with the parameters listed in Table 3.As shown in Figure 4, the delay gained by algorithm SDN-BSA approves the results of exhaustive.

CONCLUSION
In summary, this paper presents a new approach for task offloading in the SDN-Fog platform by proposing a formal model to address the delay-sensitive task offloading problem.A brute force technique and a heuristic task assignment technique were proposed and evaluated through simulations.The results show that the proposed heuristic method, based on constructing a hypergraph of the underlying network, is superior to the brute force technique and is capable of reducing delay by 22% and 6% compared to Detour and Soft-VAN, respectively.This research contributes to the field of IoT and fog computing by proposing a new approach for task offloading in SDN-Fog platforms that addresses the challenges of delay-sensitive applications.


ISSN: 2088-8708Int J Elec & Comp Eng, Vol. 13, No. 6, December 2023: 7099-7107 7102   is the sum of all propagation delay, and   is the transmission delay, and Dc is the multi-node task graph processing delay which includes both queuing delay and multi-node task graph processing delay.

Figure 1 .
Figure 1.The architecture of the SDN fog platform

Figure 2 .
Figure 2. Average of working time

Figure 3 .
Figure 3. Average of working time

Figure 4 .
Figure 4.The results of simulation 3 1 1 , … .,   1 1 , … ,  1  , … .,     } be the set of all tasks submitted by IoT devices where    is the  ℎ task of the  ℎ IoT device, and   is the number of tasks submitted by  ℎ IoT device.Each    is by itself a directed acyclic graph (DAG).So, each task is shown as    =<    ,    >.    denotes a set of nodes in each task and    denotes the set of communication links between the nodes.Each task has a processing requirement and communication requirement, the processing requirements of task nodes is denoted by    =<   1  , … ,     > where     is the processing requirement of  ℎ node of the task and  = |   |.
ℎ link of task and  = |   |.We calculate the maximum delay taken to process a task.Maximum delay (Mdf) to service a task in a fog domain is expressed as (1): ,  are in order the queuing latency and the processing latency of the  ℎ node of the Select one of the parents of the first node at CPN, if all parents of the selected node are in CPN add selected in CPN.Else, select one of the parents of the selected node with the farthest distance from the first node and call this routine for the newly selected node in a recursive way.-Run i for other CPN nodes.d.Add CPN Root cousins to CPN ancestor, CPN Root cousin is a node that is left out of CPN after completion of c. 2. Select Admin node in the hypergraph a.The admin node in the hypergraph has the most number of links to the other nodes with the ability to host task nodes.3. Assign all CPN ancestors to the admin node 4. Migrate the task nodes on CPN ancestors to adjacent fog servers using the following routine: For each task node that must be migrated to other fog servers, the following conditions should hold: (Start of time node in adjacent fog node-max (start of time node in admin node, the data arrival time of node receive from its parent))>=delay of processing task graph nodes and transmission required data on nodes for forwarding target fog server.

Table 1 .
The parameters of task graph and fog network Simulation 2: to evaluate the average working time of the proposed SDN-BSA algorithm for larger samples, we analyze the proposed algorithm on task graphs with sizes between 20 and 140.The computation capacity and communication capacity for the fog network and task graph are according to Table2.As shown in Figure3, the average working time increases with an increasing task graph size.

Table 2 .
The parameters of task graph