FINITE TWO LAYERED QUEUEING SYSTEMS

We study layered queueing systems comprised two interlacing finite M/M/• type queues, where users of each layer are the servers of the other layer. Examples can be found in file sharing programs, SETI@home project, etc. Let Li denote the number of users in layer i, i=1, 2. We consider the following operating modes: (i) All users present in layer i join forces together to form a single server for the users in layer j (j≠i), with overall service rate μjLi (that changes dynamically as a function of the state of layer i). (ii) Each of the users present in layer i individually acts as a server for the users in layer j, with service rate μj. These operating modes lead to three different models which we analyze by formulating them as finite level-dependent quasi birth-and-death processes. We derive a procedure based on Matrix Analytic methods to derive the steady state probabilities of the two dimensional system state. Numerical examples, including mean queue sizes, mean waiting times, covariances, and loss probabilities, are presented. The models are compared and their differences are discussed.


INTRODUCTION
The motivation for studying networks of queues where customers in each queue act as servers of other queues arises from distributed computer architectures labeled "peer-to-peer", designed for sharing computer resources (such as Seti@Home and others, see for example, Androutsellis-Theotokis and Spinellis [1] and references therein). A specific example can be found in Arazi, Ben-Jacob and Yechiali [2]. When activating such programs users connect into a peer-to-peer network to search for files on the computers of other users (i.e., peers) connected to the network. Files of interest can then be downloaded directly from those users. Typically, large files are broken down into smaller portions, which may be obtained from multiple peers and then reassembled by the downloader. This is done while the peer is simultaneously uploading the portions it already has to other peers. Hence, once a user activates a file sharing program, he/she operates as a server for the other connected users, and also as a customer downloading a file. Many studies on peer-to-peer apply Queueing Theory models (see e.g., Wu, Liu, and Ross [13]) to analyze the probabilistic characteristics of such systems, modeling them as layered network in which a server, while executing a service, may request a higher-layer service and wait for it to be completed. Layered queueing networks occur naturally in all kinds of information and e-commerce systems, grid systems, and real-time systems such as telecom switches; see Franks et al. [7] and references therein for an overview. Layered queues are characterized by simultaneous or separate phases where entities are no longer classified in the traditional roles of 'servers' and 'customers', but may also have a dual role of being either a server to other entities (of lower layers) or a customer to higher-layer entities. When modeling queueing systems often it is analytically convenient to assume that the queues are of infinite capacity. However, most real-world queueing systems are of finite capacity. Therefore, in this study we analyze finite-buffer queues where customers simultaneously provide and request service. Initial steps in the analysis of queues where users act as servers can be found in Perel and Yechiali [11,12], where the analysis in [11] is based on probability generating functions (PGFs), while in [12] both PGFs and Neuts's Matrix Geometric method [10] are employed. The present work extends the scope of the analysis to the case where capacities of both queues are finite, and employ other matrix analytic methods since the two methods used in [11,12] are not applicable in the current study.
Quasi birth-and-death (QBD) processes have been used extensively to model a variety of systems, mostly representing cases of unbounded populations where the service and/or interarrival times are given by phase-type distributions (see e.g., [10], Latouche and Ramaswami [9], and references there). For easying numerical calculations truncation methods can be used (see e.g., Bright and Taylor [3]). Finite homogeneous QBD processes were studied by Hajek [8], while finite non-homogeneous QBD processes are considered in De Nitto Personé and Grassi [5]. The QBD processes representing our models differ from the above processes. We exploit their special structure to employ direct matrix calculations.
Consider a system comprised of two finite connected and dependent queues (layers), where customers (users) of each queue render service to the customers of the other queue. We study three models as follows: In Model 1 (Section 2) we assume that one queue, Q 1 , operates as a multi-server finitebuffer (of size N ) M (λ 1 )/M (μ 1 )/L 2 /N system with Poisson arrival rate λ 1 and Exponential service time with mean 1/μ 1 for each individual customer, where the potential servers at Q 1 are the L 2 customers present in queue 2 (Q 2 ). That is, each customer present in Q 2 individually acts as a server for the customers in Q 1 , such that, at any given moment, the actual number of active servers in Q 1 is Min(L 1 , L 2 ). The other queue (Q 2 ) has capacity K and operates as a single-server finite-buffer M (λ 2 )/M (μ 2 L 1 )/1/K system with Poisson arrival rate λ 2 , but with dynamically changing service rate μ 2 L 1 for the single served customer. That is, the L 1 customers present in Q 1 join hands together and form a single server with an overall service rate μ 2 L 1 for the customers in Q 2 .
In Model 3 (Section 4), Q 1 operates as a finite-buffer single-server (rather than a multi-server) M (λ 1 )/M (μ 1 L 2 )/1/N system, served by the L 2 customers present in Q 2 , while Q 2 itself operates as in Model 1, namely as an M (λ 2 )/M (μ 2 L 1 )/1/K queue, drawing its servers from its opposite queue. This operating mode resembles file-sharing systems.
We formulate each of the three models described above as a finite level-dependent quasi birth-and-death (LDQBD) process and study its steady-state behavior. Utilizing the special structure of the generator matrix of the QBD processes arising in our models, we calculate each system's steady-state probabilities. We further calculate numerically the mean total number of customers in each queue, E[L 1 ] and E[L 2 ], mean sojourn time, E[W 1 ] and E[W 2 ], as well as the probability of blocking at Q i , i = 1, 2. We show that in Model 2 the carried loads of the queues, namely, λ i (1 − P(Q i is blocked))/μ i , i = 1, 2, are equal, while in Model 3, for both queues the effective arrival rate, λ i (1 − P(Q i is blocked)), is smaller than the potential mean service rate, μ i E[L j ], i = 1, 2, j = i (as is the case for finite-buffer single-server Markovian queue). In Section 5, we present numerical calculations for each of the three models and discuss the results. Section 6 summarizes the paper.

