Abstract
IoT-based network systems use a modern architecture called fog computing, In which data providing data services is economical with low latency. This paper tends to solve the challenge of resource allocation in fog computing. Solving the resource allocation challenge leads to increased profits, economic savings, and optimal computing systems use. Here resource allocation is improved by making use of the combined algorithm Nash equilibrium and auction. In the proposed method, each player is assigned a matrix. Each player matrix includes fog nodes (FNs), data service subscribers (DSSs), and data service operators (DSOs). Each player generates the best strategy based on the other players strategy in all stages of the algorithm. The simulation results show that FNs profit in the combined Nash and Auction equilibrium algorithms is superior to the Stackelberg game algorithm.
Introduction
The ever-increasing expansion of the Internet of Things is accompanied by a high volume of connections among different internet network devices. The many exchanging data will undoubtedly accompany such a high volume of connections. In recent years, high data exchange is mostly implemented via services based on cloud computing, and they are implemented on a big scale in data centers, which could have many challenges due to exerting much traffic to the network and lag in providing services. These challenges will be especially problematic in real-time applications. Analyzing such a volume of data requires high computational resources and saving. Although these resources can be supplied upon cloud computing technology and data centers, such applications will have a high cost in data exchange and lag in providing service due to relatively high physical distance among these centers and final users. IoT requires real-time exchanges, and it sometimes requires mobile exchanges, which makes the recent subject more challenging. Fog computing has been introduced to solve this problem. One of the proposed custom architectures for fog computing is a three-level architecture where three existences of the Data Service Subscribers (DSSs), the Data Service Operators (DSOs), and the Fog Nodes (FNs) are interacted with each other [1, 2]. The interaction among these three existences requires new mechanisms to develop Fog Computing to realize the Internet of Things [3].
Regarding these motivations, it needs an alternative algorithm to transfer the computations on capable devices in terms of computations that are geograph-ically closer to the sensors than the clouds and are also connected to the Internet. Such devices are in the network’s edge and, therefore, are called edge devices. They could also create a local view of data flows and sum the data to the cloud for offline anal-yses. In this regard, fog computing happens. Fog computing is defined as a distributed computational algorithm that mainly expands the provided services by cloud in the network’s edge and assists in managing and programming computations, network services, and saving among data centers and finishing equipment. Cloud computing supports mobility, computational resource, communicating protocols, intermediate heterogeneity, cloud integration, and analyzing distributed data to deal with such applied programs, which requires low delay with wide and condensed geographical distribution. These services aim at reducing the costs of using the cloud and lagging the function of applied programs to an acceptable level upon assigning executive duties to fog nodes [4].
Although relatively much research [2–4] has been done in recent years on cloud computing and the Internet of things, using fog computing in realizing the Internet of Things is a newer one, and still many of the problems and challenges of this area are classified in this field. Among these challenges, resource allocation is manifested a lot. Although fewer researches have been done on allocating cloud computing resources upon focusing on the Internet of things and since this issue is considered one of the optimization problems, this area’s research has not reached the final point. This research aims to improve resource allocation fairly and provide better and high quality and more guaranteed real-time applications.
Innovative aspects of this research include proposing a reference architecture, mathematical modeling of game theory, and designing an efficient mechanism for allocating fog computing resources. This research’s innovations significantly reduce network core traffic, equitable resource allocation to subscribers, and optimal resource allocation in fog nodes simultaneously.
The rest of the paper is organized as follows. Sec-tion 2 introduces some Cloud Computing concepts (IoT), Fog Computing, and Related works. The background of game theory and pioneers are introduced in Section 3. The simulated parameters and evaluation functions of the proposed model are described in Section 4. In Section 5, our proposed methods performance is compared with similar work in resource allocation. Finally, the main findings of the research and some final remarks are presented in Section 6.
Literature review
The applications based on the Internet of things (IoT) produce bulky data. In many cases, these bulky data are transmitted to the cloud for analysis, but it may ruin the opportunity to act on them [5]. To solve this problem, fog computing, which is sometimes called sharp edges computing in other references, is introduced. This technology aims to make near the places of data processing to its producing devices to provide better service quality, and consequently, it can reduce the traffic of network remarkably. In this regard, the issue of resource allocation in this structure could be critical.
Cloud computing
Although the emergence of cloud computing is rooted in the scientist’s primary ideas in the scientist in the 60’s, such a name was not proposed for it in those years [6]. The primary view was that all the world people could access in applied programs and their data via a wide communicating network. The first new definition of cloud computing was raised by Prof. Ramanath Chellappa in 1997. In 1999, Salesforce.Com was succeeded in providing applied programs services via a simple website as a pioneer. The 2000’s is the peak of prosperity for cloud computing. In 2009, Amazon provided an Elastic Compute Cloud (EC2) [7]. Afterward, Google and IBM started many research projects on cloud computing in 2007. In 2016, the costs in public commerce of infrastructure based on cloud computing reached more than 100 Billion Pounds, which has been increased by 20% in comparison to 2013 [8]. It is predicted that by the near future, most of the internet services will be accessible via cloud computing services.
Internet of things (IoT)
Kevin Ashton first raised Internet of Things in 1999. Although the main idea of this technology probably goes back to 70’s [9], this idea, with all its attractiveness, was neglected for about ten years. In 2010, it was realized with Google Street Service. In that year, China announces the strategy of using such technology in his country for up to ten years. Such a concept was considered in 2011 by Gartner as a research company on the market. In 2013, IDC predicted that the share of the Internet of things in the global market would reach 8.9 Trillion Dollars in future [10].
Fog computing
Fog Computing was first introduced by CISCO, while IBM has raised such technology as edge computing. Anyhow, in Nov. 2015, a consortium named Open Fog [11] was created to make the raised theory in this area real as standard. This consortium was created by Arm, Cisco, Dell, Intel, and Microsoft cooperated with Princeton University, and other members and partners cooperate with it too. According to the definition provided by this consortium, fog computing is a horizontal architecture at the system level which distributes cloud services and resources to compute, save, control, and also network connection in each part of the world among the objects. As regards the expansion of IoT data, which are processed and saved upon cloud computing [12], the fog will be able to do the sensitive computations to the lag near the sensors, which will lead to better efficiency in using the bandwidth of the network and applied and more efficient approaches of IoT [13]. Fog computing increases business agility by using more and more insight; it also increases safety and reduces operational costs. In other words, the following challenges are always raised in realizing IoT applications via cloud computing and communicating models before introducing fog computing.
Related works
Roy and Bhaumik in [14] discussed matrix games with payoffs as triangular type-2 intuitionistic fuzzy numbers as a modern idea. They argued some policy handling into the free and fair accession of water versus its finite resources.
Bahaumik et al. in [15] focussed on attended a matrix game whose payoffs are triangular intuitionistic fuzzy numbers. The authors also focus on applying a sturdy ranking method to rank fuzzy numbers to solve the matrix game.
Bahaumik et al. in [16] discussed that Uncertainty provides an important in decision-making problems like game theory. The authors’ main aim was to validate and authorize the proposed contemplations by applying them to illuminating real-life problems in the neutrosophic realm through bi-matrix game theory.
Bhaumik et al. in [17] studied the Prisoners’ dilemma game to solve human trafficking that is one of the most rising problems of today’s society. With the use of Nash equilibrium in the non-zero-sum game, the authors can earn results that were Ideal Solution.
Bhaumik and Roy in [18] discussed enhance many problems in doubt and ambiguity in nature; then, the authors proposed a matrix game to solve.
Bhaumik et al. in [19] discussed on expand and analyzing a matrix game with multiple objectives. The authors solve the problem under a single-valued neutrosophic environment in a linguistic approach.
Brikama et al. in [20] proposed the intuitionistic fuzzy set practically in different decision-making; the primary goal of this paper is to extend an approach for solving multi-criteria matrix games. Finally, these matrix games’ results are compared with the existing algorithms to show the advantages of this algorithm.
Ammar et al. in [21] discussed solving the zero-sum two-person continuous differential games using a rough programming approach. At last, with a numeral instance affirm the theoretical outcome.
Brikama et al. in [22] proposed a robust fuzzy multi-objective programming algorithm to solve curb matrix games with payoffs of fuzzy rough numbers. A significant benefaction of this paper is that it deals with restriction matrix games using two types of uncertainties, and so the operation of decision-making is more pliable.
Zhang et al. in [23] proposed a three-layer hierarchical game framework to solve the challenges of the developed fog computing networks. This paper’s proposed framework uses the Stackelberg game for the interaction between DSO and DSS and the ethical risk model for the interaction between DSO and FN, and the resource allocation for the interaction between FN and DSS.
Cao et al. in [24] proposed a FAST system, a distributed analytical system via Fog computing to monitor the fall detection system. The authors developed a set of fall detection algorithms, including algorithms based on measuring acceleration, analytical methods of temporal series, and filter-ing methods to assist fall detection. They designed a real-time fall detection system based on Fog computing, which divided the fall detection duty among edges and cloud. The proposed system has reached higher features and sensitivity in real-time data. However, the response time and energy consumption were near to available efficient approaches.
The other use of fog computing in health care was proposed by Stantchev et al. in [25]. They provided a three-level architecture for smart healthcare infrastructure. The approach is based on a service-oriented architecture and extends established architecture to provide an efficient architecture for applied health care and eldercare programs.
Augmented reality applied programs are compassionate to delay, and even minimal delays can damage the user’s experience. Zao et al. in [26] made an interactive computer game of augmented brain based on fog computing and combined data. When the person played this game, the natural flows of gathered data by EEG sensors will be produced and classified and help detect the player’s brain states.
Zhu et al. in [27] discussed the use of edge servers to improve websites’ performance, and users were connected to the Internet through fog nodes. Any user-generated HTTP request then had to go through the fog. The fog tool performed several optimizations that reduced the user waiting time to load the requested website.
Botta et al. in [28] studied the aggregation of cloud computing and the Internet of Things services. Their paper focused on integrating cloud and Internet of things, which is called Cloud loT pattern. They wrote many works separately on the Internet of things and cloud, which summarized their main features, properties, infrastructural technologies, and open issues on these two areas precisely.
The need for fog computing to create distributed intelligence on the Internet through various topics were reviewed by Byers and Wetterwald in [29]. This article discusses why distributed information is necessary. Various reasons such as scalability, protection of network resources, closest control circle, traction mode, and clustering were suggested as distributed intelligence reasons. And then, the role of real-time data analysis was discussed.
Datta et al. in [30] activated customer-centric Internet services in a fog-based model. This article stated that due to fog computing’s proximity to end-users, resistance to geographical distribution, and high mobility support, fog computing could provide services with reduced latency and improved quality service. Therefore, fog computing is becoming one of the most critical capabilities for the Internet of Things.
Aazam and Huh in [31] pointed out that the novelty, inclusiveness, and being present everywhere of the computing services were considered by the researchers and developers of these services. They pointed that since different tools produce different types of data with different frequencies and since some of the data services like emergency, health and care services, and other similar services are real-time, the response time will be very vital. Meanwhile, decision-making is necessary on the type of data that should be loaded inside the cloud with no trouble to the network and cloud. Therefore, fog computing plays a vital role in this regard.
Aazam and Huh in [32] provided a model that covered the issues related to predicting resources, type of consumer-based on estimating and reserving resource, advanced reserving and pricing for IoT consumers based on their details.
Agarwal et al. in [33] claimed that cloud computing’s primary motivation is optimizing resource consumption, maximizing efficiency, and minimizing the response time. Meanwhile, they stated that regarding the availability of some limitations in cloud computing and to overcome this limitation, fog computing was raised. In this paper, the authors studied the virtualization methods, identifying different problems, probable threats, and attacks for virtualization, and they proposed architecture based on cloud-fog to allocate stretchable resources.
Do et al. in [34] considered the evolving problem of allocating common resources and minimizing the problem of carbon trace for mainstreaming video service in fog computing. They created a distributed algorithm based on a proximal algorithm and alternate multiplication method to solve a big scale.
Sun and Zhang in [35] proposed a fog computing structure and a public budget algorithm to integrate additional resources into the network. Also, to encourage more resource holders to share their resources with the resource pool and monitor resource sponsors while actively performing their tasks, they proposed an incentive mechanism in this algorithm.
Background of game theory
The idea of game theory was introduced in the 18th century, but game theory developed dramatically in the 1920 s with mathematicians such as Emile Borrell and John von Neumann. John Nash was also instrumental in developing game theory and won the Nobel Prize for his work in this field [36].
Game theory is a mathematical tool for analyzing the processes in which players are interacting with each other. This branch of science is trying to find the answer to the question, “What happens when elements are present with conflicting motives?” To answer this question, modeling is required for each process through a game. Each game consists of elements such as players, game rules, outputs, and payoffs. In general, games can be divided into two categories: cooperative games and non-cooperative games. Cooperative games are games in which several participants unite against each other; In such games, each group of players who have allied with each other is obtained from the players’ set of strategies participating in that alliance. Non-cooperative games are games in which the competition between players is complete, and the participants are completely against each other. Due to the limited resources in the fog nodes and the challenge of resource allocation among subscribers, we have used non-cooperative game algorithms to solve this problem.
Proposed method
The data centers or clouds in big scales are usually made in far distant regions or regions away from DSS. It leads to high transferring cost, transfer density, and delay in service, which could be non-acceptable for instant interaction programs. In this regard, the closest cloud to the users is essential and useful. Therefore, in fog computations, several low-cost computing devices are put in network edges to load data computing services from the cloud, usually known as fog nodes (FNs). Regarding the supporting property on a small scale, low support, and FNs construction cost, these FNs could be used a lot in the network. FNs are generally located very close to DSSs and therefore can provide low-delay and quick-response services to the requests, while the most crucial challenge in this regard is allocating FN-limited computational resources to all DSSs to reach desired and sustainable function. An algorithm based on a non-cooperative game algorithm based on combining two auction algorithms and the Nash equilibrium was used to solve this challenge. In this regard, this section is composed of descriptive parts of game theory, its detailed investigation in the research, presenting proposed approach, stating the problem based on the optimal allocation of resource, formulating the problem to do the computation, and describing the non-cooperative game theory algo-rithm and combining algorithm of Nash equilibrium and auction algorithm.
Suggested solution
In this research, a special fog computing network composed of a set of Data Service Operators (DSOs) has been considered, and each controls a set of fog nodes to provide essential data services to the Data Service Subscribers (DSSs). The most crucial challenge in this regard is the manner of allocating FN-limited computational resources to all DSSs to reach the desired and sustainable function. Therefore, this research presents a common optimization framework for all FNs, DSOs; having used DSSs based on non-cooperative game algorithms and basing on combined auction algorithm and Nash equilibrium, an optimal resource allocation algorithm was presented.
The proposed method could be expressed as four following parts:
Statement of the problem: this part will be dealt with describing the problem based on DSS, DSO, and FN.
Formulating the problem based on the presented relationship: this part will be dealt with formulating and studying the mathematical relationship in this regard.
Non-cooperative game algorithm to allocate resources: this part will study the non-cooperative game algorithm and the Nash equilibrium to reach the best strategy.
Auction algorithm for allocating resources: the final part will study the auction algorithm for optimizing the responses obtained from the Nash equilibrium algorithm if it is possible.
Statement of the problem
In fog computations, several low-cost computing devices are considered FN, which are put in a network edge to load data computing services from the cloud. FNs are generally located very near to DSSs.
Since many of the FNs and their computational resources are invisible for DSSs. DSSs could only contact DSO and purchase the data services and could not directly request from FNs. Therefore, there is a virtual network between DSO and DSS. In receiving the request of services from all DSSs, each DSO can collect the computational resources from FNs and provide virtual data services for DSSs. Regarding the networks requirement, each DSO can allocate a different amount of computation resources from different FNs to different DSSs. Therefore, computation resources could be used effectively by neighbor DSSs.
Fog computing networks could be many FNs that are put in different locations by different DSOs to provide services to DSSs. When DSSs could choose their DSO and related FNs to increase their quality, allocating fog node resources in DSSs is a significant challenge. This research focuses on choosing resources and allocating resources among FNS, DSOs, and DSSs.
In this architecture, DSOs prioritize the price of their services, and DSSs purchase an optimal number of Computational Resource Blocks (CRB). When the price of DSOs and purchased resource of DSSs were obtained, each DSS will know how many CRB is required and then can compete with CRBs belonged to neighbor FNs. In this regard:
The proposed algorithm should choose the proper DSO for DSS.
At the next stage, DSO should choose proper FNs.
Moreover, at the final stage, FN will choose optimal CRB.
Formulating problem and studying mathematical relationships
This part will be deal with mathematical relationships. In the first equation, the obtained income of DSO is computed based on chosen DSSs, which have received their services from DSO. It is displayed in Equation (1) [1]. This equation computes the income when DSSs are directly connected to DSOs and is computes the income when DSS uses DSO directly.
Where M is the number of DSSs and if τ
ij
chooses DSS
i
, DSO
j
, it will be one, and otherwise, it will be zero. α
i
λ
i
shows the income obtained from sent works by DSS
i
in λ
i
sent rate. q
j
r
i
is the whole cost of using DSS
i
from DSO
j
. β
j
shows the proportional coefficient for the effectiveness of using DSS
i
from DSO
j
. t shows the delay cost for DSS
i
by DSO
j
. γ
j
is the proportional coefficient for the effectiveness of delay cost. If DSSs receive their services from FNs related to DSO, the obtained gain is computed as the difference of the income obtained for each DSO from DSSs with FNs costs and consumed energy and therefore, the income equation will be as Equation (2) [1].
Where
Where μ is the data transfer rate from CRBs as processing unit of FNs to DSOs, in Equation (4) [1], the final gain is computed upon considering the reward obtained from the relationship between DSS and FNs, and this reward is in fact the reduction cost of DSO upon using FNs subtracted from the relationship cost between DSS and FN.
According to Equation (4),
In this regard, this problem is composed of three target functions, and all three functions should have the most value. All three W should have the most value so that the DSO could reach the highest income and DSS could receive the best services from the chosen DSO. In continuing, we will describe the non-cooperative game algorithm to increase the value of Ws.
In this part, the most basic concept of the logical game that is the dominant strategy and eliminating defeated strategy is considered for the non-cooperative game; in this work, the dominant strategies are allocating optimal DSS, FN, and DSOs. The dominant strategies show optimal allocation with the highest W value, and the defeated strategy is the strategies that obtained the lowest W value. Each strategy in this research is as the Table 1.
A sample of a strategy involves seven DSOs, nine FNs, and eight DSSs
A sample of a strategy involves seven DSOs, nine FNs, and eight DSSs
Table 1 shows a sample of a strategy based on seven DSO, nine FN, and eight DSS. When a DSS chooses a DSO, it can receive its services from FNs of that DSO or the DSO itself.
Each game, like any other problem, includes a work area in optimization. In this article, game dimensions are for the numbers of DSS, DSO, FN, and Nash equilibrium, which is the primary goal of optimization based on game theory is computed based on this number. Therefore, each chosen strategy is a combination of allocating DSSs to DSOs and FNs to DSOs, which is displayed as a non-cooperative game, and each player improves its strategy according to the Nash equilibrium and finds optimal responses for the raised problem.
In fact, Nash equilibrium is a profile of strategies where each player could not increase his utility upon individual changing of his strategy. The other point of Nash equilibrium is that at such point, each user gives a better response to a set of strategies of his competitors. In this regard, Equation (5) [36] is used.
According to Equation (5) a-i is the strategy of the opponent i players, a
i
i’th player strategy.
In this paper, the Nash equilibrium is created upon combining the competitor strategies and creating new strategies. In this regard, the random matrix of zero and one is created, and two strategies are chosen randomly and create a new strategy for the players. Tables 2–4 create new strategy (Mask: 0100100).
The random strategy
Strategy for player 1
New strategy for player 1
This algorithm is based on the best optimal function value. According to this algorithm, when a new resource is allocated for being chosen, the function related to FN, DSS, and DSO are computed. If the obtained function values based on the optimal system is better than other strategies, it eliminates all the previous strategies as the dominant strategy; therefore, the system will have less memory and low computational load and having chosen the list of strategies by the Nash equilibrium algorithm, only the dominant strategy will be remained in the list which will optimize the system and it could be assured that the best resource allocation will be done.
System analysis
This section will evaluate the function of the pro-posed method. In this regard, having implemented the proposed method, the function of the proposed method will be compared with the known methods in this area.
The evaluating data in this paper are shown in Table 2, which have been considered as stimulation parameters.
One of the important points in each simulation is determine the evaluating parameters, these parameters are given in Equations (1), (2) and (4).
Comparative analysis
To evaluate the proposed algorithm in this research, Stackelberg game [1] is used for comparison.
Figure 1 studies the effect of the number of DSSs and DSOs in obtaining results based on the gain. These graphs well display the relationship between gain obtained based on the number of DSSs and DSOs. In this simulation and the right graph, the number of DSO is considered fixed 20, and the DSO value is considered between [60∼240], while in the left graph, the number of DSSs is considered 240 and the DSO value varies between [5∼20]. In both graphs, we could well observe the effect of the number of DSSs and DSOs in the obtained gain.

