1 Introduction

Driven by the research of Bit Torrent (BT), resource downloading, and live streaming, researchers are paying more and more attention to Peer-to-Peer (P2P) network technology, which has been developed and improved. It is a powerful advantage in distributed computing [1], teamwork, and multimedia [2, 3]. In the P2P system, the peer is regarded as the server, which downloading and transmission files, and the peer also is regarded as the consumer, which requesting service. With the progress of downloading and transmission, consumers are transformed into servers that serve other peers, wherefore the service capability of the system increases exponentially [4].

Research on P2P performance analysis based on P2P structure is becoming more and more extensive. Li et al. [5] investigated an information pool protocol (IPP) based on grid architecture (IPBGA), which is a real hybrid P2P network and grid system. Their theoretical analysis showed that the IPP of IPBGA is more effective and has lower bandwidth and processing cost. A fast convergence iterative algorithm was proposed for the Cloud-P2P content distribution network system, and the optimal allocation of bandwidth between the cloud storage terminal and the P2P terminal were studied [6, 7]. Yang et al. [8] proposed a hybrid P2P network framework for interactive streaming media, called PPISM, which reduces the load of edge server. The framework adopted hierarchical structure, which integrated content distribution network (CDN), P2P network and tree grid structure. Zhou et al. [9] presented a hybrid strategy of Rarest First and Greedy. To ensure scalability, they designed an algorithm that adapts to the number of nodes dynamically [10], while retaining part of the work of the nodes to meet the requirements of instant playback and ensure low startup delay. In terms of network throughput, Ye et al. [11] proposed a distributed adaptive mixed media access control scheme and a throughput optimization framework. The aggregated data throughput is maximized by adjusting the optimal contention window size according to the change of voice and data service load. Aiming at the scalability problem of P2P, Edmundo et al. [12] developed a model, which calculated the achievable throughput under different nodes and block selection strategies. A new understanding of the behavior of P2P cluster system that provided a new mechanism for publishers and nodes to improve the overall performance of the system. Zhou et al. [13] proposed a resource search algorithm, which uses pull and push methods. In order to deal with the liquidity problem of nodes, the activities of nodes are often repeated on a day-to-day basis in the mobile P2P ad hoc networks (P2P MANETs). Through simulation, they studied that the resource search scheme can not only improve the search success rate, but also reduce the spread of information. Yang et al. [14] studied the performance of the P2P file-sharing system from the perspective of service capacity. They found that the well performance was showed in the P2P system as the load increased in both transient and steady-state conditions scalability. In the mobile P2P network environment, Lim et al. [15] researched an effective range query processing scheme, which includes two phases: query distribution phase and monitoring phase. Li et al. [16] addressed the multivirtual neural network embedding problem by a game-theoretic approach and designed a new priority admission control mechanism to handle overloaded service requests, reducing the amount of information exchange and computational complexity.

In recent years, it is gradually increasing that the problems of P2P network performance has been solving by queuing theory. Ge et al. [17] developed a multi-class closed queuing network in the P2P system, in which each class is composed of a fixed node group and studies the performance of the P2P file-sharing system through simulation of the model. Li et al. [18] modeled M/MMPP/1 queue in the BT system and solved the corresponding stable distribution using matrix geometric solution. The relevant results that performance analysis of BT system was given. Yin et al. [19] established a new dynamic model, which reflected the interaction among nodes in the Media Delivery Network (MDN) system. They proposed the node selection and bandwidth allocation strategy, which verified the rationality and validity of the model. To inculcate cooperation among the otherwise selfish communicating nodes, the pricing game between nodes as the Rubinstein Bargain model was formulated to enhance content distribution in the delay-tolerant networking (DTN) [20]. Ferragut et al. [21] and Hu et al. [22] analyzed the dynamic characteristics of that P2P file exchange swarm from the perspective of queue. The service rate of receiving peer depends on a main fixed central component (servers or seeders) and the number of peers. Zhao et al. [23] presented the M/M/m(t) queuing model, in which servers are variable based on the migration of virtual machines in the cloud system. The stationary distribution and performance indicators are obtained by using analytic theory of matrices. Under the constraints of service level agreement (SLA), the least number of virtual machines in open and the impact of different parameters on performance are analyzed. The above-mentioned papers have studied from the perspectives of service capacity, broadband allocation, node selection strategy, network performance, and so on. However, there is little literature that analyzed the service process of multiple servers dynamically by the quasi birth and death process (QBD) and the method of matrix geometric solution.

Ma et al. [24] formulated the M/M/1 queuing system with multiple vacations and repairable faults by the method of generating functions. This method provides a useful ideological reference for being assumed that there are repairable peers in the P2P system. Wu et al. [25] studied a queuing system that limited capacity with a change in the number of servers. Therefore, it can be assumed that the dynamic changes of peers in the file transfer process of the P2P system. If the resource package required by the requesting node is less, it is not easy to query and will cause the larger query traffic. If there are too many nodes requesting the same resource, the conversion probability of the node into a service node is low, which leads to too long delay of the requesting node and abandoning the request.

