# Performance Modeling and Optimization for a Fog-Based IoT Platform

## Abstract

**:**

## 1. Introduction

## 2. Related Work

## 3. A Fog-Based IoT Platform Architecture

## 4. Performance Modeling and Analysis

_{i}, 1 ≤ i ≤ n. Upon the completion of a service at the ith fog node, the IoT task may enter the A&F server with probability p

_{i}for some administration and finance processing and then leave the system; the IoT task may also be routed to the cloud with probability 1 − p

_{i}to receive further service or processing at the cloud, based on demand. For example, a fog node may not be able to completely process an IoT task’s service request, then the service request will be sent to the cloud for further processing, as the cloud has much more powerful computing and storage capabilities compared with fog nodes. Upon the completion of the service at the cloud, the IoT task may be fed back to the ith fog node with probability q

_{i}(1 ≤ i ≤ n) to continue receiving service, or directly enter the A&F server for exit processing with probability $1-{\sum}_{i=1}^{n}{q}_{i}$ and then leave the system.

_{i}, 1 ≤ i ≤ n + 2. External task arrivals to node i form Poisson with rate ${\gamma}_{i}$. After the completion of service at node i, the task may proceed to node j with a probability independent of history or leave the system with another probability. Therefore, the system is a Jackson network [30].

_{i}denote the total average arrival rate of the IoT tasks to fog node i. This total rate is given by the sum of the external arrivals (Poisson) and the arrivals from all internal nodes (not necessarily Poisson). Thus, we obtain the following traffic equations:

#### 4.1. Modeling of the Fog Layer Subsystem

_{i}and different service rates μ

_{i}at individual fog nodes. Assume that the service time in node i is independent from that in other nodes and is also independent of the arrival process. Using the traditional method of flow balance equations [30], we solve the steady state probabilities ${\pi}_{i}\left(k\right)$ with k service requests in node i as:

#### 4.2. Modeling of the Cloud and the A&F Server

_{i}, i = n + 1, n + 2, and the mean number of customers in the server can be obtained by Little’s law:

#### 4.3. Modeling of the Overall IoT Platform System

_{i}and service rate of μ

_{i}at each server, i = n + 1, n + 2.

_{0}, k

_{1}, …, k

_{n}) exhibits the product-form solution and is given by the product of the steady state distributions of individual queues, i.e.,

## 5. Optimization Problem

## 6. Numerical Evaluation

_{i}values are set to be equal unless otherwise specified in individual figures; all the μ

_{i}values are set to be equal unless otherwise specified in individual figures; all the p

_{i}and q

_{i}values are respectively set to be equal unless otherwise specified). Other values of related parameters are set separately in the figures to study the performance of the relevant metrics. Note that the time is represented in terms of a dimensionless time unit, which can be mapped to a specific unit of time.

_{Fog}with respect to different parameters. We observe that L

_{Fog}will increase with the increase of the total external arrival rate γ or the decrease of the service rates (contained in the vector μ

_{vec}). It is obvious that the increase in the external arrival rate will lead to the increase of the queueing length. Equivalently, the increase of the service processing time (or the decrease of the service rates) will cause more service requests to wait in the queue and thus lead to an increase of queueing length. We also observe that L

_{Fog}will decrease with the increase of the number of fog nodes n given the fixed total external arrival rate γ. This is because more fog nodes participate in the service and reduce the service burden of each node.

_{Fog}with respect to different routing probabilities. We observe that, given the fixed fog node service rates μ

_{vec}and the number of nodes n, L

_{Fog}will decrease with the increase of the routing probabilities p

_{vec}or the increase with the increase of the routing probabilities q

_{vec}. When p

_{vec}increases, more service requests will enter the A&F server and then leave the system (instead of entering the cloud for further service), leading to a smaller number of requests in the system. On the contrary, when q

_{vec}increases, more service requests will be fed back to the fog layer subsystem for continuous service, leading to a larger number of requests in the system.

_{vec}or increase of the number of fog nodes given the fixed total external arrival rate γ. In Figure 6, we observe that L

