# Recommendations for Using QPN Formalism for Preparation of Incoming Request Stream Generator in Modeled System

^{*}

## Abstract

**:**

## 1. Related Work

## 2. QPN Model

#### 2.1. QPNs

- Set of places;
- Set of queueing places with scheduling strategy;
- Set of immediate or timed transitions (QPNs allow transitions to fire in different modes (transition colors));
- Initial marking (number of tokens);
- Incidence function (routing probability) is defined per color/mode basis;
- Arcs with firing weights as relative firing frequency of the mode;
- Token color function specifies the types of tokens that can reside in the place and allows transitions to fire in different modes.

#### 2.2. Mathematical Model of QPN

- $PL=\{{p}_{1},{p}_{2},\cdots ,{p}_{k}\}$ is a finite and non-empty set of places;
- $TR=\{{t}_{1},{t}_{2},\cdots ,{t}_{l}\}$ is a finite and non-empty set of transitions;
- $PL\cap TR=\u2300$;
- $CO$ is a color function defined from $PL\cup TR$ into finite and non-empty sets (specify the types of tokens that can reside in the place and allow transitions to fire in different modes);
- $IN(p,t)$ are the backward and forward incidence functions defined in $PL\times TR$, such that $IN(p,t)\in [CO\left(t\right)\u27f6CO{\left(p\right)}_{MS}],\forall (p,t)\in PL\times TR$ (specify the interconnections between places and transitions; the subscript $MS$ denotes multisets. $CO{\left(p\right)}_{MS}$ denotes the set of all finite multisets of $CO\left(p\right)$);
- $MA\left(p\right)$ is an initial marking defined on $PL$, such that $MA\left(p\right)\in CO\left(p\right),\forall p\in PL$ (specify how many tokens are contained in each place).
- $QU=(Q{U}_{1},Q{U}_{2},({q}_{1},\cdots ,{q}_{\left|PL\right|}))$, where:
- -
- $Q{U}_{1}\subseteq PL$ is a set of timed queueing places;
- -
- $Q{U}_{2}\subseteq PL$ is a set of immediate queueing places;
- -
- $Q{U}_{1}\cap Q{U}_{2}=\u2300$;
- -
- $({q}_{1},\cdots ,{q}_{\left|PL\right|})$ is an array with a description of places (if ${p}_{i}$ is a queueing place, ${q}_{i}$ denotes the description of a queue with all colors of $CO\left({p}_{i}\right)$ into consideration, or if ${p}_{i}$ is the ordinary place (${p}_{i}$) equals $null$).

- $WE=(W{E}_{1},W{E}_{2},({w}_{1},\cdots ,{w}_{\left|TR\right|}))$, where:
- -
- $W{E}_{1}\subseteq TR$ is a set of timed transitions;
- -
- $W{E}_{2}\subseteq TR$ is a set of immediate transitions;
- -
- $W{E}_{1}\cap W{E}_{2}=\u2300$, $W{E}_{1}\cup W{E}_{2}=TR$;
- -
- $W=({w}_{1},\cdots ,{w}_{\left|TR\right|})$ is an array (entry ${w}_{j}\in [CO\left({t}_{j}\right)\u27fc{\mathbb{R}}^{+}]$, such that $\forall c\in CO\left({t}_{j}\right):{w}_{j}\left(c\right)\in {\mathbb{R}}^{+}$) of:
- *
- rate of a negative exponential distribution specifying the firing delay due to color $c\in CO\left({t}_{j}\right)$, if ${t}_{j}\in W{E}_{1}$;
- *
- firing weight specifying the relative firing frequency due to color $c\in CO\left({t}_{j}\right)$, if ${t}_{j}\in W{E}_{2}$.

#### 2.3. Stream Generator

- In a simple SG, any user can use any resource in the stream generation process.
- In other cases, any stream can be generated based on a predetermined weight value.

- Simple model $(\frac{1}{4},\frac{1}{4},\frac{1}{4},\frac{1}{4})$;
- Varied models, e.g., $(\frac{1}{10},\frac{1}{5},\frac{3}{10},\frac{2}{5})$; $(\frac{1}{7},\frac{2}{7},\frac{1}{7},\frac{3}{7})$; $(\frac{1}{4},\frac{1}{4},0,\frac{1}{2})$; $(\frac{1}{5},\frac{1}{5},0,\frac{3}{5})$; $(0,\frac{1}{4},0,\frac{3}{4})$; $(0,0,\frac{1}{4}$, $\frac{3}{4})$; $(0,0,0,1)$.

## 3. Testing in QPME Tool

#### 3.1. Mathematical Model of SG in QPN