In this paper, considering dynamic changes of the loads during the process of the nodes scheduling, the performance of the P2P system based on the classical M/M/c queuing model with the strategies of repairable work failure and impatient customers is studied. And we propose a reasonable, effective and applicable peer scheduling strategy, which can reduce energy consumption and improve the service performance of P2P network systems. The contributions of this paper are threefold.

  1. (1)

    To guarantee the stability of system operation and the efficiency of transmission between nodes, the M/M/c queuing model is proposed with the strategies of dynamic changes of servers, repairable work failure and impatient customers. The main purpose of this paper is to investigate how the service efficiency and the conversion efficiency of the nodes can lead to a low energy consumption of the system and a smaller average delay of the nodes.

  2. (2)

    A three-dimensional continuous time Markov stochastic model is established, the expressions of average delay of nodes and throughput rate of system are obtained by using matrix-geometric solution method and Gauss–Seidel iterative method.

  3. (3)

    The social utility function is defined, the effects of parameter variations on the performance metrics of the P2P network system are derived through numerical analysis. The Nash equilibrium and the social optimization strategies are analyzed in detail, and the conversion rate of nodes is increased appropriately to reduce system delay and congestion, enhance throughput of system and social utility.

The rest of this paper is organized as follows. In Sect. 2, the operating mechanism of the P2P system is introduced, and the relevant parameters are assumed. In Sect. 3, the three-dimensional Markov chain is built, and the steady-state distribution is given. In Sect. 4, the performance indicators are evaluated by using some numerical results and the Nash equilibrium and social optimal strategy are analyzed. Conclusions are introduced in Sect. 5.

2 Model description

Unstructured distributed P2P networks, in which nodes are accessing the whole network by communicating with neighboring nodes. And nodes are connected irregularly without stable relationships. Nodes search for needed resources by employing the mechanism of query packets. Specifically, the node sends a query packet containing a query to its neighboring nodes, and the query packet is transmitted through an incremental manner in the network. At first a large number of requesting nodes enter the system to wait for service with the first come first served (FCFS) rules, which is called response time. And requesting nodes enter the file transfer phase after querying the nodes that has the desired resource package. Nodes that finish downloading have three options, including: continue to request downloads in order to obtain other resources, transform into servers to serve other requesting nodes, and leave the system after completing the service. The operation mechanism of the P2P network system is shown in Fig. 1.

Fig. 1
figure 1

The operation mechanism of the P2P system

The process of file transmission is abstracted as the process of service in P2P network system. The requesting node is abstracted as customer. The service node is abstracted as sever. A new queuing model is established in the P2P system. The strategies of model that including impatient customers, repairable work failure, and dynamic changes of nodes are introduced. Meanwhile, the relevant parameters are assumed as follows.

  1. (1)

    The requesting node follows the Poisson process with the parameter \(\lambda\). The model is assumed that the capacity of the requesting node is infinite in P2P system. The system allows to be idle when the server is not requested. In the idle state, it may be attacked by unsafe factors, but it does not cause congestion of system.

  2. (2)

    The time consumed by each node to complete the service follows the exponential distribution with parameter \(\mu _{1}\). Assuming that there are n requesting nodes , there are m seeds (nodes that have a complete copy after the downloading) in the system, and the service rate are \(m{{\mu }_{1}}\,(m<n)\), \(n{{\mu }_{1}} \,(n\le m)\) respectively. The minimum number of nodes that is online is 1, and the number of all nodes available is c.

  3. (3)

    The nodes that has completed service can remain in the system with probability \(\alpha \,(0<\alpha <1)\). In the system the remaining nodes have two choices: (i) if some nodes want to download other files again, they are regarded as new customers and wait at the end of line after re-entering the system. For any requesting node, re-entering the system with the probability \(\beta \,(0<\beta <\alpha )\), which is known as the feedback probability; (ii) the node that has finished the downloading can transform into seeds with probability \(\gamma \,\,(\gamma =\alpha -\beta )\) in the system. If the node that completed service is idle, it will leave system with probability \(\bar{\alpha }\,(\bar{\alpha }\text {=}1-\alpha )\).

  4. (4)

    Failed nodes that may congest or delay because the downloading is too heavy can be repaired. The failed node does not allow completely down, and can serve others at a lower service rate. The process of failure follows the Poisson process with parameter \(\xi\). The failed node that provides service with the lower service rate \({{\mu }_{2}}\). Due to the relatively low service rate during failures, some nodes are impatient. If the requesting node is not received within time T, it may become an impatient node and leave system. And the time T follows the exponential distribution with parameter \(\eta\). If the working node fails, it can be repaired immediately by waiting in line and the same nodes can only be repaired by one repairman. The repair time follows the exponential distribution with parameter \({{\beta }_{b}}\).

  5. (5)

    The service sequence is FCFS. It is assumed that the arrival time, the service time, and the repair time are mutually independent.