_{Fog}will decrease with the increase of the routing probabilities p

_{vec}or increase with the increase of the routing probabilities q

_{vec}. The reason is the same as that explained previously.

_{vec}(e.g., μ

_{vec}changes from μ

_{vec}

_{0}to 1.1 × μ

_{vec}

_{0}) or with the increase of the number of fog nodes n (e.g., n changes from 10 to 12). The larger the arrival rate γ, the more the service requests waiting in the queue, which leads to a larger mean sojourn time of the requests in the system. Similarly, the larger the processing capability of the fog node servers, the fewer requests waiting in the queue, leading to less mean sojourn time. This is because more fog nodes make the mean waiting time less than expected.

_{vec}increases, e.g., from p

_{vec0}to 1.6 × p

_{vec}

_{0}, T will be reduced quickly, particularly under the heavy traffic conditions. This can be explained as follows: the increase of the routing probabilities p

_{vec}means that more requests do not enter the cloud upon the completion of their service from the fog layer, which naturally reduces the mean waiting time and thus the mean sojourn time. We also observe that T will be increased with the increase of routing probabilities q

_{vec}, particularly under heavy traffic conditions. The increase of q

_{vec}means that more requests that have received service in the cloud will be fed back to the fog layer, which naturally causes more required mean waiting time of the requests and thus increases the mean sojourn time.

_{5}with respect to different routing probabilities. We use node 5 as an example for evaluation. We point out that any fog node produces the same result for the given input configuration, because we assume that all individual external arrival rates are set to be identical, which means that the individual effective arrival rates ${\lambda}_{i}$, $1\le i\le n$, will be the same according to Equation (6). The above assumption and the obtained identical effective arrival rates ${\lambda}_{i}$ will cause the visit ratio v

_{5}not to change with different values of the total external arrival rate γ. This has been verified in Figure 9, where the visit ratio v

_{5}is observed to be the same when γ is changed. We observe that v

_{5}will be decreased when p

_{vec}increases, e.g., from p

_{vec0}to 1.6 × p

_{vec}

_{0}. This is because the increase of the routing probabilities p

_{vec}causes more requests to enter the A&F server and exit the system upon the completion of their service from the fog layer, which naturally reduces the opportunity that a service request goes back to visit a fog node. We also observe that v

_{5}will be increased with the increase of the probabilities q

_{vec}. The increase of q

_{vec}causes more requests that have received service in the cloud to go back to the fog layer, and thus increases the opportunity that a service request visits a fog node.

_{vec}and q

_{vec}are kept the same as before.