- Set of places $PL=\{Res,Stream\}$.
- Set of transitions $TR=\left\{Generator\right\}$.
- Color function $CO\left({p}_{i}\right)$ for colors $c=\{u1,u2,r1,r2,u1r1,u1r2,u2r1,u2r2\}$. where:
- -
- $u1$ and $u2$-user-classes;
- -
- $r1$ and $r2$-resources;
- -
- $u1r1$, $u1r2$, $u2r1$, $u2r2$-stream.

- Incidence functions specify the interconnections between places and transitions $IN(p,t)$.
- Initial marking specify how many tokens are contained in each place $MA\left(p\right)=\left\{Users\right(u1=1,u2=1),Res(r1=1,r2=1),Stream(u1r1=u1r2=u2r1=u2r2=0\left)\right\}$.
- $QU=(Q{U}_{1},Q{U}_{2},(-/M/\infty /I{S}_{Users},null,null))$, where:
- -
- $Q{U}_{1}=\left\{Users\right\}$;
- -
- $Q{U}_{2}=\u2300$;

- $WE=(W{E}_{1},W{E}_{2},W)$, where:
- -
- $W{E}_{1}=\u2300$;
- -
- $W{E}_{2}=TR$, where the $Generator$ transition is immediate;
- -
- $W=(w\left(mod{e}_{1}\right),w\left(mod{e}_{2}\right),w\left(mod{e}_{3}\right),w\left(mod{e}_{4}\right))$, for simple model $W=(1,1,1,1)$ and for exemplary varied models $W=(1,2,3,4)$, $W=(1,2,1,3)$, $W=(1,1,0,2)$, $W=(1,1,0,3)$, $W=(0,1,0,3)$, $W=(0,0,1,3)$, $W=(0,0,0,1)$, where:
- *
- Color function $\forall c\in CO\left({t}_{j}\right):{w}_{j}\left(c\right)\in {\mathbb{R}}^{+}$;
- *
- Colors $c=\{mod{e}_{1},mod{e}_{2},mod{e}_{3},mod{e}_{4}\}$;
- *
- $Generator$ transition modes $mod{e}_{1},...,mod{e}_{4}$.

#### 3.2. Simulation Model

- A c token is removed from place ${p}_{i}$;
- A ${c}^{\prime}$ token is deposited in place ${p}_{i+1}$.