3 Model analysis

3.1 State transition rate matrix

Let L(t) denotes the number of requesting nodes at time t, Y(t) denotes the number of service nodes at time t, J(t) denotes the state of the nodes at time t, and J(t) is defined as follows:

  1. (1)

    \(J(t)=0\) indicates that the nodes is in a fault state or idle state at time t.

  2. (2)

    \(J(t)=1\) indicates that the nodes is in a work state at time t.

Then {\((L(t),Y(t),J(t)),t\ge 0\)} indicate a three-dimensional Markov process, which has the state space as follows:

$$\begin{aligned} \varOmega =\{(i,l,j),i\ge 0,1\le l\le c,j=0,1\} \end{aligned}$$

where the state set \((i,1,0),(i,1,1),\ldots ,(i,c,0),(i,c,1)\) is called level i\((i\ge 0)\). The level 0 denotes the idle state of system, which the number of requesting nodes is zero.

When servers are in a fault state (i.e. \(j=0\)), and \(1\le l\le c\), we can obtain

$$\begin{aligned}&P_{(i,l)(i+1,l)}=\lambda \varDelta t+o(\varDelta t),\quad i=0,\\&P_{(i,l)(i+1,l)}=(\lambda +(i+1){{\mu }_{2}}\beta )\varDelta t+o(\varDelta t),\quad {1}\le i<c,\\&P_{(i,l)(i+1,l)}=(\lambda +c{{\mu }_{2}}\beta )\varDelta t+o(\varDelta t),\quad i\ge c,\\&P_{(i,l)(i-1,l)}=i({{\mu }_{2}}\bar{\alpha }+\eta )\varDelta t+o(\varDelta t),\quad 1\le i< c,\\&P_{(i,l)(i-1,l)}=c({{\mu }_{2}}\bar{\alpha }+\eta )\varDelta t+o(\varDelta t),\quad i\ge c, \end{aligned}$$

and \(1\le l\le c-1\),

$$\begin{aligned} P_{(i,l)(i-1,l+1)}=\min {(i,l)}{{\mu }_{2}}\gamma \varDelta t+o(\varDelta t), \quad i\ge 1. \end{aligned}$$

When servers are in a work state (i.e. \(j=1\)), and \(1\le l\le c\), we can obtain

$$\begin{aligned}&P_{(i,l)(i+1,l)}=\lambda \varDelta t+o(\varDelta t), \quad i=0,\\&P_{(i,l)(i+1,l)}=(\lambda +(i+1){{\mu }_{1}}\beta )\varDelta t+o(\varDelta t),\quad {1}\le i<c,\\&P_{(i,l)(i+1,l)}=(\lambda +c{{\mu }_{1}}\beta )\varDelta t+o(\varDelta t), \quad i\ge c,\\&P_{(i,l)(i-1,l)}=i({{\mu }_{1}}\bar{\alpha }+\eta )\varDelta t+o(\varDelta t), \quad 1\le i< c,\\&P_{(i,l)(i-1,l)}=c({{\mu }_{1}}\bar{\alpha }+\eta )\varDelta t+o(\varDelta t), \quad i\ge c, \end{aligned}$$

and \(1\le l\le c-1\),

$$\begin{aligned} P_{(i,l)(i-1,l+1)}=\min {(i,l)}{{\mu }_{1}}\gamma \varDelta t+o(\varDelta t), \quad i\ge 1. \end{aligned}$$

Therefore, the state transition of the queuing model is shown in Fig. 2, where

$$\begin{aligned}&{{\theta }_{i}}=\lambda +i{{\mu }_{1}}\beta , \theta _{i}^{*}=\lambda +i{{\mu }_{2}}\beta ,2\le i\le c,\\&{{\phi }_{i}}=i({{\mu }_{1}}\bar{\alpha }+\eta ), \phi _{i}^{*}=i({{\mu }_{2}}\bar{\alpha }+\eta ),1\le i\le c,\\&{{\sigma }_{i}}=i{{\mu }_{1}}\gamma , \sigma _{i}^{*}=i{{\mu }_{2}}\gamma ,1\le i\le c-1. \end{aligned}$$
Fig. 2
figure 2

State transition diagram of queuing model

Arranging the states in lexicographic order, the state transition rate matrix of the system can be written as follows:

$$\begin{aligned} {{\varvec{Q}}}=\left[ \begin{array}{*{35}{l}} {{{{\varvec{A}}}}_{0}} &{} {{{{\varvec{C}}}}_{0}} &{} {} &{} {} &{} {} &{} {} &{} {} &{} {} \\ {{{{\varvec{B}}}}_{1}} &{} {{{{\varvec{A}}}}_{1}} &{} {{{{\varvec{C}}}}_{1}} &{} {} &{} {} &{} {} &{} {} &{} {} \\ {} &{} {{{{\varvec{B}}}}_{2}} &{} {{{{\varvec{A}}}}_{2}} &{} {{{{\varvec{C}}}}_{2}} &{} {} &{} {} &{} {} &{} {} \\ {} &{} {} &{} \ddots &{} \ddots &{} \ddots &{} {} &{} {} &{} {} \\ {} &{} {} &{} {} &{} {{{{\varvec{B}}}}_{c-1}} &{} {{{{\varvec{A}}}}_{c-1}} &{} {{{{\varvec{C}}}}_{c-1}} &{} {} &{} {} \\ {} &{} {} &{} {} &{} {} &{} {{{{\varvec{B}}}}_{{}}} &{} {{{{\varvec{A}}}}_{{}}} &{} {{{{\varvec{C}}}}_{{}}} &{} {} \\ {} &{} {} &{} {} &{} {} &{} {} &{} \ddots &{} \ddots &{} \ddots \\ \end{array} \right] \end{aligned}$$
(1)

where \({{{{\varvec{A}}}}_{0}}\), \({{{{\varvec{C}}}}_{0}}\), \({{{{\varvec{A}}}}_{i}}(1\le i\le c)\), \({{{{\varvec{B}}}}_{i}}(1\le i\le c)\), \({{C}_{i}}(1\le i\le c-1)\) indicate the state transition rate between corresponding levels, and let \({{\varvec{A}}}={{{{\varvec{A}}}}_{c}}\), \({{\varvec{B}}}={{{{\varvec{B}}}}_{c}}\), \({{\varvec{C}}}={{{{\varvec{C}}}}_{c-1}}\). For the convenience of writing, the following symbols are defined:

$$\begin{aligned}&{{\delta }_{i,0}}=-(\lambda +i{{\mu }_{2}}\bar{\alpha }+i\eta +{{\mu }_{2}}\gamma +i\xi +(i+1){{\mu }_{2}}\beta ),\,\,1\le i\le c,\\&{{\delta }_{i,1}}=-(\lambda +{{\mu }_{1}}\bar{\alpha }+{{\mu }_{1}}\gamma +{{\beta }_{\text {b}}}+(i+1){{\mu }_{1}}\beta ), \,\,1\le i\le c. \end{aligned}$$

The specific matrix is as follows:

$$\begin{aligned} {{{{\varvec{A}}}}_{0}}= & {} {{\left[ \begin{array}{ccccccc} -\lambda & {} & {} & {} & {} & {} & {} \\ {{\beta }_{b}} & -(\lambda +{{\beta }_{b}}) & {} & {} & {} & {} & {} \\ {} & {} & -\lambda & {} & {} & {} & {} \\ {} & {} & {{\beta }_{b}} & -(\lambda +{{\beta }_{b}}) & {} & {} & {} \\ {} & {} & {} & {} & \ddots & {} & {} \\ {} & {} & {} & {} & {} & -\lambda & {} \\ {} & {} & {} & {} & {} & {{\beta }_{b}} & -(\lambda +{{\beta }_{b}}) \\ \end{array} \right] }_{2c}},\\ {{{{\varvec{C}}}}_{0}}= & {} {{\left[ \begin{array}{*{35}{l}} \lambda & {} & {} & {} \\ {} & \lambda & {} & {} \\ {} & {} & \ddots & {} \\ {} & {} & {} & \lambda \\ \end{array} \right] }_{2\text {c }}},\\ {{{{\varvec{A}}}}_{i}}= & {} {{\left[ \begin{array}{*{35}{l}} {{\delta }_{i,0}} & \xi & {} & {} & {} & {} & {} \\ {{\beta }_{b}} & {{\delta }_{i,1}} & {} & {} & {} & {} & {} \\ {} & {} & {{\delta }_{i,0}} & 2\xi & {} & {} & {} \\ {} & {} & {{\beta }_{b}} & {{\delta }_{i,1}} & {} & {} & {} \\ {} & {} & {} & \ddots & \ddots & \ddots & {} \\ {} & {} & {} & {} & {} & {{\delta }_{i,0}} & c\xi \\ {} & {} & {} & {} & {} & {{\beta }_{b}} & {{\delta }_{i,1}} \\ \end{array} \right] }_{2c}}, 1\le i\le c,\\ {{{{\varvec{B}}}}_{i}}= & {} {{\left[ \begin{array}{ccccccc} i{{\mu }_{2}}\bar{\alpha }+i\eta & 0 & i{{\mu }_{2}}\gamma & {} & {} & {} & {} \\ {} & i{{\mu }_{1}}\bar{\alpha } & 0 & i{{\mu }_{2}}\gamma & {} & {} & {} \\ {} & {} & i{{\mu }_{2}}\bar{\alpha }+i\eta & 0 & i{{\mu }_{2}}\gamma & {} & {} \\ {} & {} & {} & \ddots & \ddots & \ddots & {} \\ {} & {} & {} & {} & i{{\mu }_{1}}\bar{\alpha } & 0 & i{{\mu }_{2}}\gamma \\ {} & {} & {} & {} & {} & i{{\mu }_{2}}\bar{\alpha }+i\eta & 0 \\ {} & {} & {} & {} & {} & {} & i{{\mu }_{1}}\bar{\alpha } \\ \end{array} \right] }_{2c}}, \\&\quad 1\le i\le c, \\ {{{{\varvec{C}}}}_{i}}= & {} {{\left[ \begin{array}{ccccccc} \lambda +(i+1){{\mu }_{2}}\beta & {} & {} & {} \\ {} & \lambda +(i+1){{\mu }_{1}}\beta & {} & {} \\ {} & {} & \ddots & {} \\ {} & {} & {} & \lambda +(i+1){{\mu }_{1}}\beta \\ \end{array} \right] }_{2c}}\text { ,} \\&\quad 1\le i\le c-1. \end{aligned}$$