## 7. Conclusions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Sun, Y.; Song, H.; Jara, A.J.; Bie, R. Internet of Things and Big Data Analytics for Smart and Connected Communities. IEEE Access
**2016**, 4, 766–773. [Google Scholar] [CrossRef] - Shafiq, M.; Gu, Z.; Cheikhrouhou, O.; Alhakami, W.; Hamam, H. The Rise of “Internet of Things”: Review and Open Research Issues Related to Detection and Prevention of IoT-Based Security Attacks. Wirel. Commun. Mob. Comput.
**2022**, 2022, 8669348. [Google Scholar] [CrossRef] - Bonomi, F.; Milito, R.; Zhu, J.; Addepalli, S. Fog computing and its role in the internet of things. In Proceedings of the First Edition of the MCC Workshop on Mobile Cloud Computing, Helsinki, Finland, 17 August 2012; pp. 13–16. [Google Scholar] [CrossRef]
- Alsuhli, G.; Khattab, A. A Fog-based IoT Platform for Smart Buildings. In Proceedings of the 2019 International Conference on Innovative Trends in Computer Engineering (ITCE), Aswan, Egypt, 2–4 February 2019; pp. 174–179. [Google Scholar] [CrossRef]
- Sadatacharapandi, T.P.; Padmavathi, S. Survey on Service Placement, Provisioning, and Composition for Fog-Based IoT Systems. Int. J. Cloud Appl. Comput.
**2022**, 12, 1–14. [Google Scholar] [CrossRef] - Zhai, Z.; Xiang, K.; Zhao, L.; Cheng, B.; Qian, J. IoT-RECSM-Resource-Constrained Smart Service Migration Framework for IoT Edge Computing Environment. Sensors
**2020**, 20, 2294. [Google Scholar] [CrossRef] [Green Version] - Cao, Y.; Chen, S.; Hou, P.; Brown, D. FAST: A fog computing assisted distributed analytics system to monitor fall for stroke mitigation. In Proceedings of the 2015 IEEE International Conference on Networking, Architecture and Storage (NAS), Boston, MA, USA, 6–7 August 2015; pp. 2–11. [Google Scholar] [CrossRef]
- Iorga, M.; Goren, N.; Feldman, L.; Barton, R.; Martin, M.; Mahmoudi, C. Fog Computing Conceptual Model. Natl. Inst. Stand. Technol. Spec. Publ.
**2018**, 1–8. [Google Scholar] [CrossRef] - Alraddady, S.; Soh, B.; AlZain, M.A.; Li, A.S. Fog Computing: Strategies for Optimal Performance and Cost Effectiveness. Electronics
**2022**, 11, 3597. [Google Scholar] [CrossRef] - Gia, T.N.; Jiang, M.; Rahmani, A.-M.; Westerlund, T.; Liljeberg, P.; Tenhunen, H. Fog Computing in Healthcare Internet of Things: A Case Study on ECG Feature Extraction. In Proceedings of the 2015 IEEE International Conference on Computer and Information Technology; Ubiquitous Computing and Communications; Dependable, Autonomic and Secure Computing; Pervasive Intelligence and Computing, Liverpool, UK, 26–28 October 2015; pp. 356–363. [Google Scholar] [CrossRef]
- Tasiopoulos, A.G.; Ascigil, O.; Psaras, I.; Toumpis, S.; Pavlou, G. FogSpot: Spot Pricing for Application Provisioning in Edge/Fog Computing. IEEE Trans. Serv. Comput.
**2021**, 14, 1781–1795. [Google Scholar] [CrossRef] [Green Version] - Giang, N.K.; Blackstock, M.; Lea, R.; Leung, V.C.M. Developing IoT applications in the Fog: A Distributed Dataflow approach. In Proceedings of the 2015 5th International Conference on the Internet of Things (IoT), Seoul, Korea, 26–28 October 2015; pp. 155–162. [Google Scholar] [CrossRef] [Green Version]
- Mondragón-Ruiz, G.; Tenorio-Trigoso, A.; Castillo-Cara, M.; Caminero, B.; Carrión, C. An experimental study of fog and cloud computing in CEP-based Real-Time IoT applications. J. Cloud Comput.
**2021**, 10, 32. [Google Scholar] [CrossRef] - Karagiannis, V.; Schulte, S.; Leitão, J.; Preguiça, N. Enabling Fog Computing using Self-Organizing Compute Nodes. In Proceedings of the 2019 IEEE 3rd International Conference on Fog and Edge Computing (ICFEC), Larnaca, Cyprus, 14–17 May 2019; pp. 1–10. [Google Scholar] [CrossRef]
- Yadav, J.; Sangwan, S. Dynamic Offloading Framework in Fog Computing. Int. J. Eng. Trends Technol.
**2022**, 70, 32–42. [Google Scholar] [CrossRef] - Lavassani, M.; Forsström, S.; Jennehag, U.; Zhang, T. Combining Fog Computing with Sensor Mote Machine Learning for Industrial IoT. Sensors
**2018**, 18, 1532. [Google Scholar] [CrossRef] [Green Version] - Taneja, M.; Davy, A. Resource aware placement of data analytics platform in fog computing. Procedia Comput. Sci.
**2016**, 97, 153–156. [Google Scholar] [CrossRef] [Green Version] - Zhang, H.; Xiao, Y.; Bu, S.; Niyato, D.; Yu, F.R.; Han, Z. Computing Resource Allocation in Three-Tier IoT Fog Networks: A Joint Optimization Approach Combining Stackelberg Game and Matching. IEEE Internet Things J.
**2017**, 4, 1204–1215. [Google Scholar] [CrossRef] - Silva, D.S.; Machado, J.D.S.; Ribeiro, A.D.R.L.; Ordonez, E.D.M. Towards self-optimisation in fog computing environments. Int. J. Grid Util. Comput.
**2020**, 11, 755–768. [Google Scholar] [CrossRef] - Li, S.; Liu, H.; Li, W.; Sun, W. Optimal cross-layer resource allocation in fog computing: A market-based framework. J. Netw. Comput. Appl.
**2023**, 209, 103528. [Google Scholar] [CrossRef] - Weng, C.-Y.; Li, C.-T.; Chen, C.-L.; Lee, C.-C.; Deng, Y.-Y. A Lightweight Anonymous Authentication and Secure Communication Scheme for Fog Computing Services. IEEE Access
**2021**, 9, 145522–145537. [Google Scholar] [CrossRef] - Adel, A. Utilizing technologies of fog computing in educational IoT systems: Privacy, security, and agility perspective. J. Big Data
**2020**, 7, 99. [Google Scholar] [CrossRef] - Alwakeel, A.M. An Overview of Fog Computing and Edge Computing Security and Privacy Issues. Sensors
**2021**, 21, 8226. [Google Scholar] [CrossRef] - Gomez, C.; Oller, J.; Paradells, J. Overview and Evaluation of Bluetooth Low Energy: An Emerging Low-Power Wireless Technology. Sensors
**2012**, 12, 11734–11753. [Google Scholar] [CrossRef] [Green Version] - Wang, C.; Jiang, T.; Zhang, Q. ZigBee Network Protocols and Applications, 1st ed.; Auerbach Publications: New York, NY, USA, 2014. [Google Scholar]
- Badenhop, C.W.; Graham, S.R.; Ramsey, B.W.; Mullins, B.E.; Mailloux, L.O. The Z-Wave routing protocol and its security implications. Comput. Secur.
**2017**, 68, 112–129. [Google Scholar] [CrossRef] - Khalili, A.; Soliman, A.-H.; Asaduzzaman, M.; Griffiths, A. Wi-Fi sensing: Applications; challenges. J. Eng.
**2020**, 3, 87–97. [Google Scholar] [CrossRef] - Jain, G.; Dahiya, S. NFC: Advantages, limits and future scope. Int. J. Cybern. Inform.
**2015**, 4, 1–12. [Google Scholar] [CrossRef] - Chiani, M.; Elzanaty, A. On the LoRa Modulation for IoT: Waveform Properties and Spectral Analysis. IEEE Internet Things J.
**2019**, 6, 8463–8470. [Google Scholar] [CrossRef] [Green Version] - Stewart, W.J. Probability, Markov Chains, Queues, and Simulation: The Mathematical Basis of Performance Modeling; Princeton University Press: Princeton, NJ, USA, 2009. [Google Scholar]
- Jackson, J.R. Networks of Waiting Lines. Oper. Res.
**1957**, 5, 518–521. [Google Scholar] [CrossRef] [Green Version] - Bolch, G.; Greiner, S.; de Meer, H.; Trivedi, K.S. Queueing Networks and Markov Chains, 2nd ed.; Wiley-Interscience: Hoboken, NJ, USA, 2006. [Google Scholar]
- Mishra, P. Order-recursive Gaussian elimination. IEEE Trans. Aerospace Electron. Syst.
**1996**, 32, 396–400. [Google Scholar] [CrossRef] - Beavis, B.; Dobbs, I. Optimisation and Stability Theory for Economic Analysis, Illustrated edition; Cambridge University Press: Cambridge, UK, 1990. [Google Scholar]