MODEL 1
First we address the case where Q 1 is a multi-server finite-buffer M (λ 1 )/M (μ 1 )/L 2 /N system, while Q 2 is a single-server finite-buffer M (λ 2 )/M (μ 2 L 1 )/1/K queue. All arrival and service processes are mutually independent. Without loss of generality we assume that N ≤ K.
From (2.6) we get an expression for E[L 1 ]: Alternatively, by summing Eqs. (2.1)-(2.4) over m, and then over 0 ≤ n ≤ N − 1, we arrive at The first term in the right-hand side (RHS) of (2.8) is the mean number of customers being served in Q 1 , while the second term is the mean number of customers waiting to be served there.

Deriving (P nm ) 0≤n≤N,0≤m≤K
This model can be described as a queueing system with N + 1 "phases", where phase n indicates that the service rate in Q 2 is nμ 2 . State (n, m) denotes that there are m jobs in Q 2 , 0 ≤ m ≤ K, and the system is in phase n, 0 ≤ n ≤ N . We construct a finite non-homogeneous QBD process with generator Q given by where 0 is a matrix of zeros, and starting from the upper diagonal, . , A N 1 and A 1 are each of size (N + 1) × (N + 1); A 1 2 is of size (N + 1) × N ; and A 2 is of size (N + 1) × (N + 1). They are given by Define the steady state probability vectors P 0 = (P 10 , . . . , P N 0 ) and P m = (P 0m , P 1m , . . . , P Nm ) for all 1 ≤ m ≤ K. Then the steady state probability vectors satisfy Clearly, one can solve directly (numerically) the set (2.9) (including the normalization equation, K m=0 P m · e = 1, where e is a vector of 1's). This requires some computational effort. We wish to present an alternative algorithmic-type method to ease the required computational effort. For further discussion on computational issues for finite models and infinite models the reader is referred to [9], Elhafsi and Molle [6], [3,5], to mention a few.
Theorem 2.1: The following equations hold: where, I n is the n-dimensional identity matrix.
Proof: The inductive proof uses the special structure of the model in which the off-diagonal block matrix, A 0 , is non-singular (which is not the common case in LDQBD models). We show first that (2.11) holds for every 2 ≤ j ≤ K − N + 1, and then that (2.10) holds for By the definition of the matrix D (j) we have (2.14) Therefore .

(2.15)
For j = 2, we get from Eq. (2.9) Assuming that the proposition holds for j − 1, we now show that it holds for j ≤ K − N + 1. From (2.9) we have Substituting the values of P K−j+2 and P K−j+1 we get

(2.17)
By the definition of the matrix C(i) we have

.19)
For i = 2, using Eq. (2.9) leads to and C 21 (0) = 0. Therefore, . Assuming that the proposition holds for i − 1, we now show that it holds for i ≤ N − 1. From (2.9) we have Substituting the values of P N −i+2 and P N −i+1 we get