Simulation results based on hundred repetitions based on DSO and DSS gain.
Figure 2 studies the effect of the number of FNs and DSOs in obtained the results based on gain. These graphs well show the relationship between the gain based on the number of FNs and DSOs. In this simulation and in the right graph, the number of FNs is considered fixed 30 and the DSO value is considered between [5∼20] and in the left graph, the number of DSO is considered 20, and the FNs value varies between [15∼30]. In both graphs, the gain obtained based on FN and DSO is displayed, and the gain obtained when the value of DSO is five will have a considerable difference with the value more than five, and it could be concluded that the number of DSOs should not be considered as less than ten, it is the same about FNs when FN is twenty, the possible gain was obtained.

Simulation results based on hundred repetition based of FN and DSO gain.
To verify the implementation of the proposed algorithm, FN utility is examined in two ways and compared with a similar article in [1], one for λ changes and the other for DSS changes.
Figure 3 studies the relationship between FN and DSS to compute gain. The right graph considers the number of DSSs between [60∼240] and FN as 30. The left graph considers the FN between [15∼30] and DSS as 240. In both graphs, DSS gain’s best result has occurred when FN is 25, and the best result for DSS has occurred when DSS has the highest value equal to 240.

Simulation results based on one hundred repetitions based on FN and DSS gain.
Figure 4 shows the FN utility per FN = 30 and DSS = [40 ∼240] in the Stackelberg method [1]. By comparing the right diagram in Fig. 3 where FN = 30 and DSS = 240 with the diagram in Fig. 4 where FN = 30 and DSS = 240 we see that the FN utility in the proposed method is better than the FN utility in that of Stackelberg method.