## 4. Stream Generator Results

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Zatwarnicki, K.; Barton, S.; Mainka, D. Acquisition and Modeling of Website Parameters. In Advanced Information Networking and Applications-Proceedings of the 35th International Conference on Advanced Information Networking and Applications (AINA-2021), Toronto, ON, Canada, 12–14 May 2021; Volume 3; Barolli, L., Woungang, I., Enokido, T., Eds.; Lecture Notes in Networks and Systems; Springer: Berlin/Heidelberg, Germany, 2021; Volume 227, pp. 594–605. [Google Scholar] [CrossRef]
- Krajewska, A. Performance Modeling of Database Systems: A Survey. J. Telecommun. Inf. Technol.
**2019**, 8, 37–45. [Google Scholar] [CrossRef] - Cherbal, S. Load balancing mechanism using Mobile agents. Informatica
**2021**, 45, 257–266. [Google Scholar] [CrossRef] - Walid, B.; Kloul, L. Formal Models for Safety and Performance Analysis of a Data Center System. Reliab. Eng. Syst. Saf.
**2019**, 193, 106643. [Google Scholar] [CrossRef] - Rak, T. Formal Techniques for Simulations of Distributed Web System Models. In Cognitive Informatics and Soft Computing; Mallick, P.K., Bhoi, A.K., Marques, G., Hugo, C., de Albuquerque, V., Eds.; Springer: Singapore, 2021; pp. 365–380. [Google Scholar] [CrossRef]
- Fiuk, M.; Czachórski, T. A Queueing Model and Performance Analysis of UPnP/HTTP Client Server Interactions in Networked Control Systems. In Computer Networks (CN 2019); Communications in Computer and Information Science; Springer International Publishing AG: Cham, Switzerland, 2019; pp. 366–386. [Google Scholar] [CrossRef]
- Rzonca, D.; Rzasa, W.; Samolej, S. Consequences of the Form of Restrictions in Coloured Petri Net Models for Behaviour of Arrival Stream Generator Used in Performance Evaluation. In Computer Networks; Gaj, P., Sawicki, M., Suchacka, G., Kwiecień, A., Eds.; Springer International Publishing: Cham, Switzerland, 2018; pp. 300–310. [Google Scholar] [CrossRef]
- Kounev, S.; Lange, K.D.; von Kistowski, J. Systems Benchmarking: For Scientists and Engineers; Springer International Publishing: Cham, Switzerland, 2020. [Google Scholar] [CrossRef]
- Rak, T. Modeling Web Client and System Behavior. Information
**2020**, 11, 337. [Google Scholar] [CrossRef] - Rak, T. Performance Modeling Using Queueing Petri Nets. In Computer Networks (CN 2017); Gaj, P., Kwiecien, A., Sawicki, M., Eds.; Communications in Computer and Information Science; Springer International Publishing AG: Cham, Switzerland, 2017; Volume 718, pp. 321–335. [Google Scholar] [CrossRef]
- Zatwarnicki, K. Providing Predictable Quality of Service in a Cloud-Based Web System. Appl. Sci.
**2021**, 11, 2896. [Google Scholar] [CrossRef] - Eismann, S.; Grohmann, J.; Walter, J.; von Kistowski, J.; Kounev, S. Integrating Statistical Response Time Models in Architectural Performance Models. In Proceedings of the 2019 IEEE International Conference on Software Architecture (ICSA), Hamburg, Germany, 25–29 March 2019; pp. 71–80. [Google Scholar] [CrossRef]
- Roshany, M.; Khorsandi, S. Performance analysis of the internet-protocol multimedia-subsystem’s control layer using a detailed queueing Petri-net model. Int. J. Commun. Syst.
**2018**, 32, e3885. [Google Scholar] [CrossRef] - Curiel, M.; Pont, A. Workload Generators for Web-Based Systems: Characteristics, Current Status, and Challenges. IEEE Commun. Surv. Tutor.
**2018**, 20, 1526–1546. [Google Scholar] [CrossRef] - Kolbusz, J.; Paszczynski, S.; Wilamowski, B. Network traffic model for industrial environment. In Proceedings of the 2005 3rd IEEE International Conference on Industrial Informatics (INDIN’05), Perth, Australia, 10–12 August 2005; pp. 406–411. [Google Scholar] [CrossRef]
- Tang, W.; Fu, Y.; Cherkasova, L.; Vahdat, A. Modeling and generating realistic streaming media server workloads. Comput. Netw.
**2007**, 51, 336–356. [Google Scholar] [CrossRef] - Lukichev, M. Formation of equivalent simulation model of an real-time video stream generator used in packet-oriented communication networks, taking into account the structure of the H.264 compression algorithm. T-Comm
**2019**, 13, 43–52. [Google Scholar] - Samolej, S.; Szmuc, T. HTCPNs–Based Tool for Web–Server Clusters Development. In Software Engineering Techniques; Huzar, Z., Koci, R., Meyer, B., Walter, B., Zendulka, J., Eds.; Springer: Berlin/Heidelberg, Germany, 2011; pp. 131–142. [Google Scholar]
- Samolej, S.; Szmuc, T. Web–Server Systems HTCPNs-Based Development Tool Application in Load Balance Modelling. e-Inform. Softw. Eng. J.
**2009**, 3, 139–153. [Google Scholar] - Bause, F.; Buchholz, P.; Kemper, P. Hierarchically Combined Queueing Petri Nets; Springer: Berlin/Heidelberg, Germany, 2006; pp. 176–182. [Google Scholar] [CrossRef]
- Kounev, S.; Spinner, S.; Meier, P. Introduction to queueing petri nets: Modeling formalism, tool support and case studies. In Proceedings of the 3rd Joint WOSP/SIPEW International Conference on Performance Engineering (ICPE’12), Boston, MA, USA, 22–25 April 2012. [Google Scholar] [CrossRef]
- Kounev, S.; Spinner, S.; Meier, P. QPME 2.0—A Tool for Stochastic Modeling and Analysis Using Queueing Petri Nets; Springer: Berlin/Heidelberg, Germany, 2010; Volume 6462, pp. 293–311. [Google Scholar] [CrossRef]
- Rak, T. Response Time Analysis of Distributed Web Systems Using QPNs. Math. Probl. Eng.
**2015**. [Google Scholar] [CrossRef] [Green Version]

Transition | Mode | Action |
---|---|---|

$Generator$ | $mod{e}_{1}$ | input{$u1$} ⟶ output{$u1r1$} |

input{$r1$} ⟶ output{$u1r1$} | ||

$Generator$ | $mod{e}_{2}$ | input{$u1$} ⟶ output{$u1r2$} |

input{$r2$} ⟶ output{$u1r2$} | ||

$Generator$ | $mod{e}_{3}$ | input{$u2$} ⟶ output{$u2r1$} |

input{$r1$} ⟶ output{$u2r1$} | ||

$Generator$ | $mod{e}_{4}$ | input{$u2$} ⟶ output{$u2r2$} |

input{$r2$} ⟶ output{$u2r2$} |