3.2 Steady-state analysis

The structure of the matrix \({{\varvec{Q}}}\) indicates that Markov process {\((L(t),Y(t),J(t)),t\ge 0\)} is QBD. When the Markov process is positive recurrent, the steady-state distribution is defined as follows:

$$\begin{aligned}& {{\pi }_{i,l,j}}=\underset{t\rightarrow \infty }{\mathop {\lim }}\,P\{X(t)=i,Y(t)=l,J(t)=j\},\,\,(i,l,j)\in \varOmega , \\&{\varPi }=\left( {{{\varvec{\pi }} }_{0}},{{{\varvec{\pi }} }_{1}},{{{\varvec{\pi }} }_{2}},\ldots \right) \end{aligned}$$

where

$$\begin{aligned} \begin{aligned} {{{\varvec{\pi }} }_{i}}\text {=(}{{\pi }_{i,1,0}},{{\pi }_{i,1,1}},\ldots ,{{\pi }_{i,c,0}},{{\pi }_{i,c,1}}\text {),\,\,}i\ge 0. \end{aligned} \end{aligned}$$

The sufficient and necessary conditions QBD \(\text { }\{\text { }(L(t),Y(t),\) \(J(t)),t\ge 0\text { }\}\text { }\) is positive recurrent is that the matrix quadratic equation

$$\begin{aligned} \begin{aligned} {{{{\varvec{R}}}}^{2}}{{\varvec{B}}}+{{\varvec{RA}}}+{{\varvec{C}}}=\mathbf{0} \end{aligned} \end{aligned}$$
(2)

has a minimum non-negative solution, and the spectral radius \(SP({{\varvec{R}}})<1\). Simultaneously, the \(2{{c}^{2}}+2c\) dimensional stochastic matrix is as follows:

$$\begin{aligned} {B[{\varvec{R}}]}=\left[ \begin{array}{*{35}{l}} {{\varvec{A}}_{0}} &{} {{\varvec{C}}_{0}} &{} {} &{} {} &{} {} &{} {} \\ {{\varvec{B}}_{1}} &{} {{\varvec{A}}_{1}} &{} {{\varvec{C}}_{1}} &{} {} &{} {} &{} {} \\ {} &{} {{\varvec{B}}_{2}} &{} {{\varvec{A}}_{2}} &{} {{\varvec{C}}_{2}} &{} {} &{} {} \\ {} &{} {} &{} \ddots &{} \ddots &{} \ddots &{} {} \\ {} &{} {} &{} {} &{} {{\varvec{B}}_{c-1}} &{} {{\varvec{A}}_{c-1}} &{} {{\varvec{C}}_{c-1}} \\ {} &{} {} &{} {} &{} {} &{} \varvec{B} &{} \varvec{BR}+\varvec{A} \\ \end{array} \right] \end{aligned}$$

has left-zero vector, when QBD is positive recurrent, the steady-state distribution satisfies the following equations:

$$\begin{aligned} {\left\{ \begin{array}{ll} \left( {{{\varvec{\pi }} }_{0}},{{{\varvec{\pi }} }_{1}},\ldots ,{{{\varvec{\pi }} }_{c}} \right) B[{\varvec{R}}]={\varvec{0}}, \\ \sum \limits _{i=0}^{c-1}{{{\varvec{\pi }} }_{i}}{\varvec{e}}+{{{\varvec{\pi }} }_{c}}{{\left( {\varvec{I}}-{\varvec{R}} \right) }^{-1}}{\varvec{e}}=1, \\ {{{\varvec{\pi }} }_{i}}={{{\varvec{\pi }} }_{c}}{{\varvec{R}}^{i-c}},\ i\ge c \\ \end{array}\right. } \end{aligned}$$
(3)

where \({{\varvec{e}}}\) denotes a 2c dimensional column vector, in which all elements are 1.

Because expressions of the matrices \({{\varvec{A}}}\), \({{\varvec{B}}}\), \({{\varvec{C}}}\) are relatively complex, It is difficult to obtain the exact expression of the minimum non-negative solution \({{\varvec{R}}}\) of the matrix \({{{{\varvec{R}}}}^{2}}{{\varvec{B}}}+{{\varvec{RA}}}+{{\varvec{C}}}=\mathbf{0}\). Therefore, the Gauss–Seidel iterative method is used to solve the problems mentioned above and the numerical results of \({{\pi }_{i,l,j}}\) are obtained. The specific algorithm is as follows:

figure e

The process of the above analysis uses the matrix geometry solution method. The relevant specific proof process can refer to [26].

3.3 Performance indicators

According to the above analysis, the performance indicators of requesting nodes are given by using the Little’s law.

  1. (1)

    The average length of the requesting node is given by

    $$\begin{aligned} E(L)=\sum \limits _{i=0}^{\infty }{iP(L=i)=}\sum \limits _{i=0}^{\infty }{i\left( \sum \limits _{l=1}^{c}{\sum \limits _{j=0}^{1}{{{\pi }_{i,l,j}}}} \right) }\text {.} \end{aligned}$$
  2. (2)

    The average delay of the requesting node is given by

    $$\begin{aligned} E(W)=\frac{1}{\lambda }\sum \limits _{i=c}^{\infty }{(i-c)}\left( \sum \limits _{l=1}^{c}{\sum \limits _{j=0}^{1}{{{\pi }_{i,l,j}}}} \right) \text {.} \end{aligned}$$
  3. (3)

    The departure rate of the node in the P2P system is given by

    $$\begin{aligned} D=\eta P(J=0)=\eta \sum \limits _{i=0}^{\infty }{\sum \limits _{l=1}^{c}{{{\pi }_{i,l,0}}}}\text {.} \end{aligned}$$
  4. (4)

    The total energy consumption of the system includes the energy consumption of the node in two states of work and failure. Assuming that \({{g}_{1}}\) denotes the energy consumption of the nodes in the failed state, and \({{g}_{2}}\) denotes the energy consumption of the nodes in the working state. Therefore, the total energy consumption of the system is given by

    $$\begin{aligned} {{W}_{y}}={{g}_{1}}\sum \limits _{i=0}^{\infty }{\sum \limits _{l=1}^{c}{l{{\pi }_{i,l,0}}}}+{{g}_{2}}\sum \limits _{i=0}^{\infty }{\sum \limits _{l=1}^{c}{l{{\pi }_{i,l,1}}}}\text {.} \end{aligned}$$
  5. (5)

    The maximum throughput \(\varTheta\) of the system is the maximum amount of data requests that all nodes can accept and serve per unit time. Hence, the maximum throughput of the system is given by

    $$\begin{aligned} \varTheta \text { = }{{\mu }_{2}}\sum \limits _{i=0}^{\infty }{i\sum \limits _{l=1}^{c}{{{\pi }_{i,l,0}}}}+{{\mu }_{1}}\sum \limits _{i=0}^{\infty }{i\sum \limits _{l=1}^{c}{{{\pi }_{i,l,1}}}}. \end{aligned}$$

4 Numerical examples

4.1 Impact of parameter variation on P2P systematic performance indicators

The minimum non-negative solution of the matrix quadratic equation Eq. (2) is obtained by Gauss–Seidel iterative method. The numerical results and various performance indicators of the P2P system can be obtained by solving equations of the steady-state distribution. By using MATLAB drawing, the relationship graph that performance index changes with parameters is obtained. According to the image, the influence of parameter changes can be analyzed in terms of performance indicators, which provide a basis for the scheduling strategy of the peers in P2P system.

According to the above analysis, the performance indicators of the system are obtained, and numerical experiments are used to verify the influence of parameters on performance indicators in P2P system. Assuming that \(\lambda =2\), \({{\mu }_{2}}=0.5\), \(c=15\), \(\xi =0.1\), \({{\beta }_{b}}=1.5\), \(\eta =0.3\). Figure 3 describes the relationship between the average length E(L) of requesting node and the service rate \({{\mu }_{1}}\) under normal operation of the node and the probability \(\gamma\) of nodes converting into seeds. When \(\gamma\)  is a fixed value, E(L) decreases with the increase of \({{\mu }_{1}}\). When \({{\mu }_{1}}\) is a fixed value, E(L) decreases with the increase of \(\gamma\). The main reason is that the service rate of the node increases, the downloading speed of the nodes is the higher, so the possibility of congestion is the lower in the system. At the same time, the node is more likely to be converted into the seed, the average downloads increases per unit time. Therefore, the average queue length of the requesting node is smaller.

Fig. 3
figure 3

The relationship between E(L) and \({{\mu }_{1}}\), \(\gamma\)

Assuming \({{\mu }_{1}}=3\), \({{\mu }_{2}}=0.5\), \(c=15\), \(\xi =0.1\), \({{\beta }_{b}}=2.5\), \(\eta =0.3\). Figure 4 describes the relationship between the average delay E(W) of the requesting node and the arrival rate \(\lambda\) and the probability \(\gamma\) of nodes that have finished service transforming into seeds. When \(\gamma\) is a fixed value, E(W) increases with the increase of \(\lambda\). When \(\lambda\) is a fixed value, E(W) decreases with the increase of \(\gamma\). The main reason is that the average delay of system is increasing with the arrival rate of requesting nodes increase. With the increase of the arrival rate, more and more nodes are converted into seeds, which increases the service efficiency of the system, so that the growth of average delay is flattening out. When the transformation rate of a node increases by 25%, the average delay of the system decreases by about 15%. When the arrival rate of nodes is increased by 20 times, the average delay of the system increases by 8–11%. In the case of the different transformation rates of the nodes, the numerical results of the average delay and arrival rate are shown in Table 1.

Fig. 4
figure 4

The relationship between E(W) and \(\lambda\), \(\gamma\)

Table 1 The relationship between E(W) and \(\lambda\), \(\gamma\)

Assuming \({{\mu }_{1}}=2\), \(\lambda =1\), \(c=15\), \(\xi =0.1\), \({{\beta }_{b}}=1\), \(\alpha =0.9\), \(\beta =0.1\), \(\gamma =0.8\). Figure 5 describes the relationship between the departure rate D of the system, the impatience rate \(\eta\) and the service rate \({{\mu }_{2}}\) of the server in the fault state. When \({{\mu }_{2}}\) is a fixed value, D increases with increase of \(\eta\). When \(\eta\) is a fixed value, D increases with decrease of \({{\mu }_{2}}\). The main reason is that the requesting node has a lower service rate when it fails. The node may leave the system due to the waiting time is too long. If the impatience rate in the system is higher and the service rate of the failed node is lower, the more nodes may leave the system. In the case of the different impatience rates of the nodes, the numerical results of the departure rate and service rate of the server in the fault state are shown in Table 2.

Fig. 5
figure 5

The relationship between D and \(\eta\), \({{\mu }_{2}}\)

Table 2 The relationship between D and \(\eta\), \({{\mu }_{2}}\)

Assuming \({{\mu }_{1}}=2\), \({{\mu }_{2}}=0.5\), \(c=20\), \(\xi =0.1\), \({{\beta }_{b}}=2\), \(\eta =0.3\), \({{g}_{1}}=1\), \({{g}_{2}}=2\). Figure 6 describes the relationship between the total energy consumption \({{W}_{y}}\) of the system and the arrival rate \(\lambda\) and the probability \(\gamma\) of nodes that have finished service transforming into seeds. When \(\gamma\) is a fixed value, \({{W}_{y}}\) increases with increase of \(\lambda\). When \(\lambda\) is a fixed value, \({{W}_{y}}\) increases with decrease of \(\gamma\). The main reason is that initially the number of nodes is very small. As the arrival rate gradually increases, the system energy consumption is higher. The probability of the node that finished service converting into seeds is the smaller, so the number of servers is the less. It is more likely to cause congestion and the server fails, so the total energy consumption of the system is also greater. In the case of the different arrival rates of the nodes, the numerical results of the total energy consumption and transformation rate of the nodes are shown in Table 3.

Fig. 6
figure 6

The relationship between \({{W}_{y}}\) and \(\lambda\), \(\gamma\)

Table 3 The relationship between \({{W}_{y}}\) and \(\lambda\), \(\gamma\)

4.2 Nash equilibrium and social optimal

In order to analyze the social optimal strategy, the personal utility function and the social utility function are constructed. Supposing \({{f}_{1}}\) represents the fee received after the service is completed, \({{G}_{1}}\) indicates that the average waiting cost of the node unit time due to delay, and \({{f}_{2}}\) indicates the fee paid by each node entering the system. Then the personal utility function of the node is defined as

$$\begin{aligned} {{U}_{L}}={{f}_{1}}-{{G}_{1}}E(W)-{{f}_{2}}. \end{aligned}$$

Supposing that the arriving node, which face a completely invisible queuing situation, that is, the requesting node neither knows the throughput rate of the system nor understands the status of the nodes. Assuming \(\varPhi\) that represents the potential arrival rate of the requesting node, and \({{h}^{c}}\) represents the probability of response that the requesting node under the equilibrium strategy. The equilibrium strategy of the requesting node is given by

$$\begin{aligned}\small H(t)=\left\{ \begin{array}{ll} 0, &{} {\text {when }{{f}_{1}}<\text {}{{G}_{1}}{{\left. E\text {(}W\text {)} \right| }_{\lambda =0}}+{{f}_{2}},}\\ \frac{{{\lambda }^{c}}}{\varPhi }, &{} {\text {when }{{G}_{1}}{{\left. E\text {(}W\text {)} \right| }_{\lambda =0}}+{{f}_{2}}\le {{f}_{1}}\le \text {}{{G}_{1}}{{\left. E\text {(}W\text {)} \right| }_{\lambda =\varPhi }}+{{f}_{2}},}\\ 1, &{} {\text {when }{{f}_{1}}>\text {}{{G}_{1}}{{\left. E\text {(}W\text {)} \right| }_{\lambda =\varPhi }}+{{f}_{2}}}\\ \end{array} \right. \end{aligned}$$

where \({{\lambda }^{c}}\) is the solution of \({{U}_{L}}=0\).

Assuming \({{\mu }_{1}}=2\), \({{\mu }_{2}}=0.5\), \(c=10\), \(\xi =0.05\), \({{\beta }_{b}}=3\), \(\eta =0.3\), \({{f}_{1}}=8\), \({{G}_{1}}=2.5\), \({{f}_{2}}=3\). Figure 7 describes the relationship between the personal utility \({{U}_{L}}\) and the arrival rate \(\lambda\) and the probability \(\gamma\) of nodes that have finished service are transformed into seeds. When \(\gamma\) is a fixed value, \({{U}_{L}}\) decreases with the increase of \(\lambda\). When \(\lambda\) is a fixed value, \({{U}_{L}}\) increases with the increase of \(\gamma\). The main reason is that there are relatively few nodes that finished service to convert into seeds, the average delay of the node gradually increases, which leads to decrease in personal utility. When seeds increase continuously, the average delay of the node decreases, and the individual benefits is increasing. The influence of the transformation rate and the arrival rate on individual utility and the zero point is shown in Fig. 7, the equilibrium arrival rate exists. In order to improve the energy efficiency of P2P networks, the transformation rate and service rate can be increased appropriately. In the case of the different arrival rates of the nodes, the numerical results of the personal utility and transformation rate of the nodes are shown in Table 4.

Fig. 7
figure 7

The relationship between \({{U}_{L}}\) and \(\lambda\), \(\gamma\)

Table 4 Influence of \(\gamma\) and \(\lambda\) on individual utility \({{U}_{L}}\)

To discuss the social optimal strategy, \({{h}^{*}}\) is assumed that the optimal probability of response after the requesting node entering the system. \({{\lambda }^{*}}\) is the actual request rate of the node under the social optimum. Meanwhile, \({{\lambda }^{*}}={{h}^{*}}\varPhi\). Then the social utility function is defined as

$$\begin{aligned} {{U}_{S}}=\lambda ({{f}_{1}}-{{G}_{1}}E(W)-{{f}_{2}})-{{G}_{2}}{{W}_{y}}\text { }\text {.} \end{aligned}$$

Assuming \(c=15\), \(\beta =0.1\), \({{\mu }_{2}}=0.5\), \(\xi =0.1\), \({{\beta }_{b}}=1\), \(\eta =0.3\), \({{f}_{1}}=10\), \({{G}_{1}}=2.5\), \({{f}_{2}}=3\), \({{G}_{2}}=3\), \({{g}_{1}}=2\), \({{g}_{2}}=3\). Figure 8 describes the relationship of \({{U}_{S}}\) , \({{\mu }_{1}}\) and \(\gamma\) . When \(\gamma\) is given different values, the increase of \({{U}_{S}}\) is relatively large at first and then tends to be flat with the increase of \({{\mu }_{1}}\). When \({{\mu }_{1}}=5\), \(\gamma \text { = }0.8\), there is a maximum value of social utility \({{U}_{S}}=4.5594\) under the conditions of this paper. The main reason is that the transformation rate of nodes increases, the number of nodes that have finished downloading translated into seeds increases, the service speed is the faster. System congestion and failure may be less, and the social benefit is the greater.

Fig. 8
figure 8

The relationship between \({{U}_{S}}\) and \({{\mu }_{1}}\), \(\gamma\)

5 Conclusions

For unstructured distributed P2P networks, the M/M/c queuing model with impatient customers and fault repairable is established, after considering the process of node dynamics, combining the presence of factors such as environmental disturbances and physical damage. A steady-state analysis of the system model is performed by using QBD and the matrix-geometric solution method, and expressions for performance metrics such as average delay of nodes and throughput rate are given. The effects of parameter variations on the performance metrics of the P2P network system are derived through numerical analysis. Throughput is a measure of system transmission effectiveness and social efficiency is a measure of system benefits. The optimal parameters are derived by considering the throughput rate and social benefits, etc. By observing the results of the numerical analysis, it is known that an appropriate increase in the conversion rate can reduce the average delay in the system, avoid system congestion, improve energy saving, and increase personal and social benefits.