The utility of FNs versus the number of DSSs [1].
Figure 5 studies the DSS sent rate value on the obtained gain of FNs. In this regard, the λ sent rate is considered as a value between [1∼4], and FN is considered as the most number equal to 30. According to this graph, it could be observed that increasing the sent rate will increase the gain value.
By having view to the comparison of the diagrams in Fig. 5 and red diagram in Fig. 6, ie FN = 30, it can be seen that the FN utility in the proposed method is higher than the FN utility in the Stackelberg method.

Simulation results based on hundred repetitions based on FN gain.

The utility of FNs versus the average value of λ [1].
Numerical values of the diagrams in Figs. 5 and 6 are given in Table 6 for ease of comparison.
Stimulation Parameters
Simulation results for FN number
Figure 7 is the sent rate value of CRBs as processing units of FNs computed in the obtained gain from DSO. According to this graph, μ value is considered as the sent rate. According to this graph, the best-sent rate is 3.5 to take the most gain from DSO.

Simulation results based on hundred repetitions based on DSO gain.
In this research, a combined game algorithm based on Nash and auction equilibrium theory is proposed for optimal resource allocation. First, resource allocation is done by creating FN-DSO, DSS-FN, and DSO-DSS pairs. The efficiency of the functions related to each DSS, FN, and DSO is then calculated. If the obtained functions efficiency is optimal and better than the other strategies, it is selected as the dominant strategy and eliminates all previous strategies. This dominant strategy results in a system with less memory and less computational load. Each time the game is repeated, after selecting the Nash equilibrium point algorithms list, only the dominant strategy remains in the list. This dominant strategy optimizes the system and ensures that the best resource allocation occurs. This studys main findings include equitable resource allocation to subscribers, optimal resource allocation in fog nodes simultaneously, and a significant reduction in network core traffic. Also, by examining the performance of the proposed method with methods known in this field, we concluded that the combined algorithm improves the utility of the FN factor compared to the Stackelberg game method. The results indicate the superiority of the proposed algorithms compared to the Stackelberg algorithm, and we did not face any limitations in conducting this research.