**Figure 3.**The number of service requests in the fog layer L

_{Fog}w.r.t. parameters γ, μ

_{vec}and n (p

_{vec}= p

_{vec0}, q

_{vec}= q

_{vec}

_{0}).

**Figure 4.**The number of service requests in the fog layer L

_{Fog}w.r.t. parameters p

_{vec}and q

_{vec}(μ

_{vec}= μ

_{vec}

_{0}, n = 10).

**Figure 5.**The number of service requests in the overall system L w.r.t. parameters γ, μ

_{vec}and n (p

_{vec}= p

_{vec}

_{0}, q

_{vec}= q

_{vec}

_{0}).

**Figure 6.**The number of service requests in the overall system L w.r.t. parameters p

_{vec}and q

_{vec}(μ

_{vec}= μ

_{vec}

_{0}× 110%, n = 10).

**Figure 7.**The mean sojourn time of service requests in the overall system T w.r.t. parameters γ, μ

_{vec}and n (p

_{vec}= p

_{vec}

_{0}, q

_{vec}= q

_{vec}

_{0}).

**Figure 8.**The mean sojourn time of service requests in the overall system T w.r.t. parameters p

_{vec}and q

_{vec}(μ

_{vec}= μ

_{vec0}, n = 10).

**Figure 9.**The visit ratio at a node (node 5) v