.21)
This completes the proof.
From Theorem 2.1 we conclude that P m , 1 ≤ m ≤ K − 2, can be expressed in terms of the four boundary probability vectors P N −1 , P N , P K−1 and P K . Therefore, the solution of (2.9) can be calculated by solving only the following reduced linear system: From (2.10) we can express P 1 and P 2 in terms of P N −1 and P N . Hence the system (2.22) becomes The normalization equation now becomes ⎞ ⎠ e = 1.

(2.24)
Therefore, instead of solving tediously the set of linear Eqs. (2.9), it is enough to calculate the matrices C(i), 0 ≤ i ≤ N − 3 and D (j) , 0 ≤ j ≤ K − N − 1, and solve the set of linear Eqs. (2.23) and (2.24), which yields the set of sought-for probability vectors P 0 , P 1 , . . . , P K . Moreover, in our case, due to the structure of A 0 and A 2 , the computational effort can be further reduced as follows: 1, 2, . . . , N). Thus, A 2 A −1 0 = μ2 λ2 ZI (N +1) . It follows that The mean total number of customers in Q 2 , E[L 2 ], is given by

(2.27)
In Sections 5 and 6, we will compare and discuss the results of Model 1 with the results of Model 2 (Section 3) and Model 3 (Section 4).

MODEL 2
In this model, we modify the service scheme for Q 2 : while Q 1 remains a multi-server M (λ 1 )/M (μ 1 )/L 2 /N system, Q 2 now also operates as a multi-server M (λ 2 )/M (μ 2 )/L 1 /K queue. The corresponding transition rate diagram is depicted in Figure 2. Similarly to Section 2.1, by algebraic manipulations on the (omitted) balance equations we arrive at (3.1) Equation (3.1) reveals an interesting result: the carried load of Q 1 , namely (1 − P N • )λ 1 /μ 1 , is equal to the carried load of Q 2 , (1 − P •K )λ 2 /μ 2 , independent of the capacities N and K.

Deriving (P nm ) 0≤n≤N, 0≤m≤K
This model, similarly to Model 1, can be described as a queueing system with N + 1 phases, where phase n indicates that there are n servers available, and its generator matrix Q is given by   i = m, . . . , N,   0 otherwise.

(3.6)
Proof: The proof is similar to the proof of Theorem 2.1.
Again, one calculates the matrices C(i) and D (j) and then obtains sequentially the probability vectors P m , 0 ≤ m ≤ K as functions of P N −1 , P N , P K−1 and P K . Together with the normalization equation K m=0 P m · e = 1, all required probability vectors are obtained. The mean total number of customers in Q 2 , E[L 2 ], is given by

7)
We can now calculate E[L 1 ] by

MODEL 3
In this model both queues operate as single-server systems where Q 1 is an M (λ 1 )/M (μ 1 L 2 )/1/N system, and Q 2 is an M (λ 2 )/M (μ 2 L 1 )/1/K queue. Note that the combined service rate in each queue depends on the queue length in the other queue (resembling file-sharing programs).

Balance Equations
With L 1 , L 2 , and P nm as before, Figure 3 is the corresponding transition-rate diagram. Again, by algebraic manipulations on the (omitted) balance equations we arrive at Furthermore, That is, We note that Eq. (4.2) is identical to Eq. (2.7) and exhibits that the effective arrival rate in Q 2 , λ 2 (1 − P •K ), is smaller than the potential mean service rare there, being

Deriving (P nm ) 0≤n≤N, 0≤m≤K
The corresponding generator for the finite non-homogeneous QBD process is where, A 0 0 , A 0 , A 0 1 , A 1 2 , and A 2 are the same as in Section 2.2, while A 1 1 , A 2 1 , . . . , A K 1 are a bit different and are given by The steady state probability vectors satisfy Theorem 4.1: The following equation holds:

NUMERICAL EXAMPLES
We denote by Lq i , i = 1, 2, the number of waiting customers in Q i , and by P loss (i) the proportion of arriving customers that are blocked (and lost) in Q i because the latter is at its full capacity. Tables 1-6 exhibit numerical results for a set of performance , P loss (i), i = 1, 2, and Cov (L 1 , L 2 ) for different values of λ 1 , λ 2 , μ 1 , μ 2 , N , and K. Tables 1 and 4 relate to Model 1, Tables 2 and 5 relate to Model 2, while  Tables 3 and 6 relate to Model 3.  Tables 1-3 are constructed as follows: the first numerical row in each table presents the values of the performance measures for a set of "Basic parameters" λ 1 = 5, λ 2 = 5, μ 1 = 8, and μ 2 = 8. The second, third, fourth, and fifth rows give, respectively, the values of the measures when in each row only one of the basic parameters is changed. Row six presents the results for another set of "Basic parameters" λ 1 = 10, λ 2 = 10, μ 1 = 5, and μ 2 = 5, and each of the following rows gives results when only one of the latter basic parameters is changed. Tables 4-6 are constructed in the same manner, where the first set of "Basic parameters" is λ 1 = 5, λ 2 = 5, μ 1 = 10, and μ 2 = 10, while the second set is λ 1 = 10, λ 2 = 10, μ 1 = 5, and μ 2 = 5.

Discussion
(1) When comparing the two classical models: (i) the multi-server M (λ)/M (μ)/s system (s identical servers, each with service rate μ, where the traffic intensity is ρ = λ sμ ) with (ii) the single-server M (λ)/M (sμ)/1 system (with same intensity ρ = λ sμ ) the mean number of customers in the single-server system is always smaller than in the multi-server system, while the mean number of waiting customers in the single-server system is always greater than the one in the multi-server system. In the current study this relation does not always hold. Comparing the operation modes of Q 1 in Models 1 and 2 (see Tables 1 versus 2 and Tables 4 versus 5) it is seen that E[L 1 ] in Model 1 is not always smaller than in Model 2, while E[Lq 1 ] in Model 1 is not always greater than in Model 2. The same observation holds regarding Q 2 when comparing Models 1 and 3 (see Tables 1 versus 3 and Tables 4  versus 6). This result occurs since changing the service method of one of the queues effects both queues.
(2) When increasing λ i , i = 1, 2, in all three models, E[L i ] is increased, while E[L j ] j = i is decreased. This happens since higher level of L i results in a higher number of servers attending Q j , or a higher service rate at Q j . (3) In all three models, when increasing This follows since smaller L i causes a decrease in the number of available servers, or in the service rate, at Q j . (4) There is a negative correlation between L 1 and L 2 in all models: when one is decreased the other is increased, and vice versa.

SUMMARY
In this paper, we broaden the scope of analytic investigation of 2-queue models where customers of each queue act as servers for the other queue. We consider cases where both queues are finite and analyze three models, distinguished by the way in which customers of each queue serve the customers of the opposite queue. Specifically, in Model 1 we assume that   Co v(L 1 , L 2 ) P loss (1) P loss (2) each of the customers present in Q 2 individually act as a server for the customers in Q 1 , with service time, specific for Q 1 , exponentially distributed with mean 1/μ 1 . That is, the number of available servers in Q 1 changes dynamically according to the number of customers in Q 2 . Therefore, Q 1 operates as an M (λ 1 )/M (μ 1 )/L 2 /N system. In addition, we assume that all customers of Q 1 join hands together to form a single-server, serving the customers in Q 2 with changing service rate μ 2 L 1 . That is, Q 2 operates as an M (λ 2 )/M (μ 2 L 1 )/1/K system. In Model 2 we analyzed the case where both queues are multi-server systems, where Q 1 operates as an M (λ 1 )/M (μ 1 )/L 2 /N and Q 2 as an M (λ 2 )/M (μ 2 )/L 1 /K. In Model 3 we considered the case where both queues have the same mode of operation, but, in contrast to Model 2, each queue is a single-server system in which Q 1 is an M (λ 1 )/M (μ 1 L 2 )/1/N system, and Q 2 an M (λ 2 )/M (μ 2 L 1 )/1/K system. We derive the steady state probability vectors of the system's state for each model, and calculate the mean total number of customers in the queues. The derivation of the probability vectors uses the special 3-diagonal structure of the generator matrix of the QBD process to reduce the required computational effort.
In Model 2 we show that the carried loads of both queues are equal, while in Model 3 the effective arrival rate is smaller than the realized service rate for both queues. Numerical results, presented in Section 5, further exhibit the differences between the models while insights are discussed.