Place | Token | Queue | Description |
---|---|---|---|

$Users$ | $\{u1,u2\}$ | $-/M/\infty /IS$ | Queueing place used to model concurrent clients. |

$Res$ | $\{r1,r2\}$ | null | Ordinary place used to model resource. |

$Stream$ | $\{u1r1,u1r2,$ | null | Ordinary place used to model the generated stream. |

$u2r1,u2r2\}$ |

Token Color | Place | Description |
---|---|---|

$u1$ | $Users$ | First user |

$u2$ | Second user | |

$r1$ | $Res$ | First resource |

$r2$ | Second resource | |

$u1r1$ | $Stream$ | First user and first resource |

$u1r2$ | First user second resource | |

$u2r1$ | Second user and first resource | |

$u2r2$ | Second user and second resource |

Modes | Firing Weight w | Token Color | Mean Token Population for $Stream$ |
---|---|---|---|

$mod{e}_{1}$ | 1.0 | $u1r1$ | 25,172.11 |

$mod{e}_{2}$ | 1.0 | $u1r2$ | 24,858.411 |

$mod{e}_{3}$ | 1.0 | $u2r1$ | 24,733.689 |

$mod{e}_{4}$ | 1.0 | $u2r2$ | 25,095.054 |

Modes | Firing Weight w | Token Color | Mean Token Population for $Stream$ |
---|---|---|---|

$mod{e}_{1}$ | 1.0 | $u1r1$ | 9978.882 |

$mod{e}_{2}$ | 2.0 | $u1r2$ | 19,827.981 |

$mod{e}_{3}$ | 3.0 | $u2r1$ | 29,978.301 |

$mod{e}_{4}$ | 4.0 | $u2r2$ | 39,679.93 |

$mod{e}_{1}$ | 1.0 | $u1r1$ | 14,195.611 |

$mod{e}_{2}$ | 2.0 | $u1r2$ | 28,625.108 |

$mod{e}_{3}$ | 1.0 | $u2r1$ | 14,308.058 |

$mod{e}_{4}$ | 3.0 | $u2r2$ | 42,688.806 |

$mod{e}_{1}$ | 1.0 | $u1r1$ | 24,931.845 |

$mod{e}_{2}$ | 1.0 | $u1r2$ | 25,170.6 |

$mod{e}_{3}$ | 0.0 | $u2r1$ | 0.0 |

$mod{e}_{4}$ | 2.0 | $u2r2$ | 50,286.744 |

$mod{e}_{1}$ | 1.0 | $u1r1$ | 20,154.555 |

$mod{e}_{2}$ | 1.0 | $u1r2$ | 19,958.521 |

$mod{e}_{3}$ | 0.0 | $u2r1$ | 0.0 |

$mod{e}_{4}$ | 3.0 | $u2r2$ | 60,068.627 |

$mod{e}_{1}$ | 0.0 | $u1r1$ | 0.0 |

$mod{e}_{2}$ | 1.0 | $u1r2$ | 24,933.095 |

$mod{e}_{3}$ | 0.0 | $u2r1$ | 0.0 |

$mod{e}_{4}$ | 3.0 | $u2r2$ | 75,169.879 |

$mod{e}_{1}$ | 0.0 | $u1r1$ | 0.0 |

$mod{e}_{2}$ | 0.0 | $u1r2$ | 0.0 |

$mod{e}_{3}$ | 1.0 | $u2r1$ | 24,894.468 |

$mod{e}_{4}$ | 3.0 | $u2r2$ | 75,242.374 |

$mod{e}_{1}$ | 0.0 | $u1r1$ | 0.0 |

$mod{e}_{2}$ | 0.0 | $u1r2$ | 0.0 |

$mod{e}_{3}$ | 0.0 | $u2r1$ | 0.0 |

$mod{e}_{4}$ | 1.0 | $u2r2$ | 99,950.075 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. 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**

Rak, T.; Rzonca, D.
Recommendations for Using QPN Formalism for Preparation of Incoming Request Stream Generator in Modeled System. *Appl. Sci.* **2021**, *11*, 11532.
https://doi.org/10.3390/app112311532

**AMA Style**

Rak T, Rzonca D.
Recommendations for Using QPN Formalism for Preparation of Incoming Request Stream Generator in Modeled System. *Applied Sciences*. 2021; 11(23):11532.
https://doi.org/10.3390/app112311532

**Chicago/Turabian Style**

Rak, Tomasz, and Dariusz Rzonca.
2021. "Recommendations for Using QPN Formalism for Preparation of Incoming Request Stream Generator in Modeled System" *Applied Sciences* 11, no. 23: 11532.
https://doi.org/10.3390/app112311532