_{5}w.r.t. parameters p

_{vec}and q

_{vec}(μ

_{vec}= μ

_{vec}

_{0}, n = 10).

Parameters | Value | Unit | Description |
---|---|---|---|

n | 10 | # of fog nodes | |

${\gamma}_{i},1\le i\le n$ | 1~10 | requests/unit time | external arrival rates |

${\mu}_{i},1\le i\le n$ | 20~30 | requests/unit time | fog node service rates |

${\mu}_{n+1},{\mu}_{n+2}$ | 200 | requests/unit time | cloud, A&F service rates |

${p}_{i},1\le i\le n$ | 0.5 | routing probabilities | |

${q}_{i},1\le i\le n$ | 0.05 | routing probabilities | |

${\lambda}_{i},1\le i\le n+2$ | calculated by ${\gamma}_{i}$ | requests/unit time | effective arrival rates |

**Table 2.**Optimal solution of ${\mu}_{vec}$ in (${\gamma}_{vec},C,{p}_{vec},{q}_{vec})=({\gamma}_{vec0}$, 250, ${p}_{vec0}$, ${q}_{vec0}$).

Given | ${\mathit{\gamma}}_{vec}$ | $C$ | ${p}_{vec}$ | ${q}_{vec}$ | Minimized value T | |||||

${\gamma}_{vec0}$ | 250 | ${p}_{vec0}$ | ${q}_{vec0}$ | 0.1336 | ||||||

Optimal solution | ${\mu}_{1}$ | ${\mu}_{2}$ | ${\mu}_{3}$ | ${\mu}_{4}$ | ${\mu}_{5}$ | ${\mu}_{6}$ | ${\mu}_{7}$ | ${\mu}_{8}$ | ${\mu}_{9}$ | ${\mu}_{10}$ |

23.92 | 25.30 | 22.54 | 26.65 | 21.13 | 26.65 | 28.01 | 23.92 | 22.54 | 29.34 |

**Table 3.**Optimal solution of ${\mu}_{vec}$ in (${\gamma}_{vec},C,{p}_{vec},{q}_{vec})=({1.5\times \gamma}_{vec0}$, 250, ${p}_{vec0}$, ${q}_{vec0}$).

Given | ${\gamma}_{vec}$ | $C$ | ${p}_{vec}$ | ${q}_{vec}$ | Minimized value T | |||||

${\gamma}_{vec0}$ × 150% | 250 | ${p}_{vec0}$ | ${q}_{vec0}$ | 0.3989 | ||||||

Optimal solution | ${\mu}_{1}$ | ${\mu}_{2}$ | ${\mu}_{3}$ | ${\mu}_{4}$ | ${\mu}_{5}$ | ${\mu}_{6}$ | ${\mu}_{7}$ | ${\mu}_{8}$ | ${\mu}_{9}$ | ${\mu}_{10}$ |

23.71 | 25.33 | 22.09 | 26.95 | 20.46 | 26.95 | 28.55 | 23.71 | 22.09 | 30.16 |

**Table 4.**Optimal solution of ${\mu}_{vec}$ in (${\gamma}_{vec},C,{p}_{vec},{q}_{vec})=({\gamma}_{vec0}$, 200, ${p}_{vec0}$, ${q}_{vec0}$).

Given | ${\gamma}_{vec}$ | $C$ | ${p}_{vec}$ | ${q}_{vec}$ | Minimized value T | |||||

${\gamma}_{vec0}$ | 200 | ${p}_{vec0}$ | ${q}_{vec0}$ | 0.2455 | ||||||

Optimal solution | ${\mu}_{1}$ | ${\mu}_{2}$ | ${\mu}_{3}$ | ${\mu}_{4}$ | ${\mu}_{5}$ | ${\mu}_{6}$ | ${\mu}_{7}$ | ${\mu}_{8}$ | ${\mu}_{9}$ | ${\mu}_{10}$ |

19.05 | 20.25 | 17.85 | 21.44 | 16.64 | 21.44 | 22.63 | 19.05 | 17.85 | 23.80 |

**Table 5.**Optimal solution of ${\mu}_{vec}$ in (${\gamma}_{vec},C,{p}_{vec},{q}_{vec})=({\gamma}_{vec0}$, 200, $1.6\times {p}_{vec0}$, ${q}_{vec0}$).

Given | ${\gamma}_{vec}$ | $C$ | ${p}_{vec}$ | ${q}_{vec}$ | Minimized value T | |||||

${\gamma}_{vec0}$ | 250 | ${p}_{vec0}$ | ${q}_{vec0}$ | 0.1442 | ||||||

Optimal solution | ${\mu}_{1}$ | ${\mu}_{2}$ | ${\mu}_{3}$ | ${\mu}_{4}$ | ${\mu}_{5}$ | ${\mu}_{6}$ | ${\mu}_{7}$ | ${\mu}_{8}$ | ${\mu}_{9}$ | ${\mu}_{10}$ |

18.95 | 20.29 | 17.60 | 21.61 | 16.23 | 21.61 | 22.93 | 18.95 | 17.60 | 24.23 |

**Table 6.**Optimal solution of ${\mu}_{vec}$ in (${\gamma}_{vec},C,{p}_{vec},{q}_{vec})=({\gamma}_{vec0}$, 200, ${p}_{vec0}$, ${1.6\times q}_{vec0}$).

Given | ${\gamma}_{vec}$ | $C$ | ${p}_{vec}$ | ${q}_{vec}$ | Minimized value T | |||||

${\gamma}_{vec0}$ | 250 | ${p}_{vec0}$ | ${q}_{vec0}$ | 0.8403 | ||||||

Optimal solution | ${\mu}_{1}$ | ${\mu}_{2}$ | ${\mu}_{3}$ | ${\mu}_{4}$ | ${\mu}_{5}$ | ${\mu}_{6}$ | ${\mu}_{7}$ | ${\mu}_{8}$ | ${\mu}_{9}$ | ${\mu}_{10}$ |

19.16 | 20.21 | 18.10 | 21.27 | 17.04 | 21.27 | 22.32 | 19.16 | 18.10 | 23.37 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Tang, S.
Performance Modeling and Optimization for a Fog-Based IoT Platform. *IoT* **2023**, *4*, 183-201.
https://doi.org/10.3390/iot4020010

**AMA Style**

Tang S.
Performance Modeling and Optimization for a Fog-Based IoT Platform. *IoT*. 2023; 4(2):183-201.
https://doi.org/10.3390/iot4020010

**Chicago/Turabian Style**

Tang, Shensheng.
2023. "Performance Modeling and Optimization for a Fog-Based IoT Platform" *IoT* 4, no. 2: 183-201.
https://doi.org/10.3390/iot4020010